<< 11-11-2022 >>

00:49:39FromDiscord<Elegantbeef> I believe the issue is your `M >>= (A -@Freyr)
00:49:51FromDiscord<Elegantbeef> It's a generic with 0 inferable context
00:50:44FromDiscord<Freyr> hmm I see
00:52:27*neceve quit (Ping timeout: 248 seconds)
00:53:37*neceve joined #nim
00:57:02FromDiscord<!&luke> How can I convert a json array to a Nim sequence
00:57:09FromDiscord<!&luke> Preferably using std/json
00:57:25FromDiscord<Elegantbeef> Oh wait a minute freya i might be wrong
00:59:18FromDiscord<!&luke> Oh getElems should do the job
01:00:35FromDiscord<Freyr> In reply to @Elegantbeef "Oh wait a minute": essentially Monad needs to be generic over a parameter other than the one for which it's initialised right
01:00:46FromDiscord<Freyr> Let me check how Haskell implements
01:00:50FromDiscord<Freyr> (edit) "Let me check how Haskell implements ... " added "it"
01:01:01FromDiscord<Elegantbeef> Yea dont use big words with me 😛
01:01:08FromDiscord<Elegantbeef> I just attempt to make things work
01:01:52FromDiscord<Freyr> sent a code paste, see https://play.nim-lang.org/#ix=4fyF
01:02:14FromDiscord<Elegantbeef> Yea but haskell has a working concept alternative
01:02:18FromDiscord<Elegantbeef> Concepts in Nim are very very iffy
01:03:20FromDiscord<Freyr> There's very little information about them on the internet
01:05:04FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fyG
01:05:24FromDiscord<Elegantbeef> One issue you have right now is you're doing things like `pure(A)` which means you want `proc pure(_: typedesc[A])`
01:08:35FromDiscord<Elegantbeef> Another issue is you have nothing binding the generic parameter
01:08:52FromDiscord<Elegantbeef> Like A can be anything there is no explicit relation between the M and the A
01:16:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fyH
01:16:38FromDiscord<Elegantbeef> You can have any proc placed there and it compiles as there is no constraint
01:25:28FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4fyK
01:25:45FromDiscord<voidwalker> I don't understand, `Reads up to size bytes from socket into the result.`
01:26:05FromDiscord<voidwalker> means it will read less, even 0, if there is nothing to read ?
01:26:19FromDiscord<Elegantbeef> Correct
01:26:36FromDiscord<voidwalker> well, I need it to read exactly 4 bytes
01:26:54FromDiscord<Elegantbeef> So then if you dont read 4 bytes error
01:27:16FromDiscord<Elegantbeef> If there arent 4 bytes in the socket you do what you want
01:27:54FromDiscord<voidwalker> I was under the impression that it blocked until there were 4 bytes
01:28:10FromDiscord<Elegantbeef> Depends on your socket settings
01:28:30FromDiscord<voidwalker> code worked like that so far, now it doesn't for some reason, I get a 0 sized string
01:30:04FromDiscord<Elegantbeef> Do you have a buffered socket?
01:30:30FromDiscord<voidwalker> I've no idea ? default everything
01:31:00FromDiscord<voidwalker> just trying to get a hang of the bittorrent protocol before I switch to async
01:31:05FromDiscord<Elegantbeef> well the nyou should have it buffered
01:31:12FromDiscord<Elegantbeef> so then it will wait until it recieves 4 bytes
01:32:00FromDiscord<voidwalker> yeah default seems to be true for buffered
01:40:29NimEventerNew Nimble package! snekim - A simple implementation of the classic snake game, see https://codeberg.org/annaaurora/snekim
01:50:43FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4fyM
01:50:47FromDiscord<voidwalker> still, getting 0 length for some reason
01:50:52FromDiscord<huantian> In reply to @NimEventer "New Nimble package! snekim": cute pfp
02:03:58*derpydoo joined #nim
02:24:19FromDiscord<albassort> hey what is the current trendy c interop library
02:24:40FromDiscord<Rika> Futhark?
02:25:06FromDiscord<Elegantbeef> I still use c2nim cause i like concise bindings
02:26:08FromDiscord<albassort> i haven't found one i quite like
02:36:40FromDiscord<albassort> hmmm having problems with futhark
02:41:00FromDiscord<Rika> Like
02:44:15FromDiscord<albassort> holy shit futhark lang is something i was looking for!
02:44:20FromDiscord<albassort> Halide too...
02:44:20FromDiscord<albassort> hmmm
02:48:39FromDiscord<Rika> Not the language though lmao
02:52:50FromDiscord<albassort> sorry I got distracted while googling
02:55:29*arkurious quit (Quit: Leaving)
03:23:40*arkanoid quit (Ping timeout: 260 seconds)
03:30:15NimEventerNew thread by bcharest: Editor for nim files with #? stdtmpl | standard, see https://forum.nim-lang.org/t/9594
03:36:30FromDiscord<exelotl> c2nim is my preference too
03:49:00FromDiscord<albassort> can i define procedures using macros
03:49:48FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4fz0
03:50:04FromDiscord<Elegantbeef> Can you write code that does it? Macros can
03:50:34FromDiscord<albassort> so i can write a macro which defines global functions
03:50:37FromDiscord<albassort> noted
04:08:53*derpydoo quit (Quit: derpydoo)
04:21:36FromDiscord<Freyr> So I was redefining my `Maybe` in terms of type classes and it turns out Nim doesn't really like type classes where one of the parameters is generic and the other isn't
04:22:18FromDiscord<Freyr> sent a code paste, see https://paste.rs/Pvq
04:22:47FromDiscord<Elegantbeef> Nim typeclasses are generic constraints not unions
04:23:48FromDiscord<Freyr> It errors on the `Maybe(Nothing)` saying it's of type `Maybe[Any]` rather than `Maybe[Error Type]` (because it can't instantiate B)
04:23:54FromDiscord<Freyr> (edit) "B)" => "`B`)"
04:24:36FromDiscord<Freyr> (edit) "`Maybe[Any]`" => "`Maybe[any]`"
04:24:42FromDiscord<Freyr> Definitely looks from the docs like you can do unions
04:24:47FromDiscord<Freyr> https://nim-lang.org/docs/manual.html#generics-type-classes
04:24:53FromDiscord<Elegantbeef> They're compile time constraints
04:25:00FromDiscord<Elegantbeef> Not tagged unions
04:26:44FromDiscord<Freyr> Still though, `Nothing` is a valid instance of type `Maybe[B]`
04:27:04FromDiscord<Freyr> And it should be able to see that at compile time
04:27:51FromDiscord<Elegantbeef> `Maybe[B]` and `Maybe(Nothing)` are not the same type
04:27:53FromDiscord<Elegantbeef> So one that one work
04:28:02FromDiscord<Elegantbeef> Two `Maybe` needs a generic parameter
04:30:11FromDiscord<alice.> does nim have support for enums whos members have the same name yet
04:30:18FromDiscord<alice.> prefixing them is kinda ugly
04:30:28FromDiscord<Elegantbeef> It has overloadable enums and pure enums
04:31:18FromDiscord<alice.> difference being?
04:34:06FromDiscord<Freyr> In reply to @Elegantbeef "`Maybe[B]` and `Maybe(Nothing)` are": It says `Maybe(Nothing)` is of type `Maybe[any]` shouldn't `any` be the same as `B`
04:34:20FromDiscord<Elegantbeef> No cause you didnt do `Maybe[B](Nothing)`
04:35:50FromDiscord<Elegantbeef> But like i said you cannot use that typeclass
04:38:36FromDiscord<Freyr> That's a shame
04:39:56FromDiscord<Freyr> sent a code paste, see https://play.nim-lang.org/#ix=4fzb
04:40:14FromDiscord<Freyr> That one I at least know works
04:40:42FromDiscord<Elegantbeef> Yes Nim doesnt have unions it has object variants
04:40:54FromDiscord<Elegantbeef> You can use https://github.com/alaviss/union if you want a Union syntax
04:41:43FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4fzc
04:41:53FromDiscord<ringabout> (edit) "https://play.nim-lang.org/#ix=4fzc" => "https://play.nim-lang.org/#ix=4fzd"
04:42:20FromDiscord<Elegantbeef> `ptr char -> cstring -> string`?
04:42:39FromDiscord<ringabout> Yeah
04:43:02FromDiscord<ringabout> Nim can be more strict about it in v2 https://github.com/nim-lang/Nim/pull/20761
04:46:08FromDiscord<Elegantbeef> I'd personally like `string -> cstring` to be a warning, but alas 😄
04:47:51FromDiscord<Elegantbeef> I mean an error
04:48:56FromDiscord<ringabout> Yeah, I have the same dream
04:54:20FromDiscord<ringabout> 0.20.0 changelog said ``- The switch `-d:useWinAnsi` is not supported anymore.``. I guess it is the high time to remove it completely from stdlib.
04:55:07FromDiscord<ringabout> (edit) "to remove" => " that" | " thatit ... completely" added "being removed"
04:55:42FromDiscord<ringabout> (edit) removed "the" | removed "" | "being" => "was"
05:58:45*tiorock joined #nim
05:58:45*tiorock quit (Changing host)
05:58:45*tiorock joined #nim
05:58:45*rockcavera is now known as Guest8335
05:58:45*tiorock is now known as rockcavera
06:01:31*Guest8335 quit (Ping timeout: 252 seconds)
06:03:16*tiorock joined #nim
06:03:16*tiorock quit (Changing host)
06:03:16*tiorock joined #nim
06:03:16*rockcavera is now known as Guest4073
06:03:16*tiorock is now known as rockcavera
06:04:16*tiorock joined #nim
06:04:16*tiorock quit (Changing host)
06:04:16*tiorock joined #nim
06:04:16*rockcavera quit (Killed (copper.libera.chat (Nickname regained by services)))
06:04:16*tiorock is now known as rockcavera
06:07:01*Guest4073 quit (Ping timeout: 252 seconds)
06:22:59NimEventerNew thread by JeysonFlores: Race condition in async server using websockets.... maybe?, see https://forum.nim-lang.org/t/9595
06:27:14*rockcavera quit (Remote host closed the connection)
06:40:44NimEventerNew Nimble package! sas - SAS compiler, see https://github.com/xcodz-dot/sas
06:47:10*ltriant quit (Ping timeout: 252 seconds)
07:04:38*dnh joined #nim
07:05:19*kenran joined #nim
07:30:07*PMunch joined #nim
07:53:23*jjido joined #nim
08:28:16*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:28:40*dnh joined #nim
08:59:23NimEventerNew thread by miran: A cost model for Nim v2, see https://forum.nim-lang.org/t/9596
09:06:07*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
09:18:28*kenran` joined #nim
09:20:12*kenran quit (Ping timeout: 252 seconds)
09:39:31NimEventerNew thread by sls1005: How to know if `--mm:arc` is applicable?, see https://forum.nim-lang.org/t/9597
09:55:25*ltriant joined #nim
09:59:36NimEventerNew thread by Hobbyman: How can I get the fields and field-types of an sqlite-database?, see https://forum.nim-lang.org/t/9598
10:08:55*jjido joined #nim
10:10:05*jjido quit (Client Quit)
10:26:23*jjido joined #nim
10:32:20*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
10:43:44*jmd_ quit (Ping timeout: 260 seconds)
10:49:41FromDiscord<ChocolettePalette> Hmm, do you guys know whether I should close a UDP socket? It seems like I don't really have to cuz it's connectionless, but it might have grabbed some system resources though
10:54:13qwrsocket is file descriptor, if you don't close it you'll have just a file descriptor leak, and the limit can be quite low
10:56:08qwrthough i'm not 100% sure that nim won't discard it via destructors anyway
10:58:09*vicecea quit (Read error: Connection reset by peer)
11:03:57*jjido joined #nim
11:04:36*jjido quit (Client Quit)
11:29:07*vicecea joined #nim
11:35:09*jjido joined #nim
11:35:18*jjido quit (Client Quit)
12:07:13*arkurious joined #nim
12:22:23FromDiscord<ShalokShalom> Why is there `nk` preceding the different enums ↵↵https://nim-lang.org/docs/manual.html#types-object-variants
12:22:25FromDiscord<ShalokShalom> Is see this very often in Nim. Is this to avoid namespace collisions?
12:24:02FromDiscord<Rika> Kinda, because it’s “preferred” to prefix enums than to disambiguate them when needed with the module name, I think
12:30:05FromDiscord<ShalokShalom> I see.
12:31:11PMunchJust realised that `ctx.respond` in Prologue doesn't return from the route..
12:49:30*jjido joined #nim
12:55:50FromDiscord<ChocolettePalette> For some reason I can't send & receive stuff via UDP sockets \:(Like, can I use readLine with UDP sockets? I guess no, but recvFrom doesn't work too!
12:59:37FromDiscord<ChocolettePalette> Do I have to bind them first? I am so clueless
13:01:42FromDiscord<ChocolettePalette> Ah, seems like I do, nvm then!
13:17:16*om3ga quit (Quit: Bye)
13:18:37*oz joined #nim
13:19:08*oz is now known as Guest1473
13:22:35*dnh quit (Quit: Textual IRC Client: www.textualapp.com)
13:26:57FromDiscord<pietroppeter> here we go for another ride (we are on orange side)! note how baseline traffic was raised significantly by latest the "nim in 100 seconds video": https://media.discordapp.net/attachments/371759389889003532/1040618634738929664/image.png
13:28:01FromDiscord<pietroppeter> keep the waves coming! (for example by submitting guest blogpost!)
13:29:55FromDiscord<jmgomez> Im planning to reach out 80.lv once the UE plugin has some instructions. There is a lot of people interested in the unreal community
13:30:22FromDiscord<Phil> ... should I be able to publish snorlogue I could feasibly write a simple one about setting up a simple prologue web application with admin area, ORM and REST API endpoints↵🤔
13:31:39FromDiscord<ShalokShalom> In reply to @jmgomez "Im planning to reach": I imagine. They are still waiting for Verse
13:31:53FromDiscord<ShalokShalom> I would suggest to get it ready before that takes off
13:32:37FromDiscord<ShalokShalom> And do good comparisons, when that happens 😄
13:32:47FromDiscord<jmgomez> Yeah, Im doing my best but it's totally outside of my control. Hopefully once the instructions are there, more people can jump and help if they are interested
13:32:55FromDiscord<ShalokShalom> You are only going on against the main dev of Haskell
13:33:01FromDiscord<ShalokShalom> Nothing to worry about 😄
13:33:12FromDiscord<jmgomez> haha well, not me, Araq is
13:33:24FromDiscord<jmgomez> I trust him 😛
13:33:30FromDiscord<ShalokShalom> You plan Cyo support as well? 😅
13:34:11FromDiscord<jmgomez> I plan support for the best one.. so far is Nim
13:34:26FromDiscord<hugogranstrom> In reply to @pietroppeter "here we go for": Do we know what's driving traffic this time?
13:34:56FromDiscord<pietroppeter> new blogpost on cost model on front page of HN (you can see it from the dashboard)
13:35:26FromDiscord<ShalokShalom> In reply to @jmgomez "I plan support for": Very diplomatic answer 😄
13:35:28FromDiscord<pietroppeter> https://plausible.io/nim-lang.org?page=%2Fblog%2F2022%2F11%2F11%2Fa-cost-model-for-nim.html (added a filter and look at sources, compare with removed filter)
13:36:27PMunchHmm, reading the cost model article. Is --mm:orc with `GC_disableOrc` the same as arc?
13:36:33PMunchOr are there more subtle differences?
13:37:28FromDiscord<EliasG2> here, 'worldrenderer' does not seem to be able to import 'world', how should i do imports when putting my code in different directories? https://media.discordapp.net/attachments/371759389889003532/1040621283676782622/image.png
13:37:47FromDiscord<Rika> `import ../world`
13:37:54FromDiscord<Generic> does this work by now?
13:38:02FromDiscord<Rika> idk i think so
13:38:05FromDiscord<Generic> for a long time you had to use `".."/world`
13:38:07FromDiscord<Rika> if not add "" around ..
13:38:22FromDiscord<EliasG2> In reply to @Rika "`import ../world`": ah thanks
13:38:28FromDiscord<Generic> ah right now I remember
13:38:34FromDiscord<Generic> the issue is only with multiple imports
13:38:37FromDiscord<Generic> so ../world does work
13:38:44FromDiscord<Generic> but ../[world, entity] does not
13:38:55FromDiscord<Generic> you have to use ".."/[world, entity] then
13:39:24FromDiscord<hugogranstrom> In reply to @pietroppeter "new blogpost on cost": Ahh, good to see blog post being so effective 🙂
13:39:53FromDiscord<ShalokShalom> Yeah, kinda wondering. 🤔
13:40:11FromDiscord<ShalokShalom> I guess everything can be effective, when it fits on HN
13:44:55FromDiscord<pietroppeter> you can see smaller bumps when any blogpost is published, due to existing nim community checking out new content. when some of this content reaches HN front page, it tends to explode (the first spike is the blogpost on nimconf which also reached youtube). I do expect this particular blogpost to do well, since it is very technical and can start various discussions (e.g. on hashmaps)
13:45:27FromDiscord<pietroppeter> (edit) "youtube)." => "HN)."
13:51:07FromDiscord<ShalokShalom> Thats a good starter
13:51:13FromDiscord<ShalokShalom> We could do actual guidelines
13:51:30FromDiscord<ShalokShalom> "How does your blog post do good on HN" 😅
13:51:51FromDiscord<ShalokShalom> Step1: Make it very technical, so people can fight over it 😅
13:52:08FromDiscord<ShalokShalom> I guess it would help, if some of us would join the discussion
13:53:11*kenran` quit (Remote host closed the connection)
13:58:55PMunch"As such, exceptions are allocated on the heap. However, it is possible to preallocate them.", anyone know what this means?
13:59:35FromDiscord<ChocolettePalette> Smth on the Jawa language
14:01:20FromDiscord<ChocolettePalette> If you allocate (ask OS to provide you with) let's say 1Gb, you can further immefiately allocate (ask VM to provide you with space for) stuff instantly or smth like that
14:04:19PMunchNot sure how that's related to Exceptions being preallocated..
14:04:49PMunchWell I guess you would save an allocator call in the case where you need to throw an exception
14:08:03FromDiscord<albassort> I'm so lucky to live in a world with nim
14:14:10*jjido quit (Quit: Textual IRC Client: www.textualapp.com)
14:21:11FromDiscord<ChocolettePalette> You were born too late to invent nim and too early to see it the universal language doe
14:25:03*rockcavera joined #nim
14:42:08FromDiscord<dom96> In reply to @pietroppeter "here we go for": honestly a bit disappointing that HN gives higher spikes than a YT video from someone with millions of subscribers.
14:42:22NimEventerNew post on r/nim by CirseiMasta: Javascript compilation: any type system ?, see https://reddit.com/r/nim/comments/yscfkz/javascript_compilation_any_type_system/
14:44:17FromDiscord<pietroppeter> In reply to @dom96 "honestly a bit disappointing": the effects I think are compound: having had that video first, a lot more people are interested in nim and they also look at HN. But also, I never heard about that youtube channel even if it had million of subscriber, I think HN still has a much wider audience
14:49:16FromDiscord<mantielero (mantielero)> Hello, I am struggling with an error that occurs with some bindings I am working on and x11/xlib
14:50:03FromDiscord<albassort> In reply to @ChocolettePalette "You were born too": i wouldn't be able to invent nim
14:50:38FromDiscord<mantielero (mantielero)> The error takes place when I call the following function\: https://github.com/mantielero/occt.nim/blob/0ddd864feb77c891586962ed242d496ee06bc25d/examples/viewer04.nim#L107
14:50:49FromDiscord<mantielero (mantielero)> I get the error\:↵\`\`\`
14:52:30FromDiscord<pietroppeter> sent a long message, see http://ix.io/4fBi
14:53:21FromDiscord<mantielero (mantielero)> I define `event`here\: https://github.com/mantielero/occt.nim/blob/0ddd864feb77c891586962ed242d496ee06bc25d/examples/viewer04.nim#L101
14:53:23*derpydoo joined #nim
14:54:03FromDiscord<pietroppeter> btw @dom96 do you have access to nim's google analytics? can you give me access so that I migrate the history to plausible? see https://github.com/nim-lang/website/issues/342
14:56:00FromDiscord<mantielero (mantielero)> And `processMessage` is defined here\: https://github.com/mantielero/occt.nim/blob/0ddd864feb77c891586962ed242d496ee06bc25d/examples/viewer04.nim#L91-L92
15:07:43*PMunch quit (Quit: Leaving)
15:46:56FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fBF
15:47:00FromDiscord<alice.> im still somewhat new
15:49:34FromDiscord<Generic> I'd decide on either using only variants or inheritance
15:49:45FromDiscord<alice.> what would be the trade offs?
15:49:50FromDiscord<alice.> and what do u mean by variants?
15:49:59FromDiscord<Generic> case objects
15:50:12FromDiscord<alice.> how would u structure this?
15:50:18FromDiscord<alice.> if you could provide a sample
15:50:22*yarrie joined #nim
15:50:25yarriehi everybody :-)
15:51:02FromDiscord<alice.> hey
15:51:37FromDiscord<Generic> https://github.com/RSDuck/hocuspocube/blob/master/hocuspocube/dsp/asm/dspasm.nim#L170-L208
15:51:59FromDiscord<alice.> @Generic may i ask how children: seq[Node] works?
15:52:19FromDiscord<Generic> it's basically a clone of Nim's AST used e.g. in the macros
15:52:39FromDiscord<Generic> and the compiler in general
15:52:39FromDiscord<Generic> https://nim-lang.org/docs/macros.html
15:54:29FromDiscord<alice.> @Generic right but how would i create a instance of this to represent eg a `var ident = value`
15:55:08yarriehi alice :)
15:55:28FromDiscord<alice.> :cirnu:
15:55:58yarrievery irc friendly :innocent:
15:56:06FromDiscord<Generic> https://github.com/RSDuck/hocuspocube/blob/master/hocuspocube/dsp/asm/dspasm.nim#L353-L370
15:56:20FromDiscord<Generic> it's all very much inspired by Nim's macro system
15:58:04*AliceLikesFumos joined #nim
15:58:53AliceLikesFumoshi @yarrie
15:58:58FromDiscord<alice.> lol
15:59:00yarrieAliceLikesFumos: hiii
15:59:11AliceLikesFumosalice stole my name
15:59:22yarriefirst come lol
15:59:31AliceLikesFumosFromDiscord
15:59:35AliceLikesFumosnice bot
15:59:49FromDiscord<Generic> the reason using a case object for everything is better than inheritance is because if you want to branch on the type of node, you can can only check one at a time
16:00:05FromDiscord<Generic> with `if node of Literal:`
16:00:31FromDiscord<Generic> while with case objects you can process them in case statements
16:00:33FromDiscord<alice.> gotchu
16:00:42FromDiscord<alice.> In reply to @alice. "<@249581140363575297> right but how": this is my Q though
16:00:59FromDiscord<Generic> look at the link I've sent
16:01:16FromDiscord<Generic> newIdent
16:01:49FromDiscord<Generic> there are still some other things to decide
16:02:28FromDiscord<Generic> I use a uniform representation where all the sub nodes are always in the same seq
16:02:58FromDiscord<Generic> but what you did in your example, where you have specific fields for different node types work of course too
16:03:20FromDiscord<Generic> another thing to say about your code is that it probably doesn't work
16:03:29FromDiscord<Generic> because you have recursive non ref types
16:03:47FromDiscord<dom96> @alice. here is an AST from my very old language implementation: https://github.com/dom96/nael/blob/master/src/parser.nim#L26
16:04:21FromDiscord<dom96> (You can ignore the `T` and `P` type prefixes, but it shows how to do object variants for ASTs well)
16:04:53FromDiscord<dom96> In reply to @pietroppeter "btw <@132595483838251008> do you": you'll have to catch me when I'm not at work 🙂
16:06:54FromDiscord<pietroppeter> In reply to @dom96 "you'll have to catch": I'll try to ping outside office hours if I see you around, but do not wait for me in case you happen to remember about this on your own... 😉
16:08:25FromDiscord<dom96> can you send me an email from your gmail? I think I'll need it so I can add you
16:08:38FromDiscord<dom96> (My email is on https://picheta.me)
16:11:30FromDiscord<alice.> also does nim normally use 2 or 4 spaces?
16:11:59*arkanoid joined #nim
16:12:18FromDiscord<Generic> official style is 2
16:12:22FromDiscord<Generic> though I personally use 4
16:13:13arkanoidwhoa, I've just found a large memory leak in my 100% Nim + ORC project after last refactoring. Pretty scary. How would you find them?
16:13:18*yarrie quit (Ping timeout: 268 seconds)
16:13:29FromDiscord<pietroppeter> In reply to @dom96 "can you send me": yep, done! (I happened to have also your gmail mail so I used both)
16:14:27FromDiscord<auxym> In reply to @arkanoid "whoa, I've just found": valgrind? Btw if you have a leak with ORC and without using unsafe stuff (pointers, gc_ref, etc), then you should probably report that as an issue
16:15:20arkanoidauxym, I'm not blaming Nim as it could by my logic doing so, but I have to rule it out first. Let me valgrind this
16:15:46FromDiscord<auxym> nevertheless, ORC by itself should not leak memory
16:16:26arkanoidI fear I have some asyncCheck stuff never stopping and spawning without control
16:17:05arkanoidI wonder why they give it the name "asyncCheck". I understand what id doesn, but why "async check"
16:17:38FromDiscord<dom96> what do you think it should be called instead?
16:17:51arkanoid*damn, here it comes the author*
16:17:55arkanoid:)
16:17:58FromDiscord<dom96> haha
16:18:21arkanoidwell, startRoutine?
16:18:53arkanoidit adds a new root in the event loop, doesn't it?
16:19:24arkanoidwhat does it "check?"
16:19:59FromDiscord<dom96> have you ever taken a look at its implementation?
16:20:03FromDiscord<dom96> That should explain it's name
16:20:30FromDiscord<dom96> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncfutures.nim#L425
16:20:30*AliceLikesFumos is now known as megabytesofrem
16:21:53FromDiscord<dom96> (edit) "it's" => "its"
16:21:59arkanoidok, it may describe what it does internally, but from an async api point of view its the "trampoline" for a new async routing that you may use from a sync context
16:22:09arkanoid*routine
16:22:36FromDiscord<dom96> You can call an async proc without `asyncCheck` just fine though
16:22:41FromDiscord<dom96> it will still run in the background
16:22:52FromDiscord<dom96> and I actually wanted that to be possible long-term
16:23:03FromDiscord<dom96> maybe we'll still get there someday 🙂
16:24:53arkanoidyeah but an async proc returns a Future, and generally there is split-horizon view when dealing with a mix of sync and async code. My mind goes like "this is sync and with this asyncCheck boom, I'm now into async world"
16:28:49*yarrie joined #nim
16:41:43*rockcavera quit (Remote host closed the connection)
16:42:20megabytesofremis there a way to get vscode extension to run nimpretty on save?
16:45:15*rockcavera joined #nim
16:48:57FromDiscord<ezquerra> I have not used it but perhaps this would work? https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave
16:56:16arkanoidmegabytesofrem: check editor.formatOnSave
16:56:52arkanoidit's an editor prop, not part of nim extension, but I thing nim extension looks at it to call nimpretty, but double check please
16:57:46arkanoidmaybe I'm wrong, I'm not finding any reference https://github.com/saem/vscode-nim/search?q=formatOnSave
17:00:33FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fC6
17:00:36FromDiscord<alice.> In reply to @arkanoid "megabytesofrem: check editor.formatOnSave": will do, thanks
17:03:07FromDiscord<alice.> oh it needed to be seq
17:03:09FromDiscord<vindaar> because `[ASTNode]` is not a type. It's an array with a typedesc inside. You need to specify what it is exactly (e.g. `array[N, ASTNode]` where `N` is some constant or use a `seq[ASTNode]` instead)↵(@alice.)
17:03:58FromDiscord<alice.> gotcha
17:04:03FromDiscord<alice.> yah i meant to use seq
17:16:04*ehmry quit (Ping timeout: 248 seconds)
17:16:58*ehmry joined #nim
17:31:05arkanoiddamn, I've been trying cligen and it's a mess of a library. It's unsafe, it doesn't solve edge cases that it produces itself. No no
17:31:47FromDiscord<guttural666> any way to clear only the number of lines that I have written to the terminal to avoid weirdness like this? (sending the cursor beyond my initial line) or will I have to count my lines myself? https://media.discordapp.net/attachments/371759389889003532/1040680249693839370/image.png
17:32:08arkanoiddo you know an alterative cli parsing library that can do the cmdline + ENV + cfg file like most Go programs do?
17:33:00*ehmry quit (Ping timeout: 260 seconds)
17:37:36FromDiscord<guttural666> In reply to @arkanoid "do you know an": I'm a Nim pleb, sorry
17:37:52arkanoidtesting https://nimble.directory/pkg/cliche
17:38:08arkanoidI feel the author found same issues with cligen I'm complaining about
17:43:52*derpydoo quit (Ping timeout: 252 seconds)
17:49:41*pro joined #nim
17:50:32FromDiscord<guttural666> to answer my own question above: don't believe there is a real solution, writing it myself, I came up with this: https://media.discordapp.net/attachments/371759389889003532/1040684970219413515/image.png
17:54:25FromDiscord<JohnMcAfee> All guttural and no pig squeal, eh? Lack of range sounds like a skill issue to me...
17:54:50FromDiscord<guttural666> na, squeals are there as well, but they're guttural in nature haha
17:55:03FromDiscord<JohnMcAfee> LOL!
17:55:56FromDiscord<guttural666> more Dying Fetus "squeals", less cringe early 2000s deathcore squeals haha
18:00:41FromDiscord<vindaar> huh, that's the first time I've seen someone be so negative about cligen. to me it's one of the most useful libraries in all of nim land. I'm sure if you open an issue about whatever problem you have, c-blake will either explain the reasoning for why things are the way they are, or fix them if it's something that's actually unsafe / broken↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>)
18:06:50*yarrie quit (Quit: leaving)
18:16:23*ehmry joined #nim
18:18:46FromDiscord<guttural666> is there some kind of way to be able to use all the beefy procs at the top of the file (which are typically marked with to make them "public")? maybe without having to forward declare anything if that is even a thing?
18:18:54FromDiscord<giuseppe> Hey all, I'm trying to run my nim code inside vscode and I keep getting this error
18:18:57FromDiscord<giuseppe> sh: nim: command not found
18:19:09FromDiscord<giuseppe> I think it's because it runs as sudo
18:19:10FromDiscord<UnvaxxedPureBlood> In reply to @b1rdf00d "I really appreciate how": Cool example, Thanks for sharing.
18:19:28FromDiscord<giuseppe> In reply to @giuseppe "I think it's because": though idk how to fix it, any ideas?
18:19:49FromDiscord<guttural666> In reply to @giuseppe "sh: nim: command not": adding Nimble et al to your environment variables? first thing that springs to my mind
18:20:00FromDiscord<guttural666> what platform are you on?
18:20:05FromDiscord<giuseppe> popos
18:20:14FromDiscord<guttural666> pretty sure that is it
18:20:39FromDiscord<giuseppe> how do I do this?
18:20:50FromDiscord<Horizon [She/Her]> What would be an idiomatic way to do `myObj.addX().addY().addZ()`?
18:21:04FromDiscord<guttural666> In reply to @giuseppe "how do I do": what shell do you use?
18:21:08FromDiscord<Horizon [She/Her]> I can't initialise the value at once, since it's meant to be a JVM bytecode builder library
18:21:16FromDiscord<Horizon [She/Her]> And idk how else to do it
18:21:17arkanoidI'm trying to use "nimble develop" https://github.com/nim-lang/nimble#nimble-develop to test a little change to my project dependencies, but I'm failing to understand what's the intended usage. It seems to just clone the repo in local folder, and is not creating nor editing nimble.develop file
18:21:48FromDiscord<giuseppe> In reply to @guttural666 "what shell do you": bash
18:21:57FromDiscord<guttural666> In reply to @giuseppe "how do I do": https://nim-lang.org/install_unix.html↵check this page out and then configuring path environment variable
18:22:20FromDiscord<giuseppe> thx!
18:22:32FromDiscord<guttural666> depending on what shell you use it's something like SET /usr/bin/nimble/ $PATH or soemthing like that, you really have to google it haha
18:22:35FromDiscord<Generic> In reply to @Event Horizon "I can't initialise the": https://nim-lang.org/docs/with.html
18:22:39FromDiscord<guttural666> pretty sure it's that
18:22:50FromDiscord<Generic> I actually should be using that more often myself
18:22:52FromDiscord<guttural666> popos just doesn't find the nim command
18:23:19FromDiscord<Horizon [She/Her]> In reply to @Generic "https://nim-lang.org/docs/with.html": ooh
18:23:43FromDiscord<Horizon [She/Her]> That's actually really neat!
18:24:15arkanoidgiuseppe you can do: "$ type nim" from bash to find out the path of nim binary in your $PATH
18:24:38FromDiscord<guttural666> In reply to @giuseppe "thx!": echo $PATH should tell you if your nimble / nim dirs are already in there
18:24:43FromDiscord<giuseppe> it's kinda weird because I can use the nim command
18:24:57FromDiscord<giuseppe> but not if I'm using sudo
18:25:10FromDiscord<giuseppe> and I think vscode runs it through sudo
18:25:21FromDiscord<guttural666> I think there are different set commands to make a variable globally accessible??
18:25:47FromDiscord<guttural666> set -gh /usr/bin.... something like that?
18:26:06FromDiscord<guttural666> don't quite remember and I use fish as a console emulator
18:26:10FromDiscord<guttural666> bit different
18:26:20FromDiscord<giuseppe> I updated my .bashrc file
18:26:25arkanoidgiuseppe, you really should NOT run vscode as sudo
18:26:43FromDiscord<giuseppe> Idk if its, just guessing tbh
18:26:52arkanoidapart from the security matters, it is something outside the general usage patterns
18:27:24FromDiscord<giuseppe> Thx for all the tips, I'll see what I can do
18:27:40arkanoidgiuseppe, it surely is the problem. Just check "env | grep PATH" vs "sudo env | grep PATH"
18:29:16FromDiscord<guttural666> arkanoid knows more than I do, listen to him haha
18:30:15FromDiscord<guttural666> but the env var was what I was stepping over after distro hopping like a maniac and trying to install nim and nimlsp etc. on each machine
18:30:57arkanoidgiuseppe you should understand the difference between running stuff as user vs running stuff as root (sudo) user. They do NOT share the running context (for good reason!) and you should not run stuff like development code as root. But this is not really a nim topic, but a general unix topic
18:32:27FromDiscord<giuseppe> 👍 👍
18:33:09arkanoidcould you please tell me what you get with "nimble develop -c <anypackagename>" like "nimble develop -c cliche" ? I'm getting "Error: Unknown option: -c" but it should really exist as it is documented here https://github.com/nim-lang/nimble#nimble-develop
18:34:23FromDiscord<guttural666> what would be a standard package that is included, i can test that?
18:34:25arkanoidoh wait, that's documentation for master branch, which is wildly different from current develop branch
18:34:33FromDiscord<guttural666> 😄
18:34:42arkanoidhere, there's no -c option https://github.com/nim-lang/nimble/tree/v0.13.1#nimble-develop
18:34:56arkanoidproblem solved then, I was just trying to use a future option
18:40:59FromDiscord<Horizon [She/Her]> Does nim support something like `0x32`?
18:41:02FromDiscord<Horizon [She/Her]> For hex
18:42:34FromDiscord<Horizon [She/Her]> Oh that literally just works
18:42:36FromDiscord<Horizon [She/Her]> Neat
18:43:22FromDiscord<guttural666> god, I love IT, problems literally sometimes evaporate 😄
18:44:56*jmdaemon joined #nim
18:44:58arkanoidwhat's the equivalent AST node name for bool literals? Like nnkIntLit but for bool. nnkBoolLit doesn't exist.
18:48:39*rockcavera quit (Remote host closed the connection)
18:50:20FromDiscord<Generic> bool literals don't exist
18:50:37FromDiscord<Generic> they're an enum defined in system.nim with some magic attached to it
18:51:18FromDiscord<Generic> I think `bindSym"true"`/`bindSym"false"` should work
18:59:09*rockcavera joined #nim
19:00:54FromDiscord<huantian> In reply to @Generic "bool literals don't exist": They can’t hurt you
19:11:51*LuxuryMode quit (Quit: Connection closed for inactivity)
19:12:45FromDiscord<guttural666> what kind of template do I need to accompany every call to echo with a "inc x"?
19:18:35arkanoidGeneric, what?
19:19:31arkanoidGeneric, what do you think I shold use here instead of the missing nnkBoolLit? https://github.com/juancarlospaco/cliche/blob/e3506e46e685d1f60ce5cc8ac4a039eb6c15a79f/src/cliche.nim#L19
19:20:23FromDiscord<Generic> good question
19:20:45FromDiscord<Generic> is it an untyped or typed macro?
19:23:28arkanoidGeneric: first argument `params` is passed in from "variables: untyped" macro param: func explainHelp(params: NimNode; helpMessage: string; prefix, sepa: char): string =
19:23:36arkanoidso I'd say it's untyped
19:24:03FromDiscord<Generic> ok, then true and false will still be idents
19:25:04arkanoidand? sorry but I'm not into macro a lot, I need an hint
19:26:47FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=4fCF
19:26:57FromDiscord<Generic> when you compile that, it'll echo at compile time
19:27:04FromDiscord<Generic> Ident "true"
19:27:36FromDiscord<Generic> true and false are (mostly) like any other enum
19:28:05FromDiscord<Generic> if the program is changed to
19:28:15FromDiscord<Generic> sent a code paste, see https://paste.rs/JOr
19:28:20FromDiscord<Generic> it'll print `Sym "true"`
19:28:51FromDiscord<Generic> because with a typed macro, the identifier is already resolved to https://nim-lang.org/docs/system.html#bool
19:29:18arkanoidok, so in my context I have to case .. of newIdentNode("true"), newIdentNode("false"): "bool" ?
19:29:29FromDiscord<Generic> amlost
19:29:33FromDiscord<Generic> almost
19:31:07FromDiscord<Generic> you cannot do the check with just a normal case branch
19:31:07arkanoidit doesn't compile. It says "Error: expression has no type: true"
19:31:18FromDiscord<Generic> ah I now remember
19:31:29FromDiscord<Generic> Nim cases do support elif branches, a seldom used feature
19:32:48FromDiscord<Generic> you can just add `elif element[1].kind == nnkIdent and (element[1].eqIdent("true") or element[1].eqIdent("false")): "bool"`
19:33:59arkanoidit works!
19:34:18arkanoid:D thanks. Do you want to PR in my place? The honor is your
19:34:52FromDiscord<Generic> nah, it's fine
19:35:20FromDiscord<Generic> though keep in mind that this just literally checks for the ident to be equal regardless of context
19:35:55FromDiscord<Generic> so if you have a situation where true and false might be overwritten with a variable in nearer scope (which admittedly would be a pretty crazy thing to do)
19:36:26FromDiscord<Generic> it would still trip, eventhough the proper boolean enum isn't what was meant
19:38:11FromDiscord<Generic> which I guess it's also just a short coming of untyped macros in general
19:38:34FromDiscord<Generic> though I guess this could be maybe solved with dynamic bind sym
19:42:36FromDiscord<SaAnd> It seems I can't use nimble anymore, it just says "could not import\: SSL\_get\_peer\_certificate"↵based off what I've seen, it has something to do with openssl, but how do I fix it?
19:45:16FromDiscord<Generic> I think it's due to OpenSSL 1.2 (? I don't quite remember) being phased out
19:45:20FromDiscord<Generic> but Nim still relies on it
19:45:39FromDiscord<Generic> that's atleast the reason I had this error not too long ago
19:48:15FromDiscord<guttural666> how do I wrap the lines a tthe bottom into some kind of Nim meta programming thing while preserving the variadic nature of echo? https://media.discordapp.net/attachments/371759389889003532/1040714594085257326/image.png
19:50:58FromDiscord<Generic> what do you mean?
19:50:59FromDiscord<guttural666> inc echo_lines at the bottom there, sorry
19:51:42FromDiscord<Andreas> when i test a simple binary with `valgrind` it always reports leaks ? i tried `-d:useMalloc -gc:refc` ↵No matter what combination i tried valgrind (on osx) always reports :↵`==15940== LEAK SUMMARY:↵==15940== definitely lost: 8,328 bytes in 63 blocks`
19:52:17FromDiscord<Andreas> (edit) "when i test" => "sent" | "simple binary with `valgrind` it always reports leaks ? i tried `-d:useMalloc -gc:refc` ↵No matter what combination i tried valgrind (on osx) always reports :↵`==15940== LEAK SUMMARY:↵==15940== definitely lost: 8,328 bytes in 63 blocks`" => "long message, see http://ix.io/4fCV"
19:53:38FromDiscord<guttural666> In reply to @Generic "what do you mean?": pseudo code here https://media.discordapp.net/attachments/371759389889003532/1040715946861535393/image.png
19:54:33FromDiscord<guttural666> maybe more like echo vararg1, vararg2 ...
19:58:35arkanoidGeneric, let's see what the author thinks https://github.com/juancarlospaco/cliche/issues/8#issuecomment-1312090633
20:00:39FromDiscord<Generic> In reply to @guttural666 "pseudo code here": so you want a macro which passes on the arguments to echo and then increments echo_lines?
20:00:47FromDiscord<guttural666> indeed!
20:00:57FromDiscord<Generic> you don't need a macro for that
20:01:04FromDiscord<guttural666> okay
20:01:53FromDiscord<Generic> this should work
20:01:55FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=4fD1
20:02:01FromDiscord<guttural666> just something that takes some echo lines, let's the user enter something and then clears the lines to go on to something else yknow
20:02:12FromDiscord<guttural666> oh okay, that's how that works
20:02:34FromDiscord<Generic> ok no, it doesn't
20:02:37FromDiscord<guttural666> I'm familiar with the concepts, but sometimes don't know what to look for so thanks haha
20:04:52FromDiscord<Generic> the problem is that the array is passed on as array
20:05:01FromDiscord<Generic> instead of passed in as the varargs
20:06:01FromDiscord<Generic> yeah this works
20:06:05FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=4fDb
20:06:26FromDiscord<guttural666> yes, untyped sounds right
20:06:53FromDiscord<guttural666> just want the same interface as echo, just with a counter on how many times I call it so I can auto clear the approp. amount of lines
20:07:15FromDiscord<Generic> I honestly don't really like the interface of echo
20:07:33FromDiscord<Generic> I almost exclusively use strformat
20:08:27FromDiscord<guttural666> yeah, gotta look into that
20:08:58FromDiscord<guttural666> CPP has formatting as well, never looked into it, always wrote my own hacky formatting tool for my needs
20:11:14FromDiscord<guttural666> sweet man, this works just as I wanted
20:11:16FromDiscord<guttural666> thanks
20:11:34arkanoiddom96: just quick question. How I am supposed to catch the exception raised from asyncCheck? Or generally, an exception raised from event loop itself (callback) and not yielded
20:12:15*Jjp137 quit (Ping timeout: 260 seconds)
20:12:33*Jjp137 joined #nim
20:30:12*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
20:32:47*jmdaemon joined #nim
20:33:29*jmdaemon quit (Remote host closed the connection)
20:34:41*jmdaemon joined #nim
20:35:32FromDiscord<gyoren> i need some help with making a wrapper for a c library
20:35:50FromDiscord<gyoren> are there any resources that can guide me through that or just help with that
20:43:18FromDiscord<dom96> arkanoid: by not using asyncCheck at all 🙂
20:44:38FromDiscord<b1rdf00d> In reply to @gyoren "i need some help": How about this? https://livebook.manning.com/book/nim-in-action/chapter-8/81
20:45:56arkanoiddom96, ok I've already done that. I was just curious if there was a way to hook an error catcher inside the event loop/dispatcher
20:46:02arkanoidthanks for the answer
20:46:09FromDiscord<dom96> arkanoid: you should set a callback on the future and do whatever you want with the error
20:46:44FromDiscord<dom96> some errors can be thrown from `poll` (and also `waitFor`/`runForever` since they call `poll`)
20:46:54FromDiscord<dom96> this is definitely far from ideal
20:48:13*derpydoo joined #nim
20:53:24FromDiscord<iffy (Matt Haggard)> Is there a `-d:` flag that changes Nim from v1 to v2 mode?
20:53:36FromDiscord<iffy (Matt Haggard)> (something that is optional now but will be default in v2)
20:57:11FromDiscord<albassort> 亙亙亙
20:57:33FromDiscord<guttural666> got, universal function calls just provide me with so much options, I don't know what's the best / most pleasing way
20:57:48FromDiscord<guttural666> I have to think it's func boy1 boy2
20:58:08FromDiscord<guttural666> Nim is almost like writing prose 🙂
21:05:15*pro quit (Quit: pro)
21:08:04FromDiscord<iffy (Matt Haggard)> Maybe `when defined(nimv2)`?
21:08:35FromDiscord<huantian> https://nim-lang.org/docs/system.html#NimMajor
21:10:39FromDiscord<Elegantbeef> No nim doesnt have a flag to enable the flags that'll be defaulted in v2
21:11:12FromDiscord<guttural666> finally Elegantbeef saveds the day of the uneducated masses 😍
21:12:13FromDiscord<huantian> oh that's what they mean
21:14:15Amun-Rawhen 2.0 is going to see the light of day?
21:15:21FromDiscord<iffy (Matt Haggard)> Elegantbeef\: I think I was actually asking the opposite. Is there a defined I can use to fork code for v1/v2? It's for this\: [nim-lang/Nim#20817](https://github.com/nim-lang/Nim/pull/20817)
21:15:35FromDiscord<Elegantbeef> But i'm uneducated
21:15:39FromDiscord<albassort> In reply to @Amun-Ra "when 2.0 is going": soon
21:15:44FromDiscord<Elegantbeef> Araq wants it out before 2023
21:16:08FromDiscord<albassort> how do i pronounce Araw
21:16:09FromDiscord<albassort> (edit) "Araw" => "Araq"
21:16:09Amun-Raoh, nice
21:16:30FromDiscord<guttural666> knowledgable to help plebs and very helpful, so I'm very greatful ❤️
21:16:48FromDiscord<guttural666> (edit) "knowledgable ... to" added "enough"
21:17:27FromDiscord<Elegantbeef> A-rack is how i pronounce it
21:17:28FromDiscord<Elegantbeef> Ask blizzard↵(@albassort)
21:17:59FromDiscord<albassort> Lemme call up the overwatch dev team
21:23:12FromDiscord<Horizon [She/Her]> Uh this code https://paste.ecorous.org/opinunodaz.lua produces https://paste.ecorous.org/tovujatife.rust from https://paste.ecorous.org/upuqacabij.json
21:23:19FromDiscord<Horizon [She/Her]> And it's absolutely baffling me
21:23:25FromDiscord<Horizon [She/Her]> Because that makes no sense?
21:24:04FromDiscord<Horizon [She/Her]> it literally just cuts off a lot of the text, and not appending it to the output
21:25:03FromDiscord<Horizon [She/Her]> Moving the check for the line length below the token appender makes it generate the full output correctly but that is baffling
21:28:48FromDiscord<Elegantbeef> Why you dont just parse the json and use macros is beyond me
21:34:19FromDiscord<Horizon [She/Her]> As in compile the code in the source?
21:34:28FromDiscord<Horizon [She/Her]> I should probably do that-
21:34:51FromDiscord<Elegantbeef> Nim has macros so whenever people do string concatenation to generate code it's fucking odd
21:39:28FromDiscord<Horizon [She/Her]> Yeah fair enough, i'll do that instead
21:39:39FromDiscord<Horizon [She/Her]> I keep forgetting that macros are powerful
21:44:33FromDiscord<Horizon [She/Her]> How do i exactly use macros to generate Nim code? :p
21:44:47FromDiscord<Horizon [She/Her]> Should i just define a macro and call it? or is there something cleaner?
21:44:54FromDiscord<Elegantbeef> https://nim-lang.org/docs/macros.html
21:45:00FromDiscord<Horizon [She/Her]> (and then obviously return the generated ast)
21:45:11FromDiscord<Elegantbeef> https://dev.to/beef331/demystification-of-macros-in-nim-13n8
21:45:21FromDiscord<Horizon [She/Her]> Ah thanks!
21:59:40FromDiscord<guttural666> kinda weird does Nm care about the order of declaration of procs in a file? I had the compiler complain about that earlier, which is a bummer since the procs should be at the top
22:00:07FromDiscord<guttural666> now, I have a template and proc at the top and it's fine?
22:00:40FromDiscord<guttural666> nah, doesnt't work
22:01:37FromDiscord<guttural666> having to forward declare stuff is stupid and non befitting nim lel
22:02:10FromDiscord<guttural666> parse the whole file and figure it out / reorder it compiler boi
22:03:27FromDiscord<Elegantbeef> Yes order of delcaration matters
22:03:37FromDiscord<Elegantbeef> Eventually it will not but there is no ETA on that
22:04:30FromDiscord<guttural666> I've seen some discussions on github about that
22:04:49FromDiscord<guttural666> experimental {.bois,}
22:05:02FromDiscord<Elegantbeef> Eh dont use code reorder just forward declare
22:05:10FromDiscord<guttural666> yeah
22:05:40FromDiscord<guttural666> kinda sad to see all the procs that got a star down at the bottom
22:05:51FromDiscord<guttural666> 😦
22:06:01FromDiscord<Elegantbeef> What?
22:06:18FromDiscord<guttural666> procs that are exposed with a
22:06:41FromDiscord<guttural666> they have the most functionality, so they rely on a lot of other stuff in that module
22:07:03FromDiscord<guttural666> means, they have to be at the bottom of the file
22:07:27FromDiscord<guttural666> very sad and inappropriate
22:09:29FromDiscord<Elegantbeef> They do not, you can forward declare anything they depend on
22:09:56FromDiscord<guttural666> that's my point, I don't want to do that
22:09:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fEv
22:10:13FromDiscord<Elegantbeef> Well then be sad
22:10:27FromDiscord<guttural666> compiler smart, compiler know
22:10:30FromDiscord<Elegantbeef> You can use code reordering but i generally dont think it's great
22:10:32FromDiscord<Elegantbeef> Compiler doesnt know
22:10:41FromDiscord<Elegantbeef> Cause compiler sems code top to bottom
22:10:53FromDiscord<Elegantbeef> Which means it doesnt know you have a `doThing` if you remove the forward declaration
22:11:00FromDiscord<Elegantbeef> It's a single pass compiler in that regard
22:11:37FromDiscord<guttural666> yeah, you know a lot more about this than I do, as a pleb that is my feeling, if I know, the compiler should be able to know
22:12:35FromDiscord<Elegantbeef> The single pass nature is the same reason you cannot have cyclical imports
22:13:10FromDiscord<guttural666> yeah, that's another annoyance, in my mind that should be possible / reconcilable
22:13:29FromDiscord<guttural666> so fucking annoying, the compiler should be able to figure that out
22:13:36FromDiscord<Elegantbeef> Meh
22:13:44FromDiscord<Elegantbeef> It's a bit annoying but it makes code more readable imo, ymmv
22:13:45FromDiscord<guttural666> i think some langs do that
22:15:31FromDiscord<guttural666> looking up ymmv
22:16:22FromDiscord<Elegantbeef> Your mileage may vary
22:16:30FromDiscord<guttural666> but dont you always have to scroll to the bottom of a file if you want to see the public interface?
22:16:53FromDiscord<guttural666> figured as much, I can google et al elegant 😄
22:17:27FromDiscord<Elegantbeef> Not really in my experience, many things i write have only a few hidden things
22:17:48FromDiscord<Elegantbeef> In fact my game framework is mostly exported procedures
22:18:25FromDiscord<guttural666> link pls
22:18:55arkanoidwhat's wrong with this async code? why it doesn't compile? It returns compile error on future.read https://play.nim-lang.org/#ix=4fEy
22:19:07FromDiscord<Elegantbeef> https://github.com/beef331/truss3d
22:20:48FromDiscord<guttural666> thanks man
22:21:05FromDiscord<guttural666> didn't even know there was a += since there is no ++
22:21:24NimEventerNew thread by mantielero: Error: cannot convert 'tyObject_XEvent__EZvRvOUywFnBp4PzilZBoA' to 'XEvent&', see https://forum.nim-lang.org/t/9599
22:21:37*ehmry quit (Ping timeout: 252 seconds)
22:21:41FromDiscord<Elegantbeef> arkanoid seems like it's an issue with the asyncmacro
22:21:48FromDiscord<Elegantbeef> It's not getting told it's a void future so is erroring
22:22:45FromDiscord<guttural666> do you disable GC for your game stuff Elegant?
22:23:10arkanoidElegantbeef, but it gives same error even with "proc foo(): Future[void] {.async.} = discard"
22:23:27*ehmry joined #nim
22:23:55FromDiscord<Arathanis> i am so excited for Concepts to be fully realized, still can't do Functors cause `type S = auto` and `each S` both don't work so I have no idea how to inject an otherwise unspecified generic type into a concept.
22:24:53FromDiscord<Elegantbeef> No i'm not an idiot↵(@guttural666)
22:25:35FromDiscord<guttural666> is it that good already, can't imagine
22:25:36FromDiscord<Arathanis> Do you use determinist ref counting for your game to keep the overhead low?
22:25:38arkanoidDo you mean it is a Nim bug worth opening an issue on github? It seems so trivial
22:25:57FromDiscord<Elegantbeef> I dont even heap allocate much for my game
22:26:00FromDiscord<Arathanis> Can you share your game? I'd like to see it or is it WIP?
22:26:15FromDiscord<Elegantbeef> Like the hell are people doing in their games that the GC is an issue
22:26:23FromDiscord<Elegantbeef> https://streamable.com/csyb0s
22:26:58FromDiscord<Elegantbeef> The only time GC is really an issue in games is when you're using Java and want to make a 'infinitely' large block game
22:27:26FromDiscord<Arathanis> In reply to @Elegantbeef "Like the hell are": My, admittedly limited, understanding is some people think non-deterministic GC is a big no-no for games cause it can randomly cause performance drops. I've heard ref counting where its cleaned up as soon as the ref count is 0 is considered fine.
22:27:46FromDiscord<Elegantbeef> Meh you've already fucked up in that case
22:27:59FromDiscord<Elegantbeef> If you're having clean up during gameplay you need to quit what you're doing
22:28:24FromDiscord<Arathanis> surely some things need to be deconstructed during gameplay, right?
22:28:50FromDiscord<Elegantbeef> Even in Unity with C# it's good practice to have near 0 GC
22:29:31FromDiscord<Arathanis> I guess if you use an Arena even objects you no longer need aren't wasted, they are waiting to be reused not just orphaned for when you decide its time to clean the memory up
22:29:58FromDiscord<Arathanis> In reply to @Elegantbeef "https://streamable.com/csyb0s": this is neat, whats the concept?
22:30:26FromDiscord<Arathanis> im trying to decide if its tower defense-esque or like a novel kind of chess or something
22:30:40FromDiscord<Arathanis> oh wiat im dumb i see it now
22:31:50FromDiscord<Elegantbeef> The most heap allocations i do in my project is loading models/textures and the GUI
22:31:55FromDiscord<Elegantbeef> Since my GUI is fully retained and OOP based
22:33:32FromDiscord<dom96> arkanoid: what type is `future`?
22:33:35arkanoidI think I can't get a smaller example than this: https://play.nim-lang.org/#ix=4fED
22:34:09FromDiscord<dom96> And no, this is not a problem with the async macro
22:34:57arkanoiddom96: I'm trying to wrap withTimeout proc with a custom version that raises exception, but I'm failing to understand why it's complaning about returning a future.read for a Future[void]
22:35:19arkanoidI mean, do I have to check about not-voidness before returning?
22:35:40FromDiscord<Elegantbeef> You say it's not a problem with the async macro but given that it fails the `isVoid` branch of `completeImpl` says otherwise imo
22:36:13FromDiscord<Elegantbeef> Ah sorry it's inside asyncfuture
22:37:23FromDiscord<dom96> You can't `read` a Future[void]
22:37:39FromDiscord<dom96> But yes, the error message you get sucks
22:37:43FromDiscord<Elegantbeef> Uhhh
22:38:00arkanoidsure, but I was expecting it to resolve to a simple "return"
22:38:14FromDiscord<Elegantbeef> `read` has a branch specifically for `T isnot void`
22:38:26arkanoidnot blaming anyone here, except me
22:38:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fEE
22:38:31FromDiscord<Elegantbeef> Also `T: not void` isnt specified
22:38:33FromDiscord<dom96> okay, let me be more specific
22:38:42FromDiscord<dom96> You cannot return a void
22:38:50FromDiscord<dom96> same way you can't echo a void
22:39:20arkanoidok, so when T is not void: return future.read
22:39:27FromDiscord<dom96> yep
22:41:33arkanoid{.async.} procs without explicit return type are implicit Future[void], correct?
22:41:40FromDiscord<dom96> yep
22:41:48arkanoidthanks twice
22:42:05FromDiscord<dom96> You're welcome 🙂
22:43:20*ehmry quit (Ping timeout: 260 seconds)
22:44:59arkanoidI've created my custom variant of asyncCheck called asyncCatch that never raises exception (it is a server program that never quits), problem is that I'm getting less detailed stacktraces than asyncCheck, and I think its due to asyncfutures.injectStacktrace, but it's not exported
22:45:50arkanoidwell, I'll wrap asyncCheck instead of making a variant of it, I guess
22:47:07FromDiscord<dom96> I often create an `asyncLog` which logs the exceptions in my server programs
22:47:10*ehmry joined #nim
22:49:59arkanoiddom96: this takes me to the initial question. asyncCheck exception cannot be stopped, right? They crash the program
22:52:37FromDiscord<dom96> there might be some hacky way, but in general they cannot be stopped
22:58:41arkanoidif asyncCheck is hacking the way to create better stacktraces using private injectStacktrace, I think that an alternative to asyncCheck that can be used as "main async trampoline" that let user controls what is happening in case of error is missing in async api
23:00:02FromDiscord<dom96> yep, plenty of things missing
23:03:44arkanoidalso my async network code is filled with withTimout code. Basically one for every await. Well, not sure if there's anything nicer here, except considering timeout embedded in asyncnet procs
23:04:41FromDiscord<dom96> also any operations that timeout won't be cancelled (!)
23:04:56arkanoid?
23:07:11arkanoiddo you mean that whenever I get Future[bool] > false from withTimout, the underlying future is left in ram?
23:08:01arkanoid(asking this as I'm fighting a mysterious memory leak in my 100% nim async-based project)
23:08:55FromDiscord<dom96> withTimeout(sock.read(1024), 100) # if this times out then the `sock.read` will still continue trying to read data from the socket, and at some point in the future it will read that data
23:09:56arkanoidoh!
23:10:12*ehmry quit (Ping timeout: 248 seconds)
23:10:44arkanoidI need to force close the futures, then
23:10:52FromDiscord<dom96> what you should do in that case is close the `sock` (or whatever other FD you are using)
23:10:57arkanoid(and also I guess I've just found where my memory leak is)
23:11:00FromDiscord<dom96> this will cancel any pending operations on it
23:11:29FromDiscord<dom96> there is no way to cancel a specific future (the chronos fork of Nim's async supports this though in case you need it)
23:11:58FromDiscord<dom96> but honestly, if your operation timed out you usually want to close the associated fd anyway
23:13:04arkanoiddom96: well, now that I know this I have to refactor my code to actually move around AsyncSocket references, instead of abstracting them away
23:13:12arkanoid(or just move to chronos=
23:15:03*ehmry joined #nim
23:27:25arkanoidthanks again for the answers
23:31:27*derpydoo quit (Quit: derpydoo)
23:33:30*cornfeedhobo quit (*.net *.split)
23:33:30*ixmpp quit (*.net *.split)
23:42:18*cornfeedhobo joined #nim