<< 25-08-2022 >>

00:04:45*def- quit (Quit: -)
00:06:02*def- joined #nim
00:06:42FromDiscord<Elegantbeef> This is quite odd, my bindings of wasmedge suddenly dont work for anything but my tests
00:25:53FromDiscord<Elegantbeef> Ok so i downloaded a different .so and now everything is broken good
00:28:43FromDiscord<Elegantbeef> @Rika\: do you remember the name of that one wasm runtime you asked me about?
00:33:55*agentwa joined #nim
00:52:42*krux02 quit (Remote host closed the connection)
01:08:35FromDiscord<Rika> Do I?
01:09:02FromDiscord<Elegantbeef> Disregard that i think i found it but ugh it doesnt seem to be usable as a system library
01:09:08FromDiscord<Elegantbeef> Wasmedge really is driving me up the wall
01:13:22FromDiscord<Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=48y8
01:13:40FromDiscord<Nalmyth> (edit) "https://play.nim-lang.org/#ix=48y8" => "https://play.nim-lang.org/#ix=48y9"
01:14:25FromDiscord<Elegantbeef> `QueueItem(query: query`
01:15:30FromDiscord<Nalmyth> Hmm, then it's giving me `Error: cannot evaluate at compile time: query`
01:15:32FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=48ya
01:15:47FromDiscord<!Patitotective> then do not make it a const (?)
01:15:47FromDiscord<Elegantbeef> you're using `const`
01:15:57FromDiscord<Nalmyth> Oh đŸ€Šâ€â™‚ïž
01:16:03FromDiscord<Nalmyth> Thank you 🙂
01:16:23FromDiscord<!Patitotective> you may want to create your own `initQueueItem` procedure so you don't need to name the fields
01:16:44FromDiscord<Nalmyth> I was trying to create a `with-queue` using body
01:17:07FromDiscord<Nalmyth> But the body didn't fold up nicely to go in the `on_complete`
01:17:18FromDiscord<Nalmyth> (edit) "`with-queue`" => "`template with-queue`"
01:19:25FromDiscord<Elegantbeef> What were you after?
01:19:31FromDiscord<Nalmyth> Thank you working now 🙌
01:20:27FromDiscord<Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=48yb
01:20:28FromDiscord<Nalmyth> I was looking at something like that
01:20:48FromDiscord<Elegantbeef> change the parameter names so they dont match anything inside
01:21:06FromDiscord<Elegantbeef> `query: query` will replace what ever you passed in as that parameter and have that in there
01:21:25FromDiscord<Nalmyth> Aha I see, I will try that
01:25:29FromDiscord<Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=48yc
01:25:37FromDiscord<Nalmyth> Hmm đŸ€” now my QUEUE is in global scope outside of the template I guess
01:25:51FromDiscord<Nalmyth> I guess I can pass the queue around
01:26:56FromDiscord<Nalmyth> Perhaps anyone knows of a prebuilt queue for nim?↔↔Basically [fn, fn, fn] processing and later callbacks
01:26:59FromDiscord<Nalmyth> (edit) "nim?↔↔Basically" => "nim?↔Basically"
01:27:09FromDiscord<Nalmyth> (edit) "Perhaps anyone knows of a prebuilt queue for nim?↔Basically [fn, fn, fn] ... processing" added "serial"
01:27:26FromDiscord<Elegantbeef> Do not know what you mean
01:28:27FromDiscord<!Patitotective> perhaps https://nimble.directory/search?query=queue
01:29:37FromDiscord<Elegantbeef> I really wish i could read at this point, would be more sane to write a wasm runtime myself than fight with this runtime
01:31:26FromDiscord<Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=48ye
01:31:45FromDiscord<Nalmyth> (edit) "https://play.nim-lang.org/#ix=48ye" => "https://play.nim-lang.org/#ix=48yf"
01:32:19FromDiscord<Nalmyth> (edit) "https://play.nim-lang.org/#ix=48yf" => "https://play.nim-lang.org/#ix=48yg"
01:32:38FromDiscord<Nalmyth> (edit) "https://play.nim-lang.org/#ix=48yg" => "https://paste.rs/oYX"
01:32:44FromDiscord<Elegantbeef> So just a sequence?
01:32:47FromDiscord<Elegantbeef> Or is this FIFO?
01:32:51FromDiscord<Nalmyth> (edit) "https://play.nim-lang.org/#ix=48yi" => "https://play.nim-lang.org/#ix=48yh"
01:32:53FromDiscord<Nalmyth> FIFO yea
01:33:04FromDiscord<Nalmyth> Like a task scheduler without any bells or whistles
01:33:37FromDiscord<Elegantbeef> Perhaps `std/deques`?
01:33:47FromDiscord<Elegantbeef> I dont know, i dont often use queues i normally have stacks
01:34:25FromDiscord<Nalmyth> In reply to @Elegantbeef "Perhaps `std/deques`?": Yea I've got it running under the hood of the one I'm building now
01:34:48FromDiscord<Nalmyth> I see most of the async libraries add a lot of complexity at the moment
01:34:57FromDiscord<Nalmyth> Since we have real threads might as well use them
01:35:13FromDiscord<Elegantbeef> Your data type is two closure procedures probably
01:35:15FromDiscord<Rika> Threads will add more complexity than async
01:35:57FromDiscord<Nalmyth> Yea my idea was to push them onto a worker thread in a `with_queue` call
01:36:05FromDiscord<Nalmyth> And the body of the template is the worker function
01:36:36FromDiscord<Nalmyth> So you can abstract all the threads away and just keep that in the template area
01:36:53FromDiscord<Elegantbeef> Well then i'd just use a channel, but the issue now becomes sharing resources across threads
01:37:08FromDiscord<Elegantbeef> Like you cannot reliably pass closures across threads
01:37:10FromDiscord<Nalmyth> Yea nanomsg is good for this it's true
01:37:34FromDiscord<Elegantbeef> Who said anything about nanomsg
01:37:52FromDiscord<Nalmyth> Could just iproc:// to a bus
01:37:58FromDiscord<Nalmyth> Would be not so nim style though 😅
01:38:01FromDiscord<Rika> ?
01:38:08FromDiscord<Elegantbeef> Could just use the builtin channels since that's what you're doing
01:38:10FromDiscord<Nalmyth> (edit) "iproc://" => "`iproc://`"
01:38:11FromDiscord<Rika> That doesn’t change anything, I think
01:38:17FromDiscord<Elegantbeef> Channels are FIFO queues for cross thread communication
01:38:18FromDiscord<Nalmyth> In reply to @Elegantbeef "Could just use the": Oh we have?
01:38:20FromDiscord<Nalmyth> Cool
01:38:36FromDiscord<Elegantbeef> I'm fairly certain they're FIFO
01:38:52FromDiscord<Nalmyth> Could be nice to have TCP ability later đŸ€”
01:38:54FromDiscord<Rika> They’re unidirectional
01:39:00FromDiscord<Rika> Just in case you don’t know
01:39:02FromDiscord<Nalmyth> Ah
01:39:19FromDiscord<Rika> You need two channels to communicate between two threads
01:39:37FromDiscord<Nalmyth> So forward one and backward one
01:40:11FromDiscord<Nalmyth> Could be nice to just move everything to a forward pipeline
01:41:26FromDiscord<Nalmyth> I guess both of these actions don't really solve the `with_queue` so well though
01:41:31FromDiscord<Nalmyth> (edit) "actions" => "choices"
01:59:22FromDiscord<!&luke> ssh’d into my laptop so I can almost natively use nim on my phone https://media.discordapp.net/attachments/371759389889003532/1012179349220372602/IMG_2076.png
01:59:43FromDiscord<!&luke> Also that’s inim
02:02:30FromDiscord<!&luke> Building a project https://media.discordapp.net/attachments/371759389889003532/1012180138915528795/IMG_2076.png
02:02:45FromDiscord<!&luke> Building a project https://media.discordapp.net/attachments/371759389889003532/1012180198592086036/IMG_2077.png
02:04:48*arkurious quit (Quit: Leaving)
02:08:05FromDiscord<Rika> Is it native if you’re remotely logged into the laptop
02:25:41FromDiscord<!&luke> In reply to @Rika "Is it native if": No it’s over ssh
02:25:53FromDiscord<!&luke> I can get a native version too
02:28:58FromDiscord<!&luke> In reply to @ripluke "I can get a": Hmm
 https://media.discordapp.net/attachments/371759389889003532/1012186796693659679/IMG_2081.png
02:29:17FromDiscord<!&luke> I guess I can only use it over ssh
02:38:48*agentwa quit (Quit: Client closed)
02:40:14*derpydoo quit (Quit: derpydoo)
02:50:17FromDiscord<Rika> In reply to @ripluke "No it’s over ssh": That’s what I mean
02:50:33FromDiscord<Rika> SSH almost always mean remote is it not?
02:50:40FromDiscord<Rika> Unless your phone is your laptop
03:28:49FromDiscord<!&luke> It is remote
03:29:08FromDiscord<!&luke> Ssh is basically me connecting to my pc over an encrypted connection
03:31:25FromDiscord<Rika> Oh I misread
03:31:38FromDiscord<Rika> So yeah what does “almost natively” mean here xd
04:08:26FromDiscord<b1rdf00d> there's ish terminal for ios which runs alpine linux. Not native but it is on your phone
04:09:21FromDiscord<b1rdf00d> It'd be pretty cool to make a custom auto complete keyboard to provide code auto complete prompts
04:14:28FromDiscord<creikey> how do I make a reference to an object without it being a reference counted object
04:14:39FromDiscord<Elegantbeef> you use `ptr`
04:14:45FromDiscord<creikey> aw man but those unsafe
04:14:45FromDiscord<Elegantbeef> And cry at all the things that unsafe code gives you
04:15:04FromDiscord<Elegantbeef> Welcome to not having view types done
04:15:13FromDiscord<creikey> is this nim 2.0?
04:15:24FromDiscord<Elegantbeef> 2.X but yes soon tm
04:15:50FromDiscord<creikey> man how does nim get really good it's got so much annoying stuff right now and seems to move slow
04:15:59FromDiscord<creikey> is it like some company invests in it?
04:17:31FromDiscord<creikey> I guess it has less annoying stuff than a lot of other languages some of them mainstrema
04:17:34FromDiscord<creikey> (edit) "mainstrema" => "mainstream"
04:24:15FromDiscord<Rika> Nim doesn’t have enough devs nor supporters I’d say
04:24:33FromDiscord<creikey> I so badly wish nim had like a really good debugger
04:26:36FromDiscord<Rika> Wish harder to the point you implement it
04:27:04FromDiscord<creikey> In reply to @Rika "Wish harder to the": I would if I had time. I really really wish I had that clock thing from harry potter so I could like pause the world and program as much as I wanted to
04:27:18FromDiscord<creikey> I think it would take me a long time to make something like that good too
04:27:25FromDiscord<creikey> (edit) "too" => "too, I'm still kind of inexperienced"
04:27:43FromDiscord<creikey> I also don't make good engineering decisions a lot still
04:27:45FromDiscord<Rika> Even if you were generally experienced it is difficult to create a debugger
04:28:06FromDiscord<creikey> In reply to @Rika "Even if you were": it is definitely a smaller task than the whole nim compiler though
04:28:11FromDiscord<creikey> like nimsuggest is a starting point right
04:28:13FromDiscord<Rika> Of course
04:28:26FromDiscord<Rika> But it is not much smaller compared to whatever else
04:28:30FromDiscord<creikey> to be honest I'm not even sure how I would even begin to do something like that, I don't know how debuggers are implemented
04:28:42FromDiscord<Rika> Nim suggest is a behemoth if you haven’t heard
04:28:45FromDiscord<creikey> oh god
04:28:58FromDiscord<Rika> Why do you think no one works on it
04:29:01FromDiscord<creikey> it's only 1000 files
04:29:02FromDiscord<creikey> (edit) "files" => "lines"
04:29:03FromDiscord<creikey> lol
04:29:27FromDiscord<creikey> (edit) "lol ... " added "imagine if it was 1000 files"
04:29:47FromDiscord<Elegantbeef> Nim suggest uses the compiler
04:29:59FromDiscord<creikey> so it's a mess by virtue of depending on the compiler?
04:29:59FromDiscord<Elegantbeef> So even if it doesnt look like it's big it's the compiler
04:30:19FromDiscord<Elegantbeef> Sure
04:30:53FromDiscord<Rika> The compiler library API has to improve alongside the suggestion engine
04:31:15FromDiscord<Elegantbeef> Eh the suggestion engine is embedded inside the compiler
04:31:23FromDiscord<Elegantbeef> `when defined(nimSuggest): suggest X`
04:31:34FromDiscord<creikey> In reply to @Elegantbeef "`when defined(nimSuggest): suggest X`": no way
04:31:43FromDiscord<Elegantbeef> No way
04:31:58FromDiscord<Elegantbeef> To quote everyone's favourite tech nomad, you're blowing my mind
04:31:58FromDiscord<Rika> In reply to @Elegantbeef "Eh the suggestion engine": Well I meant that it would be best to decouple them more
04:32:06FromDiscord<Rika> Then again I’m not sure how that would even be done
04:32:12FromDiscord<creikey> In reply to @Elegantbeef "To quote everyone's favourite": what is this a referenc eto?
04:32:15FromDiscord<creikey> (edit) "referenc eto?" => "reference to?"
04:32:21FromDiscord<creikey> In reply to @Elegantbeef "`when defined(nimSuggest): suggest X`": I don't see this anywhere in the source
04:32:55FromDiscord<Elegantbeef> I was referencing disruptek an banned nim programmer
04:33:06FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/search?q=defined%28nimsuggest%29
04:33:21FromDiscord<creikey> In reply to @Elegantbeef "https://github.com/nim-lang/Nim/search?q=defined%28": I'm bad at asearchign
04:33:51FromDiscord<Rika> In reply to @Elegantbeef "I was referencing disruptek": A
04:34:07FromDiscord<Elegantbeef> yea i was going to write something else but didnt delete enough
04:34:08FromDiscord<Elegantbeef> Shoot me
04:34:12FromDiscord<Rika> Okay
04:34:17FromDiscord<Rika> Where would you prefer?
04:34:36FromDiscord<Elegantbeef> Anywhere above the eyes
04:41:21FromDiscord<Prestige> Is there a way to have an index as part of any iterator? Specifically I'm looking to use it with the `lines` iterator which returns lines of a file
04:41:30FromDiscord<Prestige> I assume I just have to track a var externally though
04:41:36FromDiscord<Elegantbeef> `import std/enumerate`
04:45:32FromDiscord<Prestige> Ty
05:16:56FromDiscord<Bung> https://github.com/bung87/webview2/blob/1bc58773343ca9931937fa208883a78913e99c4e/src/webview2/loader.nim#L143 why the envCompletedHandler addr changed it passed from two procs
06:03:09*cyraxjoe quit (Ping timeout: 268 seconds)
06:08:44FromDiscord<ShalokShalom> This talk references "highly customizable error messages thanks to meta-programming"
06:08:48FromDiscord<ShalokShalom> How this?
06:09:28FromDiscord<Elegantbeef> What talk?
06:09:34FromDiscord<ShalokShalom> Wait
06:10:04FromDiscord<ShalokShalom> Its early in the morning here
06:10:08FromDiscord<ShalokShalom> Ah, its about the types
06:10:17FromDiscord<ShalokShalom> https://youtu.be/d2VRuZo2pdA
06:11:00FromDiscord<Elegantbeef> I mean you can implement your own compiler passes so one could argue metaprogramming does give cusutomizable error messages
06:11:11FromDiscord<Elegantbeef> But it'd be a bad argument
06:17:47FromDiscord<Bung> In reply to @Bung "https://github.com/bung87/webview2/blob/1bc58773343": @ElegantBeef Could you take a took at this ? it's maybe my silly mistake
06:17:55FromDiscord<Elegantbeef> At what?
06:18:12*cyraxjoe joined #nim
06:18:40FromDiscord<Bung> a ptr t pass into here and its addr changed
06:19:01FromDiscord<Elegantbeef> If you posted something it didnt get to matrix
06:20:11FromDiscord<Bung> browser.nim:126 -> CreateCoreWebView2EnvironmentWithOptions -> CreateWebViewEnvironmentWithClientDll
06:20:54FromDiscord<Bung> https://github.com/bung87/webview2/blob/1bc58773343ca9931937fa208883a78913e99c4e/src/webview2/loader.nim#L143
06:22:41FromDiscord<Elegantbeef> So what's happening?
06:23:11FromDiscord<ShalokShalom> In reply to @Elegantbeef "I mean you can": That's cool
06:23:31FromDiscord<ShalokShalom> Why do you think its a bad argument to do it with meta programming?
06:23:54FromDiscord<Elegantbeef> It's a bad argument in Nim cause you'd need to put your code into a macro block to get that, or use term rewriting macros
06:25:27FromDiscord<Bung> environmentCompletedHandler addr1:1920884539504 -> envCompletedHandler:ptr 000001bf3da40070
06:25:54FromDiscord<Elegantbeef> I'm going to need you to use your words
06:26:06FromDiscord<Bung> it complely changed to another thing
06:26:29FromDiscord<ShalokShalom> And what has static resource management to do with that?
06:26:34FromDiscord<ShalokShalom> 😊
06:27:03FromDiscord<ShalokShalom> Any videos of Nim you find especially good?
06:27:17FromDiscord<Bung> the environmentCompletedHandler I created addr is 1920884539504 when pass into there I echo the param it change to anther thing
06:27:30*PMunch joined #nim
06:28:40FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=48yV
06:29:29FromDiscord<Elegantbeef> It only makes sense that it changes where it points if you pass in a `var ptr T`
06:29:39FromDiscord<Elegantbeef> pointers should be passed by copy
06:31:04FromDiscord<Bung> but I never re assign it
06:31:17FromDiscord<Elegantbeef> Ok then it expects a `ptr ptr` and you're giving it just a `ptr`
06:31:33FromDiscord<Elegantbeef> If you arent changing it, it means the call you're calling is
06:33:35FromDiscord<Bung> I copyed same type definition from c/c++ code
06:35:27FromDiscord<Bung> browser.nim:126 -> CreateCoreWebView2EnvironmentWithOptions -> CreateWebViewEnvironmentWithClientDll , look here it changed only inside CreateWebViewEnvironmentWithClientDll
06:35:42FromDiscord<Elegantbeef> Well i cannot say anything
06:35:44FromDiscord<Elegantbeef> So have fun
06:36:00FromDiscord<Bung> I also echo inside CreateCoreWebView2EnvironmentWithOptions it's same address
06:37:09FromDiscord<Bung> okay. Thanks~
06:38:03*Guest59 joined #nim
06:40:05*skandal left #nim (#nim)
06:40:05Guest59Hi to all!
06:40:06Guest59Please, can you help me understand why this simple program is not working?
06:40:06Guest59type
06:40:07Guest59  StrawStack[T] = ref object
06:40:07Guest59    data: ptr seq[T]
06:40:08Guest59proc newStack[T](size: int): ref StrawStack[T] =
06:40:09Guest59  new result
06:40:09Guest59  var s = newSeq[T](size)
06:40:09Guest59  result.data = s.addr # this gives SIGSEGV
06:40:10Guest59when isMainModule:
06:40:10Guest59  var s = newStack[int](3)
06:40:27FromDiscord<Elegantbeef> https://play.nim-lang.org/
06:41:11Guest59https://play.nim-lang.org/#ix=48yZ
06:41:13FromDiscord<Elegantbeef> You're unsafely using a ref though
06:41:50FromDiscord<Elegantbeef> `s` is on the stack so `result.data = s.addr` is unsafe
06:41:51Guest59Before this I tried using normal ref (not pointers) but couldn't get through
06:41:59FromDiscord<Elegantbeef> Why are you not doing `ref seq[T]`?
06:42:43Guest59and how I can assign var s = newSeq[T](size) to result.data?
06:43:06FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=48z0
06:43:09FromDiscord<Elegantbeef> There were a few issues
06:43:21FromDiscord<Elegantbeef> `ref StrawStack[T]` means you have a `ref ref object`
06:43:27FromDiscord<Elegantbeef> So you'd need to `new` both of those
06:43:55FromDiscord<Elegantbeef> `ptr seq[T]` is only safe if you know what you're doing with Refc, with orc/arc you cannot do that safely
06:45:44Guest59Ahh! that's the point, right: `ref StrawStack[T]` is ref ref
06:46:17FromDiscord<Elegantbeef> For some reason people really stumble on the `ref object` 😄
06:47:28FromDiscord<Elegantbeef> This dumpster fire of a forum post did the same https://forum.nim-lang.org/t/9397
06:47:36FromDiscord<Elegantbeef> Inb4 this "guest59" is said person
06:48:47Guest59I cannot understand what seems a double initialization of `result.data`: first you initialize it in `data: new(ref seq[T])` and than you assign a new sequence
06:49:16FromDiscord<Elegantbeef> You need to allocate the `ref` then the seq
06:50:00FromDiscord<Elegantbeef> `ref` in Nim is a heap allocated managed pointer
06:50:11FromDiscord<Elegantbeef> So you have to explicitly allocate it with either a `new` or `Type()`
06:52:33Guest59mmm, thinking about it...
06:53:01Guest59(not about the latest you wrote, I know about managed pointers in the heap)
06:53:14FromDiscord<Elegantbeef> I dont know anything about how a 'strawstack' works so i do not know if there is any more nim way of doing it
06:54:06FromDiscord<Elegantbeef> There isnt much reason to have a `ref` object with a `ref seq` as far as i know
06:55:15FromDiscord<Elegantbeef> I guess with refc that'd copy less than just a `seq` but with orc/arc move semantics would move that heap memory
06:55:38Guest59The point for me is not about the StrawStack (it is just a stack that uses an internal allocated array that increases/decreases at need).
06:55:38Guest59Is more about how ref/pointers work in nim
06:58:37Guest59From your point of view Elegantbeef, Could be implemented like this? https://play.nim-lang.org/#ix=48z2
06:58:54Guest59No more `ref` only object
06:59:34Guest59so when I create `new result` the whole StrawStack and sequence[T] are created
07:00:19Guest59Anyway... thanks for the help, it is very appreciated
07:00:37*rockcavera quit (Remote host closed the connection)
07:00:48FromDiscord<Elegantbeef> There is still a ref
07:01:46FromDiscord<Elegantbeef> `new` heap allocates value types
07:01:59FromDiscord<Elegantbeef> so `assert typeof(new int) is (ref int)`
07:02:45Guest59I see
07:03:25FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=48z5
07:03:31FromDiscord<Elegantbeef> Is how you'd do it without any references
07:04:55FromDiscord<pongsu> proc newDatabase(filename = "test.db"): Database =↔ new result↔ result.db = open(filename, "", "", "")
07:04:57Guest59I see... another little question: in nim to have let's say a `constructor` I should use a proc like I did, right?
07:05:16FromDiscord<Rika> Pretty much yes
07:05:27FromDiscord<pongsu> who can explain the "new result" mean?
07:05:52Guest59`new result` allocates on the heap an objects from a reference, right?
07:05:58FromDiscord<Rika> It creates a new reference and sets result to that
07:08:44FromDiscord<pongsu> set result to the heap object --- Is this behavior automatic?
07:10:23FromDiscord<Rika> It’s done by “new” yes
07:10:33*vicecea quit (Remote host closed the connection)
07:11:16FromDiscord<Pastor> Is there some document about "new"?
07:11:53*vicecea joined #nim
07:12:40FromDiscord<Rika> In the documentation for the module “system” perhaps
07:12:55FromDiscord<Rika> I’m being roundabout because I can’t currently quickly pull the link up
07:16:17FromDiscord<Pastor> thank you, I have found the definition codes of "new"
07:21:04FromDiscord<Pastor> I want to know if the result variable is always initialized in stack? not heap?
07:23:44FromDiscord<Pastor> If the return type is object or mutable, we should "new result"?
07:24:25FromDiscord<Elegantbeef> If the return is a `ref` you need to heap allocate it
07:25:46FromDiscord<Pastor> I see, thanks
07:28:41*agentwa joined #nim
07:29:52*agentwa quit (Client Quit)
07:42:07FromDiscord<impbox [ftsf]> hmm, can't do method operators it seems?
07:58:26*Guest59 quit (Quit: Client closed)
07:58:30*Vladar joined #nim
08:02:24FromDiscord<Elegantbeef> @impbox [ftsf]\: yes you can
08:02:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48zm
08:04:10FromDiscord<impbox [ftsf]> hmm, weird... =\
08:04:44FromDiscord<impbox [ftsf]> i just removed all my method operators since it didn't seem to work and i'm in a rush
08:04:56FromDiscord<impbox [ftsf]> damn coding last minute for a live performance
08:05:22FromDiscord<Rika> GL
08:05:23FromDiscord<Elegantbeef> Even if it didnt you could've used a named procedure and a template which invoked it 😄
08:06:14FromDiscord<impbox [ftsf]> yea, i just renamed to not be an operator
08:06:59FromDiscord<impbox [ftsf]> added a whole bunch of nice new features to my visuals software, but trying to rush in loading/saving before the gig
08:07:13FromDiscord<impbox [ftsf]> serialization/deserialization is still a pain >_<
08:07:23FromDiscord<Elegantbeef> frosty 😄
08:08:02FromDiscord<impbox [ftsf]> ooh, handles subclasses?
08:08:41FromDiscord<Elegantbeef> Probably not
08:08:48FromDiscord<Elegantbeef> I mean it'd "work" but not as you'd want
08:09:44FromDiscord<Elegantbeef> I guess yes it'd work
08:09:47*cyraxjoe quit (Ping timeout: 252 seconds)
08:10:04FromDiscord<Elegantbeef> You'd implement a `serialise` method that does the serialising
08:10:15FromDiscord<Elegantbeef> But you'd have to override every object's serialise method
08:10:19FromDiscord<Elegantbeef> Cause well OOP sucks 😄
08:10:51FromDiscord<impbox [ftsf]> yeah D:
08:11:17FromDiscord<impbox [ftsf]> that's pretty much what i'm doing now
08:12:09FromDiscord<Elegantbeef> Yep oop was a mistake
08:12:22FromDiscord<impbox [ftsf]> one day i'll learn
08:13:13FromDiscord<voidwalker> so this is the OOP was a mistake gang
08:13:21FromDiscord<Elegantbeef> Correct
08:13:28FromDiscord<Elegantbeef> There's a reason that Nim is procedural
08:13:32FromDiscord<voidwalker> I wonder what programming language discords praise OOP
08:13:38FromDiscord<Elegantbeef> C++, Java, C#
08:13:40FromDiscord<impbox [ftsf]> i'm not an oop fan, but i tend to make things that are oopy
08:14:07FromDiscord<voidwalker> oopsy
08:14:22FromDiscord<Elegantbeef> I try to avoid OOP as much as possible as it just makes everything terrible
08:15:25*cyraxjoe joined #nim
08:16:04FromDiscord<voidwalker> blah I so hate this "I can't go wrong learning Java to get a job". Everyone does it ;\
08:16:17FromDiscord<voidwalker> Even at universities here it's the main language
08:16:18FromDiscord<Elegantbeef> I guess the one reason it's such a pain in nim is we cannot easily go "Hey look up this type, instantiate it let me serialise to it then return it as the base"
08:16:49FromDiscord<Elegantbeef> The entire list of subtypes isnt queryable, which is a shame
08:17:43FromDiscord<Bung> @ElegantBeef found its about how repr works, it relys on type definition, if a the obj
08:17:48FromDiscord<impbox [ftsf]> i feel like other than the serialization/deserialization type stuff, oop in nim does what i want
08:18:28FromDiscord<Bung> (edit) "@ElegantBeef found its about how repr works, it relys on type definition, if a the obj ... " added "field I define as ptr A, I actually store a ptr B , it will not print the actually structure"
08:19:18FromDiscord<Elegantbeef> Yea it's the only way to have a truely heterogeneous collections
08:19:36FromDiscord<Elegantbeef> Which means user defined types can be used and extended
09:25:17*Vladar quit (Remote host closed the connection)
09:29:20*Vladar joined #nim
09:46:26FromDiscord<Olfactory Hallucinations> In reply to @iWonderAboutTuatara "it's annoying since I": replying to an old comment here, but the Replit Nim environment (https://replit.com/languages/nim) has access to a temporary file system, which makes it easy to test stuff using files and shells.
09:47:30*Vladar quit (Ping timeout: 264 seconds)
09:57:22*wallabra_ joined #nim
09:58:46*wallabra quit (Ping timeout: 260 seconds)
09:59:05*wallabra_ is now known as wallabra
10:16:40FromDiscord<EyeCon> In reply to @Olfactory Hallucinations "replying to an old": Yes, but:↔> Nim Compiler Version 1.2.0 (2020-04-03)
10:19:14FromDiscord<Olfactory Hallucinations> That's a drawback for sure. I've mostly used it to test simple things, but I haven't run into any issues yet
10:21:57FromDiscord<EyeCon> It wasn't meant as an objection, it's better than nothing for sure, but it would be very nice if they'd update it
10:22:44FromDiscord<EyeCon> It just has the potential of sending you into a rabbit hole of a problem which has already been solved in a later version
10:26:26FromDiscord<Olfactory Hallucinations> Yeah, that's true.
10:45:25PMunchYou technically have a file-system on the playground as well
10:45:44PMunchBut in order to put files there you need to use compile-time file writing
10:46:24FromDiscord<Rika> Wand box also kinda has a file system
10:52:38*Vladar joined #nim
11:06:09PMunchHmm, I have a local `$` function that access some global state. But `join` and friends really doesn't like this..
11:07:36PMunchI guess I could go through and make a reference for the elements that points to the parent..
11:07:48PMunchThat would mean you could have multiple parents as well..
11:10:27FromDiscord<planetis> lol I am looking at a similar thing right now, trying to compile debugEcho in a nosideeffect proc but $ reports that it has side effects.
11:11:10FromDiscord<techdev> sent a long message, see http://ix.io/48uN
11:12:38FromDiscord<aruZeta> In reply to @techdev "If you have a": <@&371760044473319454>
11:14:45FromDiscord<Rika> In reply to @aruZeta "<@&371760044473319454>": That was quick
11:14:57PMunchHmm, these usernames and profiles seems more and more like real users
11:15:13PMunchThis one even had a profile picture
11:15:26PMunch@Rika, fastest ban-hammer in the west
11:17:40FromDiscord<aruZeta> lmao
11:22:54*Vladar quit (Ping timeout: 264 seconds)
11:33:10FromDiscord<b1rdf00d> is there a wait time before posting set up on this discord? might help filter some of the spam
11:34:10FromDiscord<aruZeta> problem is some of the bots join from the irc
11:34:44PMunch@aruZeta, it's been a loooong time since we had an IRC spammer
11:34:52PMunchAll of these come from Matrix
11:35:07FromDiscord<aruZeta> well that's what i meant, sr
11:35:08FromDiscord<aruZeta> (edit) "sr" => "sry"
11:35:21PMunchBut no, I don't think there is a wait time
11:35:35PMunchWe're looking at options for dealing with this in a better way
11:35:58FromDiscord<aruZeta> for discord there is https://media.discordapp.net/attachments/371759389889003532/1012324453553819658/unknown.png
11:36:15FromDiscord<aruZeta> (edit) "for discord there is ... https://media.discordapp.net/attachments/371759389889003532/1012324453553819658/unknown.png" added "these "requirements" to join a server"
11:36:38FromDiscord<Rika> This discord server has no spam problem
11:36:38FromDiscord<aruZeta> (edit) "join" => "send messages in"
11:36:40FromDiscord<Rika> It’s from matrix
11:36:46FromDiscord<aruZeta> yh ik
11:36:51FromDiscord<Rika> Matrix does not have a similar system
11:37:06FromDiscord<aruZeta> that's what i was going to ask if there was smth of the like
11:37:57FromDiscord<enthus1ast> imho the only real solution is to moderate
11:38:07FromDiscord<enthus1ast> like so that new user cannot do anything in the channel
11:38:21FromDiscord<enthus1ast> and must ping a mod to enable them
11:38:26FromDiscord<enthus1ast> but yeah
11:38:29FromDiscord<Rika> In reply to @enthus1ast "imho the only real": Why not severe
11:38:36FromDiscord<Rika> this is a bad joke
11:38:45FromDiscord<aruZeta> bruh
11:39:20FromDiscord<enthus1ast> i don't get it @Rika
11:39:39FromDiscord<Rika> Moderate as in not the verb
11:39:49FromDiscord<Rika> “Mild moderate severe”
11:40:00FromDiscord<enthus1ast> ah \:)
11:40:41FromDiscord<enthus1ast> i think discord has the issue not YET, afaik there where some spammers spamming on discord already
11:40:59FromDiscord<Rika> The kind of spam is different in discord
11:41:03FromDiscord<Rika> Usually it’s DM spam
11:41:14FromDiscord<Rika> Which is why I have it off by default
11:44:19FromDiscord<Phil> Hah! Avoided that for the most part
11:46:20FromDiscord<SouperZ> hey guys does anyone know how to do opengl stuff in a imgui window? im using https://github.com/nimgl/nimgl/blob/master/examples/timgui.nim
11:49:10FromDiscord<impbox [ftsf]> i'm doing it right now
11:49:24FromDiscord<impbox [ftsf]> but i'm about to run out
11:49:26FromDiscord<impbox [ftsf]> sorry
11:49:30FromDiscord<impbox [ftsf]> but it's totally doable!
11:49:36FromDiscord<impbox [ftsf]> you can do it!
11:51:30*xet7 joined #nim
11:55:50*Vladar joined #nim
12:38:11FromDiscord<Bung> I finally use x64dbg find where the problem nearby
12:45:42*arkurious joined #nim
12:55:22*derpydoo joined #nim
13:17:34FromDiscord<ravinder387> why i'm getting error https://media.discordapp.net/attachments/371759389889003532/1012350023893254265/Screenshot_from_2022-08-25_18-46-56.png
13:18:17FromDiscord<Prestige> use parens
13:18:56FromDiscord<ravinder387> i know.. but in docs it is written that u can call function f a,b
13:18:59FromDiscord<Prestige> the compiler sees `echo(add0(2), 3)`
13:19:02FromDiscord<ravinder387> why it not working
13:21:07FromDiscord<aruZeta> the compiler thinks the comma is for echo
13:21:10FromDiscord<Bung> (add0 2) echo's param 1th, 3 echo's param 2th
13:21:11FromDiscord<aruZeta> not for add8
13:21:12FromDiscord<aruZeta> (edit) "add8" => "add0"
13:21:26FromDiscord<ravinder387> docs https://media.discordapp.net/attachments/371759389889003532/1012350996757872721/Screenshot_from_2022-08-25_18-50-55.png
13:21:45FromDiscord<aruZeta> that's exactly how it works
13:21:56FromDiscord<aruZeta> echo mySum 0, 1
13:22:15FromDiscord<aruZeta> the comma separates arg0 and arg1 of ECHO
13:22:37FromDiscord<aruZeta> so it would look like echo(mySum 0, 1)
13:22:41FromDiscord<aruZeta> (edit) "echo(mySum" => "`echo(mySum" | "1)" => "1)`"
13:22:52FromDiscord<aruZeta> (edit) "echo" => "`echo" | "1" => "1`"
13:23:19FromDiscord<aruZeta> what you want to do is `echo mySum(0, 1)`
13:25:13*jmdaemon quit (Ping timeout: 268 seconds)
13:26:20FromDiscord<ravinder387> here <function> <arg0> <arg1> echo mySum 0
13:26:29FromDiscord<ravinder387> for echo mySum is argument
13:26:31FromDiscord<ravinder387> u mean
13:27:02FromDiscord<aruZeta> in your example we dont have `f arg0 arg1`
13:27:12FromDiscord<aruZeta> we have `f1 f2 arg0 arg1`
13:27:32FromDiscord<aruZeta> (edit) "arg0" => "arg0,"
13:27:37FromDiscord<aruZeta> (edit) "arg0" => "arg0,"
13:27:58FromDiscord<ravinder387> wht about this https://media.discordapp.net/attachments/371759389889003532/1012352638291030026/Screenshot_from_2022-08-25_18-57-21.png
13:30:01FromDiscord<ravinder387> try
13:30:03FromDiscord<ravinder387> sent a long message, see http://ix.io/48AM
13:30:36FromDiscord<aruZeta> idk about the compiler's internals, but my wild guess is that `=` is also a function
13:31:00FromDiscord<aruZeta> use `add0(2, 3)` and it should work
13:31:19FromDiscord<ravinder387> yes i know
13:33:54FromDiscord<ravinder387> var x = 1 here var is keyword x is symbol = function 1 value
13:33:58FromDiscord<ravinder387> how it works
13:35:56FromDiscord<Rika> https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax
13:36:40FromDiscord<Rika> If your proc returns, you cannot use command call syntax with more than one argument I guess
13:44:36FromDiscord<ravinder387> can i see ast for any expression
13:44:46FromDiscord<ravinder387> how it parsed string
13:44:58FromDiscord<ravinder387> i mean everything
13:47:01FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48AR
13:47:16FromDiscord<aruZeta> put your code there and it will show you the generated AST
13:48:36FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48AS
13:49:11FromDiscord<aruZeta> by clickying here, the button on the left of `Run!` https://media.discordapp.net/attachments/371759389889003532/1012357978709557298/unknown.png
13:49:19PMunchI'm starting to think I've spent too long on notificatcher :P
13:49:33PMunchJust added some more features to handle closing notifications and getting pids
13:50:05PMunchSo now you can tie it together with your favourite terminal GUI application even better than before!
13:50:09FromDiscord<ravinder387> i want to see in vscode also
13:50:33FromDiscord<aruZeta> In reply to @ravinder387 "i want to see": just compile the code and it will be showed on the compile log
13:50:47FromDiscord<aruZeta> no need to run the compiled executable
13:51:02FromDiscord<aruZeta> In reply to @PMunch "I'm starting to think": what's notificatcher
13:51:19PMunchhttps://github.com/PMunch/notificatcher
13:51:29PMunchBasically a program to get notifications from DBus
13:51:51PMunchSo if you don't have a notification program you can use that and build your own workflow for notifications
13:51:54FromDiscord<aruZeta> lol I searched `notificatcher` in ddg and it showed me a repo of yours named `notifishower`
13:52:10PMunchHaha, yeah those two are kind of related
13:53:03PMunchIt's useful if you want to show notifications on a bar in a WM for example
13:53:24FromDiscord<aruZeta> nice
13:53:41FromDiscord<aruZeta> since I'm on sway I have mako to handle the notifs
13:54:18PMunchBut notificatcher can also run programs and such with the notifications
13:54:37PMunchSo for example you can do this: notificatcher --run 'zenity --{hints:urgency:info:warning:error} --title "Notification from: {appName}" --text "{summary}"' --file "/tmp/notifications/{id}" --closeRun 'kill $(cat /tmp/notification/{id})' "{pid}"
13:54:55FromDiscord<aruZeta> hmmm
13:55:09PMunchThat will start zenity for every notification, then if they are discarded by the program that created them kill the zenity window
13:55:22FromDiscord<aruZeta> interesting
13:55:50FromDiscord<aruZeta> but since I don't make much use of notifications I can't find it (atm) any use for me
13:55:58PMunchNotifishower is basically just a program to create small GUIs through a terminal tool
13:56:18PMunchYeah it's mostly for extreme tinkerers
13:56:19FromDiscord<aruZeta> I mean, the only notif I get is the dumb wezterm telling me there are new updates
13:56:29PMunchBut I've gotta go
13:56:30*PMunch quit (Quit: Leaving)
13:56:39FromDiscord<Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=48AT
13:56:43FromDiscord<aruZeta> and I thought I configured it to not show me those notifs ...
13:57:01FromDiscord<aruZeta> In reply to @Nalmyth "I couldn't find the": do you mean generics
13:57:07FromDiscord<Nalmyth> Ah maybe that's the search term
13:57:25FromDiscord<aruZeta> if you mean the T stuff, then yh that's generics
13:57:41FromDiscord<aruZeta> take a look here
13:57:41FromDiscord<Nalmyth> Yea seems to be it, thank you!
13:57:43FromDiscord<aruZeta> https://nim-lang.org/docs/manual.html#generics
13:58:18FromDiscord<Nalmyth> Is there some way to specify exactly which function I want to call?↔I have a problem with one small function which I'd like to return two different types from
13:58:44FromDiscord<aruZeta> hmm
13:58:45FromDiscord<Nalmyth> like `someFunc[typeA](5)`
13:59:09FromDiscord<Nalmyth> Ah maybe this https://media.discordapp.net/attachments/371759389889003532/1012360485477294170/Screenshot_2022-08-25_at_17.59.04.png
14:00:50FromDiscord<aruZeta> i think not https://media.discordapp.net/attachments/371759389889003532/1012360908032462938/unknown.png
14:01:07FromDiscord<aruZeta> unless you are doing `foo.bar[T](arg)`
14:01:07FromDiscord<Nalmyth> Hmm
14:01:18FromDiscord<aruZeta> which you should write as `foo.bar[:T](arg)
14:01:19FromDiscord<aruZeta> (edit) "`foo.bar[:T](arg)" => "`foo.bar[:T](arg)`"
14:01:33FromDiscord<Nalmyth> I will write a small example to make sure I understood it
14:01:41FromDiscord<aruZeta> do you maybe mean smth like this:? https://media.discordapp.net/attachments/371759389889003532/1012361123904897084/unknown.png
14:01:58FromDiscord<aruZeta> it will result in a ambiguous call error
14:02:15FromDiscord<Nalmyth> Yea I was thinking: "How can that work??" 😅
14:02:55FromDiscord<Rika> It won’t
14:03:06FromDiscord<aruZeta> short answer
14:03:09FromDiscord<aruZeta> (edit) "short answer ... " added "^^"
14:03:56FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48AZ
14:04:03FromDiscord<Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=48B0
14:04:23FromDiscord<Nalmyth> (edit) "https://play.nim-lang.org/#ix=48B0" => "https://play.nim-lang.org/#ix=48B1"
14:04:38FromDiscord<Nalmyth> In reply to @aruZeta "but you can do": Yea looks perfect, I will try!
14:05:00FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=48B2
14:05:03FromDiscord<aruZeta> yep
14:05:14FromDiscord<Nalmyth> So specify options directly there
14:05:14FromDiscord<aruZeta> you should have `T: SomeType`
14:05:18FromDiscord<aruZeta> inside the generic
14:05:21FromDiscord<Nalmyth> Ah I see
14:05:34FromDiscord<aruZeta> `proc someFunc[T: SomeType]`
14:05:47FromDiscord<aruZeta> (edit) "SomeType]`" => "SomeType](param bla bla): T =`"
14:13:13FromDiscord<Nalmyth> Hmm it works but it looks a bit messy now 🙁 ↔I guess I will try to do it somehow with polymorphism instead
14:13:17FromDiscord<Nalmyth> (edit) "Hmm it ... works" added "sortof"
14:13:46FromDiscord<Nalmyth> More useful in this case as I really want to access some specific types from a module based on which type was specified which adds a lot of bloat to the function
14:16:39FromDiscord<Nalmyth> Finally added an extra unused typed parameter, and it's much easier to reason about
14:16:43FromDiscord<Nalmyth> Thank you guys 🙏
14:16:59*agentwa joined #nim
14:17:22FromDiscord<Nalmyth> (edit) "Finally added an extra unused typed ... parameter," added "`(_: TypeA, ...)`"
14:19:00FromDiscord<aruZeta> np, what best works for ya
14:23:22FromDiscord<sealmove> I read the manual about the `{.header.}` and I still don't get it. When would one use it?
14:27:05FromDiscord<aruZeta> from what I've read, it does not declare anything but just add's an `#include` to the generated c
14:27:40FromDiscord<aruZeta> (edit) "an" => "a"
14:28:30FromDiscord<aruZeta> so your generated c code will require the header specified to exist in order to be compiled
14:30:05FromDiscord<Bung> sent a code paste, see https://paste.rs/epz
14:30:30FromDiscord<Bung> (edit) "https://play.nim-lang.org/#ix=48Bh" => "https://play.nim-lang.org/#ix=48Bg"
14:34:48FromDiscord<sealmove> In reply to @aruZeta "so your generated c": hmm, so the code you are writing won't be using anything from that header file, correct? otherwise I suppose `{.importc.}` suffices.
14:35:23FromDiscord<sealmove> it's confusing because `{.header.}` is applied to what? types?
14:35:46FromDiscord<aruZeta> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma
14:35:54FromDiscord<aruZeta> > The header pragma is very similar to the nodecl pragma: It can be applied to almost any symbol and specifies that it should not be declared and instead, the generated code should contain an #include
14:36:46FromDiscord<sealmove> not declared where? not declared in the file the pragma appears?
14:36:59FromDiscord<aruZeta> look at nodecl
14:37:04FromDiscord<aruZeta> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-nodecl-pragma
14:37:13FromDiscord<aruZeta> > It tells Nim that it should not generate a declaration for the symbol in the C code
14:37:34FromDiscord<aruZeta> that's what "not declared" means
14:38:33FromDiscord<aruZeta> declaration in the C code generated, not in nim
14:38:39FromDiscord<aruZeta> (edit)
14:39:29FromDiscord<aruZeta> `{.header.}` will just put an `#include` in the generated C code, which I guess would import the specified file
14:41:00FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Bq
14:42:48FromDiscord<Alea> In reply to @aruZeta "i think not": wait what issue is this solving?
14:44:45FromDiscord<aruZeta> In reply to @Alea "wait what issue is": if you call `foo.bar[T](param)`, it will be parsed as `(foo.bar(param))[T]`
14:45:21FromDiscord<aruZeta> while `foo.bar[:T](param)` will be parsed as (bar[T](foo, param)`
14:45:24FromDiscord<aruZeta> (edit) "(bar[T](foo," => "`(bar[T](foo,"
14:46:47FromDiscord<aruZeta> In reply to @àžŁŃ”àž„É­àč“à菦©Ń” "so basically if you": you will most likely need to specify header
14:46:57FromDiscord<aruZeta> where is it importing that symbol from?
14:47:07FromDiscord<aruZeta> that's what header describes
14:47:33FromDiscord<aruZeta> The header pragma specifies the header file that contains the imported procedure. The importc pragma asks the Nim compiler to import the printf procedure from C
14:47:41FromDiscord<aruZeta> (edit) "procedure." => "symbol."
14:47:48FromDiscord<aruZeta> (edit) "printf procedure" => "symbol"
14:48:22FromDiscord<sealmove> ok I understand, thanks. btw do you have some examples with variety? importing structs, functions etc
14:48:42FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48Bv
14:49:10FromDiscord<aruZeta> In reply to @àžŁŃ”àž„É­àč“à菦©Ń” "ok I understand, thanks.": hmm
14:51:47FromDiscord<Rika> In reply to @àžŁŃ”àž„É­àč“à菦©Ń” "so basically if you": If you need this it’s in the io module, CFile
14:51:47FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48Bw
14:52:06FromDiscord<aruZeta> (correct anyone who knows, since I don't lol)
14:52:23FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=48Bx
14:53:13FromDiscord<aruZeta> my bad
14:53:31FromDiscord<aruZeta> (edit) "https://play.nim-lang.org/#ix=48Bw" => "https://play.nim-lang.org/#ix=48By"
14:53:36FromDiscord<aruZeta> wth was in my head to write that
14:53:56FromDiscord<Bung> does this means the variable store "C:\Users\crc32\AppData\Roaming\webview" size too small ? https://media.discordapp.net/attachments/371759389889003532/1012374269243699351/2022-08-25_225214.png
14:55:14FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48BB
14:55:24FromDiscord<aruZeta> np
15:01:20*LuxuryMode joined #nim
15:09:59FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48BT
15:10:11FromDiscord<aruZeta> no
15:10:25FromDiscord<aruZeta> unless you the importc pragma
15:10:41FromDiscord<sealmove> yes I am talking about importc
15:11:12FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48BV
15:11:15FromDiscord<aruZeta> it would look like
15:11:21FromDiscord<sealmove> great
15:12:02FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48BW
15:12:34*rockcavera joined #nim
15:12:34*rockcavera quit (Changing host)
15:12:34*rockcavera joined #nim
15:12:36*ehmry quit (Ping timeout: 260 seconds)
15:13:07FromDiscord<aruZeta> you need to specify their actual name in the c code using importc
15:19:00FromDiscord<nx0> recently started learning macros, is this expected? - https://play.nim-lang.org/#ix=48BY
15:21:17*agentwa left #nim (#nim)
15:22:15FromDiscord<sealmove> In reply to @aruZeta "you need to specify": oh
15:24:36FromDiscord<sealmove> In reply to @nx0 "recently started learning macros,": hmm macro overloading :DDDD
15:24:56FromDiscord<sealmove> I guess we don't have that
15:29:09FromDiscord<nx0> macro overloading works in other cases though - https://play.nim-lang.org/#ix=48C0↔just a minor change to the previous code
15:29:30FromDiscord<aruZeta> In reply to @nx0 "recently started learning macros,": that's because your macro is creating the proc a second time, i think?
15:29:57FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48C1
15:32:08FromDiscord<nx0> so? as mentioned in the code, it works when first macro is commented out. and i checked that it is not executing both macros either by printing some random stuff in the macros. and it also works if i add a dummy int node. the issue is with overloading afaict, but i have \~0 knowledge of macros, so...
15:32:59FromDiscord<sealmove> some times the macros are not printed because of caching
15:33:11FromDiscord<aruZeta> it does not work if I commen the first macro https://media.discordapp.net/attachments/371759389889003532/1012384152424812706/unknown.png
15:34:03FromDiscord<aruZeta> well i guess i need to comment the first proc b too
15:34:04FromDiscord<aruZeta> my bad
15:35:55FromDiscord<aruZeta> anyway, i have never used a macro as a pragma, so idk
15:36:03FromDiscord<aruZeta> (edit) "used" => "created"
15:36:13FromDiscord<aruZeta> (edit) "anyway, i have never created a macro ... as" added "and used it"
15:47:24FromDiscord<SouperZ> In reply to @SouperZ "hey guys does anyone": anyone?
15:52:17*ehmry joined #nim
15:55:02FromDiscord<hotdog> In reply to @SouperZ "anyone?": Opengl is already there, you can just render on top of or below the imgui stuff
15:55:49FromDiscord<SouperZ> In reply to @hotdog "Opengl is already there,": yes but what about inside a imgui window
15:55:58FromDiscord<SouperZ> i cant find much resources
15:59:18FromDiscord<hotdog> In reply to @SouperZ "yes but what about": What do you mean? It's not an imgui window, it's opengl. The window itself created by glfw
15:59:46FromDiscord<SouperZ> In reply to @hotdog "What do you mean?": i mean a imgui window like this https://media.discordapp.net/attachments/371759389889003532/1012390841425330306/unknown.png
15:59:58FromDiscord<SouperZ> not a system window
16:08:33FromDiscord<hotdog> In reply to @SouperZ "i mean a imgui": Ah. Looks like there's a couple of ways https://github.com/ocornut/imgui/issues/984
16:19:32FromDiscord<choltreppe> how can you get the highest and lowest value of a Slice?
16:22:32FromDiscord<aruZeta> In reply to @choltreppe "how can you get": https://play.nim-lang.org/#ix=48Cc
16:24:08FromDiscord<aruZeta> this works because of how a HSlice is defined https://nim-lang.org/docs/system.html#HSlice
16:24:27FromDiscord<aruZeta> (edit) "HSlice" => "`HSlice`"
16:25:11FromDiscord<aruZeta> (note that `Slice[T]` is just an alias for `HSlice[T, T]`)
16:25:23FromDiscord<choltreppe> ok thanks
16:25:32FromDiscord<aruZeta> np!
16:45:52FromDiscord<!&luke> In reply to @b1rdf00d "there's ish terminal for": Tried it, can't install Nim tho as it's i386
16:58:29FromDiscord<EyeCon> In reply to @Olfactory Hallucinations "That's a drawback for": Tio apparently has Nim too, but I don't know which version: https://tio.run/#nim
16:58:47FromDiscord<EyeCon> How do I find out the compiler version? Is there a symbol automatically defined for me?
16:59:16FromDiscord<aruZeta> in actual nim code?
16:59:28FromDiscord<aruZeta> or via command line
16:59:56FromDiscord<EyeCon> In Nim code, I can't influence command line that much
17:00:04FromDiscord<EyeCon> I have an oracle which runs programs
17:00:12FromDiscord<EyeCon> and I want to find out the Nim version
17:00:26FromDiscord<aruZeta> i will try search if it exits, since idk
17:01:00FromDiscord<EyeCon> Thanks, I'm searching too
17:01:02FromDiscord<aruZeta> https://nim-lang.org/docs/system.html#NimVersion
17:01:24FromDiscord<aruZeta> there ya go
17:01:41FromDiscord<aruZeta> it's a const
17:02:05FromDiscord<EyeCon> Ah, thanks
17:02:11FromDiscord<EyeCon> My search-fu is weak
17:02:51FromDiscord<EyeCon> In reply to @EyeCon "Tio apparently has Nim": `echo NimVersion`↔> 1.0.0
17:03:06FromDiscord<EyeCon> 😒
17:03:16FromDiscord<EyeCon> Why don't people update their installations
17:03:19FromDiscord<aruZeta> In reply to @EyeCon "My search-fu is weak": it was the 4th result lol https://media.discordapp.net/attachments/371759389889003532/1012406834990157835/unknown.png
17:03:51FromDiscord<EyeCon> In reply to @aruZeta "it was the 4th": I, trying to be clever, first checked the compiler documentation page, and then proceeded to the Index
17:04:13FromDiscord<EyeCon> Before I was finished you wrote it
17:05:42FromDiscord<aruZeta> lmao
17:19:30FromDiscord<Shiba> does anyone recommend "mastering nim" book
17:19:33FromDiscord<Shiba> (edit) "book" => "book?"
17:22:35FromDiscord<aruZeta> only nim book I've read is "Nim in action", and I do recommend it for newbies in the language
17:23:19FromDiscord<Shiba> i did learn the basics and a little bit of advanced stuff
17:23:32FromDiscord<Shiba> In reply to @Shiba "does anyone recommend "mastering": but is its worth buying
17:23:45FromDiscord<Shiba> (edit) "In reply to @Shiba "does anyone recommend "mastering": but is its worth buying ... " added ", like is it gonna make me a nim master"
17:24:49FromDiscord<Shiba> (edit) "In reply to @Shiba "does anyone recommend "mastering": but is its worth buying , like is it gonna make me a nim master ... " added "for real"
17:25:33FromDiscord<aruZeta> hey dom I see you :3
17:26:13FromDiscord<aruZeta> In reply to @Shiba "but is its worth": master's are made through experience
17:26:21FromDiscord<flywind> Read the Nim manual thoroughly, you can master Nim quickly 😜
17:26:49FromDiscord<Generic> this but unironically
17:27:28FromDiscord<aruZeta> once you know the basics of the language, try doing some projects
17:27:47FromDiscord<aruZeta> you will need to search the manual a lot, and so you will learn more stuff
17:28:03FromDiscord<Shiba> like small apps , examples?
17:28:16FromDiscord<aruZeta> and as flywind said, read the https://nim-lang.org/docs/manual.html
17:28:31FromDiscord<Shiba> i read that like 5 times
17:28:39FromDiscord<aruZeta> oh
17:28:55FromDiscord<aruZeta> then, what have you used nim for
17:29:55FromDiscord<flywind> In reply to @Shiba "like small apps ,": https://xmonader.github.io/nimdays/ there are lots of small apps written in Nim
17:30:04FromDiscord<aruZeta> try making a DSL to learn macros/templates, some low level algorithm to learn low level nim, create a lib, a tui or a tui game, there are lots of stuff
17:30:10FromDiscord<Shiba> In reply to @aruZeta "then, what have you": ive had experience with making games, so iam trying to make one in nim
17:30:27FromDiscord<Shiba> oh nice idea
17:30:58FromDiscord<aruZeta> which of all
17:31:24FromDiscord<aruZeta> there are also parsers, json/xml/ini/yaml
17:31:27FromDiscord<Shiba> all of them
17:31:40FromDiscord<aruZeta> nice :)
17:32:12FromDiscord<Shiba> (edit) "all of them ... " added ", iam gonna do a little research about those stuff , and see if can make atleast one"
17:38:50FromDiscord<Forest> What are good alternatives to json for storing large amounts of data in a format that many languages can read?
17:39:04*jmdaemon joined #nim
17:39:23FromDiscord<Forest> Large amounts of data could mean around 780 megabytes in a json file format
17:39:37FromDiscord<Generic> can it be binary?
17:39:40FromDiscord<Forest> And could also be way bigger
17:39:55FromDiscord<Forest> In reply to @Generic "can it be binary?": That's good with me but I'm storing large amounts of string data
17:40:10FromDiscord<Generic> well binary formats are even then at an advantage
17:40:12FromDiscord<mratsim> In reply to @Forest "What are good alternatives": CBOR? msgpack?
17:40:24FromDiscord<Generic> because they can store the length of the string in advance
17:40:37FromDiscord<Generic> so there's no scanning
17:40:43FromDiscord<Forest> Cbor?
17:40:46FromDiscord<Forest> In reply to @Generic "well binary formats are": Oh neat
17:40:47FromDiscord<EyeCon> CBOR
17:40:54FromDiscord<Forest> Yeah what's that?
17:40:56FromDiscord<Generic> I second message message pack
17:41:04FromDiscord<mratsim> In reply to @Forest "Yeah what's that?": https://en.wikipedia.org/wiki/CBOR
17:41:40FromDiscord<mratsim> sent a long message, see http://ix.io/48Cn
17:42:16FromDiscord<Forest> Hm what's the difference between them both then? To me seems like msgpack and CBOR do essentially the same thing
17:42:21FromDiscord<Prestige> msgpack looks nice
17:42:28FromDiscord<Forest> In reply to @Avahe "msgpack looks nice": Agreed
17:43:47FromDiscord<mratsim> In reply to @Forest "Hm what's the difference": CBOR is standardized by the IETF and is used in open protocols
17:43:55FromDiscord<mratsim> CBOR was inspired by msgpack afterall
17:44:01FromDiscord<Forest> Oh neat
17:44:23FromDiscord<mratsim> https://media.discordapp.net/attachments/371759389889003532/1012417169314824273/unknown.png
17:45:47FromDiscord<mratsim> oh interesting, CBOR can also handle bigints
17:46:09FromDiscord<mratsim> and bigfloats and fractions 😼
17:46:52FromDiscord<Forest> Cbor has tags? Like XML?
17:46:57FromDiscord<Prestige> https://git.sr.ht/~ehmry/nim_cbor
17:47:45FromDiscord<Forest> Yup already have that up
17:48:13FromDiscord<Forest> Is this... The whole implementation in a single file? That looks unbelievably simple
17:49:20ehmryit could be simplier if the API was cleaned up
17:49:27FromDiscord<aruZeta> In reply to @Avahe "https://git.sr.ht/~ehmry/nim_cbor": there is a flake.nix there, fellow nixer
17:49:42FromDiscord<Prestige> Oh hi ehmry
17:49:57FromDiscord<aruZeta> what a chad
17:50:04FromDiscord<Forest> In reply to @ehmry "it could be simplier": Wdym?
17:51:12FromDiscord<Forest> Ah initial commit was smaller but still, unbelievably small
17:52:37FromDiscord<aruZeta> someday I need to port my nix dots to a flake, that day I will die
17:53:19FromDiscord<Forest> Difference between them?
17:53:57FromDiscord<aruZeta> surely will need to rewrite all my dots
17:54:17FromDiscord<Prestige> I need to do that as well...
17:54:21FromDiscord<aruZeta> and tbh idk how a flake is supposed to work
17:54:25FromDiscord<aruZeta> need to research
17:55:11ehmryyou don't really need flakes in with your nimble stuff unless you are using something like C libraries
17:55:33FromDiscord<aruZeta> oh lord, just seeing how much commits I have in my dotfiles makes it more painful https://media.discordapp.net/attachments/371759389889003532/1012419976319225876/unknown.png
17:56:02FromDiscord<aruZeta> In reply to @ehmry "you don't really need": i actually just use a shell.nix, I mean for my dotfiles
17:56:09ehmrythere is already a flake that contains most of nimble https://github.com/nix-community/flake-nimble
17:56:31FromDiscord<aruZeta> oh thanks, will save it for the day I research about flakes
17:57:40FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48Cr
17:57:49FromDiscord<aruZeta> (edit) "https://play.nim-lang.org/#ix=48Cr" => "https://play.nim-lang.org/#ix=48Cs"
17:58:02FromDiscord<aruZeta> (edit) "https://play.nim-lang.org/#ix=48Cs" => "https://play.nim-lang.org/#ix=48Ct"
18:01:07*LuxuryMode quit (Quit: Connection closed for inactivity)
18:19:47FromDiscord<Forest> Question: How expensive is it to use nim_cbor? (Memory-wise)
18:26:22FromDiscord<sealmove> how to use toast (nimpterop)? `toast myfile.h` outputs nothing)
18:32:36FromDiscord<sealmove> Ah it needs `-n`
18:42:04*pro joined #nim
19:02:53FromDiscord<reversem3> I know I can just use if logic or case statements to turn morse code into ascii , but using a table how would you turn morse into ascii ? I have a const called MORSE with all the chars like 'A'\: ".-" and so on and put that into a table using toTable.
19:05:38*NimBot joined #nim
19:13:29FromDiscord<reversem3> would the table have to be ordered ?
19:22:39FromDiscord<sealmove> why would it?
19:23:18FromDiscord<sealmove> you would just index your table with the code you want to convert
19:24:03FromDiscord<reversem3> have an example ? still working on tables
19:24:38FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48CR
19:25:14FromDiscord<sealmove> tables in nim are like hashmaps (e.g. in java) or dictionaries (e.g. in python)
19:25:24FromDiscord<sealmove> are you familiar with the concept?
19:25:41FromDiscord<reversem3> yes key , value
19:26:03FromDiscord<sealmove> so you can easily just from a key to a value
19:26:20FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48CS
19:27:03FromDiscord<sealmove> oh you said your pairs look like this `'A': ".-"`
19:27:45FromDiscord<sealmove> then you need to revert them, for example `".-": 'A'`
19:28:37*Vladar quit (Quit: Leaving)
19:32:51FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48CV
19:33:01FromDiscord<sealmove> (edit) "https://play.nim-lang.org/#ix=48CV" => "https://play.nim-lang.org/#ix=48CW"
19:33:18FromDiscord<sealmove> (edit) "https://play.nim-lang.org/#ix=48CW" => "https://play.nim-lang.org/#ix=48CX"
19:48:42FromDiscord<planetis> If I need to use splitFile in nimble file what to do? import os crashes with invalid section '.'
19:48:50FromDiscord<planetis> (edit) "invalid" => ""invalid" | "'.'" => "'.'""
19:51:32FromDiscord<reversem3> Ok cool , so that reverses it↔(@sealmove)
19:53:25FromDiscord<planetis> nvm
19:54:56FromDiscord<planetis> sent a code paste, see https://play.nim-lang.org/#ix=48D5
19:56:28FromDiscord<reversem3> I had a problem with that with nico awhile ago, it has something to do with your code , if was for me anyway
19:58:31FromDiscord<planetis> I just used strings slices bc I can't even
20:27:02FromDiscord<reversem3> How do you split a seq ? so your only getting the key or the value
20:28:10FromDiscord<Forest> Any examples for constructing a data structure for nim_cbor? Read cbor.txt but not much info lmao
20:28:21FromDiscord<aruZeta> lol
20:28:59FromDiscord<Forest> Hm may just use msgpack for now
20:28:59*sagax joined #nim
20:29:08FromDiscord<Forest> msgpack4nim looks nice
20:45:27*om3ga quit (Ping timeout: 268 seconds)
20:45:54FromDiscord<Phil> In reply to @reversem3 "How do you split": Sorry... split a seq? Maybe I'm just a bit too tired, but could you give a rundown example what you want?
20:46:26FromDiscord<Phil> Because if you want to iterate over a seq while getting also the index you can use `for index, value in enumerate(myseq)'
20:46:29FromDiscord<Phil> (edit) "enumerate(myseq)'" => "enumerate(myseq)`"
20:47:08FromDiscord<reversem3> Yeah I want to separate the key and value
20:47:47FromDiscord<reversem3> They add the key or value to a string input
20:48:32FromDiscord<Phil> You're at tables right now, right? Not at a seq? Since the "key" in a seq is just a number and normally that's not the wording one uses to describe interacting with a seq so I'm somewhat confused.↔↔Maybe just provide an example of what you want in and what you want out?
20:51:22FromDiscord<reversem3> https://play.nim-lang.org/#ix=48Di -- basically trying to figure out how to translate morecode to ascii using nim tables
20:53:37FromDiscord<reversem3> In python I can just switch [value] = key then split it up and then join
20:53:40FromDiscord<reversem3> In python I can just switch [value] = key then split it up append and then join
20:57:32FromDiscord<Phil> So like, make a seq of all table keys, make a second seq of all table values, join the individual seqs all together into 1 large key-string and a second large value-string?
21:00:36FromDiscord<reversem3> So I can do something like https://compucademy.net/morse-code-with-python/
21:00:59FromDiscord<reversem3> Trying to do the same with nim
21:01:19FromDiscord<Elegantbeef> So what's the issue?
21:04:51FromDiscord<reversem3> Ok I'll try that↔(@Phil)
21:18:48FromDiscord<Phil> In reply to @reversem3 "Ok I'll try that": That wasn't a suggestion, that was me trying to comprehend and guessing what you want to achieve 😄
21:20:10FromDiscord<Phil> So like you want to turn a dictionary like `{"bla": "-", "blubb": "-.-"}` into `"blablub"` and `"--.-"` ?↔Or what's the goal?
21:20:38FromDiscord<Phil> (edit) "`"blablub"`" => "`"blablubb"`"
21:21:01FromDiscord<reversem3> Yeah I want to take input string and get back morse
21:21:18FromDiscord<Phil> OHHHH so the inverse!
21:22:10FromDiscord<Phil> You'd want to split `blablubb` up into `["bla", "blubb"]` to get the morse `["-", "-.-"]` ?
21:22:23FromDiscord<aruZeta> is https://play.nim-lang.org/ down?
21:22:28FromDiscord<Elegantbeef> Yes
21:22:53FromDiscord<aruZeta> let's compile on local then lol
21:23:49FromDiscord<Elegantbeef> I mean the best you can do is something like https://hastebin.com/ahegusunuv.lua
21:24:11FromDiscord<Elegantbeef> Without spaces in the morse i dont think it's possible to get morse -\> ascii
21:24:22ehmryForest: depends what you do, using `CborNode` is probably expensive, but `writeCbor` and `fromCbor` should be cheap
21:24:38FromDiscord<Elegantbeef> And if the morse has spaces then i'd suggest using parseutils and `parseUntil`
21:25:12FromDiscord<Forest> In reply to @ehmry "<@909883978717204561>: depends what you": Thanks!
21:27:02FromDiscord<reversem3> Interesting , ok thanks
21:28:30FromDiscord<Phil> In reply to @reversem3 "Interesting , ok thanks": Yeah you need some kind of separator. Otherwise, how do you know that `-.-` is EA or part of (, ) or maybe RT
21:29:38*derpydoo quit (Ping timeout: 244 seconds)
21:39:53FromDiscord<reversem3> right make sense
21:46:07FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=48Dw
21:49:56FromDiscord<Generic> it depends a bit
21:50:50FromDiscord<aruZeta> what's a {.closure.}, is it like a ptr to a function?
21:51:26FromDiscord<Rika> It’s a function that also captures some state in the current scope
21:52:21FromDiscord<Rika> So a function that accesses (not just global) stuff from outside it’s body without it being in its parameters
21:53:17FromDiscord<Generic> one shortcut you can take is if you parse UTF-8 and you don't need to distinguish between non ASCII characters, is to just not decode the UTF-8
21:53:40FromDiscord<⎝âȘ©ïčâȘšâŽ > Remember me?
21:53:59FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48DA
21:54:04FromDiscord<⎝âȘ©ïčâȘšâŽ > It's been two days and I think I finally write a Brainfuck compiler in Nim.
21:54:30FromDiscord<⎝âȘ©ïčâȘšâŽ > https://media.discordapp.net/attachments/371759389889003532/1012480110978404392/unknown.png
21:54:32FromDiscord<!Patitotective> In reply to @Generic "one shortcut you can": what i want to do is to check if codepoints are between 0x20>..0x10FFFF
21:54:58FromDiscord<Generic> yes, with UTF-8 just check whether a byte is 128 or above
21:55:24FromDiscord<⎝âȘ©ïčâȘšâŽ > In reply to @⎝âȘ©ïčâȘšâŽ  "": Well, it's not a compiler, rather an interpreter. And yes, that's the whole code.
21:55:27FromDiscord<Generic> then it will be (part) of a codepoint of 128 or above
21:55:40FromDiscord<aruZeta> In reply to @⎝âȘ©ïčâȘšâŽ  "": nice screenshot
21:56:01FromDiscord<Generic> ah though for what you want to archieve you need to decode UTF-8
21:56:11FromDiscord<⎝âȘ©ïčâȘšâŽ > In reply to @aruZeta "nice screenshot": VS Code Coldcode extension.
21:56:16FromDiscord<!Patitotective> In reply to @Generic "yes, with UTF-8 just": so i can use my same parser and check if `input[idx].int in 0x21..0x10FFFF`ÂĄ
21:56:18FromDiscord<!Patitotective> (edit) "0x21..0x10FFFF`ÂĄ" => "0x21..0x10FFFF`?"
21:56:20FromDiscord<⎝âȘ©ïčâȘšâŽ > (edit) "Coldcode" => "ColdCode"
21:56:22FromDiscord<Generic> no
21:56:36FromDiscord<Generic> ignore what I wrote earlier, you need to decode it into runes
21:57:08FromDiscord<!Patitotective> and to do that, do i use the `runes` iterator or `runeAt` procedure?
21:57:26FromDiscord<Generic> it depends on the other code
21:57:33FromDiscord<Generic> which will call your parse procedure
21:57:59FromDiscord<Generic> what exactly do you want to do when with the runes you found
21:58:40FromDiscord<!Patitotective> check if they're above 0x20 and below or same as 0x10FFFF (?)
21:58:53FromDiscord<Generic> but do you want to replace them afterwards or what?
21:59:34FromDiscord<!Patitotective> nope, if they're not in that range then return 0 because its not valid
22:00:27FromDiscord<Generic> if that's all you want to do and you don't care whether the UTF-8 is actually valid, there's actually a pretty evil trick you can do
22:01:01FromDiscord<!Patitotective> 👀
22:01:35FromDiscord<Generic> oh wait
22:01:54FromDiscord<Generic> 0x10FFFF is the maximum code point in UTF-8
22:02:02FromDiscord<Generic> is your input data even UTF-8?
22:03:24FromDiscord<!Patitotective> i'm just trying to follow this specification↔my input is any valid nim string i guess https://media.discordapp.net/attachments/371759389889003532/1012482349553963018/unknown.png
22:03:50FromDiscord<Generic> every possible byte sequence is a valid Nim string
22:04:37FromDiscord<Generic> the second criterion can only be violated by UTF-32 encoded strings
22:05:38FromDiscord<Rika> That’s not what they mean
22:06:00FromDiscord<Rika> They have a string that can be anything, they want to parse by ignoring invalid bytes
22:06:47FromDiscord<!Patitotective> rather than ignoring, erroring
22:07:56FromDiscord<Rika> Then what’s wrong with that runes iterator?
22:09:10FromDiscord<!Patitotective> it's not like there's something wrong but that i cannot do `inc idx` anymore
22:09:15FromDiscord<Generic> In reply to @aruZeta "I'm asking cuz I'm": you need to convert the proc references from nim call to a closure call i.e. `(proc (x, y: int): bool)(mask0), proc (x, y: int): bool)(mask1), ...`
22:09:35FromDiscord<aruZeta> hmm
22:09:41FromDiscord<aruZeta> anyway I did it in a better way
22:10:33FromDiscord<Rika> In reply to @Patitotective "it's not like there's": Yeah, so what? I’m not sure what you need that for
22:12:00FromDiscord<!Patitotective> ok, thanks, let me try
22:14:50FromDiscord<!Patitotective> since i have this invalid characters set `nonIdenChars + {' '}`, and now i have runes↔what would be the best way to compare them? converting the set to runes? converting the rune and the set to integers?
22:16:44FromDiscord<@bracketmaster-5a708063d73408ce4> has somebody written a tool like `make` in nim?
22:16:52FromDiscord<Elegantbeef> nake exists
22:17:58*pro quit (Quit: pro)
22:18:50FromDiscord<@bracketmaster-5a708063d73408ce4> looking at nake
22:19:01FromDiscord<@bracketmaster-5a708063d73408ce4> does it handle files as outputs?
22:19:07FromDiscord<@bracketmaster-5a708063d73408ce4> And files as dependencies?
22:19:14FromDiscord<Elegantbeef> No clue what either of those mean
22:22:50*ehmry quit (Ping timeout: 244 seconds)
22:25:09*notchris_ joined #nim
22:25:26*tk quit (Ping timeout: 244 seconds)
22:25:48*estiquelapice_ joined #nim
22:31:42*madprops_ joined #nim
22:33:04*sagax quit (*.net *.split)
22:33:04*oddish quit (*.net *.split)
22:33:04*alice quit (*.net *.split)
22:33:04*estiquelapice quit (*.net *.split)
22:33:04*madprops quit (*.net *.split)
22:33:04*notchris quit (*.net *.split)
22:33:10*notchris_ is now known as notchris
22:35:15*madprops_ is now known as madprops
22:35:15*madprops quit (Changing host)
22:35:15*madprops joined #nim
22:53:11FromDiscord<!Patitotective> actually i dont seem to need runes at all↔nim strings cannot be higher than 0x10ffff and 0x20 is easy to check since its just ascii :p
22:53:45FromDiscord<Elegantbeef> The hell are you doing?
22:54:46FromDiscord<!Patitotective> trying to make a nim KDL (a cuddly document language) implementation https://media.discordapp.net/attachments/371759389889003532/1012495279427174520/unknown.png
22:55:45FromDiscord<Elegantbeef> And is https://nim-lang.org/docs/strutils.html#validIdentifier%2Cstring too complicated?
22:57:28FromDiscord<Elegantbeef> I dont really get what you're doing so i'll shush
22:58:56*tk joined #nim
22:59:48FromDiscord<!Patitotective> i'm making a parse procedure that takes an input string and returns the number of characters until an invalid character (according to KDL's spec) is found↔and about `validIdentifier`, not sure it fulfills KDL requirements :p
23:00:09FromDiscord<Elegantbeef> Yea it clearly doesnt
23:00:23FromDiscord<!Patitotective> btw how was the nim cli real time interpreter called?
23:00:28FromDiscord<Elegantbeef> So then yea you'd use the unicode rune operator and check if the above is true
23:00:33FromDiscord<Elegantbeef> nim secret
23:01:11FromDiscord<!Patitotective> lmao https://media.discordapp.net/attachments/371759389889003532/1012496892065763379/unknown.png
23:01:11FromDiscord<Elegantbeef> Jesus christ the unicode module doesnt support openarrays
23:01:15FromDiscord<Elegantbeef> Literally unusable
23:01:26FromDiscord<!Patitotective> In reply to @Elegantbeef "Jesus christ the unicode": yeah, i had to slice 💀
23:01:39FromDiscord<Elegantbeef> Copy paste the module and make it take openarray[char]
23:01:56FromDiscord<Rika> Then patch file
23:01:57FromDiscord<Rika> Haha
23:02:10FromDiscord<Elegantbeef> Exactly
23:02:20FromDiscord<Elegantbeef> I dont get why it doesnt take `openarray[char]` it's so weird
23:02:21FromDiscord<!Patitotective> In reply to @Elegantbeef "nim secret": h-how do i install it?....
23:02:30FromDiscord<Elegantbeef> Do you have the nimcompiler?
23:02:32FromDiscord<Elegantbeef> It's installed
23:02:37FromDiscord<!Patitotective> then how do i run it
23:02:40FromDiscord<Elegantbeef> Or do you mean inim
23:02:47FromDiscord<Elegantbeef> cmon
23:02:52FromDiscord<!Patitotective> oh yea it was inim 😁
23:02:54FromDiscord<Elegantbeef> The nim VM repl is `nim secret`
23:05:37FromDiscord<!Patitotective> was the patch file and copy/pasting unicode module a joke or should i actually do it? if so where is documentation about patch files :p
23:05:57FromDiscord<Elegantbeef> I mean you dont need to patchfile cause it doesnt really matter if other modules use the std/unicode
23:06:04FromDiscord<Elegantbeef> But the copy pasting is ideal if you want performance
23:07:00FromDiscord<!Patitotective> i wont do it for now and when i finish it i'll do it and compare performance :]
23:07:12*rockcavera quit (Read error: Connection reset by peer)
23:07:41*rockcavera joined #nim
23:07:41*rockcavera quit (Changing host)
23:07:41*rockcavera joined #nim
23:11:52*alice joined #nim
23:13:15*ehmry joined #nim
23:15:23FromDiscord<auxym> In reply to @Patitotective "trying to make a": neat! I was thinking of doing that, but I won't complain if you save me the work!
23:15:52FromDiscord<!Patitotective> In reply to @auxym "neat! I was thinking": :p
23:17:54FromDiscord<!Patitotective> not being able to have a raw string start with double quotes is really annoying
23:30:41FromDiscord<Rika> You can’t?
23:31:27FromDiscord<Rika> !eval echo r""""idk""""
23:31:32NimBot"idk"
23:31:46FromDiscord<Rika> @!Patitotective
23:32:26FromDiscord<Elegantbeef> Also this is nim even if you couldnt you could do `proc doubleQuote(s: static string): string = ...`
23:33:21FromDiscord<!Patitotective> !eval echo """"idx""""
23:33:26NimBot"idx"
23:33:47FromDiscord<!Patitotective> seems like multi-line strings allow double quotes :p
23:34:22FromDiscord<Rika> đŸ€”
23:35:30FromDiscord<!Patitotective> because they're raw already
23:35:33FromDiscord<!Patitotective> https://nim-lang.org/docs/manual.html#lexical-analysis-triple-quoted-string-literals
23:36:05FromDiscord<!Patitotective> In reply to @Patitotective "because they're raw already": i mean, do not interpret escaped sequences and allow double quotes (without having to write two)
23:37:18FromDiscord<Rika> ?
23:37:27FromDiscord<Rika> yeah okay so?
23:37:37FromDiscord<Rika> im confused, what do you want exactly?
23:37:37FromDiscord<!Patitotective> sooo what
23:38:06FromDiscord<!Patitotective> ummm nothing particularly
23:38:19FromDiscord<!Patitotective> i mean, i dont have that problem anymore
23:38:20FromDiscord<!Patitotective> :p
23:42:19FromDiscord<!Patitotective> i have two procedures, one that validates a KDL number and another actually converts the input string into a float↔how should i name them? `validate` and `parse` or `validate` and `evaluate`?
23:44:49FromDiscord<Rika> parse
23:44:57FromDiscord<Rika> evaluate involves running some code
23:46:58FromDiscord<!Patitotective> :]
23:49:30FromDiscord<!Patitotective> can i use a case statement with open array instead of slicing the string?
23:51:40FromDiscord<⎝âȘ©ïčâȘšâŽ > Ok, I think I bugfixed the code again.
23:52:49FromDiscord<⎝âȘ©ïčâȘšâŽ > Now I have to find the way I can set some modifiers so the user can choose if the interpreter can wrap, the length of the array, the max value of each cell, etc. https://media.discordapp.net/attachments/371759389889003532/1012509886925508618/unknown.png