00:11:32 | FromDiscord | <Horizon [She/Her]> https://github.com/nim-lang/Nim/pull/21053 hopefully this PR will be backported to 1.6 :P |
00:11:50 | FromDiscord | <Elegantbeef> You can ask for it to be |
00:12:31 | FromDiscord | <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:45 | FromDiscord | <Gumbercules> In reply to @Event Horizon "https://github.com/nim-lang/Nim/pull/21053 hopefull": you can just patch until then |
00:13:53 | FromDiscord | <Gumbercules> or fix it locally if it's in the compiler |
00:14:04 | FromDiscord | <Horizon [She/Her]> Hm yeah I'll likely do that |
00:14:24 | FromDiscord | <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:44 | FromDiscord | <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:46 | FromDiscord | <voidwalker> It seems doing the .read() on the future raised the exception |
00:28:16 | FromDiscord | <voidwalker> So I guess I need a try in a for, not a for in a try |
00:28:25 | FromDiscord | <Yepoleb> In reply to @voidwalker "hm so if I": usually you await the futures themselves |
00:29:03 | FromDiscord | <voidwalker> I know that usually, I was just kind of surprised at this behaviour. Wish I'd understand all the inner workings |
00:30:05 | FromDiscord | <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:56 | FromDiscord | <voidwalker> yeah perhaps long term exceptions are not the best way to handle "expected" network behaviour like timeouts and domain resolve fails |
00:31:05 | FromDiscord | <voidwalker> (edit) "term" => "term," |
00:32:15 | FromDiscord | <Yepoleb> the await keyword basically just runs random tasks in the async loop until the one given is completed |
00:33:24 | FromDiscord | <voidwalker> Ohh that makes more sense if you put it like that : ) You should have written the async docs haha |
00:34:12 | FromDiscord | <voidwalker> so the simple assignment, futureVar = procThatReturnsFuture() puts the task on the async loop |
00:34:19 | FromDiscord | <voidwalker> (edit) "futureVar" => "`futureVar" | "procThatReturnsFuture()" => "procThatReturnsFuture()`" |
00:39:38 | FromDiscord | <Yepoleb> not sure about that 🙁 |
00:49:26 | FromDiscord | <Yepoleb> In reply to @voidwalker "so the simple assignment,": going by my intuition assignment is not enough to schedule a task |
00:51:06 | arkanoid | I find myself often fighting the hinter saying that I have unused imports, but it doesn't compile if I remove them |
00:51:20 | arkanoid | I mean remove the imports, not remove the hints |
00:52:30 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6K |
00:52:51 | FromDiscord | <Elegantbeef> Yea `sleepAsync` gives up the cpu |
00:54:26 | FromDiscord | <Yepoleb> sleepAsync is a bad hack if you don't really need to sleep |
00:54:34 | FromDiscord | <Elegantbeef> indeed |
00:54:48 | FromDiscord | <voidwalker> well it's not the sleepAsync that does it, but the await itself ? |
00:55:16 | FromDiscord | <Elegantbeef> the `sleepAsync` says "here's the cpu for at least 10s" so all other queue async processes can be worked on |
00:55:32 | FromDiscord | <Yepoleb> yes, any await pauses the current procedure to let the async scheduler do its job |
00:56:14 | FromDiscord | <Elegantbeef> the 'correct' thing would be to use `all` or to await the specific future |
00:56:24 | FromDiscord | <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:55 | FromDiscord | <Yepoleb> but you might be wasting time |
00:56:58 | FromDiscord | <voidwalker> @ElegantBeef if I use all, and one of the procs excepts, the whole thing fails |
00:57:04 | FromDiscord | <Yepoleb> it's better to wait for the task you actually care about |
00:57:22 | FromDiscord | <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:26 | FromDiscord | <Yepoleb> i think the easiest solution is to just await one future after the other in a for loop |
00:57:33 | FromDiscord | <Yepoleb> they will execute in parallel anyway |
00:57:46 | FromDiscord | <Elegantbeef> 'parallel' |
00:58:32 | FromDiscord | <voidwalker> yes that's what I first did, but I did it like `for each in allOfThem: result &= await each()` |
00:58:47 | FromDiscord | <voidwalker> and this actually made the program wait for each of them to complete before starting the other |
00:58:48 | FromDiscord | <Yepoleb> did that not work? |
00:58:50 | FromDiscord | <voidwalker> no |
00:59:16 | FromDiscord | <voidwalker> so that's why I need the seq[Future[]], add Future proc tasks to it, and then run the await |
00:59:25 | FromDiscord | <voidwalker> or maybe it can be done in some other way and I don't know |
01:00:21 | FromDiscord | <Yepoleb> oh, i get it |
01:00:26 | FromDiscord | <voidwalker> I couldn't find any sample code that does "run n same type of tasks concurrently and then combine their results" |
01:01:28 | FromDiscord | <Yepoleb> In reply to @voidwalker "yes that's what I": was `allOfThem` a seq of futures? |
01:01:38 | FromDiscord | <Yepoleb> or what else was it |
01:02:25 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6M |
01:02:34 | FromDiscord | <voidwalker> well, should have been &=, whatever |
01:02:38 | FromDiscord | <Yepoleb> okay |
01:02:43 | FromDiscord | <voidwalker> this blocked each request |
01:03:08 | FromDiscord | <Yepoleb> yes, because you awaited the result of one `httpTrackerAnnounce` before calling the next |
01:03:23 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6O |
01:03:34 | FromDiscord | <Yepoleb> if you do one loop first calling them all and another loop to await them it should work as intended |
01:03:48 | FromDiscord | <Yepoleb> without any special magic |
01:04:05 | FromDiscord | <voidwalker> yep, that's the plan : ) brb |
01:05:54 | FromDiscord | <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:12 | FromDiscord | <voidwalker> (edit) "the" => "a" | "future" => "some futures" | "the exception." => " exceptions." |
01:06:33 | FromDiscord | <voidwalker> (edit) "uncertainty." => "uncertainty state." |
01:23:35 | * | neceve quit (Ping timeout: 268 seconds) |
01:25:28 | * | neceve joined #nim |
01:25:57 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6T |
01:26:23 | FromDiscord | <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:39 | FromDiscord | <voidwalker> I put an echo in the TrackerAnnounce proc, for debug, and this is the output: |
01:26:59 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4i6U |
01:27:56 | FromDiscord | <voidwalker> so it seems they begin executing immediately after being assigned to the future sequence |
01:28:51 | FromDiscord | <voidwalker> which makes me wonder if the code couldn't be simplified somehow to not use two loops ? |
01:33:40 | FromDiscord | <Yepoleb> Knowing when and how tasks get scheduled is hard without looking up the implementation details |
01:34:32 | FromDiscord | <voidwalker> lol really, I mean shouldn't these things be obvious from the docs ? : ) |
01:34:47 | FromDiscord | <voidwalker> maybe they are and I am just too stupid |
01:35:04 | FromDiscord | <voidwalker> anyway here is how it goes |
01:35:04 | FromDiscord | <voidwalker> https://media.discordapp.net/attachments/371759389889003532/1050586346458206230/simplescreenrecorder-2022-12-09_03.33.24.mkv |
01:35:05 | FromDiscord | <Yepoleb> I have most of my knowledge from python async where this is done a bit differently |
01:35:21 | FromDiscord | <voidwalker> hm don't know how to embed video |
01:36:06 | FromDiscord | <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:21 | FromDiscord | <Rika> actually no thats wrong |
01:37:00 | FromDiscord | <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:12 | FromDiscord | <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:48 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4i6W |
01:38:52 | FromDiscord | <Yepoleb> In reply to @Rika "futures run as soon": Other async implementations require explicit scheduling, that's why i was confused |
01:39:26 | FromDiscord | <voidwalker> that sort of makes sense |
01:39:49 | FromDiscord | <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:59 | FromDiscord | <voidwalker> that's exactly what I want to do |
01:40:15 | FromDiscord | <Yepoleb> 😐 |
01:41:04 | FromDiscord | <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:25 | FromDiscord | <voidwalker> we need a mapIt that handles exceptions 😄 |
01:41:49 | FromDiscord | <Yepoleb> Yes, let's hide all the control flow |
01:42:58 | FromDiscord | <Rika> if you want to simulate python, you can put an `await sleepAsync(0)` at the start |
01:43:11 | FromDiscord | <Rika> i think thats how python async would work |
01:43:54 | NimEventer | New thread by TyroneClide: Set Length Seq, see https://forum.nim-lang.org/t/9706 |
01:46:15 | FromDiscord | <voidwalker> @Rika thanks for the clear explanation. So I guess `sleepAsync(10)` can also mean "allocate 10ms to run async code" |
01:46:29 | FromDiscord | <voidwalker> (edit) "`sleepAsync(10)`" => "`await sleepAsync(10)`" |
01:47:03 | FromDiscord | <voidwalker> but what about sleepAsync(0), what meaning would that have, since nothing can run in 0ms : ) |
01:48:09 | FromDiscord | <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:39 | FromDiscord | <Rika> In reply to @voidwalker "<@259277943275126785> thanks for the": kinda yeah not really, "allocate at least 10 ms to run async code" |
01:54:53 | FromDiscord | <Rika> so it can take longer depending on the gap between awaits in one async task |
01:55:05 | FromDiscord | <Rika> In reply to @voidwalker "but the sleep timer": yes |
01:55:49 | FromDiscord | <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:01 | FromDiscord | <Rika> tfw cooperative multitasking |
01:56:04 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4i75 |
01:56:12 | FromDiscord | <Rika> In reply to @not logged in "Why is this happening?": what is indent's declaration |
01:56:46 | FromDiscord | <! Nilts> In reply to @Rika "what is indent's declaration": `var indent = 0` |
01:56:51 | FromDiscord | <Rika> remove the |
01:56:53 | FromDiscord | <Rika> wait |
01:56:56 | FromDiscord | <Rika> why the |
01:56:59 | FromDiscord | <Rika> is it global |
01:57:07 | FromDiscord | <Rika> where is it declared more specifiaclly |
01:57:22 | FromDiscord | <Rika> prolly better to just show whole code |
01:57:27 | FromDiscord | <Rika> brb again lol |
01:57:48 | FromDiscord | <! Nilts> In reply to @Rika "why the *": because it's in a module and needs to be shared? |
01:58:17 | FromDiscord | <Rika> yes my mind is just running too quick rn |
01:58:37 | FromDiscord | <! Nilts> sooo? |
01:58:41 | FromDiscord | <! Nilts> what now |
01:59:16 | FromDiscord | <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:37 | FromDiscord | <Rika> In reply to @not logged in "what now": post code |
01:59:43 | FromDiscord | <Rika> hard to understand the context |
01:59:45 | FromDiscord | <Rika> (edit) "hard to understand the context ... " added "without" |
02:00:45 | FromDiscord | <! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4i79 |
02:02:37 | FromDiscord | <! Nilts> im stupid, i don't even need it, but i still want to know the issue |
02:07:26 | FromDiscord | <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:54 | FromDiscord | <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:43 | FromDiscord | <voidwalker> how does `await sleepAsync(timeout)` differ from `poll(timeout)` ? |
02:16:23 | arkanoid | I 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:42 | FromDiscord | <Yepoleb> Poll waits only waits for completion events but does not process them while sleepasync also continues execution. |
02:16:53 | FromDiscord | <Elegantbeef> By definition of using `cast` it's "not safe" 😄 |
02:17:13 | FromDiscord | <Elegantbeef> It shouldnt be UB though if that's what you mean |
02:17:27 | FromDiscord | <Yepoleb> But don't abuse sleepasync for running tasks with unknown runtime! |
02:17:39 | FromDiscord | <Elegantbeef> Though i'd say "tag the object {.packed.}" just to ensure you dont get fucky data |
02:17:40 | FromDiscord | <voidwalker> would you do `cast` in code that drives space rockets hmm |
02:18:01 | FromDiscord | <Elegantbeef> Cast is safe if you know what you're doing |
02:19:00 | FromDiscord | <Yepoleb> Two definitions of safe are colliding here |
02:19:44 | FromDiscord | <Elegantbeef> Well there's what Nim considers safe and what is actually safe |
02:19:55 | arkanoid | ElegantBeef, 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:59 | NimEventer | New thread by RodSteward: Return value for joinThread?, see https://forum.nim-lang.org/t/9707 |
02:21:16 | FromDiscord | <Elegantbeef> `static: assert sizeof(ColorRgba) == 4` 😄 |
02:22:07 | FromDiscord | <Elegantbeef> `copyMem` might be the way to go then |
02:22:45 | FromDiscord | <Elegantbeef> You technically can do `cast[ptr uint32](myColor.addr)[]` but it can cause aliasing issues |
02:23:40 | arkanoid | ElegantBeef, 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:30 | arkanoid | never used copymem, let me check the docs |
02:25:12 | arkanoid | isn't the lack of "packed" a problem for copyMem, too? |
02:25:53 | FromDiscord | <Elegantbeef> Well unlikely it'll cause an issue but kinda |
02:26:31 | FromDiscord | <Elegantbeef> You do know that data type you're using is premultiplied right? |
02:26:48 | arkanoid | and? |
02:27:17 | arkanoid | don't really know what it means, I know I need to store a value larger than 255 for each pixel |
02:27:18 | FromDiscord | <Elegantbeef> It means that the rgb values are used with the alpha value |
02:27:48 | FromDiscord | <Elegantbeef> A colour with rgba of `255, 255, 255, 127` will not be the same inside ColorRGBX afaik |
02:28:00 | FromDiscord | <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:04 | arkanoid | I 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:07 | FromDiscord | <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:08 | FromDiscord | <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:35 | FromDiscord | <Yepoleb> This is such a common optimization, just do the dumb thing and let the compiler figure it out for you |
02:31:06 | FromDiscord | <Yepoleb> Works always, no need to worry about implementation specifics |
02:34:04 | FromDiscord | <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:24 | FromDiscord | <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:50 | FromDiscord | <voidwalker> https://github.com/nim-lang/Nim/issues/14810 2.5 years 😦 what are they doing |
02:43:58 | FromDiscord | <Elegantbeef> Talking about hacks instead of making sensible APIs |
02:43:58 | FromDiscord | <Elegantbeef> 😄 |
02:45:31 | FromDiscord | <voidwalker> This is the second time I put #todo, leave it ugly like this until nim fixes their shit in githubURL |
02:45:59 | FromDiscord | <voidwalker> ah, right, let's check on the first one : ) |
02:47:20 | FromDiscord | <voidwalker> https://github.com/nim-lang/Nim/issues/19782 - hm nope. fix is there since may 17 :[ |
02:49:35 | FromDiscord | <Elegantbeef> 'prs welcome' |
02:57:55 | FromDiscord | <Yepoleb> In reply to @voidwalker "Well, some good practical": There is simply not enough text to explain it properly. |
02:58:11 | FromDiscord | <voidwalker> in the nim docs? sure |
02:58:34 | FromDiscord | <voidwalker> maybe if you are already super familiar with the concepts |
02:58:47 | FromDiscord | <Yepoleb> The documentation is only useful for people who already understand all the concepts |
02:59:01 | FromDiscord | <Yepoleb> And even then it's hard |
03:24:09 | NimEventer | New 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:49 | arkanoid | I've solved by shl, shr and those old school stuff |
03:50:41 | FromDiscord | <albassort> opinions on printf formatting |
03:50:49 | FromDiscord | <albassort> i didn't like it at first but i started liking it the more i use it |
03:51:30 | FromDiscord | <albassort> i think the typing is a bit needless and archaic though |
03:51:46 | arkanoid | Yepoleb: something like this passes my test https://wandbox.org/permlink/60PTXsVTRxSEGzRC is there a better way? |
03:52:01 | arkanoid | never 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:15 | FromDiscord | <Gumbercules> In reply to @arkanoid "<@144300201857777664>: something like this": no not really |
06:58:08 | FromDiscord | <Gumbercules> it's twiddling btw |
06:58:24 | FromDiscord | <Gumbercules> https://graphics.stanford.edu/~seander/bithacks.html |
06:58:28 | FromDiscord | <Gumbercules> fun page |
06:59:36 | FromDiscord | <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:54 | FromDiscord | <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:43 | FromDiscord | <ShalokShalom> In reply to @NimEventer "New thread by linwaytin:": @Emanresu3 See, they are loving your package 🥳 |
07:49:03 | * | PMunch joined #nim |
07:50:09 | FromDiscord | <ShalokShalom> (edit) "@Emanresu3" => "Emanresu3" |
07:51:41 | FromDiscord | <planetis> Is there a performance penalty of enabling -fno-strict-aliasing for nim code? |
07:53:23 | FromDiscord | <Elegantbeef> It's on by default afaik↵(@planetis) |
07:53:48 | FromDiscord | <Slava0135> how can i cast (int8, int8) to int16 |
07:55:41 | FromDiscord | <planetis> yep seems so, for gcc at least. thanks beef |
07:56:37 | FromDiscord | <planetis> don't see it in the cached files with clang |
07:57:15 | FromDiscord | <Elegantbeef> scroll up slava |
08:00:05 | * | m5zs7k joined #nim |
08:00:29 | FromDiscord | <Slava0135> nim why https://media.discordapp.net/attachments/371759389889003532/1050683337213218826/image.png |
08:00:49 | FromDiscord | <Elegantbeef> Why what? |
08:01:27 | FromDiscord | <Slava0135> 1 shl 4 == 4 |
08:01:38 | Amun-Ra | since when 0x10 is 4? |
08:01:47 | FromDiscord | <planetis> its 2 |
08:01:52 | FromDiscord | <Slava0135> oh i am dumb then |
08:01:58 | FromDiscord | <planetis> sorry 16 |
08:02:04 | FromDiscord | <Elegantbeef> `0x` is hex |
08:02:09 | FromDiscord | <Slava0135> yes yes |
08:02:09 | FromDiscord | <Elegantbeef> `0b` is binary |
08:02:18 | Amun-Ra | 0b10 is still not 4 ;) |
08:02:40 | FromDiscord | <Elegantbeef> Oh i know |
08:02:48 | FromDiscord | <Elegantbeef> I just was pointing where i think the hookup was |
08:02:55 | FromDiscord | <Slava0135> in some language 1 << 4 == 4 but i don't remember which |
08:02:58 | Amun-Ra | I know :> |
08:03:10 | FromDiscord | <Elegantbeef> That's just wrong |
08:03:26 | FromDiscord | <Elegantbeef> 1 shl 4 should equal 2^4 |
08:15:25 | PMunch | @Slava0135, what?! In what language would 1 << 4 == 4? That's just mathematically incorrect |
08:15:40 | PMunch | Unless they use << as some other operator than left shift |
08:16:29 | FromDiscord | <Elegantbeef> `<<` is just `^` right?! 😄 |
08:20:07 | Amun-Ra | but no ^ as in ** ;) |
08:25:06 | FromDiscord | <Rika> In reply to @PMunch "<@439814569972727818>, what?! In what": It is if you’re somehow using half bits or something lmao |
08:25:43 | PMunch | Haha, sure |
08:26:58 | Amun-Ra | or base 4 |
08:29:53 | FromDiscord | <Rika> Base four would have 1 << 1 == 4 base 10 |
08:30:42 | FromDiscord | <Elegantbeef> It'd have to be base 1/4 😄 |
08:41:51 | Amun-Ra | and what about analog cpus? ;> |
08:49:25 | FromDiscord | <albassort> can i make enums non-case sensitive |
08:49:34 | FromDiscord | <albassort> this is user facing .-. |
08:50:29 | * | kenran joined #nim |
08:50:39 | FromDiscord | <Elegantbeef> Make an alias that starts with the alternative verrsion |
08:51:31 | PMunch | (Or write a macro which does that automatically) |
08:51:56 | FromDiscord | <albassort> it would be easier to write a magic |
08:51:57 | * | kenran quit (Remote host closed the connection) |
08:52:14 | FromDiscord | <albassort> or maybe implement my own parseEnum( |
08:52:17 | FromDiscord | <albassort> (edit) "parseEnum(" => "parseEnum?" |
08:52:51 | PMunch | Or just uppercase the enum before you parseEnum it |
08:53:07 | FromDiscord | <albassort> cant because not my code |
08:53:11 | FromDiscord | <albassort> #not my code! |
08:53:26 | FromDiscord | <albassort> (edit) "#not my code!" => "notmycode!" |
08:53:30 | PMunch | But you can import your own parseEnum? |
08:53:39 | FromDiscord | <albassort> (edit) "notmycode!" => "#notmycode!" |
08:53:46 | FromDiscord | <albassort> that was a short sighted nonsensical statement |
08:53:52 | FromDiscord | <albassort> no i cant |
08:54:53 | PMunch | What is this code? Why can't you edit it? |
08:55:34 | FromDiscord | <albassort> nimyaml |
08:56:48 | FromDiscord | <Elegantbeef> You do realise it has custom serialization support? |
08:57:07 | FromDiscord | <Elegantbeef> https://nimyaml.org/serialization.html#customize-serialization |
08:57:26 | FromDiscord | <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:12 | NimEventer | New 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:12 | FromDiscord | <albassort> is it a good idea to define procedures in one file, and then define globals in another, |
09:31:25 | FromDiscord | <albassort> sent a long message, see http://ix.io/4i85 |
09:31:34 | FromDiscord | <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:34 | FromDiscord | <albassort> (edit) "http://ix.io/4i85" => "http://ix.io/4i86" |
09:33:14 | FromDiscord | <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:21 | FromDiscord | <voidwalker> any ideas ? |
09:36:02 | FromDiscord | <Elegantbeef> Templates are hygenic |
09:36:09 | FromDiscord | <Elegantbeef> `let resp {.inject.}` |
09:38:36 | FromDiscord | <voidwalker> wonderful : ) |
09:38:51 | FromDiscord | <voidwalker> what a funny word to use, hygienic |
09:41:36 | FromDiscord | <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:05 | FromDiscord | <voidwalker> wow, my first template : ) |
09:50:38 | FromDiscord | <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:46 | arkanoid | if there any performance difference in doing let a = 50.float32 or let a = 50f32 ? |
10:44:32 | FromDiscord | <Bung> one has proc call other dont |
11:00:25 | * | ltriant quit (Ping timeout: 260 seconds) |
11:18:54 | * | estiquelapice quit () |
11:29:43 | arkanoid | Bung: thanks |
11:30:38 | arkanoid | does it apply even when converting to distinct of same type? eg myInt.myDistinctInt |
11:46:24 | * | estiquelapice joined #nim |
11:51:08 | arkanoid | curiosity: 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:38 | FromDiscord | <Yepoleb> Both are very unlikely to have a performance penalty |
11:52:13 | FromDiscord | <Yepoleb> Because compiler optimization again |
11:52:28 | arkanoid | great |
11:52:44 | FromDiscord | <Yepoleb> Don't worry about such tiny details, they won't matter in the long run |
11:54:28 | FromDiscord | <Rika> In reply to @Yepoleb "Don't worry about such": It can matter for embedded contexts which I see Arkanoid in often |
11:54:59 | arkanoid | Yepoleb, 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:30 | arkanoid | Rika, 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:25 | PMunch | Hmm, 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:01 | arkanoid | how to copy a TableRef? |
12:06:08 | arkanoid | shallow copy |
12:06:18 | PMunch | Hmm, tried to run expandMacro and got a `Error: unhandled exception: value out of range: 36320 notin -32768 .. 32767 [RangeDefect]` |
12:06:37 | PMunch | arkanoid, `let x = myTable`? |
12:07:16 | arkanoid | PMunch: that would work if Table, not TableRef. Or not? |
12:07:34 | arkanoid | Table = value semantics, TableRef, the other way |
12:07:41 | * | neceve joined #nim |
12:08:02 | * | neceve quit (Remote host closed the connection) |
12:08:03 | arkanoid | I 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:06 | PMunch | arkanoid, well a shallow copy of a TableRef is a copy of the ref |
12:25:10 | PMunch | Which is what that would do |
12:25:28 | PMunch | But I guess you want to copy one the Table, but not the data in the table? |
12:26:03 | PMunch | Then you'd need a `Table[SomeType, ref DataType]` and it doesn't have to be a TableRef |
12:26:27 | FromDiscord | <Yepoleb> In reply to @arkanoid "<@144300201857777664>, usually I don't": You can use godbolt compiler explorer to figure out where to optimize |
12:27:56 | arkanoid | Yepoleb: thanks! didn't know about this instrument |
12:27:57 | FromDiscord | <Yepoleb> Can't you just dereference the tableref and assign it to an empty tableref? |
12:28:29 | * | ltriant joined #nim |
12:29:18 | PMunch | Hmm, not entirely sure what kind of data structure Table uses under the hood |
12:29:36 | PMunch | But as long as it's a reference type of some sort then I guess that should work |
12:31:50 | PMunch | Hmm, 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:34 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=4i8v |
12:41:49 | FromDiscord | <ambient> and how do I build a set of tuples in a easy way, say like (5,0), (-1,-1) etc |
12:42:46 | FromDiscord | <Rika> Set as in? |
12:42:57 | FromDiscord | <Rika> {} this kind? You need to use hash sets instead |
12:43:20 | FromDiscord | <Rika> https://nim-lang.org/docs/sets.html |
12:43:34 | FromDiscord | <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:22 | FromDiscord | <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:54 | PMunch | I 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:57 | PMunch | Hmm, 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:45 | FromDiscord | <nocturn9x> SO |
13:02:47 | FromDiscord | <nocturn9x> (edit) "SO" => "So" |
13:02:53 | FromDiscord | <nocturn9x> Nim has great C FFI |
13:02:59 | FromDiscord | <nocturn9x> but does it have a working Nim FFI too? |
13:03:11 | FromDiscord | <nocturn9x> I need to compile two pieces of code with different options and still join them into a final executable |
13:03:45 | FromDiscord | <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:57 | FromDiscord | <answer> sent a code paste, see https://play.nim-lang.org/#ix=4i8I |
13:32:55 | Zevv | PMunch: 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:22 | PMunch | Thanks for the extremely fast response :) |
13:42:34 | * | ltriant quit (Ping timeout: 256 seconds) |
14:00:42 | * | Phytolizer joined #nim |
14:07:58 | FromDiscord | <Rika> In reply to @answer "is there anything equivalent": No, enums are used for that case |
14:08:34 | FromDiscord | <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:41 | FromDiscord | <nocturn9x> not really |
14:13:22 | FromDiscord | <MetuMortis> In reply to @answer "is there anything equivalent": you look like a TS dev :d |
14:13:58 | FromDiscord | <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:57 | FromDiscord | <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:29 | FromDiscord | <Yepoleb> I'd try to link the modules normally because it's unlikely there is no way to do it |
14:22:34 | FromDiscord | <Rika> In reply to @MetuMortis "you look like a": So? |
14:23:23 | FromDiscord | <Gumbercules> In reply to @albassort "is it a good": It doesn't really matter. Nim performs dead code elimination |
14:25:01 | FromDiscord | <nocturn9x> In reply to @Yepoleb "But it's hard to": well |
14:25:06 | FromDiscord | <nocturn9x> I need one piece not to rely on nim's GC |
14:25:12 | FromDiscord | <nocturn9x> while the rest of it needs it |
14:25:42 | FromDiscord | <Gumbercules> What are you trying to do? |
14:25:43 | FromDiscord | <nocturn9x> I tried using the stuff nim provides to disable the GC in critical paths |
14:25:46 | FromDiscord | <nocturn9x> but they seem to do nothing |
14:25:53 | FromDiscord | <nocturn9x> In reply to @Gumbercules "What are you trying": I'm writing a compiler and bytecode VM |
14:26:06 | FromDiscord | <nocturn9x> several thousands lines of code in the compiler definitely need the GC |
14:26:11 | FromDiscord | <nocturn9x> but the VM needs as little interference as possible |
14:26:19 | FromDiscord | <nocturn9x> which is why I wrote my own tiny M&S GC |
14:26:44 | FromDiscord | <Gumbercules> You know you're not going to be able to use most of the standard lib sans gc right? |
14:26:56 | FromDiscord | <Gumbercules> No Nim strings or seqs |
14:27:03 | FromDiscord | <nocturn9x> that's the idea yeah |
14:27:05 | FromDiscord | <Gumbercules> Or anything using then |
14:27:06 | FromDiscord | <Gumbercules> Okay |
14:27:08 | FromDiscord | <nocturn9x> I have my own `ptr Stuff` |
14:27:14 | FromDiscord | <nocturn9x> or I use simple `object`s |
14:27:18 | FromDiscord | <nocturn9x> no refs, no stdlib, etc. |
14:27:47 | FromDiscord | <Gumbercules> The no gc flag simply warns on heap usage |
14:28:05 | FromDiscord | <Gumbercules> Doesn't actually disable the gc or anything |
14:30:00 | FromDiscord | <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:47 | FromDiscord | <Gumbercules> I don't believe you can have them in the same compilation unit with different compilation options |
14:31:48 | FromDiscord | <nocturn9x> hm |
14:31:50 | FromDiscord | <nocturn9x> thanks for your help |
14:31:53 | FromDiscord | <nocturn9x> I'll see what I can do |
14:32:24 | FromDiscord | <Gumbercules> Maybe have a config that sets no gc and run the compiler twice |
14:33:03 | FromDiscord | <nocturn9x> doesn't sound too bad |
14:33:06 | FromDiscord | <Gumbercules> First time with compile only on the module which should avoid gc usage |
14:33:09 | FromDiscord | <nocturn9x> I might also have like |
14:33:16 | FromDiscord | <nocturn9x> the VM compiled as a separate executable |
14:33:19 | FromDiscord | <nocturn9x> and call it manually |
14:33:22 | FromDiscord | <nocturn9x> with command-line arguments |
14:33:32 | FromDiscord | <Gumbercules> Yeah that could work too |
14:33:45 | FromDiscord | <Gumbercules> Writing your own PL I take it? |
14:34:59 | FromDiscord | <nocturn9x> Yep |
14:35:07 | FromDiscord | <nocturn9x> I'm starting to write the C backend right now |
14:35:48 | FromDiscord | <Gumbercules> Awesome! Excited to see what you build!!! |
14:35:50 | FromDiscord | <scruz> hello, what are the major drawbacks of Nim in its current state? |
14:36:20 | FromDiscord | <Gumbercules> In reply to @scruz "hello, what are the": Pretty broad question.... |
14:36:35 | FromDiscord | <Gumbercules> What are you trying to do with it? |
14:36:54 | FromDiscord | <Gumbercules> App dev? Web dev? Embedded dev? |
14:37:07 | FromDiscord | <scruz> embedded dev mostly |
14:37:25 | FromDiscord | <Gumbercules> I mean Nim has that whole better C going |
14:37:38 | FromDiscord | <scruz> Nim + Python |
14:37:45 | FromDiscord | <Phil> You'll need a chat with generic |
14:37:53 | FromDiscord | <Gumbercules> Circular dependencies get annoying |
14:38:08 | FromDiscord | <Gumbercules> Esp in larger projects |
14:38:17 | FromDiscord | <Phil> And or pmunch/girvo |
14:38:42 | FromDiscord | <Gumbercules> You end up having to stuff all your type defs in a single module |
14:39:16 | FromDiscord | <Gumbercules> Compiler is slow if you need to compile a lot of importc'd code |
14:40:05 | FromDiscord | <Gumbercules> No great IDE support, if you like using IDEs |
14:40:14 | FromDiscord | <Gumbercules> Tooling continues to be bleh |
14:41:16 | FromDiscord | <Gumbercules> Other than that... I don't know I'm sure I'm missing things |
14:42:05 | * | junaid_ joined #nim |
14:42:26 | FromDiscord | <Gumbercules> Might be a good question to ask on the forums |
14:44:10 | FromDiscord | <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:14 | FromDiscord | <Gumbercules> Yeah that too |
14:45:37 | FromDiscord | <Gumbercules> Good call Yepoleb, forgot that one |
14:47:02 | FromDiscord | <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:40 | FromDiscord | <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:51 | FromDiscord | <nocturn9x> That could also probably work I guess |
14:48:08 | FromDiscord | <Yepoleb> But having a libcompiler and a libvm is most likely the cleanest solution |
14:50:26 | FromDiscord | <nocturn9x> ye |
14:50:58 | PMunch | Huh? Someone needs to talk to me? |
14:51:15 | FromDiscord | <Rika> What’s your embedded experience in Nim |
14:51:15 | * | junaid_ quit (Remote host closed the connection) |
14:51:20 | FromDiscord | <Rika> Like what’s it like |
14:51:25 | FromDiscord | <Rika> Is basically what is asked of you |
14:51:43 | PMunch | Oh, I'd say it's pretty fantastic. But library support at the moment is the biggest drawback |
14:52:07 | PMunch | Nim simply doesn't have a large enough ecosystem on embedded platforms at the moment |
14:52:47 | PMunch | But 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:59 | FromDiscord | <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:09 | FromDiscord | <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:46 | FromDiscord | <Rika> The second makes a copy |
15:09:48 | PMunch | @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:59 | FromDiscord | <ambient> ok good to know |
15:12:14 | * | PMunch quit (Quit: Leaving) |
15:21:19 | FromDiscord | <nocturn9x> is there a way to avoid stuff like |
15:21:21 | FromDiscord | <nocturn9x> `import ../../../../../frontend/compiler/targets/bytecode/opcodes` |
15:21:27 | FromDiscord | <nocturn9x> it's truly awful |
15:21:44 | FromDiscord | <nocturn9x> can I tell nim to start lookups in the `src` directory every time |
15:21:55 | Amun-Ra | sure |
15:22:07 | FromDiscord | <nocturn9x> how? |
15:22:55 | Amun-Ra | for example: swietch "path", "src" (in config.nims) |
15:23:01 | * | ltriant joined #nim |
15:23:21 | Amun-Ra | that'll make src directory to be one of default path to look for |
15:23:58 | Amun-Ra | import frontend/compiler/foo will import src/frontenf/compiler/foo.nim, and so on |
15:24:25 | Amun-Ra | switch* |
15:28:32 | * | ltriant quit (Ping timeout: 256 seconds) |
15:32:16 | FromDiscord | <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:03 | FromDiscord | <Gumbercules> This is one reason I don't use nimble |
15:35:37 | * | ltriant joined #nim |
15:38:34 | FromDiscord | <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:11 | FromDiscord | <Gumbercules> I use git submodules and add paths to my `config.nims` file |
15:39:22 | FromDiscord | <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:49 | FromDiscord | <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:58 | FromDiscord | <Gumbercules> there are a few alternatives available |
15:40:03 | * | neceve quit (Remote host closed the connection) |
15:40:14 | FromDiscord | <Gumbercules> https://github.com/disruptek/nimph |
15:40:26 | * | ltriant quit (Ping timeout: 256 seconds) |
15:40:34 | FromDiscord | <Gumbercules> Nimble didn't even have lockfiles until a year or two ago |
15:40:48 | FromDiscord | <Gumbercules> (edit) "here" => "active here," |
15:40:58 | FromDiscord | <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:10 | FromDiscord | <Gumbercules> I don't blame you |
15:41:22 | FromDiscord | <Gumbercules> I wouldn't want to touch Nimble's source either |
15:41:40 | FromDiscord | <jtv> I think the docs for the nimscript file with Nimble are woefully poor too. So unclear. |
15:42:50 | FromDiscord | <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:43 | FromDiscord | <jtv> With better alternatives, I wonder why it's not a priority to replace it |
15:43:55 | FromDiscord | <Gumbercules> politics |
15:44:17 | FromDiscord | <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:27 | FromDiscord | <Gumbercules> not sure who is signing up for that work, if anyone, though |
15:45:19 | FromDiscord | <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:43 | FromDiscord | <Gumbercules> Yeah, docs are another long running issue... |
15:47:12 | * | ltriant joined #nim |
15:48:15 | FromDiscord | <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:09 | FromDiscord | <Gumbercules> Things have definitely improved over the years, but it's not sexy work so not many people sign up for it |
15:49:49 | FromDiscord | <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:17 | FromDiscord | <Gumbercules> Historically new features have taken priority over stabilization / tooling |
15:50:34 | FromDiscord | <jtv> Well, getting people paid to work on it can be changed 🙂 |
15:51:46 | * | ltriant quit (Ping timeout: 256 seconds) |
15:52:56 | FromDiscord | <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:59 | FromDiscord | <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:06 | FromDiscord | <Gumbercules> heh |
15:53:19 | FromDiscord | <Gumbercules> nimble does cache stuff - I wonder if that has to do anything with it |
15:53:26 | FromDiscord | <Gumbercules> it's been a while since I used nimble |
15:53:32 | FromDiscord | <Gumbercules> (edit) "I" => "I've" |
15:53:50 | FromDiscord | <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:12 | FromDiscord | <jtv> I don't even know who's really important besides Araq 🤷 |
15:56:04 | FromDiscord | <Gumbercules> I don't know anymore either - I know @ringabout is a major contributor lately |
15:56:14 | FromDiscord | <Gumbercules> not sure who else.... |
15:57:29 | FromDiscord | <Gumbercules> out of all the pictures of contribs on the repo's page - I believe only two are very active haha |
15:57:56 | FromDiscord | <jtv> Any clue why people have wandered off? |
15:58:04 | FromDiscord | <Gumbercules> everyone else is either long gone or slowed down contribs majorly |
15:58:11 | FromDiscord | <Gumbercules> mmm lots of reasons |
15:58:21 | FromDiscord | <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:47 | FromDiscord | <Gumbercules> frustration with the language and frustration with people / politics I'd say are the primary culprits |
15:58:50 | FromDiscord | <jtv> sent a code paste, see https://play.nim-lang.org/#ix=4i9o |
15:59:19 | FromDiscord | <jtv> It's seeing it now. I deleted all the cached info, but it still somehow doesn't compare to true? |
15:59:21 | FromDiscord | <Gumbercules> I've been here 7 years so it's tough to cover all the reasons people have left |
15:59:59 | FromDiscord | <jtv> Thanks, was def interested as to whether there were major high level reasons |
16:00:02 | FromDiscord | <Gumbercules> I left for a while too but recently came back into the fold |
16:00:23 | FromDiscord | <Gumbercules> Nim has changed quite a bit in those 7 years - we have completely new memory management systems |
16:00:30 | FromDiscord | <Gumbercules> or the language does rather |
16:01:18 | FromDiscord | <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:33 | FromDiscord | <Gumbercules> I suppose we'll see how the rollout of 2.0 goes |
16:02:23 | FromDiscord | <Gumbercules> looks like @juan_carlos has been doing quite a bit of work on Nim lately too |
16:02:37 | FromDiscord | <jtv> sent a long message, see http://ix.io/4i9r |
16:03:13 | FromDiscord | <Gumbercules> haha yeah Rust can be a pretty friction-filled experience |
16:03:22 | FromDiscord | <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:24 | FromDiscord | <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:44 | FromDiscord | <Gumbercules> yeah - I'd say don't let nimble define your experience |
16:03:57 | FromDiscord | <Gumbercules> Nimble has never been a great experience and it's why alternatives exist in the first place I guess |
16:03:59 | FromDiscord | <jtv> Yeah, again, neither excites me. I do have a lot of friends who are big on Zig |
16:04:04 | FromDiscord | <Gumbercules> Git submodules work very well for me |
16:04:26 | FromDiscord | <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:44 | FromDiscord | <Gumbercules> and the ability to author build scripts - Nimscript tasks work well for this |
16:05:13 | * | neceve joined #nim |
16:05:29 | FromDiscord | <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:30 | FromDiscord | <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:03 | FromDiscord | <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:10 | FromDiscord | <Gumbercules> maybe... |
16:06:18 | FromDiscord | <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:51 | FromDiscord | <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:57 | FromDiscord | <jtv> I've been surprised how much the template and macro systems can help actually improve readability |
16:07:15 | FromDiscord | <Gumbercules> https://sr.ht/~duangle/scopes/ has also been a bug in my ear over the years |
16:07:31 | FromDiscord | <jtv> But usability is also getting the answers you need, so the docs. |
16:07:33 | FromDiscord | <Gumbercules> but it has such a small community / is barely worked on - probably because it works and doesn't need much attention |
16:07:40 | FromDiscord | <jtv> And that's pretty bad |
16:08:42 | FromDiscord | <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:26 | FromDiscord | <Gumbercules> the live compiler thing is pretty sweet |
16:09:47 | FromDiscord | <Gumbercules> although with hot code reloading you can do something fairly similar with Nim |
16:10:04 | FromDiscord | <Gumbercules> (not Nim's HCR feature - I don't even think it works, but that also might be FUD) |
16:10:20 | FromDiscord | <Gumbercules> I just dlopen / dlclose |
16:12:30 | FromDiscord | <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:33 | FromDiscord | <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:38 | FromDiscord | <jtv> 🤯 |
16:12:52 | FromDiscord | <jtv> It's private for the moment |
16:12:59 | FromDiscord | <jtv> It's there, trust me 🙂 |
16:14:14 | FromDiscord | <jtv> Odd, the nimble file though is still the old nimble file. |
16:16:07 | * | ltriant joined #nim |
16:16:08 | FromDiscord | <ringabout> Well, you can probably copy the nimble file to a public repo to make a reproducible issue. |
16:16:27 | FromDiscord | <jtv> Actually, I'll just open it up, it's no big deal |
16:18:33 | FromDiscord | <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:17 | FromDiscord | <ringabout> That's weird, `nimble install https://github.com/crashappsec/con4m@#head` works. |
16:23:23 | FromDiscord | <ringabout> (edit) "weird," => "weird." |
16:24:21 | FromDiscord | <ringabout> In reply to @jtv "Done. Would def": https://github.com/crashappsec/con4m/blob/v0.2.1/con4m.nimble |
16:24:33 | FromDiscord | <ringabout> The version should be changed to 0.2.1 |
16:24:34 | FromDiscord | <jtv> Yeah I JUST noticed that |
16:24:43 | FromDiscord | <jtv> No, that's a very old file |
16:25:09 | FromDiscord | <jtv> Like very old |
16:25:20 | FromDiscord | <jtv> It is at the head though |
16:25:41 | FromDiscord | <jtv> And how the old one got overwritten WTF |
16:26:02 | FromDiscord | <jtv> Good thing I still have the new one on my other computer that hadn't pulled |
16:26:19 | FromDiscord | <jtv> Thanks for looking. |
16:26:50 | FromDiscord | <jtv> Still don't know how it happened tho, but thanks 🙂 |
16:26:56 | FromDiscord | <ringabout> No problem |
16:27:41 | * | ltriant joined #nim |
16:30:21 | FromDiscord | <jtv> No wait, the HEAD does have the right file |
16:30:26 | FromDiscord | <jtv> And that's the tagged version |
16:30:57 | FromDiscord | <jtv> So I'm clearly doing something wrong. |
16:32:05 | FromDiscord | <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:42 | FromDiscord | <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:44 | FromDiscord | <ringabout> As I said https://github.com/crashappsec/con4m/blob/3af365889379682f0a3d3e944cf195bd1d0c57df/con4m.nimble#L3 should be the same as the tagged version. |
16:35:13 | FromDiscord | <jtv> Yeah, I gotcha, I'm just trying to figure out how the tag is associated with something so old |
16:35:23 | FromDiscord | <ringabout> You can now change the version to 0.2.3 and tag it as v0.2.3 |
16:35:30 | FromDiscord | <jtv> I committed, merged, added the tag... |
16:35:55 | FromDiscord | <jtv> Yeah will delete and re-add the tag |
16:37:51 | FromDiscord | <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:38 | FromDiscord | <Gumbercules> I was talking about in the repo's landing page |
16:39:18 | * | ltriant joined #nim |
16:39:23 | FromDiscord | <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:34 | FromDiscord | <jtv> Thanks again, @ringabout I owe you one 🙂 |
16:39:37 | FromDiscord | <ShalokShalom> Yeah |
16:39:46 | FromDiscord | <ringabout> In reply to @jtv "Thanks again, <@658563905425244160> I": You are welcome |
16:39:50 | FromDiscord | <ShalokShalom> These are the ones, who have contributed in the last year |
16:39:54 | FromDiscord | <Gumbercules> yeah |
16:40:00 | FromDiscord | <Gumbercules> new blood |
16:40:32 | FromDiscord | <ShalokShalom> @jtvWelcome to the community 😄 |
16:40:46 | FromDiscord | <jtv> Thanks 🙂 |
16:41:05 | FromDiscord | <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:44 | FromDiscord | <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:35 | FromDiscord | <Gumbercules> No thanks |
17:17:39 | FromDiscord | <Gumbercules> You don't even have a Nim flavor and your advertising your product in the Nim discord |
17:17:47 | FromDiscord | <Gumbercules> hard fail |
17:17:56 | FromDiscord | <jtv> 🤣 |
17:18:24 | FromDiscord | <Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4i9H |
17:18:25 | FromDiscord | <Gumbercules> doesn't sound generic af at all! |
17:18:35 | * | ltriant quit (Ping timeout: 252 seconds) |
17:18:44 | FromDiscord | <Gumbercules> sounds like you spent a lot of time weighing the merits and characteristics of the C PL before you wrote that |
17:21:53 | FromDiscord | <Phil> In reply to @Alfa "Hi I created coffee": This is not about the nim programming language, use offtopic for this. |
17:22:34 | FromDiscord | <Alfa> In reply to @Isofruit "This is not about": Sure |
17:22:36 | FromDiscord | <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:49 | FromDiscord | <Horizon [She/Her]> Does std/json have a standard to serialise and unserialise a Nim object? |
17:46:44 | FromDiscord | <Horizon [She/Her]> Standard as in, a `to_json`/`from_json` method |
17:47:03 | FromDiscord | <Gumbercules> https://nim-lang.org/docs/json.html#overview-unmarshalling |
17:47:05 | FromDiscord | <Gumbercules> https://nim-lang.org/docs/json.html#creating-json |
17:47:12 | FromDiscord | <Gumbercules> btw it's traditionally serialize / deserialize and marshal / unmarshal |
17:47:40 | FromDiscord | <Require Support> try jsony if you want more control |
17:48:11 | FromDiscord | <Gumbercules> there are multiple thirdparty json libs - jsony isn't hte only one |
17:48:18 | FromDiscord | <Gumbercules> (edit) "hte" => "the" |
17:48:40 | * | ltriant joined #nim |
17:50:04 | FromDiscord | <Horizon [She/Her]> In reply to @Gumbercules "btw it's traditionally serialize": Ah neat! |
17:50:10 | FromDiscord | <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:27 | FromDiscord | <Phil> I find it more intuitive to work with tbh |
17:55:03 | FromDiscord | <Phil> sent a long message, see https://paste.rs/hMI |
17:55:37 | FromDiscord | <Horizon [She/Her]> I just want to add basic support really, I'll like add some extra code for optional module support |
17:55:44 | FromDiscord | <jos> chatgpt can write nim |
17:56:06 | FromDiscord | <Horizon [She/Her]> We know xD |
17:56:12 | FromDiscord | <Horizon [She/Her]> People have been talking about it for ages now |
17:56:15 | FromDiscord | <Gumbercules> In reply to @jos "chatgpt can write nim": #offtopic please |
17:56:39 | FromDiscord | <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:16 | FromDiscord | <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:28 | FromDiscord | <jos> instead of trying to police it because it vaguely falls in a category you don't like |
18:02:14 | FromDiscord | <Gumbercules> lol okay bub |
18:02:27 | FromDiscord | <Phil> Chiiiiill |
18:02:38 | FromDiscord | <Phil> Anyway, question about std/httpclient |
18:03:11 | FromDiscord | <Phil> sent a long message, see http://ix.io/4i9T |
18:05:11 | * | ltriant quit (Ping timeout: 260 seconds) |
18:06:35 | FromDiscord | <Phil> I am halfway certain that this is an error from whatever C lib is used for that client |
18:09:12 | FromDiscord | <Gumbercules> nah that's an error from the operating system |
18:09:38 | * | rockcavera quit (Remote host closed the connection) |
18:10:02 | FromDiscord | <Gumbercules> is the address resolvable? |
18:10:43 | FromDiscord | <Gumbercules> generally this means that IP address isn't available to your network / already in use |
18:11:08 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4i9U |
18:11:17 | FromDiscord | <Phil> I am assuming its trying to send a request over a busy port |
18:11:40 | FromDiscord | <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:10 | Amun-Ra | seems like you're trying to bind to something you don't own |
18:12:37 | FromDiscord | <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:25 | Amun-Ra | do you use docker? |
18:13:33 | FromDiscord | <Phil> Aye. |
18:13:48 | FromDiscord | <Phil> The database is a postgres instance and comes in a container in which I also have the application |
18:13:50 | FromDiscord | <Gumbercules> yeah that's prob your problem |
18:14:00 | FromDiscord | <Gumbercules> do you have them bridged networking wise? |
18:14:15 | FromDiscord | <Phil> Fair point, let me check |
18:14:27 | Amun-Ra | Phil: is that docker instance really serving the port |
18:14:29 | Amun-Ra | ? |
18:14:36 | FromDiscord | <Gumbercules> yeah also port mapping... |
18:14:47 | * | neceve joined #nim |
18:14:56 | Amun-Ra | mhm |
18:14:58 | * | pro joined #nim |
18:15:03 | * | neceve quit (Remote host closed the connection) |
18:15:14 | FromDiscord | <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:40 | arkanoid | sometimes "obj.foo[MyType]()" fails to compile, but "foo[MyType](obj)" works. Why is it failing? |
18:15:49 | FromDiscord | <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:09 | FromDiscord | <Gumbercules> seems like the source lacks the annotation |
18:17:18 | FromDiscord | <Gumbercules> https://github.com/nim-lang/Nim/tree/version-1-6/lib/pure/collections/tables.nim#L317 |
18:17:19 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4i9X |
18:17:50 | FromDiscord | <Gumbercules> unless you were simply inquiring as to why it was not annotated |
18:17:57 | FromDiscord | <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:03 | FromDiscord | <Gumbercules> ah okay |
18:18:09 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4i9X" => "https://play.nim-lang.org/#ix=4i9Y" |
18:18:17 | FromDiscord | <Gumbercules> wasn't aware that was a thing now |
18:20:38 | * | neceve joined #nim |
18:20:45 | FromDiscord | <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:13 | FromDiscord | <Gumbercules> I imagine the `postgres` docker image is making itself available somehow to the `tests` service |
18:21:22 | FromDiscord | <Phil> Ahhh you think this was hacked around via that mechanism |
18:21:26 | FromDiscord | <Gumbercules> possibly |
18:21:29 | FromDiscord | <jmgomez> converters doesnt work on generics, right? |
18:21:38 | FromDiscord | <Gumbercules> In reply to @jmgomez "converters doesnt work on": they're for distinct types I believe |
18:21:58 | FromDiscord | <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:50 | FromDiscord | <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:51 | FromDiscord | <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:21 | FromDiscord | <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:21 | FromDiscord | <Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4ia1 |
18:32:34 | FromDiscord | <Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4ia2 |
18:34:32 | FromDiscord | <jmgomez> 👍 |
18:35:08 | * | ltriant joined #nim |
18:38:38 | * | neceve joined #nim |
18:38:58 | FromDiscord | <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:43 | NimEventer | New thread by mantielero: Struggling to understand `asyncjs`'s `PromiseJs`, see https://forum.nim-lang.org/t/9710 |
18:44:24 | FromDiscord | <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:46 | FromDiscord | <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:00 | FromDiscord | <Gumbercules> happens |
18:45:22 | FromDiscord | <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:20 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4ia6 |
18:50:28 | FromDiscord | <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:26 | NimEventer | New 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:37 | FromDiscord | <Phil> ... I would never have thought that nim might need an nsfw channel |
19:04:44 | FromDiscord | <Phil> Just to be able to put this there |
19:04:49 | FromDiscord | <Phil> As like the one post in general |
19:05:11 | FromDiscord | <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:34 | FromDiscord | <Gumbercules> this shit is so tired |
19:07:08 | FromDiscord | <Gumbercules> if a person were to have written this no one would laugh or think it was funny or cool or whatever |
19:07:20 | FromDiscord | <Gumbercules> but because some stupid bot did it, everyone is like OMG WTF THIS IS AMAZING! THE BEST THING EVER! |
19:07:57 | FromDiscord | <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:08 | FromDiscord | <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:32 | FromDiscord | <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:39 | FromDiscord | <Gumbercules> which is not at all relevant |
19:08:57 | FromDiscord | <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:04 | FromDiscord | <Gumbercules> probably because they have nothing better to do and want attention |
19:09:29 | FromDiscord | <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:52 | FromDiscord | <Phil> In reply to @Gumbercules "probably because they have": That, or the were bored and just found the thought funny |
19:09:56 | FromDiscord | <Gumbercules> yeah :/ unless the community adopts a stance that sharing chatgpt stuff is prohibited in official communication channels |
19:10:07 | FromDiscord | <Gumbercules> well they weren't even creative enough to come up with the idea on their own |
19:10:12 | FromDiscord | <Gumbercules> notice the inspired by part |
19:10:19 | FromDiscord | <Gumbercules> it's just regurgitated shit |
19:11:42 | FromDiscord | <Phil> 🤷 ↵Anyway, time to start the betting pool |
19:11:58 | FromDiscord | <Phil> Will the github CI pipeline run on first try or will some arbitrary thing I forget kick me over |
19:12:26 | FromDiscord | <Phil> (edit) "forget" => "forgot" |
19:13:04 | FromDiscord | <ShalokShalom> @Phil Can we have an AI channel? |
19:13:20 | FromDiscord | <Phil> In reply to @ShalokShalom "<@180601887916163073> Can we have": I don't know, can you? |
19:14:02 | FromDiscord | <Gumbercules> May we? |
19:14:21 | FromDiscord | <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:53 | FromDiscord | <Phil> In reply to @Gumbercules "I don't think <@180601887916163073>": This is the right answer 😄 |
19:17:33 | FromDiscord | <Phil> I'm just a normal user, so basically asking me for a channel is trying at the wrong place 😄 |
19:20:30 | FromDiscord | <PMunch> Hmm, I guess we could 🤔 |
19:21:24 | * | ltriant joined #nim |
19:22:17 | FromDiscord | <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:35 | FromDiscord | <Phil> ... time to procrastinate that to tomorrow |
19:23:31 | FromDiscord | <ShalokShalom> @Phil didn't you get mod rights? |
19:25:15 | FromDiscord | <PMunch> Have to figure out how to set up bridges and stuff though |
19:25:15 | FromDiscord | <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:17 | FromDiscord | <ShalokShalom> sent a long message, see http://ix.io/4iah |
19:26:27 | * | ltriant quit (Ping timeout: 268 seconds) |
19:30:16 | FromDiscord | <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:12 | FromDiscord | <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:36 | FromDiscord | <ShalokShalom> In reply to @PMunch "Well we haven't really": Mainly in #off-topic |
19:57:44 | FromDiscord | <ShalokShalom> People were already complaining. |
19:57:53 | FromDiscord | <ShalokShalom> It kinda took over the channel |
19:59:31 | FromDiscord | <leetnewb> off-topic has been a wild ride lately anyhow :p |
19:59:55 | FromDiscord | <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:33 | FromDiscord | <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:38 | FromDiscord | <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:30 | FromDiscord | <Horizon [She/Her]> Fair |
20:22:07 | FromDiscord | <Gumbercules> In reply to @jmgomez "some people will say": Enums can't have holes and their size doesn't align with C |
20:22:24 | FromDiscord | <Gumbercules> But you can also specify the size for a Nim enum |
20:22:34 | FromDiscord | <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:38 | stutonk | What, exactly, does 'nimble install' do? Does it just relocate files to the ~/.nimble directory? |
20:23:48 | FromDiscord | <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:59 | FromDiscord | <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:26 | FromDiscord | <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:22 | FromDiscord | <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:38 | FromDiscord | <Gumbercules> (edit) "mods" => "models" |
20:26:41 | FromDiscord | <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:12 | FromDiscord | <PMunch> Oh wow, I apparently haven't been paying attention at all |
20:27:26 | FromDiscord | <PMunch> Or this all happens while I'm sleeping.. |
20:27:58 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4iat |
20:28:01 | FromDiscord | <jmgomez> without messign with emit if possible |
20:28:14 | FromDiscord | <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:22 | FromDiscord | <Horizon [She/Her]> On ArcoLinux if anyone else knows the solution |
20:29:23 | FromDiscord | <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:39 | FromDiscord | <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:57 | NimEventer | New 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:57 | FromDiscord | <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:14 | FromDiscord | <ShalokShalom> https://tenor.com/view/pepe-iasip-charlie-conspiracy-gif-11562330 |
21:16:16 | FromDiscord | <ShalokShalom> Its all a conspiracy |
21:16:26 | * | ltriant quit (Ping timeout: 265 seconds) |
21:21:14 | FromDiscord | <ShalokShalom> In reply to @Event Horizon "God damn it, Nim's": Have you tried turning it off and on again? 😛 |
21:21:22 | FromDiscord | <Horizon [She/Her]> yes xD |
21:21:23 | arkanoid | how can I add a "when available" switch("passC","-mavx2") into my config.nims? |
21:23:01 | FromDiscord | <Gumbercules> You can't really |
21:23:16 | arkanoid | well, cat /proc/cpuinfo contains that |
21:23:20 | arkanoid | so I can? |
21:23:22 | * | ltriant joined #nim |
21:23:27 | FromDiscord | <Gumbercules> You have to parse that |
21:23:42 | FromDiscord | <Gumbercules> Nim can't detect CPU features like this at compile time |
21:23:57 | FromDiscord | <Gumbercules> Notice how there are no simd libs for Nim that do this |
21:24:36 | FromDiscord | <Gumbercules> You might be able to use a C/C++ lib and use libffi for compile time ffi |
21:25:21 | FromDiscord | <ShalokShalom> @Gumbercules do you mean https://theartbutton.ai/ with treeforms website? |
21:25:27 | FromDiscord | <Gumbercules> Yes |
21:25:32 | FromDiscord | <ShalokShalom> Since I think, that one is not from him |
21:25:42 | FromDiscord | <Gumbercules> I'm pretty sure it is |
21:25:53 | FromDiscord | <Gumbercules> They posted about it on the forums |
21:26:21 | FromDiscord | <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:06 | FromDiscord | <ShalokShalom> Hnn, I think you are correct |
21:27:37 | FromDiscord | <Gumbercules> There was some post the other day about how optimized compilers are bad about reloading values into registers when vectorizing |
21:27:42 | FromDiscord | <Gumbercules> On HN |
21:27:53 | FromDiscord | <Gumbercules> (edit) "optimized" => "optimizing" |
21:28:24 | * | ltriant quit (Ping timeout: 264 seconds) |
21:28:24 | FromDiscord | <Gumbercules> I'm doing my simd manually but it's work |
21:28:48 | * | ltriant joined #nim |
21:28:51 | FromDiscord | <Gumbercules> And I have no detection scheme figured out. I just assume my users can support sse2 atm |
21:29:36 | FromDiscord | <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:30 | FromDiscord | <Gumbercules> Yup |
21:31:31 | FromDiscord | <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:51 | FromDiscord | <Gumbercules> Not that this really matters |
21:38:57 | FromDiscord | <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:20 | FromDiscord | <demotomohiro> `config.nims` |
21:39:23 | arkanoid | demotomohiro, thanks, I didn't know about march=native |
21:39:43 | FromDiscord | <Gumbercules> Yeah I've seen someone do what demo is describing |
21:39:51 | arkanoid | what's the advantage of parsing cpuinfo isntead of using march=native? |
21:40:16 | FromDiscord | <Gumbercules> You can find out exactly what instruction sets are supported I guess |
21:40:59 | FromDiscord | <Gumbercules> And I'm not sure if every compiler offers that feature, if you're planning on supporting more than gxc |
21:41:08 | FromDiscord | <Gumbercules> (edit) "gxc" => "gcc" |
21:41:37 | arkanoid | I 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:44 | FromDiscord | <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:58 | FromDiscord | <Horizon [She/Her]> How would i overload the `to` method for my custom type? |
22:27:24 | FromDiscord | <Horizon [She/Her]> So when you do `to(jsonNode, MyType)`, it has custom functionality |
22:28:25 | FromDiscord | <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:39 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/jsonutils.html |
22:28:47 | FromDiscord | <Elegantbeef> The `std/json` package doesnt work with hooks |
22:29:50 | FromDiscord | <Horizon [She/Her]> Ah alright |
22:38:17 | FromDiscord | <Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4iaZ |
22:38:32 | FromDiscord | <Horizon [She/Her]> Example taken from here: https://nim-lang.org/docs/httpclient.html#AsyncHttpClient |
22:39:16 | FromDiscord | <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:16 | FromDiscord | <Horizon [She/Her]> Is there a way to do something like `getOptionalStr` if the value isn't present? |
23:04:32 | FromDiscord | <Horizon [She/Her]> Or does `some("")` default to empty? |
23:04:41 | FromDiscord | <Horizon [She/Her]> (`none`) |
23:12:15 | FromDiscord | <Horizon [She/Her]> Just made a wrapper proc |
23:13:08 | FromDiscord | <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:32 | FromDiscord | <Horizon [She/Her]> Ah |
23:26:09 | * | ltriant joined #nim |
23:30:49 | * | ltriant quit (Ping timeout: 260 seconds) |
23:36:11 | FromDiscord | <ShalokShalom> https://youtu.be/WA1c_S6Zsu4 |
23:41:25 | FromDiscord | <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 |