<< 09-12-2022 >>

00:11:32FromDiscord<Horizon [She/Her]> https://github.com/nim-lang/Nim/pull/21053 hopefully this PR will be backported to 1.6 :P
00:11:50FromDiscord<Elegantbeef> You can ask for it to be
00:12:31FromDiscord<voidwalker> hm so if I have some future vars assigned a proc that return a future, it is sufficient i do an await sleepAsync after that for them to get executed ?
00:13:45FromDiscord<Gumbercules> In reply to @Event Horizon "https://github.com/nim-lang/Nim/pull/21053 hopefull": you can just patch until then
00:13:53FromDiscord<Gumbercules> or fix it locally if it's in the compiler
00:14:04FromDiscord<Horizon [She/Her]> Hm yeah I'll likely do that
00:14:24FromDiscord<Horizon [She/Her]> In reply to @Elegantbeef "You can ask for": Probably will if the tests pass and it works as expected, when I wake up tomorrow
00:16:44FromDiscord<voidwalker> Elegantbeef, I think I know why my futures mapIt thingie didn't work. Some of the Futures in the seq were assigned a proc that raised an exception (timeout), and even though the code was enclosed in a try/except block, the mapIt failed to complete because of that
00:18:46FromDiscord<voidwalker> It seems doing the .read() on the future raised the exception
00:28:16FromDiscord<voidwalker> So I guess I need a try in a for, not a for in a try
00:28:25FromDiscord<Yepoleb> In reply to @voidwalker "hm so if I": usually you await the futures themselves
00:29:03FromDiscord<voidwalker> I know that usually, I was just kind of surprised at this behaviour. Wish I'd understand all the inner workings
00:30:05FromDiscord<voidwalker> So I cannot do this: `let whatever = await all(futs)` - it will except if one the futs[n] returned an exception value
00:30:56FromDiscord<voidwalker> yeah perhaps long term exceptions are not the best way to handle "expected" network behaviour like timeouts and domain resolve fails
00:31:05FromDiscord<voidwalker> (edit) "term" => "term,"
00:32:15FromDiscord<Yepoleb> the await keyword basically just runs random tasks in the async loop until the one given is completed
00:33:24FromDiscord<voidwalker> Ohh that makes more sense if you put it like that : ) You should have written the async docs haha
00:34:12FromDiscord<voidwalker> so the simple assignment, futureVar = procThatReturnsFuture() puts the task on the async loop
00:34:19FromDiscord<voidwalker> (edit) "futureVar" => "`futureVar" | "procThatReturnsFuture()" => "procThatReturnsFuture()`"
00:39:38FromDiscord<Yepoleb> not sure about that 🙁
00:49:26FromDiscord<Yepoleb> In reply to @voidwalker "so the simple assignment,": going by my intuition assignment is not enough to schedule a task
00:51:06arkanoidI find myself often fighting the hinter saying that I have unused imports, but it doesn't compile if I remove them
00:51:20arkanoidI mean remove the imports, not remove the hints
00:52:30FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6K
00:52:51FromDiscord<Elegantbeef> Yea `sleepAsync` gives up the cpu
00:54:26FromDiscord<Yepoleb> sleepAsync is a bad hack if you don't really need to sleep
00:54:34FromDiscord<Elegantbeef> indeed
00:54:48FromDiscord<voidwalker> well it's not the sleepAsync that does it, but the await itself ?
00:55:16FromDiscord<Elegantbeef> the `sleepAsync` says "here's the cpu for at least 10s" so all other queue async processes can be worked on
00:55:32FromDiscord<Yepoleb> yes, any await pauses the current procedure to let the async scheduler do its job
00:56:14FromDiscord<Elegantbeef> the 'correct' thing would be to use `all` or to await the specific future
00:56:24FromDiscord<voidwalker> sleepAsync just happens to give enough time for the procs to finish, so that I can read its future value without any other checks
00:56:55FromDiscord<Yepoleb> but you might be wasting time
00:56:58FromDiscord<voidwalker> @ElegantBeef if I use all, and one of the procs excepts, the whole thing fails
00:57:04FromDiscord<Yepoleb> it's better to wait for the task you actually care about
00:57:22FromDiscord<voidwalker> I know, I am just debugging/trying to figure out what's going on here.. I know sleepAsync is not the "correct" way to implement the idea
00:57:26FromDiscord<Yepoleb> i think the easiest solution is to just await one future after the other in a for loop
00:57:33FromDiscord<Yepoleb> they will execute in parallel anyway
00:57:46FromDiscord<Elegantbeef> 'parallel'
00:58:32FromDiscord<voidwalker> yes that's what I first did, but I did it like `for each in allOfThem: result &= await each()`
00:58:47FromDiscord<voidwalker> and this actually made the program wait for each of them to complete before starting the other
00:58:48FromDiscord<Yepoleb> did that not work?
00:58:50FromDiscord<voidwalker> no
00:59:16FromDiscord<voidwalker> so that's why I need the seq[Future[]], add Future proc tasks to it, and then run the await
00:59:25FromDiscord<voidwalker> or maybe it can be done in some other way and I don't know
01:00:21FromDiscord<Yepoleb> oh, i get it
01:00:26FromDiscord<voidwalker> I couldn't find any sample code that does "run n same type of tasks concurrently and then combine their results"
01:01:28FromDiscord<Yepoleb> In reply to @voidwalker "yes that's what I": was `allOfThem` a seq of futures?
01:01:38FromDiscord<Yepoleb> or what else was it
01:02:25FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6M
01:02:34FromDiscord<voidwalker> well, should have been &=, whatever
01:02:38FromDiscord<Yepoleb> okay
01:02:43FromDiscord<voidwalker> this blocked each request
01:03:08FromDiscord<Yepoleb> yes, because you awaited the result of one `httpTrackerAnnounce` before calling the next
01:03:23FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6O
01:03:34FromDiscord<Yepoleb> if you do one loop first calling them all and another loop to await them it should work as intended
01:03:48FromDiscord<Yepoleb> without any special magic
01:04:05FromDiscord<voidwalker> yep, that's the plan : ) brb
01:05:54FromDiscord<voidwalker> I got stuck not knowing what was going on, but it seems the .read() on future triggered the exception. The exception was in a quantum uncertainty. It only manifested when taking a peek at it : D
01:06:12FromDiscord<voidwalker> (edit) "the" => "a" | "future" => "some futures" | "the exception." => " exceptions."
01:06:33FromDiscord<voidwalker> (edit) "uncertainty." => "uncertainty state."
01:23:35*neceve quit (Ping timeout: 268 seconds)
01:25:28*neceve joined #nim
01:25:57FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6T
01:26:23FromDiscord<voidwalker> this works, but I was wrong about my understanding that the async proc calls only trigger when an await or other such event is encountered
01:26:39FromDiscord<voidwalker> I put an echo in the TrackerAnnounce proc, for debug, and this is the output:
01:26:59FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6U
01:27:56FromDiscord<voidwalker> so it seems they begin executing immediately after being assigned to the future sequence
01:28:51FromDiscord<voidwalker> which makes me wonder if the code couldn't be simplified somehow to not use two loops ?
01:33:40FromDiscord<Yepoleb> Knowing when and how tasks get scheduled is hard without looking up the implementation details
01:34:32FromDiscord<voidwalker> lol really, I mean shouldn't these things be obvious from the docs ? : )
01:34:47FromDiscord<voidwalker> maybe they are and I am just too stupid
01:35:04FromDiscord<voidwalker> anyway here is how it goes
01:35:04FromDiscord<voidwalker> https://media.discordapp.net/attachments/371759389889003532/1050586346458206230/simplescreenrecorder-2022-12-09_03.33.24.mkv
01:35:05FromDiscord<Yepoleb> I have most of my knowledge from python async where this is done a bit differently
01:35:21FromDiscord<voidwalker> hm don't know how to embed video
01:36:06FromDiscord<Rika> futures can run as soon as they're made if there is a free dispatcher (or whatever theyre called) to run them
01:36:21FromDiscord<Rika> actually no thats wrong
01:37:00FromDiscord<Rika> futures run as soon as theyre made by a call (basically when you call an async proc they are run up to the first `await` like a sync call, then you need to await in the calling context to continue that future)
01:38:12FromDiscord<Yepoleb> In reply to @voidwalker "lol really, I mean": You should not rely on implementation details if they're not documented, but there are definitely some parts that need documentation
01:38:48FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4i6W
01:38:52FromDiscord<Yepoleb> In reply to @Rika "futures run as soon": Other async implementations require explicit scheduling, that's why i was confused
01:39:26FromDiscord<voidwalker> that sort of makes sense
01:39:49FromDiscord<Yepoleb> In reply to @voidwalker "which makes me wonder": Not really, unless you want to make it one of your infamous one liners
01:39:59FromDiscord<voidwalker> that's exactly what I want to do
01:40:15FromDiscord<Yepoleb> 😐
01:41:04FromDiscord<voidwalker> I guess I could map the first for, since just "scheduling" the futures will not encounter any exception until the first `await` in the called procs
01:41:25FromDiscord<voidwalker> we need a mapIt that handles exceptions 😄
01:41:49FromDiscord<Yepoleb> Yes, let's hide all the control flow
01:42:58FromDiscord<Rika> if you want to simulate python, you can put an `await sleepAsync(0)` at the start
01:43:11FromDiscord<Rika> i think thats how python async would work
01:43:54NimEventerNew thread by TyroneClide: Set Length Seq, see https://forum.nim-lang.org/t/9706
01:46:15FromDiscord<voidwalker> @Rika thanks for the clear explanation. So I guess `sleepAsync(10)` can also mean "allocate 10ms to run async code"
01:46:29FromDiscord<voidwalker> (edit) "`sleepAsync(10)`" => "`await sleepAsync(10)`"
01:47:03FromDiscord<voidwalker> but what about sleepAsync(0), what meaning would that have, since nothing can run in 0ms : )
01:48:09FromDiscord<voidwalker> but the sleep timer check only happens in the async loop, that means, until there's an await, so non-async cpu intensive code could block this wait more than you set it, no ?
01:54:39FromDiscord<Rika> In reply to @voidwalker "<@259277943275126785> thanks for the": kinda yeah not really, "allocate at least 10 ms to run async code"
01:54:53FromDiscord<Rika> so it can take longer depending on the gap between awaits in one async task
01:55:05FromDiscord<Rika> In reply to @voidwalker "but the sleep timer": yes
01:55:49FromDiscord<Rika> if the sleep future completes but the running task is still not in an await, it will have to get to the await before it switches back
01:56:01FromDiscord<Rika> tfw cooperative multitasking
01:56:04FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4i75
01:56:12FromDiscord<Rika> In reply to @not logged in "Why is this happening?": what is indent's declaration
01:56:46FromDiscord<! Nilts> In reply to @Rika "what is indent's declaration": `var indent = 0`
01:56:51FromDiscord<Rika> remove the
01:56:53FromDiscord<Rika> wait
01:56:56FromDiscord<Rika> why the
01:56:59FromDiscord<Rika> is it global
01:57:07FromDiscord<Rika> where is it declared more specifiaclly
01:57:22FromDiscord<Rika> prolly better to just show whole code
01:57:27FromDiscord<Rika> brb again lol
01:57:48FromDiscord<! Nilts> In reply to @Rika "why the *": because it's in a module and needs to be shared?
01:58:17FromDiscord<Rika> yes my mind is just running too quick rn
01:58:37FromDiscord<! Nilts> sooo?
01:58:41FromDiscord<! Nilts> what now
01:59:16FromDiscord<Yepoleb> In reply to @Rika "if you want to": I think the main difference in python is that tasks are not automatically scheduled, so they do not run unless they are actively being awaited or were manually scheduled.
01:59:37FromDiscord<Rika> In reply to @not logged in "what now": post code
01:59:43FromDiscord<Rika> hard to understand the context
01:59:45FromDiscord<Rika> (edit) "hard to understand the context ... " added "without"
02:00:45FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4i79
02:02:37FromDiscord<! Nilts> im stupid, i don't even need it, but i still want to know the issue
02:07:26FromDiscord<Yepoleb> In reply to @Rika "if you want to": I just realized with this code the scheduler could in theory give execution right back to the same proc without running anything else, so this is not suitable for triggering any kind of deterministic behavior.
02:11:54FromDiscord<Yepoleb> awaiting sleep for its side effects almost never works as intended, unless it's some best-effort-can't-do-this-properly hack
02:12:43FromDiscord<voidwalker> how does `await sleepAsync(timeout)` differ from `poll(timeout)` ?
02:16:23arkanoidI have an object made of 4 uints8 that I want to convert to uint32 and back, just by splitting it. How safe is to "cast[ColorRGBA](myUint32) / cast[uint32](myColorRGBA)" ?
02:16:42FromDiscord<Yepoleb> Poll waits only waits for completion events but does not process them while sleepasync also continues execution.
02:16:53FromDiscord<Elegantbeef> By definition of using `cast` it's "not safe" 😄
02:17:13FromDiscord<Elegantbeef> It shouldnt be UB though if that's what you mean
02:17:27FromDiscord<Yepoleb> But don't abuse sleepasync for running tasks with unknown runtime!
02:17:39FromDiscord<Elegantbeef> Though i'd say "tag the object {.packed.}" just to ensure you dont get fucky data
02:17:40FromDiscord<voidwalker> would you do `cast` in code that drives space rockets hmm
02:18:01FromDiscord<Elegantbeef> Cast is safe if you know what you're doing
02:19:00FromDiscord<Yepoleb> Two definitions of safe are colliding here
02:19:44FromDiscord<Elegantbeef> Well there's what Nim considers safe and what is actually safe
02:19:55arkanoidElegantBeef, thanks. Problem is the the source (ColorRGBA) type is from an external package, and I can't (actually don't want) to edit it adding {.packed.}. I'm trying the trivial cast now and I'm not getting the expected result
02:19:59NimEventerNew thread by RodSteward: Return value for joinThread?, see https://forum.nim-lang.org/t/9707
02:21:16FromDiscord<Elegantbeef> `static: assert sizeof(ColorRgba) == 4` 😄
02:22:07FromDiscord<Elegantbeef> `copyMem` might be the way to go then
02:22:45FromDiscord<Elegantbeef> You technically can do `cast[ptr uint32](myColor.addr)[]` but it can cause aliasing issues
02:23:40arkanoidElegantBeef, yes, the assert passes. The object I want to map as uint32 is https://github.com/treeform/chroma/blob/149d62be570ea0da073beb0110246a8e5d95357a/src/chroma/colortypes.nim#L24
02:24:30arkanoidnever used copymem, let me check the docs
02:25:12arkanoidisn't the lack of "packed" a problem for copyMem, too?
02:25:53FromDiscord<Elegantbeef> Well unlikely it'll cause an issue but kinda
02:26:31FromDiscord<Elegantbeef> You do know that data type you're using is premultiplied right?
02:26:48arkanoidand?
02:27:17arkanoiddon't really know what it means, I know I need to store a value larger than 255 for each pixel
02:27:18FromDiscord<Elegantbeef> It means that the rgb values are used with the alpha value
02:27:48FromDiscord<Elegantbeef> A colour with rgba of `255, 255, 255, 127` will not be the same inside ColorRGBX afaik
02:28:00FromDiscord<Yepoleb> arkanoid: don't cast, it's undefined behavior in c because of strict aliasing (two pointers of different types are not allowed to point to the same address) and you are possibly violating alignment rules, because your composite type is not guaranteed to have the right alignment for a 4 byte read (mqybe i am wrong on that though) and the packing makes it unreliable as well.
02:28:04arkanoidI don't the the "output color" now, I just want to hack around pixie to do what it can do but on my scientific sumulator
02:29:07FromDiscord<Elegantbeef> You can use either copymem or manually do the logic using `for i field in enumerate myColor.fieldPairs: myVal = myVal or int(field shl i 8)`
02:29:08FromDiscord<Yepoleb> Just code the manual bitshifts to transform the colors, if all the conditions are right for a cast, the compiler will 100% do it in release mode
02:30:35FromDiscord<Yepoleb> This is such a common optimization, just do the dumb thing and let the compiler figure it out for you
02:31:06FromDiscord<Yepoleb> Works always, no need to worry about implementation specifics
02:34:04FromDiscord<Yepoleb> In reply to @voidwalker "but the sleep timer": It seems like you need a broader introduction to async concepts, i will try to find the time tomorrow, now i need sleep 😦
02:35:24FromDiscord<voidwalker> Well, some good practical examples, together with an animated infographic of what happens inside the program. I have a hard time processing these abstract concepts from text : P
02:37:05*arkurious quit (Quit: Leaving)
02:40:50FromDiscord<voidwalker> https://github.com/nim-lang/Nim/issues/14810 2.5 years 😦 what are they doing
02:43:58FromDiscord<Elegantbeef> Talking about hacks instead of making sensible APIs
02:43:58FromDiscord<Elegantbeef> 😄
02:45:31FromDiscord<voidwalker> This is the second time I put #todo, leave it ugly like this until nim fixes their shit in githubURL
02:45:59FromDiscord<voidwalker> ah, right, let's check on the first one : )
02:47:20FromDiscord<voidwalker> https://github.com/nim-lang/Nim/issues/19782 - hm nope. fix is there since may 17 :[
02:49:35FromDiscord<Elegantbeef> 'prs welcome'
02:57:55FromDiscord<Yepoleb> In reply to @voidwalker "Well, some good practical": There is simply not enough text to explain it properly.
02:58:11FromDiscord<voidwalker> in the nim docs? sure
02:58:34FromDiscord<voidwalker> maybe if you are already super familiar with the concepts
02:58:47FromDiscord<Yepoleb> The documentation is only useful for people who already understand all the concepts
02:59:01FromDiscord<Yepoleb> And even then it's hard
03:24:09NimEventerNew thread by linwaytin: Nim-pipexp, see https://forum.nim-lang.org/t/9708
03:31:08*systemds1cks joined #nim
03:31:24*oprypin_ joined #nim
03:31:58*encyde joined #nim
03:34:50*systemdsucks quit (Ping timeout: 256 seconds)
03:34:50*Jjp137 quit (Ping timeout: 256 seconds)
03:34:50*ltriant quit (Ping timeout: 256 seconds)
03:34:50*ensyde quit (Ping timeout: 256 seconds)
03:34:50*oprypin quit (Ping timeout: 256 seconds)
03:37:55*ltriant joined #nim
03:43:13*Jjp137 joined #nim
03:49:49arkanoidI've solved by shl, shr and those old school stuff
03:50:41FromDiscord<albassort> opinions on printf formatting
03:50:49FromDiscord<albassort> i didn't like it at first but i started liking it the more i use it
03:51:30FromDiscord<albassort> i think the typing is a bit needless and archaic though
03:51:46arkanoidYepoleb: something like this passes my test https://wandbox.org/permlink/60PTXsVTRxSEGzRC is there a better way?
03:52:01arkanoidnever actually trained myself doing bit fiddling
06:40:47*tiorock joined #nim
06:40:48*tiorock quit (Changing host)
06:40:48*tiorock joined #nim
06:40:48*rockcavera is now known as Guest1826
06:40:48*Guest1826 quit (Killed (copper.libera.chat (Nickname regained by services)))
06:40:48*tiorock is now known as rockcavera
06:55:25*m5zs7k quit (Ping timeout: 260 seconds)
06:56:15FromDiscord<Gumbercules> In reply to @arkanoid "<@144300201857777664>: something like this": no not really
06:58:08FromDiscord<Gumbercules> it's twiddling btw
06:58:24FromDiscord<Gumbercules> https://graphics.stanford.edu/~seander/bithacks.html
06:58:28FromDiscord<Gumbercules> fun page
06:59:36FromDiscord<Gumbercules> https://www.codementor.io/@erikeidt/bit-twiddling-understanding-bit-operations-iqj68ynb7 seems like a pretty easy rundown - if you understand how numbers are represented in binary this should be pretty easy stuff to grok
06:59:54FromDiscord<Gumbercules> (edit) "https://www.codementor.io/@erikeidt/bit-twiddling-understanding-bit-operations-iqj68ynb7 seems like a pretty easy rundown - if you understand how ... numbers" added "decimal"
07:02:54*m5zs7k joined #nim
07:46:27*m5zs7k quit (Ping timeout: 246 seconds)
07:48:43FromDiscord<ShalokShalom> In reply to @NimEventer "New thread by linwaytin:": @Emanresu3 See, they are loving your package 🥳
07:49:03*PMunch joined #nim
07:50:09FromDiscord<ShalokShalom> (edit) "@Emanresu3" => "Emanresu3"
07:51:41FromDiscord<planetis> Is there a performance penalty of enabling -fno-strict-aliasing for nim code?
07:53:23FromDiscord<Elegantbeef> It's on by default afaik↵(@planetis)
07:53:48FromDiscord<Slava0135> how can i cast (int8, int8) to int16
07:55:41FromDiscord<planetis> yep seems so, for gcc at least. thanks beef
07:56:37FromDiscord<planetis> don't see it in the cached files with clang
07:57:15FromDiscord<Elegantbeef> scroll up slava
08:00:05*m5zs7k joined #nim
08:00:29FromDiscord<Slava0135> nim why https://media.discordapp.net/attachments/371759389889003532/1050683337213218826/image.png
08:00:49FromDiscord<Elegantbeef> Why what?
08:01:27FromDiscord<Slava0135> 1 shl 4 == 4
08:01:38Amun-Rasince when 0x10 is 4?
08:01:47FromDiscord<planetis> its 2
08:01:52FromDiscord<Slava0135> oh i am dumb then
08:01:58FromDiscord<planetis> sorry 16
08:02:04FromDiscord<Elegantbeef> `0x` is hex
08:02:09FromDiscord<Slava0135> yes yes
08:02:09FromDiscord<Elegantbeef> `0b` is binary
08:02:18Amun-Ra0b10 is still not 4 ;)
08:02:40FromDiscord<Elegantbeef> Oh i know
08:02:48FromDiscord<Elegantbeef> I just was pointing where i think the hookup was
08:02:55FromDiscord<Slava0135> in some language 1 << 4 == 4 but i don't remember which
08:02:58Amun-RaI know :>
08:03:10FromDiscord<Elegantbeef> That's just wrong
08:03:26FromDiscord<Elegantbeef> 1 shl 4 should equal 2^4
08:15:25PMunch@Slava0135, what?! In what language would 1 << 4 == 4? That's just mathematically incorrect
08:15:40PMunchUnless they use << as some other operator than left shift
08:16:29FromDiscord<Elegantbeef> `<<` is just `^` right?! 😄
08:20:07Amun-Rabut no ^ as in ** ;)
08:25:06FromDiscord<Rika> In reply to @PMunch "<@439814569972727818>, what?! In what": It is if you’re somehow using half bits or something lmao
08:25:43PMunchHaha, sure
08:26:58Amun-Raor base 4
08:29:53FromDiscord<Rika> Base four would have 1 << 1 == 4 base 10
08:30:42FromDiscord<Elegantbeef> It'd have to be base 1/4 😄
08:41:51Amun-Raand what about analog cpus? ;>
08:49:25FromDiscord<albassort> can i make enums non-case sensitive
08:49:34FromDiscord<albassort> this is user facing .-.
08:50:29*kenran joined #nim
08:50:39FromDiscord<Elegantbeef> Make an alias that starts with the alternative verrsion
08:51:31PMunch(Or write a macro which does that automatically)
08:51:56FromDiscord<albassort> it would be easier to write a magic
08:51:57*kenran quit (Remote host closed the connection)
08:52:14FromDiscord<albassort> or maybe implement my own parseEnum(
08:52:17FromDiscord<albassort> (edit) "parseEnum(" => "parseEnum?"
08:52:51PMunchOr just uppercase the enum before you parseEnum it
08:53:07FromDiscord<albassort> cant because not my code
08:53:11FromDiscord<albassort> #not my code!
08:53:26FromDiscord<albassort> (edit) "#not my code!" => "notmycode!"
08:53:30PMunchBut you can import your own parseEnum?
08:53:39FromDiscord<albassort> (edit) "notmycode!" => "#notmycode!"
08:53:46FromDiscord<albassort> that was a short sighted nonsensical statement
08:53:52FromDiscord<albassort> no i cant
08:54:53PMunchWhat is this code? Why can't you edit it?
08:55:34FromDiscord<albassort> nimyaml
08:56:48FromDiscord<Elegantbeef> You do realise it has custom serialization support?
08:57:07FromDiscord<Elegantbeef> https://nimyaml.org/serialization.html#customize-serialization
08:57:26FromDiscord<albassort> no
09:00:03*neceve quit (Quit: ZNC - https://znc.in)
09:04:41*m5zs7k quit (Ping timeout: 265 seconds)
09:06:36*adigitoleo joined #nim
09:07:12NimEventerNew thread by Nanako: A question about random returns, see https://forum.nim-lang.org/t/9709
09:08:03*m5zs7k joined #nim
09:11:39*neceve joined #nim
09:12:01*neceve quit (Remote host closed the connection)
09:18:41*neceve joined #nim
09:19:01*neceve quit (Remote host closed the connection)
09:30:12FromDiscord<albassort> is it a good idea to define procedures in one file, and then define globals in another,
09:31:25FromDiscord<albassort> sent a long message, see http://ix.io/4i85
09:31:34FromDiscord<voidwalker> So I am trying to write a template, which I would insert in the middle of some procs, no parameters, Just simple code substitution. (would work as simple string substitution actually)
09:31:34FromDiscord<albassort> (edit) "http://ix.io/4i85" => "http://ix.io/4i86"
09:33:14FromDiscord<voidwalker> I have a `let resp = .. ` inside the template, and then `result = if resp...` at the end of the proc. It says resp is undeclared identifier
09:33:21FromDiscord<voidwalker> any ideas ?
09:36:02FromDiscord<Elegantbeef> Templates are hygenic
09:36:09FromDiscord<Elegantbeef> `let resp {.inject.}`
09:38:36FromDiscord<voidwalker> wonderful : )
09:38:51FromDiscord<voidwalker> what a funny word to use, hygienic
09:41:36FromDiscord<voidwalker> dirty pragma is more like what I need though.. it's all dirty
09:46:40*neceve joined #nim
09:47:02*neceve quit (Remote host closed the connection)
09:49:05FromDiscord<voidwalker> wow, my first template : )
09:50:38FromDiscord<voidwalker> https://github.com/sgmihai/torrentim/blob/main/udp_tracker2.nim#L17
09:52:39*neceve joined #nim
09:53:02*neceve quit (Remote host closed the connection)
10:01:40*neceve joined #nim
10:16:53*kenran joined #nim
10:35:03*kenran quit (Remote host closed the connection)
10:42:46arkanoidif there any performance difference in doing let a = 50.float32 or let a = 50f32 ?
10:44:32FromDiscord<Bung> one has proc call other dont
11:00:25*ltriant quit (Ping timeout: 260 seconds)
11:18:54*estiquelapice quit ()
11:29:43arkanoidBung: thanks
11:30:38arkanoiddoes it apply even when converting to distinct of same type? eg myInt.myDistinctInt
11:46:24*estiquelapice joined #nim
11:51:08arkanoidcuriosity: what's the logic of calling type seq instead of Seq? because it has value semantics and so it should look like int, float, etc?
11:51:38FromDiscord<Yepoleb> Both are very unlikely to have a performance penalty
11:52:13FromDiscord<Yepoleb> Because compiler optimization again
11:52:28arkanoidgreat
11:52:44FromDiscord<Yepoleb> Don't worry about such tiny details, they won't matter in the long run
11:54:28FromDiscord<Rika> In reply to @Yepoleb "Don't worry about such": It can matter for embedded contexts which I see Arkanoid in often
11:54:59arkanoidYepoleb, usually I don't case much about these small details, but I'm developing a program that basically is 40 lines executed recursively millions of time (O(x*y) complexity). It works, but every small improvements makes a change here
11:56:30arkanoidRika, I'm not really embedded programming, but I do I/O with embedded, so yes I have to do binary stuff, but not strictly memory related. But here I'm on a different subject (scientific model crunching numbers)
11:59:25PMunchHmm, it's really annoying that you can't create a `ref SomeObject` by doing `new SomeObject(field: value)`
12:00:02*neceve quit (Quit: ZNC - https://znc.in)
12:06:01arkanoidhow to copy a TableRef?
12:06:08arkanoidshallow copy
12:06:18PMunchHmm, tried to run expandMacro and got a `Error: unhandled exception: value out of range: 36320 notin -32768 .. 32767 [RangeDefect]`
12:06:37PMuncharkanoid, `let x = myTable`?
12:07:16arkanoidPMunch: that would work if Table, not TableRef. Or not?
12:07:34arkanoidTable = value semantics, TableRef, the other way
12:07:41*neceve joined #nim
12:08:02*neceve quit (Remote host closed the connection)
12:08:03arkanoidI want to `pop` values from a shallow copy of a TableRef
12:19:37*neceve joined #nim
12:20:03*neceve quit (Remote host closed the connection)
12:23:43*neceve joined #nim
12:24:01*neceve quit (Remote host closed the connection)
12:25:06PMuncharkanoid, well a shallow copy of a TableRef is a copy of the ref
12:25:10PMunchWhich is what that would do
12:25:28PMunchBut I guess you want to copy one the Table, but not the data in the table?
12:26:03PMunchThen you'd need a `Table[SomeType, ref DataType]` and it doesn't have to be a TableRef
12:26:27FromDiscord<Yepoleb> In reply to @arkanoid "<@144300201857777664>, usually I don't": You can use godbolt compiler explorer to figure out where to optimize
12:27:56arkanoidYepoleb: thanks! didn't know about this instrument
12:27:57FromDiscord<Yepoleb> Can't you just dereference the tableref and assign it to an empty tableref?
12:28:29*ltriant joined #nim
12:29:18PMunchHmm, not entirely sure what kind of data structure Table uses under the hood
12:29:36PMunchBut as long as it's a reference type of some sort then I guess that should work
12:31:50PMunchHmm, what was the library that could create repeated snippets from a list or enum?
12:35:42*neceve joined #nim
12:36:02*neceve quit (Remote host closed the connection)
12:37:24*jmdaemon quit (Ping timeout: 264 seconds)
12:41:34FromDiscord<ambient> sent a code paste, see https://play.nim-lang.org/#ix=4i8v
12:41:49FromDiscord<ambient> and how do I build a set of tuples in a easy way, say like (5,0), (-1,-1) etc
12:42:46FromDiscord<Rika> Set as in?
12:42:57FromDiscord<Rika> {} this kind? You need to use hash sets instead
12:43:20FromDiscord<Rika> https://nim-lang.org/docs/sets.html
12:43:34FromDiscord<ambient> in generalities, I often have some data struct and a hashing function, what's the best way in Nim to convert that to a good abstraction?
12:48:22FromDiscord<Rika> Use the same api as the “hashes” module for your hashing function so you can use that data type with the sets module (and tables, and any module that uses hashes)
12:48:54PMunchI guess you could also use a built in set if you could convert each tuple into a single number representation
12:49:18*ltriant quit (Ping timeout: 256 seconds)
12:52:22*ltriant joined #nim
12:54:41*neceve joined #nim
12:54:57PMunchHmm, this is really weird. I can't echo out the `repr` of this untyped block..
12:55:02*neceve quit (Remote host closed the connection)
12:56:47*ltriant quit (Ping timeout: 252 seconds)
13:01:24*neceve joined #nim
13:02:45FromDiscord<nocturn9x> SO
13:02:47FromDiscord<nocturn9x> (edit) "SO" => "So"
13:02:53FromDiscord<nocturn9x> Nim has great C FFI
13:02:59FromDiscord<nocturn9x> but does it have a working Nim FFI too?
13:03:11FromDiscord<nocturn9x> I need to compile two pieces of code with different options and still join them into a final executable
13:03:45FromDiscord<nocturn9x> They don't strictly need each other, module 1 dumps everything into a file and module two reads from said file (didn't want any memory shared between them for obvious reasons)
13:22:57FromDiscord<answer> sent a code paste, see https://play.nim-lang.org/#ix=4i8I
13:32:55ZevvPMunch: thanks for the with, i just added you to the repo because all this merging makes me super tired
13:37:41*ltriant joined #nim
13:38:22PMunchThanks for the extremely fast response :)
13:42:34*ltriant quit (Ping timeout: 256 seconds)
14:00:42*Phytolizer joined #nim
14:07:58FromDiscord<Rika> In reply to @answer "is there anything equivalent": No, enums are used for that case
14:08:34FromDiscord<Yepoleb> In reply to @nocturn9x "They don't strictly need": If it's just about avoiding the temporary files you can use sockets or pipes
14:08:41FromDiscord<nocturn9x> not really
14:13:22FromDiscord<MetuMortis> In reply to @answer "is there anything equivalent": you look like a TS dev :d
14:13:58FromDiscord<Yepoleb> @nocturn9x Nim can expose c functions and build as a library, so you can use the C FFI to inferface with it, that's the most flexible but also inconvenient solution
14:14:57FromDiscord<Yepoleb> But it's hard to say what works and what doesn't if we don't know why your code can't just be compiled together
14:22:29FromDiscord<Yepoleb> I'd try to link the modules normally because it's unlikely there is no way to do it
14:22:34FromDiscord<Rika> In reply to @MetuMortis "you look like a": So?
14:23:23FromDiscord<Gumbercules> In reply to @albassort "is it a good": It doesn't really matter. Nim performs dead code elimination
14:25:01FromDiscord<nocturn9x> In reply to @Yepoleb "But it's hard to": well
14:25:06FromDiscord<nocturn9x> I need one piece not to rely on nim's GC
14:25:12FromDiscord<nocturn9x> while the rest of it needs it
14:25:42FromDiscord<Gumbercules> What are you trying to do?
14:25:43FromDiscord<nocturn9x> I tried using the stuff nim provides to disable the GC in critical paths
14:25:46FromDiscord<nocturn9x> but they seem to do nothing
14:25:53FromDiscord<nocturn9x> In reply to @Gumbercules "What are you trying": I'm writing a compiler and bytecode VM
14:26:06FromDiscord<nocturn9x> several thousands lines of code in the compiler definitely need the GC
14:26:11FromDiscord<nocturn9x> but the VM needs as little interference as possible
14:26:19FromDiscord<nocturn9x> which is why I wrote my own tiny M&S GC
14:26:44FromDiscord<Gumbercules> You know you're not going to be able to use most of the standard lib sans gc right?
14:26:56FromDiscord<Gumbercules> No Nim strings or seqs
14:27:03FromDiscord<nocturn9x> that's the idea yeah
14:27:05FromDiscord<Gumbercules> Or anything using then
14:27:06FromDiscord<Gumbercules> Okay
14:27:08FromDiscord<nocturn9x> I have my own `ptr Stuff`
14:27:14FromDiscord<nocturn9x> or I use simple `object`s
14:27:18FromDiscord<nocturn9x> no refs, no stdlib, etc.
14:27:47FromDiscord<Gumbercules> The no gc flag simply warns on heap usage
14:28:05FromDiscord<Gumbercules> Doesn't actually disable the gc or anything
14:30:00FromDiscord<Gumbercules> There are probably several ways to do this but you can use exportc and importc as @Yepoleb suggested with nimcall as the calling convention
14:30:47FromDiscord<Gumbercules> I don't believe you can have them in the same compilation unit with different compilation options
14:31:48FromDiscord<nocturn9x> hm
14:31:50FromDiscord<nocturn9x> thanks for your help
14:31:53FromDiscord<nocturn9x> I'll see what I can do
14:32:24FromDiscord<Gumbercules> Maybe have a config that sets no gc and run the compiler twice
14:33:03FromDiscord<nocturn9x> doesn't sound too bad
14:33:06FromDiscord<Gumbercules> First time with compile only on the module which should avoid gc usage
14:33:09FromDiscord<nocturn9x> I might also have like
14:33:16FromDiscord<nocturn9x> the VM compiled as a separate executable
14:33:19FromDiscord<nocturn9x> and call it manually
14:33:22FromDiscord<nocturn9x> with command-line arguments
14:33:32FromDiscord<Gumbercules> Yeah that could work too
14:33:45FromDiscord<Gumbercules> Writing your own PL I take it?
14:34:59FromDiscord<nocturn9x> Yep
14:35:07FromDiscord<nocturn9x> I'm starting to write the C backend right now
14:35:48FromDiscord<Gumbercules> Awesome! Excited to see what you build!!!
14:35:50FromDiscord<scruz> hello, what are the major drawbacks of Nim in its current state?
14:36:20FromDiscord<Gumbercules> In reply to @scruz "hello, what are the": Pretty broad question....
14:36:35FromDiscord<Gumbercules> What are you trying to do with it?
14:36:54FromDiscord<Gumbercules> App dev? Web dev? Embedded dev?
14:37:07FromDiscord<scruz> embedded dev mostly
14:37:25FromDiscord<Gumbercules> I mean Nim has that whole better C going
14:37:38FromDiscord<scruz> Nim + Python
14:37:45FromDiscord<Phil> You'll need a chat with generic
14:37:53FromDiscord<Gumbercules> Circular dependencies get annoying
14:38:08FromDiscord<Gumbercules> Esp in larger projects
14:38:17FromDiscord<Phil> And or pmunch/girvo
14:38:42FromDiscord<Gumbercules> You end up having to stuff all your type defs in a single module
14:39:16FromDiscord<Gumbercules> Compiler is slow if you need to compile a lot of importc'd code
14:40:05FromDiscord<Gumbercules> No great IDE support, if you like using IDEs
14:40:14FromDiscord<Gumbercules> Tooling continues to be bleh
14:41:16FromDiscord<Gumbercules> Other than that... I don't know I'm sure I'm missing things
14:42:05*junaid_ joined #nim
14:42:26FromDiscord<Gumbercules> Might be a good question to ask on the forums
14:44:10FromDiscord<Yepoleb> In reply to @scruz "hello, what are the": I agree with the stuff mentioned, but bad documentation is the biggest one for me
14:45:14FromDiscord<Gumbercules> Yeah that too
14:45:37FromDiscord<Gumbercules> Good call Yepoleb, forgot that one
14:47:02FromDiscord<Gumbercules> Bad docs have been a consistent complaint since I started using Nim in 2015. Situation has improved but still has a long way to go. It's not sexy work...
14:47:40FromDiscord<Yepoleb> In reply to @nocturn9x "I need one piece": If you don't pass GC'd objects between the code you can probably get away with just linking them together
14:47:51FromDiscord<nocturn9x> That could also probably work I guess
14:48:08FromDiscord<Yepoleb> But having a libcompiler and a libvm is most likely the cleanest solution
14:50:26FromDiscord<nocturn9x> ye
14:50:58PMunchHuh? Someone needs to talk to me?
14:51:15FromDiscord<Rika> What’s your embedded experience in Nim
14:51:15*junaid_ quit (Remote host closed the connection)
14:51:20FromDiscord<Rika> Like what’s it like
14:51:25FromDiscord<Rika> Is basically what is asked of you
14:51:43PMunchOh, I'd say it's pretty fantastic. But library support at the moment is the biggest drawback
14:52:07PMunchNim simply doesn't have a large enough ecosystem on embedded platforms at the moment
14:52:47PMunchBut of course, if you don't mind implementing a bunch of sensors and such yourself then it's pretty neat. Can get really small code while still retaining the high-level nature of the language
14:57:59FromDiscord<ambient> why do people recommend to use "toOpenArray" instead of "s[a,,b]"? (for performance)
15:00:03*neceve quit (Quit: ZNC - https://znc.in)
15:00:09FromDiscord<ambient> I'm reading https://www.reddit.com/r/nim/comments/yor0ue/how_to_write_performant_nim/
15:06:46*neceve joined #nim
15:07:01*neceve quit (Remote host closed the connection)
15:09:46FromDiscord<Rika> The second makes a copy
15:09:48PMunch@ambient, well `s[a..b]` creates a new sequence which copies over all the objects. This means a new allocation and potentionally a lot of copying. OpenArray on the other hand is a pointer/length pair which points to element `a` with length `b-a` in this case. That means that you can iterate over the values in the sequence without having to copy them into a new one.
15:09:59FromDiscord<ambient> ok good to know
15:12:14*PMunch quit (Quit: Leaving)
15:21:19FromDiscord<nocturn9x> is there a way to avoid stuff like
15:21:21FromDiscord<nocturn9x> `import ../../../../../frontend/compiler/targets/bytecode/opcodes`
15:21:27FromDiscord<nocturn9x> it's truly awful
15:21:44FromDiscord<nocturn9x> can I tell nim to start lookups in the `src` directory every time
15:21:55Amun-Rasure
15:22:07FromDiscord<nocturn9x> how?
15:22:55Amun-Rafor example: swietch "path", "src" (in config.nims)
15:23:01*ltriant joined #nim
15:23:21Amun-Rathat'll make src directory to be one of default path to look for
15:23:58Amun-Raimport frontend/compiler/foo will import src/frontenf/compiler/foo.nim, and so on
15:24:25Amun-Raswitch*
15:28:32*ltriant quit (Ping timeout: 256 seconds)
15:32:16FromDiscord<jtv> Do I have to do anything special to get Nimble to pull refreshed tags from github?? I've got a package I'm testing, and project 2 is not seeing the new version. The new tag is definitely there, definitely has a v on the front. The new version definitely bumped the version number in the .nimble file. I can't believe I've spent over an hour on this.
15:35:03FromDiscord<Gumbercules> This is one reason I don't use nimble
15:35:37*ltriant joined #nim
15:38:34FromDiscord<jtv> It's definitely frustrating. All the docs say is that, if the nimble verison is bumped, if the tag is there, it should detect. But... it doesn't. I also found when getting the first version up, the doc was wrong. If there were no tags, the docs say it will pull HEAD, but it most certainly did not.
15:39:11FromDiscord<Gumbercules> I use git submodules and add paths to my `config.nims` file
15:39:22FromDiscord<jtv> Generally, I'm glad I found Nim, but I think a lot more people would be attracted to it if there were a bit more polish, especially in toolchain and docs.
15:39:45*neceve joined #nim
15:39:49FromDiscord<Gumbercules> yeah well the person who designed and implemented Nimble is no longer here and whether they did a good job or not is very much up for debate
15:39:58FromDiscord<Gumbercules> there are a few alternatives available
15:40:03*neceve quit (Remote host closed the connection)
15:40:14FromDiscord<Gumbercules> https://github.com/disruptek/nimph
15:40:26*ltriant quit (Ping timeout: 256 seconds)
15:40:34FromDiscord<Gumbercules> Nimble didn't even have lockfiles until a year or two ago
15:40:48FromDiscord<Gumbercules> (edit) "here" => "active here,"
15:40:58FromDiscord<jtv> Cool I'll check it out. A bit of a shame, but if I can't get this thing to refresh tags, I'm not going to go spelunking in the source to figure it out.
15:41:10FromDiscord<Gumbercules> I don't blame you
15:41:22FromDiscord<Gumbercules> I wouldn't want to touch Nimble's source either
15:41:40FromDiscord<jtv> I think the docs for the nimscript file with Nimble are woefully poor too. So unclear.
15:42:50FromDiscord<Gumbercules> I've been out of the loop for a while, but Nimble has consistently been a source of complaints for the years I've been active in the community, which is a pretty long time
15:43:43FromDiscord<jtv> With better alternatives, I wonder why it's not a priority to replace it
15:43:55FromDiscord<Gumbercules> politics
15:44:17FromDiscord<Gumbercules> at least that was the reason previously - I think at this point people would rather make nimble work as advertised and improve it vs replace it with something new
15:44:27FromDiscord<Gumbercules> not sure who is signing up for that work, if anyone, though
15:45:19FromDiscord<jtv> Yeah, if nobody is working on it... I've been here a week or two, and have already seen a ton of people fighting nimble and having problems getting googlable answers to other basics about the language and the libs :/
15:45:43FromDiscord<Gumbercules> Yeah, docs are another long running issue...
15:47:12*ltriant joined #nim
15:48:15FromDiscord<jtv> Hopefully someone makes those kinds of things a priority, as not everyone is as willing to just do what it takes to figure stuff out, and overall, Nim is an incredibly worthy language that deserves a big user base. I am really in love w/ the language, it is just hard to recommend it to people if these kinds of basics aren't there 😦
15:49:09FromDiscord<Gumbercules> Things have definitely improved over the years, but it's not sexy work so not many people sign up for it
15:49:49FromDiscord<Gumbercules> Not many people, if anyone at this point, get paid to work on Nim so it's been mostly contributors over the years with a very small core dev team
15:50:17FromDiscord<Gumbercules> Historically new features have taken priority over stabilization / tooling
15:50:34FromDiscord<jtv> Well, getting people paid to work on it can be changed 🙂
15:51:46*ltriant quit (Ping timeout: 256 seconds)
15:52:56FromDiscord<jtv> This problem is hilarious. The tag doesn't even EXIST anymore, I nuked it, and yet Nimble is still saying, "Nope, that's the only version I see".
15:52:59FromDiscord<Gumbercules> Of course, but leadership is in charge of these sorts of things. If you have ideas for bringing more contributors / how to raise $$$ to attract them, I'm sure they'd be open to listening!
15:53:06FromDiscord<Gumbercules> heh
15:53:19FromDiscord<Gumbercules> nimble does cache stuff - I wonder if that has to do anything with it
15:53:26FromDiscord<Gumbercules> it's been a while since I used nimble
15:53:32FromDiscord<Gumbercules> (edit) "I" => "I've"
15:53:50FromDiscord<jtv> Well, I haven't met them yet, but I'm pretty good at raising money so hey hopefully we'll become friendly 🙂
15:54:12FromDiscord<jtv> I don't even know who's really important besides Araq 🤷
15:56:04FromDiscord<Gumbercules> I don't know anymore either - I know @ringabout is a major contributor lately
15:56:14FromDiscord<Gumbercules> not sure who else....
15:57:29FromDiscord<Gumbercules> out of all the pictures of contribs on the repo's page - I believe only two are very active haha
15:57:56FromDiscord<jtv> Any clue why people have wandered off?
15:58:04FromDiscord<Gumbercules> everyone else is either long gone or slowed down contribs majorly
15:58:11FromDiscord<Gumbercules> mmm lots of reasons
15:58:21FromDiscord<jtv> I really only just heard about the language for the first time (well, since it went 1.0) a month or two ago
15:58:46*ltriant joined #nim
15:58:47FromDiscord<Gumbercules> frustration with the language and frustration with people / politics I'd say are the primary culprits
15:58:50FromDiscord<jtv> sent a code paste, see https://play.nim-lang.org/#ix=4i9o
15:59:19FromDiscord<jtv> It's seeing it now. I deleted all the cached info, but it still somehow doesn't compare to true?
15:59:21FromDiscord<Gumbercules> I've been here 7 years so it's tough to cover all the reasons people have left
15:59:59FromDiscord<jtv> Thanks, was def interested as to whether there were major high level reasons
16:00:02FromDiscord<Gumbercules> I left for a while too but recently came back into the fold
16:00:23FromDiscord<Gumbercules> Nim has changed quite a bit in those 7 years - we have completely new memory management systems
16:00:30FromDiscord<Gumbercules> or the language does rather
16:01:18FromDiscord<Gumbercules> if I had to say whether things are moving in the right direction or not, I'd say they are but it's always tough to tell
16:01:33FromDiscord<Gumbercules> I suppose we'll see how the rollout of 2.0 goes
16:02:23FromDiscord<Gumbercules> looks like @juan_carlos has been doing quite a bit of work on Nim lately too
16:02:37FromDiscord<jtv> sent a long message, see http://ix.io/4i9r
16:03:13FromDiscord<Gumbercules> haha yeah Rust can be a pretty friction-filled experience
16:03:22FromDiscord<jtv> A lot of hype around 2.0 might get people looking, but if the first 2 weeks isn't smooth for people, not a lot will stay, no matter how good.
16:03:24FromDiscord<Gumbercules> I wrote around 5k loc in Odin recently and messed around with Zig for a bit before that
16:03:24*ltriant quit (Ping timeout: 260 seconds)
16:03:44FromDiscord<Gumbercules> yeah - I'd say don't let nimble define your experience
16:03:57FromDiscord<Gumbercules> Nimble has never been a great experience and it's why alternatives exist in the first place I guess
16:03:59FromDiscord<jtv> Yeah, again, neither excites me. I do have a lot of friends who are big on Zig
16:04:04FromDiscord<Gumbercules> Git submodules work very well for me
16:04:26FromDiscord<Gumbercules> then again - I don't need much besides the ability to import Nim code at this point
16:04:33*ltriant joined #nim
16:04:44FromDiscord<Gumbercules> and the ability to author build scripts - Nimscript tasks work well for this
16:05:13*neceve joined #nim
16:05:29FromDiscord<jtv> Sure, I don't REALLY need a package manager for what I'm doing now, was just hoping to open source all the parts when ready 🙂
16:05:30FromDiscord<Gumbercules> Yeah Zig is cool but it feels like it's becoming way too academic / concerned with solving problems no one really needs solutions to
16:06:03FromDiscord<Gumbercules> In reply to @jtv "Sure, I don't REALLY": yeah - I'd like to do the same with my engine eventually but I'm going to tackle the nimble issue when I'm done with the rest
16:06:10FromDiscord<Gumbercules> maybe...
16:06:18FromDiscord<jtv> Yup exactly. Whereas readability, and ease of use Python did pretty well in the early days (it's overcomplicated now really, without the benefits)
16:06:51FromDiscord<Gumbercules> I did like Odin for the productivity it offered and the simplicity however the verbosity and lack of ability to hide it, plus the dependency on LLVM has turned me off
16:06:57FromDiscord<jtv> I've been surprised how much the template and macro systems can help actually improve readability
16:07:15FromDiscord<Gumbercules> https://sr.ht/~duangle/scopes/ has also been a bug in my ear over the years
16:07:31FromDiscord<jtv> But usability is also getting the answers you need, so the docs.
16:07:33FromDiscord<Gumbercules> but it has such a small community / is barely worked on - probably because it works and doesn't need much attention
16:07:40FromDiscord<jtv> And that's pretty bad
16:08:42FromDiscord<jtv> I have seen Scopes before, but never really checked it out. I will add it to my list, thanks 🙂
16:09:14*ltriant quit (Ping timeout: 260 seconds)
16:09:26FromDiscord<Gumbercules> the live compiler thing is pretty sweet
16:09:47FromDiscord<Gumbercules> although with hot code reloading you can do something fairly similar with Nim
16:10:04FromDiscord<Gumbercules> (not Nim's HCR feature - I don't even think it works, but that also might be FUD)
16:10:20FromDiscord<Gumbercules> I just dlopen / dlclose
16:12:30FromDiscord<ringabout> In reply to @jtv "This is progress, but": Where is the package though? https://github.com/crashappsec/con4m doesn't seem to exist,
16:12:33FromDiscord<jtv> I must not have found the cache; I looked all through the nimble directory, including looking for dot files ofc, and didn't find anything. But when I removed my >= 0.2.1 requirement it... downloaded 0.2.1, but is still placing it in a directory called 0.1.1
16:12:38FromDiscord<jtv> 🤯
16:12:52FromDiscord<jtv> It's private for the moment
16:12:59FromDiscord<jtv> It's there, trust me 🙂
16:14:14FromDiscord<jtv> Odd, the nimble file though is still the old nimble file.
16:16:07*ltriant joined #nim
16:16:08FromDiscord<ringabout> Well, you can probably copy the nimble file to a public repo to make a reproducible issue.
16:16:27FromDiscord<jtv> Actually, I'll just open it up, it's no big deal
16:18:33FromDiscord<jtv> Done. Would def appreciate if you could take a look and see if I'm doing something dumb
16:20:40*ltriant quit (Ping timeout: 256 seconds)
16:23:17FromDiscord<ringabout> That's weird, `nimble install https://github.com/crashappsec/con4m@#head` works.
16:23:23FromDiscord<ringabout> (edit) "weird," => "weird."
16:24:21FromDiscord<ringabout> In reply to @jtv "Done. Would def": https://github.com/crashappsec/con4m/blob/v0.2.1/con4m.nimble
16:24:33FromDiscord<ringabout> The version should be changed to 0.2.1
16:24:34FromDiscord<jtv> Yeah I JUST noticed that
16:24:43FromDiscord<jtv> No, that's a very old file
16:25:09FromDiscord<jtv> Like very old
16:25:20FromDiscord<jtv> It is at the head though
16:25:41FromDiscord<jtv> And how the old one got overwritten WTF
16:26:02FromDiscord<jtv> Good thing I still have the new one on my other computer that hadn't pulled
16:26:19FromDiscord<jtv> Thanks for looking.
16:26:50FromDiscord<jtv> Still don't know how it happened tho, but thanks 🙂
16:26:56FromDiscord<ringabout> No problem
16:27:41*ltriant joined #nim
16:30:21FromDiscord<jtv> No wait, the HEAD does have the right file
16:30:26FromDiscord<jtv> And that's the tagged version
16:30:57FromDiscord<jtv> So I'm clearly doing something wrong.
16:32:05FromDiscord<jtv> `https://github.com/crashappsec/con4m/blob/main/con4m.nimble` Is the head, and that's the version I tagged, I haven't done anything since
16:32:34*ltriant quit (Ping timeout: 256 seconds)
16:32:42FromDiscord<jtv> So why the blob associated w/ the tag is wrong... all the code that gets pulled seems right, the nimble file is the only thing wrong
16:34:44FromDiscord<ringabout> As I said https://github.com/crashappsec/con4m/blob/3af365889379682f0a3d3e944cf195bd1d0c57df/con4m.nimble#L3 should be the same as the tagged version.
16:35:13FromDiscord<jtv> Yeah, I gotcha, I'm just trying to figure out how the tag is associated with something so old
16:35:23FromDiscord<ringabout> You can now change the version to 0.2.3 and tag it as v0.2.3
16:35:30FromDiscord<jtv> I committed, merged, added the tag...
16:35:55FromDiscord<jtv> Yeah will delete and re-add the tag
16:37:51FromDiscord<ShalokShalom> In reply to @Gumbercules "out of all the": https://github.com/nim-lang/Nim/graphs/contributors?from=2021-11-14&to=2022-12-09&type=c
16:38:38FromDiscord<Gumbercules> I was talking about in the repo's landing page
16:39:18*ltriant joined #nim
16:39:23FromDiscord<Gumbercules> it shows who the top contributors to the project are historically, I believe only ringabout and araq out of the avatars shown there are very active
16:39:34FromDiscord<jtv> Thanks again, @ringabout I owe you one 🙂
16:39:37FromDiscord<ShalokShalom> Yeah
16:39:46FromDiscord<ringabout> In reply to @jtv "Thanks again, <@658563905425244160> I": You are welcome
16:39:50FromDiscord<ShalokShalom> These are the ones, who have contributed in the last year
16:39:54FromDiscord<Gumbercules> yeah
16:40:00FromDiscord<Gumbercules> new blood
16:40:32FromDiscord<ShalokShalom> @jtvWelcome to the community 😄
16:40:46FromDiscord<jtv> Thanks 🙂
16:41:05FromDiscord<Gumbercules> yes, welcome!
16:44:00*ltriant quit (Ping timeout: 260 seconds)
16:50:50*ltriant joined #nim
16:55:48*ltriant quit (Ping timeout: 256 seconds)
17:02:25*ltriant joined #nim
17:07:18*LuxuryMode joined #nim
17:07:34*ltriant quit (Ping timeout: 260 seconds)
17:14:00*ltriant joined #nim
17:14:44FromDiscord<Alfa> Hi I created coffee for developers each programing language has its own taste based on laguages carateristics https://programerscoffee.myshopify.com. Check it out
17:16:35FromDiscord<Gumbercules> No thanks
17:17:39FromDiscord<Gumbercules> You don't even have a Nim flavor and your advertising your product in the Nim discord
17:17:47FromDiscord<Gumbercules> hard fail
17:17:56FromDiscord<jtv> 🤣
17:18:24FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4i9H
17:18:25FromDiscord<Gumbercules> doesn't sound generic af at all!
17:18:35*ltriant quit (Ping timeout: 252 seconds)
17:18:44FromDiscord<Gumbercules> sounds like you spent a lot of time weighing the merits and characteristics of the C PL before you wrote that
17:21:53FromDiscord<Phil> In reply to @Alfa "Hi I created coffee": This is not about the nim programming language, use offtopic for this.
17:22:34FromDiscord<Alfa> In reply to @Isofruit "This is not about": Sure
17:22:36FromDiscord<Alfa> Sorry
17:25:32*ltriant joined #nim
17:30:22*ltriant quit (Ping timeout: 256 seconds)
17:31:20*junaid_ joined #nim
17:35:03*junaid__ joined #nim
17:35:11*junaid__ quit (Client Quit)
17:37:08*ltriant joined #nim
17:42:11*ltriant quit (Ping timeout: 264 seconds)
17:43:41*pro joined #nim
17:43:41*pro quit (Client Quit)
17:44:49FromDiscord<Horizon [She/Her]> Does std/json have a standard to serialise and unserialise a Nim object?
17:46:44FromDiscord<Horizon [She/Her]> Standard as in, a `to_json`/`from_json` method
17:47:03FromDiscord<Gumbercules> https://nim-lang.org/docs/json.html#overview-unmarshalling
17:47:05FromDiscord<Gumbercules> https://nim-lang.org/docs/json.html#creating-json
17:47:12FromDiscord<Gumbercules> btw it's traditionally serialize / deserialize and marshal / unmarshal
17:47:40FromDiscord<Require Support> try jsony if you want more control
17:48:11FromDiscord<Gumbercules> there are multiple thirdparty json libs - jsony isn't hte only one
17:48:18FromDiscord<Gumbercules> (edit) "hte" => "the"
17:48:40*ltriant joined #nim
17:50:04FromDiscord<Horizon [She/Her]> In reply to @Gumbercules "btw it's traditionally serialize": Ah neat!
17:50:10FromDiscord<Horizon [She/Her]> In reply to @Require Support "try jsony if you": Eh, I don't really need it so
17:51:32*junaid_ quit (Read error: No route to host)
17:52:48*junaid_ joined #nim
17:53:36*ltriant quit (Ping timeout: 256 seconds)
17:54:27FromDiscord<Phil> I find it more intuitive to work with tbh
17:55:03FromDiscord<Phil> sent a long message, see https://paste.rs/hMI
17:55:37FromDiscord<Horizon [She/Her]> I just want to add basic support really, I'll like add some extra code for optional module support
17:55:44FromDiscord<jos> chatgpt can write nim
17:56:06FromDiscord<Horizon [She/Her]> We know xD
17:56:12FromDiscord<Horizon [She/Her]> People have been talking about it for ages now
17:56:15FromDiscord<Gumbercules> In reply to @jos "chatgpt can write nim": #offtopic please
17:56:39FromDiscord<Gumbercules> and mods - please for the love of all that is holy can we get an AI channel or something for this crap under #non-programming?
18:00:02*neceve quit (Quit: ZNC - https://znc.in)
18:00:16FromDiscord<jos> how about you just appreciate some activity in a relatively unpopular discord for a relatively unpopular language
18:00:17*ltriant joined #nim
18:00:28FromDiscord<jos> instead of trying to police it because it vaguely falls in a category you don't like
18:02:14FromDiscord<Gumbercules> lol okay bub
18:02:27FromDiscord<Phil> Chiiiiill
18:02:38FromDiscord<Phil> Anyway, question about std/httpclient
18:03:11FromDiscord<Phil> sent a long message, see http://ix.io/4i9T
18:05:11*ltriant quit (Ping timeout: 260 seconds)
18:06:35FromDiscord<Phil> I am halfway certain that this is an error from whatever C lib is used for that client
18:09:12FromDiscord<Gumbercules> nah that's an error from the operating system
18:09:38*rockcavera quit (Remote host closed the connection)
18:10:02FromDiscord<Gumbercules> is the address resolvable?
18:10:43FromDiscord<Gumbercules> generally this means that IP address isn't available to your network / already in use
18:11:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4i9U
18:11:17FromDiscord<Phil> I am assuming its trying to send a request over a busy port
18:11:40FromDiscord<Phil> Note that when this request runs, I'll have also started, in a separate process, an instance of a prologue server
18:11:50*ltriant joined #nim
18:12:10Amun-Raseems like you're trying to bind to something you don't own
18:12:37FromDiscord<Phil> So when this runs I have 2 things that will have just gotten assigned their port:↵The server I compiled and booted up as part of the test like 50ms earlier↵The httpclient that is supposed to shoot HTTP requests against said server to check its response for correctness
18:13:25Amun-Rado you use docker?
18:13:33FromDiscord<Phil> Aye.
18:13:48FromDiscord<Phil> The database is a postgres instance and comes in a container in which I also have the application
18:13:50FromDiscord<Gumbercules> yeah that's prob your problem
18:14:00FromDiscord<Gumbercules> do you have them bridged networking wise?
18:14:15FromDiscord<Phil> Fair point, let me check
18:14:27Amun-RaPhil: is that docker instance really serving the port
18:14:29Amun-Ra?
18:14:36FromDiscord<Gumbercules> yeah also port mapping...
18:14:47*neceve joined #nim
18:14:56Amun-Ramhm
18:14:58*pro joined #nim
18:15:03*neceve quit (Remote host closed the connection)
18:15:14FromDiscord<Phil> The main reason I didn't do so manually is because norm got away with not having to do so, hmmm
18:15:27*pro left #nim (#nim)
18:15:40arkanoidsometimes "obj.foo[MyType]()" fails to compile, but "foo[MyType](obj)" works. Why is it failing?
18:15:49FromDiscord<deech> Why does the generated documentation for `Table` not show that `[]` could raise a `KeyError` in the raises pragma, `{.raises: [KeyError].}`? https://media.discordapp.net/attachments/371759389889003532/1050838189616681080/image.png
18:16:43*ltriant quit (Ping timeout: 248 seconds)
18:17:09FromDiscord<Gumbercules> seems like the source lacks the annotation
18:17:18FromDiscord<Gumbercules> https://github.com/nim-lang/Nim/tree/version-1-6/lib/pure/collections/tables.nim#L317
18:17:19FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4i9X
18:17:50FromDiscord<Gumbercules> unless you were simply inquiring as to why it was not annotated
18:17:57FromDiscord<deech> In reply to @Gumbercules "https://github.com/nim-lang/Nim/tree/version-1-6/li": To my knowledge it should be inferred.
18:18:03FromDiscord<Gumbercules> ah okay
18:18:09FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4i9X" => "https://play.nim-lang.org/#ix=4i9Y"
18:18:17FromDiscord<Gumbercules> wasn't aware that was a thing now
18:20:38*neceve joined #nim
18:20:45FromDiscord<Gumbercules> In reply to @Isofruit "For comparison, norm's docker-compose": I know you can alias services in docker compose and then refer to them with those aliases
18:21:01*neceve quit (Remote host closed the connection)
18:21:13FromDiscord<Gumbercules> I imagine the `postgres` docker image is making itself available somehow to the `tests` service
18:21:22FromDiscord<Phil> Ahhh you think this was hacked around via that mechanism
18:21:26FromDiscord<Gumbercules> possibly
18:21:29FromDiscord<jmgomez> converters doesnt work on generics, right?
18:21:38FromDiscord<Gumbercules> In reply to @jmgomez "converters doesnt work on": they're for distinct types I believe
18:21:58FromDiscord<Gumbercules> should be easy enough to figure out though....
18:23:22*ltriant joined #nim
18:24:50*neceve joined #nim
18:25:01*neceve quit (Remote host closed the connection)
18:25:50FromDiscord<scruz> In reply to @Gumbercules "Other than that... I": Thanks for the reply, I was busy so couldn't check during that time
18:28:10*ltriant quit (Ping timeout: 256 seconds)
18:28:32*rockcavera joined #nim
18:29:51FromDiscord<jmgomez> In reply to @Gumbercules "should be easy enough": yes, I will need to split in a smaller chunk. Have a mix of imported generics and inheritance.. They built a "type system" in the reflection system parallel to the actual cpp type system and some times there is a lot of friction
18:31:21FromDiscord<Gumbercules> oh sorry I just meant if you could use converters
18:31:42*neceve joined #nim
18:32:01*neceve quit (Remote host closed the connection)
18:32:21FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4ia1
18:32:34FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4ia2
18:34:32FromDiscord<jmgomez> 👍
18:35:08*ltriant joined #nim
18:38:38*neceve joined #nim
18:38:58FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4ia4
18:39:01*neceve quit (Remote host closed the connection)
18:39:59*ltriant quit (Ping timeout: 260 seconds)
18:41:43NimEventerNew thread by mantielero: Struggling to understand `asyncjs`'s `PromiseJs`, see https://forum.nim-lang.org/t/9710
18:44:24FromDiscord<Phil> unintelligable strangled anger-gargling noises↵The entire connection issue was one of such stupidity I want to bang my head against the wall
18:44:46FromDiscord<Phil> Turns out I just had the test server incorrectly set up. As in, completely wrongly set up and accidentally overwriting environmental variables it needed
18:45:00FromDiscord<Gumbercules> happens
18:45:22FromDiscord<Phil> Like that "putEnv" should've been screaming at me in my test_server file when I have a "database_setup" module EXPLICITLY for environmental variables (which are only needed for creating db connections)
18:46:43*ltriant joined #nim
18:50:20FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4ia6
18:50:28FromDiscord<Phil> And now I can finally claim that snorlogue runs flawlessly for both sqlite and postgres... and now to figure out how to run this on github
18:51:39*ltriant quit (Ping timeout: 260 seconds)
18:58:17*ltriant joined #nim
18:59:26NimEventerNew post on r/nim by Akronae: Inspired by a r/programmerhumor post, see https://reddit.com/r/nim/comments/zh5ii1/inspired_by_a_rprogrammerhumor_post/
19:00:10*neceve joined #nim
19:03:01*ltriant quit (Ping timeout: 268 seconds)
19:04:37FromDiscord<Phil> ... I would never have thought that nim might need an nsfw channel
19:04:44FromDiscord<Phil> Just to be able to put this there
19:04:49FromDiscord<Phil> As like the one post in general
19:05:11FromDiscord<Phil> And before anyone wants to question why this would be NSFW:↵Would you want to explain to a colleague at work what you're reading there?
19:06:34FromDiscord<Gumbercules> this shit is so tired
19:07:08FromDiscord<Gumbercules> if a person were to have written this no one would laugh or think it was funny or cool or whatever
19:07:20FromDiscord<Gumbercules> but because some stupid bot did it, everyone is like OMG WTF THIS IS AMAZING! THE BEST THING EVER!
19:07:57FromDiscord<Gumbercules> It's not, and it's spammy and distracts from the focus of this server / community which is developing the language and ecosystem for Nim / building things with Nim
19:08:08FromDiscord<Phil> In reply to @Gumbercules "if a person were": I disagree, for I would laugh as to why somebody took the time to write this nonsense
19:08:32FromDiscord<Gumbercules> Feeding chatgpt a prompt about Nim and sharing the results doesn't make it related to this discord - you could replace Nim with C++ and it would be as relevant still
19:08:39FromDiscord<Gumbercules> which is not at all relevant
19:08:57FromDiscord<Gumbercules> In reply to @Isofruit "I disagree, for I": well I mean - you can do the same thing now - why is someone wasting their time doing this?
19:09:04FromDiscord<Gumbercules> probably because they have nothing better to do and want attention
19:09:29FromDiscord<Phil> Anyway though, this is kind of unavoidable as NimEventer basically just posts every post from reddit here
19:09:49*ltriant joined #nim
19:09:52FromDiscord<Phil> In reply to @Gumbercules "probably because they have": That, or the were bored and just found the thought funny
19:09:56FromDiscord<Gumbercules> yeah :/ unless the community adopts a stance that sharing chatgpt stuff is prohibited in official communication channels
19:10:07FromDiscord<Gumbercules> well they weren't even creative enough to come up with the idea on their own
19:10:12FromDiscord<Gumbercules> notice the inspired by part
19:10:19FromDiscord<Gumbercules> it's just regurgitated shit
19:11:42FromDiscord<Phil> 🤷 ↵Anyway, time to start the betting pool
19:11:58FromDiscord<Phil> Will the github CI pipeline run on first try or will some arbitrary thing I forget kick me over
19:12:26FromDiscord<Phil> (edit) "forget" => "forgot"
19:13:04FromDiscord<ShalokShalom> @Phil Can we have an AI channel?
19:13:20FromDiscord<Phil> In reply to @ShalokShalom "<@180601887916163073> Can we have": I don't know, can you?
19:14:02FromDiscord<Gumbercules> May we?
19:14:21FromDiscord<Gumbercules> I don't think @Phil has admin powers here - probably @Yardanico or @PMunch
19:14:38*ltriant quit (Ping timeout: 256 seconds)
19:16:53FromDiscord<Phil> In reply to @Gumbercules "I don't think <@180601887916163073>": This is the right answer 😄
19:17:33FromDiscord<Phil> I'm just a normal user, so basically asking me for a channel is trying at the wrong place 😄
19:20:30FromDiscord<PMunch> Hmm, I guess we could 🤔
19:21:24*ltriant joined #nim
19:22:17FromDiscord<Phil> Yes the github CI pipelines are running through.↵I can basically release Snorlogue now.↵... whichi means I still need to read up again how that worked, make a release and then add it to the nimble package list
19:22:35FromDiscord<Phil> ... time to procrastinate that to tomorrow
19:23:31FromDiscord<ShalokShalom> @Phil didn't you get mod rights?
19:25:15FromDiscord<PMunch> Have to figure out how to set up bridges and stuff though
19:25:15FromDiscord<Phil> I asked back when the crypto spam was extra bad, nothing happened since then, all you need to do is click on my name to see no role attached 😛
19:26:17FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4iah
19:26:27*ltriant quit (Ping timeout: 268 seconds)
19:30:16FromDiscord<PMunch> Well we haven't really had that much AI stuff here have we? I mean please don't write a bot which actually chats here, that would probably be super annoying/disruptive. But just ignoring the occasional AI post isn't terribly hard.
19:32:12FromDiscord<Phil> I'm tempted to agree given that my heart is filled with the kind of neutrality that would make zap brannigan go off on a tangent
19:33:02*ltriant joined #nim
19:37:48*ltriant quit (Ping timeout: 252 seconds)
19:44:39*ltriant joined #nim
19:49:23*ltriant quit (Ping timeout: 264 seconds)
19:56:12*ltriant joined #nim
19:56:53*arkurious joined #nim
19:56:58*LuxuryMode quit (Quit: Connection closed for inactivity)
19:57:36FromDiscord<ShalokShalom> In reply to @PMunch "Well we haven't really": Mainly in #off-topic
19:57:44FromDiscord<ShalokShalom> People were already complaining.
19:57:53FromDiscord<ShalokShalom> It kinda took over the channel
19:59:31FromDiscord<leetnewb> off-topic has been a wild ride lately anyhow :p
19:59:55FromDiscord<pmunch> Oh, I must've missed it. I'll look into creating a channel, would probably be useful to know how to do at some point anyways
20:01:06*ltriant quit (Ping timeout: 256 seconds)
20:05:21*kenran joined #nim
20:05:35*kenran quit (Remote host closed the connection)
20:07:48*ltriant joined #nim
20:12:42*ltriant quit (Ping timeout: 268 seconds)
20:15:33FromDiscord<Horizon [She/Her]> I'm wrapping a library and it has an enum called `Public` and `Private`, is it better to treat it as an enum or as a distinct boolean?
20:17:38FromDiscord<jmgomez> In reply to @Event Horizon "I'm wrapping a library": some people will say it's better to dont use enums, we do use them in NUE
20:19:22*ltriant joined #nim
20:20:30FromDiscord<Horizon [She/Her]> Fair
20:22:07FromDiscord<Gumbercules> In reply to @jmgomez "some people will say": Enums can't have holes and their size doesn't align with C
20:22:24FromDiscord<Gumbercules> But you can also specify the size for a Nim enum
20:22:34FromDiscord<Gumbercules> Can't do anything about the holey situation
20:22:47*stutonk joined #nim
20:23:04*junaid_ quit (Remote host closed the connection)
20:23:38stutonkWhat, exactly, does 'nimble install' do? Does it just relocate files to the ~/.nimble directory?
20:23:48FromDiscord<Gumbercules> In reply to @PMunch "Well we haven't really": It's been in #main #offtopic #gamedev the forums, reddit, and probably elsewhere
20:23:59FromDiscord<jmgomez> yeah, I know this is how we bind them https://github.com/jmgomez/NimForUE/blob/master/src/nimforue/unreal/coreuobject/uobjectflags.nim
20:24:25*ltriant quit (Ping timeout: 268 seconds)
20:24:26FromDiscord<jmgomez> There is a helpful macro there that plug in some operators @Horizon [She/Her] feel free to steal it if you want 🙂
20:26:22FromDiscord<Gumbercules> It's not that it's annoying to talk about AI or the mods but most posts / messages are just screenshots of questions people ask and the response chatgpt gives. I guess some folks might be interested in seeing it produce Nim code or erotic stories involving Nim, but the code is generally wrong and the erotic stories about Nim are, well...
20:26:38FromDiscord<Gumbercules> (edit) "mods" => "models"
20:26:41FromDiscord<jmgomez> I think there is a way to bind types with non default public constructor, Im trying nodecl and also to use the contructor pragma for a valid constructor but it keeps adding the declarations (and therefore calling the constructor). Any idea?
20:27:12FromDiscord<PMunch> Oh wow, I apparently haven't been paying attention at all
20:27:26FromDiscord<PMunch> Or this all happens while I'm sleeping..
20:27:58FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4iat
20:28:01FromDiscord<jmgomez> without messign with emit if possible
20:28:14FromDiscord<Horizon [She/Her]> God damn it, Nim's VSC extension keeps giving a "can't find Nim binary" despise it being on path
20:29:22FromDiscord<Horizon [She/Her]> On ArcoLinux if anyone else knows the solution
20:29:23FromDiscord<Gumbercules> In reply to @PMunch "Or this all happens": The most interesting thing has been treeforms site / service and their use of it to generate game assets, but even that is barely tangential to Nim
20:29:39FromDiscord<Gumbercules> Only because they used Nim to build the site really
20:30:57*ltriant joined #nim
20:34:14*stutonk quit (Quit: Client closed)
20:35:40*ltriant quit (Ping timeout: 256 seconds)
20:42:28*ltriant joined #nim
20:43:57NimEventerNew post on r/nim by scemino: Need help on my game engine, see https://reddit.com/r/nim/comments/zh864e/need_help_on_my_game_engine/
20:47:06*ltriant quit (Ping timeout: 252 seconds)
20:54:02*ltriant joined #nim
20:59:09*ltriant quit (Ping timeout: 260 seconds)
20:59:49*ltriant joined #nim
21:00:02*neceve quit (Quit: ZNC - https://znc.in)
21:03:52*neceve joined #nim
21:04:02*neceve quit (Remote host closed the connection)
21:04:34*ltriant quit (Ping timeout: 256 seconds)
21:06:39*neceve joined #nim
21:07:02*neceve quit (Remote host closed the connection)
21:11:26*ltriant joined #nim
21:15:57FromDiscord<ShalokShalom> In reply to @PMunch "Or this all happens": Or this happens to be regulated by some AI, so that you as a mod doesn't recognize any of it
21:16:14FromDiscord<ShalokShalom> https://tenor.com/view/pepe-iasip-charlie-conspiracy-gif-11562330
21:16:16FromDiscord<ShalokShalom> Its all a conspiracy
21:16:26*ltriant quit (Ping timeout: 265 seconds)
21:21:14FromDiscord<ShalokShalom> In reply to @Event Horizon "God damn it, Nim's": Have you tried turning it off and on again? 😛
21:21:22FromDiscord<Horizon [She/Her]> yes xD
21:21:23arkanoidhow can I add a "when available" switch("passC","-mavx2") into my config.nims?
21:23:01FromDiscord<Gumbercules> You can't really
21:23:16arkanoidwell, cat /proc/cpuinfo contains that
21:23:20arkanoidso I can?
21:23:22*ltriant joined #nim
21:23:27FromDiscord<Gumbercules> You have to parse that
21:23:42FromDiscord<Gumbercules> Nim can't detect CPU features like this at compile time
21:23:57FromDiscord<Gumbercules> Notice how there are no simd libs for Nim that do this
21:24:36FromDiscord<Gumbercules> You might be able to use a C/C++ lib and use libffi for compile time ffi
21:25:21FromDiscord<ShalokShalom> @Gumbercules do you mean https://theartbutton.ai/ with treeforms website?
21:25:27FromDiscord<Gumbercules> Yes
21:25:32FromDiscord<ShalokShalom> Since I think, that one is not from him
21:25:42FromDiscord<Gumbercules> I'm pretty sure it is
21:25:53FromDiscord<Gumbercules> They posted about it on the forums
21:26:21FromDiscord<demotomohiro> `-march=native` gcc option automatically use avx2 instructions if possile when your build machine's CPU support it.
21:26:43*neceve joined #nim
21:27:02*neceve quit (Remote host closed the connection)
21:27:06FromDiscord<ShalokShalom> Hnn, I think you are correct
21:27:37FromDiscord<Gumbercules> There was some post the other day about how optimized compilers are bad about reloading values into registers when vectorizing
21:27:42FromDiscord<Gumbercules> On HN
21:27:53FromDiscord<Gumbercules> (edit) "optimized" => "optimizing"
21:28:24*ltriant quit (Ping timeout: 264 seconds)
21:28:24FromDiscord<Gumbercules> I'm doing my simd manually but it's work
21:28:48*ltriant joined #nim
21:28:51FromDiscord<Gumbercules> And I have no detection scheme figured out. I just assume my users can support sse2 atm
21:29:36FromDiscord<demotomohiro> If you don't like how compiler vectorize your code, you need to use intrinsic functions or inline asm to use simd instructions explicity.
21:30:30FromDiscord<Gumbercules> Yup
21:31:31FromDiscord<Gumbercules> https://lemire.me/blog/2022/12/06/optimizing-compilers-reload-vector-constants-needlessly/
21:31:40*neceve joined #nim
21:32:01*neceve quit (Remote host closed the connection)
21:33:28*ltriant quit (Ping timeout: 256 seconds)
21:38:51FromDiscord<Gumbercules> Not that this really matters
21:38:57FromDiscord<demotomohiro> @stutonk I think you can read the content of /proc/cpuinfo in `config.nim` with `const s = staticRead("/proc/cpuinfo")`. Then, parse the string and call switch("passC", "-mavx2") if avx2 is available.
21:39:20FromDiscord<demotomohiro> `config.nims`
21:39:23arkanoiddemotomohiro, thanks, I didn't know about march=native
21:39:43FromDiscord<Gumbercules> Yeah I've seen someone do what demo is describing
21:39:51arkanoidwhat's the advantage of parsing cpuinfo isntead of using march=native?
21:40:16FromDiscord<Gumbercules> You can find out exactly what instruction sets are supported I guess
21:40:59FromDiscord<Gumbercules> And I'm not sure if every compiler offers that feature, if you're planning on supporting more than gxc
21:41:08FromDiscord<Gumbercules> (edit) "gxc" => "gcc"
21:41:37arkanoidI just need a process to run as fast as possible on a single machine
21:46:40*neceve joined #nim
21:47:01*neceve quit (Remote host closed the connection)
21:50:41*neceve joined #nim
21:51:02*neceve quit (Remote host closed the connection)
21:56:44FromDiscord<MetuMortis> Is there any way to install nim on github actions machine?
22:00:40*neceve joined #nim
22:20:25*wallabra joined #nim
22:20:31*wallabra quit (Remote host closed the connection)
22:20:58*wallabra joined #nim
22:23:13*wallabra quit (Client Quit)
22:23:44*wallabra joined #nim
22:26:58FromDiscord<Horizon [She/Her]> How would i overload the `to` method for my custom type?
22:27:24FromDiscord<Horizon [She/Her]> So when you do `to(jsonNode, MyType)`, it has custom functionality
22:28:25FromDiscord<Horizon [She/Her]> I'm going to implement multiple JSON serialisers and deserialisers, so just want to be able to get std/json work first
22:28:39FromDiscord<Elegantbeef> https://nim-lang.org/docs/jsonutils.html
22:28:47FromDiscord<Elegantbeef> The `std/json` package doesnt work with hooks
22:29:50FromDiscord<Horizon [She/Her]> Ah alright
22:38:17FromDiscord<Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4iaZ
22:38:32FromDiscord<Horizon [She/Her]> Example taken from here: https://nim-lang.org/docs/httpclient.html#AsyncHttpClient
22:39:16FromDiscord<Horizon [She/Her]> On Nim `1.6.10`
22:45:30*jmdaemon joined #nim
22:48:49*Phytolizer quit (Remote host closed the connection)
22:49:29*ltriant joined #nim
22:54:04*ltriant quit (Ping timeout: 260 seconds)
23:04:16FromDiscord<Horizon [She/Her]> Is there a way to do something like `getOptionalStr` if the value isn't present?
23:04:32FromDiscord<Horizon [She/Her]> Or does `some("")` default to empty?
23:04:41FromDiscord<Horizon [She/Her]> (`none`)
23:12:15FromDiscord<Horizon [She/Her]> Just made a wrapper proc
23:13:08FromDiscord<amadan> In reply to @Event Horizon "Nim doesn't seem to": Error message should be clearer↵But `multisync` requires you have a parameter like `Something | AsyncSomething` so that it knows when to call the sync vs async version
23:24:32FromDiscord<Horizon [She/Her]> Ah
23:26:09*ltriant joined #nim
23:30:49*ltriant quit (Ping timeout: 260 seconds)
23:36:11FromDiscord<ShalokShalom> https://youtu.be/WA1c_S6Zsu4
23:41:25FromDiscord<ShalokShalom> Pulsar Editor, successor of Atom
23:44:45*ltriant joined #nim
23:48:37*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
23:49:00*wallabra joined #nim