00:03:35 | * | tiorock joined #nim |
00:03:35 | * | tiorock quit (Changing host) |
00:03:35 | * | tiorock joined #nim |
00:03:35 | * | rockcavera quit (Killed (tungsten.libera.chat (Nickname regained by services))) |
00:03:35 | * | tiorock is now known as rockcavera |
00:19:31 | FromDiscord | <Nilts> Does karax have custom components like react? |
00:49:59 | NimEventer | New thread by Naterlarsen: Getting a Compile Error - "Error: cannot open file: sockets", see https://forum.nim-lang.org/t/9974 |
00:53:17 | * | lumo_e quit (Quit: Quit) |
00:55:45 | * | Lord_Nightmare2 joined #nim |
00:56:18 | * | xet7 quit (Ping timeout: 255 seconds) |
00:56:45 | * | anddam quit (Ping timeout: 255 seconds) |
00:56:46 | * | Lord_Nightmare quit (Ping timeout: 255 seconds) |
00:58:49 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
01:02:08 | FromDiscord | <slime> How about rust liked enum compared with case of in Nim🧐 |
01:09:24 | * | xet7 joined #nim |
01:10:00 | * | anddam joined #nim |
01:14:15 | FromDiscord | <amadan> In reply to @not logged in "Does karax have custom": Mean you can call a function which returns a VNode to kinda have components |
01:14:22 | * | derpydoo joined #nim |
01:18:48 | * | derpydoo quit (Ping timeout: 255 seconds) |
01:21:47 | FromDiscord | <Nilts> In reply to @amadan "Mean you can call": but can they have their own vars and what not? |
01:24:06 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#types-object-variants↵(@slime) |
01:24:44 | FromDiscord | <Elegantbeef> There is not much to compare, rust's 'enum's are more succinct but also require using pattern matching |
01:25:24 | NimEventer | New Nimble package! asyncIters - Async iterators. Able to both await futures and yield values, see https://github.com/SirNickolas/asyncIters-Nim |
01:26:14 | FromDiscord | <ringabout> Hi, beef. I was wondering, would you be interested in joining in the mod team? |
01:28:03 | FromDiscord | <huantian> yall looking to beef up the mod team? 😛 |
01:29:15 | * | derpydoo joined #nim |
01:33:56 | FromDiscord | <Nilts> Anyone know how to write a match-first parser? |
01:38:36 | FromDiscord | <Elegantbeef> I'm not really interested in it, but i've been asked whether i want to be multiple times 😄 |
01:41:12 | * | arkurious quit (Quit: Leaving) |
01:42:42 | FromDiscord | <ringabout> I see. Sorry to bother you 😜 The mod channel now floods with community building related discussions. I'm going to move the discussion to the community channel when it is mature. |
01:43:15 | FromDiscord | <Nilts> In reply to @not logged in "Anyone know how to": I can't wrap my head around a system of modular parsing. Like if X succeeds continue on to part Y or back up and go to part Z |
01:43:34 | FromDiscord | <Elegantbeef> Doesnt npeg support this? |
01:45:02 | FromDiscord | <ringabout> In reply to @ringabout "I see. Sorry to": I shall make more mods join in the nim.devs after the roadmap is finished. |
01:45:16 | FromDiscord | <michaelb.eth> In reply to @ringabout "I see. Sorry to": asking out of curiosity, but re: "mod channel" and the query about a participant here joining the mod team, is that in reference to the forum? |
01:45:29 | FromDiscord | <michaelb.eth> (edit) "curiosity, but" => "curiosity only:" |
01:47:00 | FromDiscord | <Nilts> In reply to @Elegantbeef "Doesnt npeg support this?": Yes. I had a grand idea, but npeg would be simpler! Although for optimizations i might want to use a web-worker. |
01:52:56 | FromDiscord | <ringabout> In reply to @michaelb.eth "asking out of curiosity": All platorms. |
01:53:01 | FromDiscord | <ringabout> (edit) "platorms." => "platforms." |
01:54:35 | FromDiscord | <ringabout> https://media.discordapp.net/attachments/371759389889003532/1083206167813161051/image.png |
01:54:51 | FromDiscord | <ringabout> We have made a list for moderators. |
02:00:14 | FromDiscord | <michaelb.eth> I'm online in this discord all the time, and look at the forum frequently, though granted I'm just usually checking posts vs. checking long-running discussions. I was trying to understand "floods with community building related discussions.", but I probably haven't been close enough attention. |
02:02:19 | FromDiscord | <ringabout> Yeah, we work in a private channel and a private repo. |
02:02:26 | FromDiscord | <michaelb.eth> Is there a meta-discussion somewhere about the need for additional mods to help with the flood? Note: I'm not requesting or thinking about being a mod, but I like Nim a lot, just wondering about it. |
02:03:10 | FromDiscord | <michaelb.eth> gotcha |
02:04:05 | FromDiscord | <michaelb.eth> (edit) "it." => "the need presented." |
02:07:26 | FromDiscord | <ringabout> We are going to announce recently accpeted mods on the Nim forum. I suppose it builds on trust, like having contributed to the official Nim related project. A mod is supposed to be helpful and is willing to help with the community building, like reviewing code from contributors and improving the workflow in order to welcome more contributors. |
02:07:44 | FromDiscord | <ringabout> (edit) "project." => "projects." |
02:10:24 | FromDiscord | <ringabout> Like https://github.com/nim-lang/packages/pull/2532 a mod is supposed to improve the workflow of the Nim infrastructure. This PR intends to incrementally check newly added packages so the CI time will be reduced from 10+ minutes to few seconds. |
02:17:24 | FromDiscord | <ringabout> Likewise I'm working on the workflow of the testable specification https://github.com/nim-lang/testspec I might document all the defines here. The mod should build a workflow for contributors and welcome them => https://opensource.guide/building-community |
02:17:43 | FromDiscord | <ringabout> (edit) "here." => "there." |
02:28:08 | FromDiscord | <michaelb.eth> sent a long message, see http://ix.io/4qiC |
02:28:39 | FromDiscord | <michaelb.eth> (edit) "http://ix.io/4qiC" => "http://ix.io/4qiD" |
02:29:09 | FromDiscord | <michaelb.eth> (edit) "http://ix.io/4qiD" => "http://ix.io/4qiE" |
02:30:48 | FromDiscord | <ringabout> Probably, I didn't notice that since I was admitted into the mod team recently. |
02:48:54 | FromDiscord | <Nilts> How would i check if the nim js is nodejs? |
02:49:26 | FromDiscord | <Nilts> (I want to disable node for my package) |
03:10:42 | FromDiscord | <michaelb.eth> In reply to @ringabout "Probably, I didn't notice": I was making a suggestion, all I meant, you probably didn't missing anything, though I could have. |
03:25:15 | FromDiscord | <ringabout> In reply to @michaelb.eth "I was making a": Thank you for your suggestions. I will discuss with other mods. |
04:39:59 | * | rmn joined #nim |
04:46:24 | * | rmn quit (Quit: Leaving) |
04:46:35 | * | rmn joined #nim |
04:47:02 | * | rmn quit (Remote host closed the connection) |
04:47:07 | * | rmnmjw joined #nim |
04:47:49 | * | rmnmjw quit (Remote host closed the connection) |
04:47:56 | * | rmnmjw_ joined #nim |
04:49:08 | * | rmnmjw__ joined #nim |
04:52:48 | * | rmnmjw_ quit (Ping timeout: 248 seconds) |
04:54:31 | * | xet7 quit (Ping timeout: 260 seconds) |
05:01:36 | * | rmnmjw__ is now known as rmnmjw |
05:03:20 | * | azimut_ quit (Ping timeout: 255 seconds) |
06:04:03 | * | tiorock joined #nim |
06:04:03 | * | tiorock quit (Changing host) |
06:04:03 | * | tiorock joined #nim |
06:04:03 | * | rockcavera is now known as Guest1646 |
06:04:03 | * | tiorock is now known as rockcavera |
06:06:35 | * | Guest1646 quit (Ping timeout: 248 seconds) |
06:09:14 | * | kenran joined #nim |
06:30:42 | * | advesperacit joined #nim |
06:33:09 | * | Goodbye_Vincent quit (Quit: Ping timeout (120 seconds)) |
06:33:25 | * | Goodbye_Vincent joined #nim |
07:00:48 | * | rockcavera quit (Remote host closed the connection) |
07:05:21 | FromDiscord | <Odi> sent a code paste, see https://play.nim-lang.org/#ix=4qjb |
07:06:17 | FromDiscord | <Odi> (edit) "https://play.nim-lang.org/#ix=4qjb" => "https://play.nim-lang.org/#ix=4qjc" |
07:08:09 | FromDiscord | <Elegantbeef> IO is slow so it's best always to avoid doing each line independantly |
07:12:27 | FromDiscord | <albassort> In reply to @Elegantbeef "IO is slow so": this is the same reason why when you parse in streams, you dont go byte by byte |
07:12:34 | FromDiscord | <albassort> the bigger the chunks the less the io wait |
07:16:56 | FromDiscord | <Elegantbeef> Also did you build with `-d:release`? |
07:17:33 | FromDiscord | <Elegantbeef> With `-d:release` on my ryzen 5600x your code is around 5s |
07:19:55 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qjf |
07:33:52 | * | onetwo3 quit (Ping timeout: 248 seconds) |
07:36:42 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4qjj |
07:36:55 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4qjj" => "https://play.nim-lang.org/#ix=4qjk" |
07:37:38 | FromDiscord | <Phil> 11th gen Intel Core I7 https://media.discordapp.net/attachments/371759389889003532/1083292495401730110/image.png |
07:43:03 | * | onetwo3 joined #nim |
08:15:27 | * | Notxor joined #nim |
08:24:28 | FromDiscord | <Phil> Nim doesn't have an exact equivalent to typescript union-types right?↵As in, something like↵`type A = "bla" | "blu"`↵With the intention that any value passed into a variable of type A must be a string with the value "bla" or "blu" |
08:24:51 | FromDiscord | <Phil> Which in typescript I guess is not enforced at all at runtime and mostly at compile-time, so would only be relevant for static-strings |
08:25:03 | FromDiscord | <enthus1ast> enums? |
08:25:15 | FromDiscord | <Phil> Benefit over enum would that you don't need to import a file that defines the enum-type |
08:25:23 | FromDiscord | <Phil> (edit) "Benefit over enum would ... that" added "be" |
08:25:52 | FromDiscord | <Phil> Or rather that's the benefit in typescript for those types, users don't need to be aware an enum or the like even exists, they just pass in strings and when they're invalid they get a compiler-error |
08:25:54 | FromDiscord | <enthus1ast> in nim you would like to do a parseEnum |
08:26:33 | FromDiscord | <Elegantbeef> Nim just has static values |
08:26:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qju |
08:27:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qjv |
08:27:48 | FromDiscord | <Phil> Yeah but that means defining it manually instead of being able to be suprt lazy |
08:27:57 | FromDiscord | <Phil> (edit) "suprt" => "super" |
08:28:05 | FromDiscord | <Phil> as in, the check |
08:28:10 | FromDiscord | <Phil> (edit) "as in, ... themanually" added "defining" | "definingthe check ... " added "manually" |
08:28:13 | FromDiscord | <Elegantbeef> Well make the distinct type a module |
08:31:30 | FromDiscord | <Elegantbeef> There we go! |
08:31:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3tEY |
08:33:54 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4qjx |
08:34:04 | FromDiscord | <enthus1ast> `Error: signature for '=' must be proc[T: object](x: var T; y: T)` |
08:34:38 | FromDiscord | <Elegantbeef> `=` used to be copy, so maybe in the future it might work? |
08:56:40 | FromDiscord | <Coachonko> When I brwose the docs I see func and procs, I thought nim uses procs only. What are func then? |
08:57:13 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#procedures-func |
08:57:46 | FromDiscord | <Coachonko> Oh |
08:58:44 | FromDiscord | <Coachonko> I've been writing pure functions with `proc` without knowing |
08:58:52 | FromDiscord | <Coachonko> 😎 |
09:08:30 | FromDiscord | <Andreas> hi, i need the `T` from a `ptr T` ? my proc gets `ptr T` and needs to lookup `T` from a `table[string, int]` . When the proc receives a `T` it get the mapping via `table[$T]`, but that fails for `ptr T` ? |
09:08:48 | FromDiscord | <Andreas> (edit) "get" => "gets" |
09:09:43 | FromDiscord | <Andreas> (edit) "hi, i need the `T` from a `ptr T` ? my proc gets `ptr T` and needs to lookup `T` from a `table[string, int]` . When the proc receives a `T` it gets the mapping via `table[$T]`, but that fails for `ptr T` ... ?" added "?↵So howto extract the `T`-part from the `ptr T`, pls" |
09:10:07 | FromDiscord | <Elegantbeef> How are you writing the procedure? |
09:11:03 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qjF |
09:11:41 | FromDiscord | <4zv4l> this is the json file |
09:11:43 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qjG |
09:16:09 | * | tinytoast joined #nim |
09:18:40 | * | tinystoat quit (Ping timeout: 260 seconds) |
09:18:55 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4qjL |
09:19:22 | * | randomuser464876 joined #nim |
09:19:43 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=4qjL" => "https://play.nim-lang.org/#ix=4qjM" |
09:19:47 | FromDiscord | <Elegantbeef> Why doesnt `$T` work? |
09:20:46 | FromDiscord | <Andreas> In reply to @Elegantbeef "Why doesnt `$T` work?": `$T` = "ptr IntSet", well i could put a "ptr IntSet"into the mapping-table... |
09:21:06 | FromDiscord | <Andreas> (edit) "IntSet"into" => "IntSet" into" |
09:21:09 | FromDiscord | <Elegantbeef> Ok so you want to skip all `ptr` s |
09:21:32 | FromDiscord | <Elegantbeef> `typeof(default(T)[])` |
09:21:44 | FromDiscord | <Elegantbeef> That skips over one, if you want to skip over all you need a proc |
09:22:35 | FromDiscord | <Andreas> In reply to @Elegantbeef "That skips over": thank you man, thats 100% what i was looking for.. |
09:29:52 | FromDiscord | <tandy> oh, my bad, I'll try it then↵(@djazz) |
09:32:54 | * | koltrast quit (Ping timeout: 255 seconds) |
09:54:23 | * | azimut joined #nim |
09:58:16 | * | koltrast joined #nim |
10:14:46 | Zevv_ | PMunch: what's the difference between eeprom_write_byte() and eeprom_update_byte() in avr libc? |
10:15:08 | PMunch | Good question |
10:15:14 | Zevv_ | I'm full of good questions |
10:15:17 | Zevv_ | I'll get the source :) |
10:16:03 | Zevv_ | bah it's all asm |
10:18:42 | Zevv_ | hm something about internal functions incrementing or decrementing the address in the return value |
10:18:44 | Amun-Ra | update check if the data differs |
10:18:54 | Amun-Ra | if it doesn't there's no write |
10:19:03 | Amun-Ra | and less flash wear |
10:19:10 | Amun-Ra | checks* |
10:20:23 | Zevv_ | ah thanks, where did you get that from? |
10:20:36 | Amun-Ra | my /dev/mem :> |
10:20:43 | Amun-Ra | sec |
10:20:52 | Amun-Ra | Zevv_: https://www.programming-electronics-diy.xyz/2018/07/avr-eeprom-library.html |
10:21:10 | Zevv_ | takk |
10:21:31 | Amun-Ra | vaersagod |
10:21:50 | FromDiscord | <sOkam!> well, one writes and the other updates, duh 😄 |
10:24:38 | * | FromDiscord quit (Remote host closed the connection) |
10:24:52 | * | FromDiscord joined #nim |
10:26:33 | Zevv_ | duh |
10:28:09 | FromDiscord | <gogolxdong> `/root/nimbus-eth2/tools/generate_makefile.nim(1, 2) Error: cannot open file: ""` |
10:28:33 | FromDiscord | <gogolxdong> sent a code paste, see https://play.nim-lang.org/#ix=4qk3 |
10:50:05 | * | rmnmjw quit (Quit: Leaving) |
10:50:24 | * | rmnmjw joined #nim |
10:50:25 | FromDiscord | <sOkam!> Is there a way to reference the value of a non-ref variable, before that variable gets its value, in such a way that they both are updated when the first one gets some data? |
11:36:15 | * | arkurious joined #nim |
11:37:48 | Amun-Ra | only a ptr comes to my mind |
11:49:29 | FromDiscord | <sOkam!> i figure i should do what nimgl/vulkan is doing, by having an initializer proc that loads the aliase like they load the real functions 🤷♂️ |
11:49:49 | FromDiscord | <jmgomez> In reply to @sOkam! "Is there a way": doesnt a getter/setter work for you? |
11:50:30 | FromDiscord | <sOkam!> its for a proc variable. do getter/setters work on proc? |
11:51:26 | FromDiscord | <jmgomez> as long as it's a variable inside a type it should |
11:51:47 | FromDiscord | <jmgomez> (edit) "type" => "object" |
11:52:08 | FromDiscord | <sOkam!> they are not, afaik |
11:52:24 | FromDiscord | <sOkam!> since they are vulkan procs linked when the app initializes |
13:03:34 | * | rockcavera joined #nim |
13:05:37 | * | junaid_ joined #nim |
13:12:47 | * | junaid_ quit (Remote host closed the connection) |
13:16:09 | * | junaid_ joined #nim |
13:25:49 | FromDiscord | <Nerve> Why might a library I'm statically linking work fine in a debug build and then just...silently do nothing in a release build? |
13:36:03 | * | junaid_ quit (Remote host closed the connection) |
13:38:52 | Amun-Ra | there must be a different issue with the code |
13:45:47 | * | derpydoo quit (Ping timeout: 248 seconds) |
14:00:57 | * | derpydoo joined #nim |
14:05:29 | FromDiscord | <Nilts> In nim, if threads have there own memory, how do they access functions, consts, etc? |
14:06:20 | FromDiscord | <enthus1ast> could be that you must build both, the lib and the host in release or debug↵(@Nerve) |
14:07:09 | FromDiscord | <enthus1ast> i had troubles in the past mixing both. |
14:09:43 | FromDiscord | <Nerve> It's a C library, so how would I go about that? Do I need to compile the library's .a file with the same optimization flags as `-d:release`? |
14:17:25 | Amun-Ra | if nim is optimizing it out -- you're not calling any part of the lib |
14:23:43 | * | azimut quit (Remote host closed the connection) |
14:24:27 | * | azimut joined #nim |
14:31:52 | FromDiscord | <Nerve> I definitely am...that's super odd |
14:32:29 | FromDiscord | <Nerve> Are my bindings not being assertive enough? I'm using `{.importc.}`, do I need more? |
14:32:51 | FromDiscord | <enthus1ast> ah ok, i thought it was a nim lib.↵(@Nerve) |
14:37:01 | Amun-Ra | Nerve: do you call any of the bindings? |
14:38:31 | FromDiscord | <Nerve> In reply to @Nerve "I definitely am...that's super": Yes |
14:40:20 | Amun-Ra | hmm |
14:40:54 | FromDiscord | <Nerve> I think I see what's going on |
14:42:32 | FromDiscord | <Nerve> It's a C function that drops results into pointers, and only returns a code. I actually check that code to see if it failed. Still, if I compile `-d:release`, it does nothing. However, immediately following the function call, if I print the result code, then it works and the C function actually runs. |
14:42:54 | FromDiscord | <Nerve> (edit) "It's a C function that drops results into pointers, and only returns a code. I actually check that code ... to" added "with an `if` statement" |
14:43:38 | FromDiscord | <Nerve> So something about resolving the result code is causing Nim or gcc to snip the foreign function entirely or not, depending. |
14:44:02 | FromDiscord | <Nerve> This being with `-d:release` optimizations, of course. |
14:44:46 | FromDiscord | <gogolxdong> nimbus-eth2 syncing https://media.discordapp.net/attachments/371759389889003532/1083399988261965954/image.png |
14:51:04 | FromDiscord | <gogolxdong> what's the difference between nimbus-eth1 and nimbus-eth2 |
15:11:11 | * | Notxor quit (Remote host closed the connection) |
15:20:15 | FromDiscord | <Gumbercules> one targets ethereum 1.0 and the other, 2.0? |
15:20:28 | FromDiscord | <Gumbercules> that's just a guess... |
15:28:37 | FromDiscord | <Nerve> In reply to @Nerve "It's a C function": Is there anybody around with expertise in the compiler? Should I ask in #internals ? |
15:37:05 | * | azimut quit (Remote host closed the connection) |
15:37:29 | * | azimut joined #nim |
15:44:03 | FromDiscord | <Gumbercules> In reply to @Nerve "Is there anybody around": That would be the place to ask |
15:49:56 | FromDiscord | <SpiderDave> how do i turn a float into a string, but if it's an integer like 42.0 then leave off the .0? i still want it to work for values like 1.5 though |
15:50:23 | * | PMunch quit (Quit: leaving) |
15:57:54 | FromDiscord | <jtv> No way to do that is wrong. You could convert it to an int, and see if the int and float value are the same? Or convert to a string and chop off anything from the dot on, if the rest of the digits are 0. Tho neither approach is awesome without a bunch of extra work if you might have very big or very small numbers where the float might end up getting written in exponential notation. |
15:58:47 | * | derpydoo quit (Quit: derpydoo) |
16:22:20 | FromDiscord | <SpiderDave> sent a code paste, see https://play.nim-lang.org/#ix=4qmq |
16:53:31 | FromDiscord | <Takemichi Hanagaki> Guys, I need some help.↵I've got an object `Date` that makes reference to `DateTime`, and I want to compare both `Date`s, how can I do it without comparing pointers, instead? |
16:53:59 | FromDiscord | <Takemichi Hanagaki> (edit) "`DateTime`, and" => "`DateTime`. And" | "both `Date`s," => "two `Date` objects," |
16:54:08 | FromDiscord | <Takemichi Hanagaki> (edit) "And" => "↵And" |
16:55:14 | FromDiscord | <Takemichi Hanagaki> My code is: `x.date > y.date` is comparing pointers, instead of its values. |
17:09:27 | * | kenran quit (Remote host closed the connection) |
17:39:40 | * | ehmry joined #nim |
18:01:39 | * | rmnmjw quit (Read error: Connection reset by peer) |
18:03:05 | FromDiscord | <Hourglass [She/Her]> I am so confused why my code can't serialise or serialise numbers for the protocol |
18:03:05 | FromDiscord | <Hourglass [She/Her]> https://play.nim-lang.org/#ix=4qn0 |
18:03:25 | FromDiscord | <Hourglass [She/Her]> Seems like single bytes work, but anymore and it just throws a fit |
18:03:40 | FromDiscord | <Hourglass [She/Her]> Likely an easy fix with reading 1 byte at a time but still annoying |
18:04:48 | FromDiscord | <Hourglass [She/Her]> My serialisation seems to be the broken code |
18:04:49 | NimEventer | New thread by nimnam: Macros and interfacing with the world ?, see https://forum.nim-lang.org/t/9975 |
18:05:32 | FromDiscord | <Rika> `bigEndianNN` is (dest, src) and not (src, dest) |
18:05:40 | FromDiscord | <Rika> you're using it like (src, dest) |
18:05:52 | FromDiscord | <Hourglass [She/Her]> Is it the same for `swapEndian`? |
18:05:58 | FromDiscord | <Rika> yes |
18:06:13 | FromDiscord | <Hourglass [She/Her]> I was using swap endian before but had the same issue |
18:06:17 | FromDiscord | <Hourglass [She/Her]> In reply to @Rika "yes": Aah |
18:07:26 | FromDiscord | <Hourglass [She/Her]> It works! Thanks for pointing that out Rika! |
18:09:59 | FromDiscord | <Rika> also you dont need that cpu endian check |
18:14:32 | FromDiscord | <Hourglass [She/Her]> Since I'm using `bigEndian`? I'll remove that rn |
18:23:58 | FromDiscord | <Hourglass [She/Her]> I am clueless where this error is coming from ngl |
18:24:05 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4qn3 |
18:24:40 | * | randomuser464876 quit (Quit: Client closed) |
18:24:46 | FromDiscord | <Phil> O.O |
18:25:16 | FromDiscord | <Phil> I will be honest, I am wondering why you're squeezing that much logic into one line of code |
18:25:46 | FromDiscord | <Phil> Wait, that's not even on you, that's the std lib blowing up? |
18:26:13 | FromDiscord | <Phil> That looks super weird, what kind of code is doing this? |
18:27:46 | FromDiscord | <Hourglass [She/Her]> I have no idea which is what is frustrating me lol |
18:30:45 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4qn4 |
18:30:57 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4qn5 |
18:32:33 | FromDiscord | <Hourglass [She/Her]> Not even using the `nbPlugin` toggle |
18:41:23 | FromDiscord | <Hourglass [She/Her]> Oh! Even weirder: It only breaks on devel |
18:41:36 | FromDiscord | <Hourglass [She/Her]> Works perfectly fine on 1.6/10 |
18:41:38 | FromDiscord | <Hourglass [She/Her]> .10 |
18:42:00 | FromDiscord | <Hourglass [She/Her]> Using latest devel, but idk how i'd make a minimal reproducible example |
18:45:21 | FromDiscord | <Phil> Could you go back to devel and compile with --mm:refc? |
18:45:42 | FromDiscord | <Phil> or stay on 1.6.10 and compile with --mm:orc? |
18:46:54 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Could you go back": This is being compiled with `refc` for the tests on both |
18:47:31 | FromDiscord | <Hourglass [She/Her]> orc + devel has that same issue |
18:48:00 | FromDiscord | <Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "This is being compiled": Wait nvm I just realised arc is the default for devel isnt it |
18:48:08 | FromDiscord | <Phil> Nah, orc is |
18:48:43 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4qn9 |
18:49:15 | FromDiscord | <Phil> sent a long message, see http://ix.io/4qna |
18:49:27 | FromDiscord | <Hourglass [She/Her]> Uh what |
18:49:39 | FromDiscord | <Hourglass [She/Her]> now 1.6.10 refc is having the same issue |
18:49:50 | FromDiscord | <Hourglass [She/Her]> I'm... So confused |
18:50:02 | FromDiscord | <Phil> You're on linux? |
18:50:06 | FromDiscord | <Hourglass [She/Her]> Yeah |
18:50:34 | FromDiscord | <Phil> Clean out your cache and try again, just brutally rm-r ~/.cache/nim/ |
18:50:48 | FromDiscord | <Phil> Repeat the compile, but clear out the cache in between each run |
18:51:02 | FromDiscord | <Phil> (edit) "compile," => "4 compile checks," |
18:53:16 | FromDiscord | <Hourglass [She/Her]> Okay they all have the same issue |
18:53:30 | FromDiscord | <Hourglass [She/Her]> Btw im using nimble test to run the examples |
18:53:39 | FromDiscord | <Hourglass [She/Her]> tests |
18:54:06 | FromDiscord | <Hourglass [She/Her]> nim c has the same issue anyway |
18:54:07 | FromDiscord | <Hourglass [She/Her]> So odd |
18:54:49 | FromDiscord | <Phil> Okay so not necessarily a memory management issue |
18:55:02 | FromDiscord | <Hourglass [She/Her]> Doesn't seem to be |
18:55:33 | FromDiscord | <Phil> My personal guess is that it doesn't like the type declarations |
18:55:42 | FromDiscord | <Hourglass [She/Her]> In my code? |
18:55:52 | FromDiscord | <Phil> Yeah, due to those using the async pragma or something |
18:56:55 | FromDiscord | <Phil> Since macros are often the basis for pragmas , that's my current bet |
18:56:59 | FromDiscord | <Hourglass [She/Her]> I'm not even calling the async version of those procs which is weird as hell, since I'm using the stream-based API, not touching the sockets |
18:57:35 | FromDiscord | <Phil> It may just be objecting to using the async pragma with that particular set of code |
18:57:42 | FromDiscord | <Phil> (edit) "set of code" => "type definition" |
18:57:49 | FromDiscord | <Hourglass [She/Her]> Though... `proc readVarNum[R: int32 | int64](s: AsyncSocket): Future[R] {.async.} =` |
18:57:56 | FromDiscord | <Hourglass [She/Her]> Maybe that's the issue |
18:58:02 | FromDiscord | <Hourglass [She/Her]> `Future[R]` |
19:00:43 | FromDiscord | <Phil> A generic classified only by its output being generic seems fishy either way |
19:01:42 | FromDiscord | <Hourglass [She/Her]> Same issue after I separated the int32 and int64 code into separate procs |
19:02:05 | FromDiscord | <Hourglass [She/Her]> wait |
19:03:28 | FromDiscord | <Hourglass [She/Her]> Fixed! |
19:03:42 | FromDiscord | <Hourglass [She/Her]> A pain but it works again! |
19:17:43 | FromDiscord | <Phil> ? |
19:17:47 | FromDiscord | <Phil> What was the issue? |
19:18:01 | FromDiscord | <Phil> And is it the kind of thing you would've loved to have seen on SO ? 😛 |
19:21:46 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "What was the issue?": No idea, that's the thing |
19:22:02 | FromDiscord | <Hourglass [She/Her]> I just fiddled a bit |
19:22:07 | FromDiscord | <Hourglass [She/Her]> And it worked :p |
20:16:02 | * | Notxor joined #nim |
20:28:17 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qnr |
20:30:11 | FromDiscord | <Phil> I'm not quite sure, what does this represent? |
20:30:32 | FromDiscord | <Phil> Vaguely smells like it'd be represented via object variant |
20:30:59 | FromDiscord | <4zv4l> well I don't know much Rust↵but it seems like a mix between an enum and an union |
20:34:29 | NimEventer | New question by Francesco: unable to share a proc between two classes, see https://stackoverflow.com/questions/75689752/unable-to-share-a-proc-between-two-classes |
20:38:32 | FromDiscord | <Nycto> I’m trying to create a proc with the same name as a type I’ve defined. My goal is to create a method that converts to the type from another type in the same style as other Nim conversions (`foo.uint` for example). But the compiler is complaining about conflicting names. Is there any way around this? Example of what I’m trying to do: https://play.nim-lang.org/#ix=4qns |
20:39:34 | Amun-Ra | iirc no |
20:42:15 | FromDiscord | <Nycto> Ah, bummer. But thanks! |
20:42:27 | Amun-Ra | Nycto: I'm (ab)using this convention: 'https://play.nim-lang.org/#ix=4qnv' |
20:43:32 | Amun-Ra | if you use when you can change color: LCDColor to color: static[LCDColor] for clarity |
20:44:21 | Amun-Ra | as in 'https://play.nim-lang.org/#ix=4qnx' |
20:49:49 | FromDiscord | <4zv4l> In reply to @Isofruit "I'm not quite sure,": really did the trick ! |
20:50:00 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qny |
20:51:12 | FromDiscord | <4zv4l> this was the rust code |
20:51:13 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qnz |
20:51:29 | FromDiscord | <4zv4l> (edit) "https://play.nim-lang.org/#ix=4qnz" => "https://play.nim-lang.org/#ix=4qnA" |
20:53:37 | FromDiscord | <Phil> I feel like that just reinvents optionals tbh.↵A more interesting example I think would be if the enum had like 5 different types |
20:53:46 | FromDiscord | <Phil> (edit) "I feel like that ... just" added "particular case" |
20:54:37 | FromDiscord | <Phil> But nice to see the code!↵Seems more legible to me in nim, though chances are that's because I have much more nim experience nowadays than Rust |
20:55:30 | FromDiscord | <4zv4l> I honestly prefer Nim so much↵it may be less safe but↵so much easier to interact with C, winapi and handle memory manually or gb or reference counting↵so much possibility and the code is easy to read and fast to learn |
20:55:43 | Amun-Ra | readability isn't one of rust traits |
20:56:03 | FromDiscord | <4zv4l> making the project for my company, I really realized I couldn't have chosen a better language for that job |
20:59:25 | FromDiscord | <Phil> In reply to @4zv4l "I honestly prefer Nim": I mean, even that "less safe" bit means you're using `cast`, `ptr` or other things that would normally ring a bell |
20:59:58 | FromDiscord | <Phil> And no amount of holy magic can prevent you from getting a nilpointer when you expect a lib to contain a proc and then it turns out it doesn't |
21:01:49 | FromDiscord | <4zv4l> In reply to @Isofruit "I feel like that": indeed, just saw the `std/options` lib |
21:02:05 | FromDiscord | <4zv4l> but since they didn't import anything in the Rust code, wanted to make it in raw Nim too |
21:02:18 | FromDiscord | <Phil> Fair point! |
21:04:01 | FromDiscord | <4zv4l> I was afraid about memory usage but it seems the rust one allocate multiple (20) times, in total `3.2kb`↵meanwhile nim allocate only once `1kb` |
21:05:56 | FromDiscord | <Takemichi Hanagaki> sent a code paste, see https://play.nim-lang.org/#ix=4qnD |
21:11:15 | FromDiscord | <Nerve> In reply to @Amun-Ra "readability isn't one of": Having moved a Rust project to Nim for my employer, I can speak to this directly. A good half of Rust code is dedicated to massaging the borrow checker, and the business logic gets completely lost. Meanwhile I have a hard time finding any parts of my Nim project that aren't business logic. |
21:11:40 | FromDiscord | <Phil> In reply to @Nerve "Having moved a Rust": Oh no! Your precious technical details that got lost! |
21:11:50 | * | nmz- joined #nim |
21:11:51 | FromDiscord | <Nerve> whatever shall I do |
21:11:55 | * | nmz- left #nim (Ploop) |
21:12:04 | FromDiscord | <Phil> All this spare free time you now suddenly have |
21:12:38 | FromDiscord | <Nerve> I mean, all of my roadblocks now have been either deciding on how to structure my business logic, or interfacing with C libraries. |
21:13:23 | FromDiscord | <Phil> one of those is one of software-dev's general big questions, the other is one of software dev's general big language problems |
21:14:11 | FromDiscord | <Nerve> Yes, but crucially, none of that brainspace is spent on memory semantics, nor do I have to parse through oodles of memory semantics while scrolling my code |
21:14:14 | FromDiscord | <Odi> In reply to @Elegantbeef "With `-d:release` on my": Thank you for your follow up:D i will test your code<3 |
21:14:17 | FromDiscord | <Phil> I guess nim makes structuring that somewhat "clearer" since you don't really have a choice to do "proper" OO |
21:14:26 | FromDiscord | <Odi> In reply to @albassort "this is the same": Thank you for your answer, it was kind=) |
21:14:27 | FromDiscord | <Phil> So your choice of going "full OO" isn't there |
21:14:43 | FromDiscord | <Phil> Which leaves you with procedural with some OO flavour here or there |
21:15:06 | FromDiscord | <Nerve> I come from the functional world so I avoid highly referential OO anyways, most of my work is on the stack, in pure functions, no refs |
21:16:07 | FromDiscord | <Nerve> You have to use them to get variant objects, but it doesn't ever become a problem because the variant type contains the ref |
21:16:16 | FromDiscord | <Nerve> (edit) "them" => "refs" |
21:17:55 | FromDiscord | <Nerve> Moving from the functional world to Nim is remarkably easy given Nim's preferences, unlike Python which has a lot of reference-type footguns |
21:28:25 | FromDiscord | <Elegantbeef> Yes move the `var` to `container: var seq[Value]`↵(@Takemichi Hanagaki) |
21:28:50 | FromDiscord | <Livid> Is there a way to mark an object that contains a reference to decrement the references ref count? |
21:29:24 | FromDiscord | <Elegantbeef> Why do you need to? |
21:29:58 | FromDiscord | <Livid> I'm trying to make a dynamic array that doesn't have a type, but rather a data size (yes, this is very unsafe), but when I remove an item (where the type is an object that contains a ref to something else) and there is no other references to the GC'd object, it is not free'd. |
21:30:28 | FromDiscord | <Elegantbeef> You want to use destructors then |
21:32:15 | FromDiscord | <Phil> Beef! Did you know that owlkettle had an {.internal.} pragma? |
21:32:29 | FromDiscord | <Elegantbeef> Should i have? |
21:32:40 | FromDiscord | <Phil> If you used setters it'd be recommendable to use it |
21:34:08 | FromDiscord | <Phil> Because if you use setters, then you generally want users to assign to the setter instead of the field that the setter forwards the value to |
21:34:21 | FromDiscord | <Phil> And with {.internal.} you can hide the field from the docs |
21:34:41 | FromDiscord | <Takemichi Hanagaki> In reply to @Elegantbeef "Yes move the `var`": Ohh, my bad! It was a misstyping...↵I'm using as you suggest me.↵But, how can I define when use var or non-var version? |
21:35:02 | FromDiscord | <Elegantbeef> When you use a var it calls the var version |
21:35:08 | FromDiscord | <Livid> In reply to @Elegantbeef "You want to use": Does that mean to always call `=destroy`? Because wouldn't that always free, rather than decrement the reference count? Or how would I just decrement the count? |
21:35:09 | FromDiscord | <Elegantbeef> when you use a non var it uses the nonvar version |
21:35:36 | FromDiscord | <Elegantbeef> Ref's `=destroy` properly does a decrement ref count and only frees if it's the last ref in a non cyclic tree↵(@Livid) |
21:36:06 | FromDiscord | <Takemichi Hanagaki> In reply to @Elegantbeef "when you use a": Hummmm, got it!↵Thank you! |
21:37:17 | FromDiscord | <Elegantbeef> Livid you might want to do something like https://github.com/beef331/traitor/blob/traitor1/traitor.nim#L5-L24 and↵https://github.com/beef331/traitor/blob/traitor1/traitor.nim#L226-L230 |
21:40:15 | FromDiscord | <Odi> In reply to @Elegantbeef "With `-d:release` on my": Tested and validated, when i added -d:release --m:orc (i am using the zig compiler so the -d:lto flag is not supported yet) i get a speed of 3.53 second. Thank you, mye delicous Beef👍 |
21:40:58 | FromDiscord | <Elegantbeef> Then you might even get sub 3 seconds with my variant! 😄 |
21:41:24 | FromDiscord | <Takemichi Hanagaki> In reply to @Elegantbeef "when you use a": Is there a way to turn a `var` into a `let` without change the value? |
21:42:25 | FromDiscord | <Takemichi Hanagaki> In reply to @Takemichi Hanagaki "Is there a way": I don't want to copy my sequence and have one more. |
21:42:40 | FromDiscord | <Takemichi Hanagaki> (edit) "sequence" => "`seq`" |
21:42:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qnJ |
21:43:09 | FromDiscord | <Elegantbeef> `lent` is a read only reference, so it does not copy if consumed directly |
21:43:20 | FromDiscord | <Takemichi Hanagaki> sent a code paste, see https://play.nim-lang.org/#ix=4qnL |
21:43:43 | FromDiscord | <Takemichi Hanagaki> In reply to @Elegantbeef "`lent` is a read": It's exactly what I was looking for. Thank you!!!!!! 🤩 |
21:44:04 | FromDiscord | <Elegantbeef> I guess that should technically be a `t: var T): lent T` |
21:46:08 | arkanoid | I'm quite confused. I've always launched async proc with asynccheck, or waitfor, of just awaiting it, or grabbing the future and yelding on it. But now I've accidentally discarded it like "discard myasincproc()" and it executed normally. What's the difference from discarding it and asynccheck'ing it? |
21:51:09 | FromDiscord | <Elegantbeef> All i know is you never should discard a future that you care about |
21:55:47 | * | advesperacit quit () |
22:49:02 | FromDiscord | <gnu> hi! |
22:50:46 | FromDiscord | <Elegantbeef> Hello |
22:54:18 | FromDiscord | <Nilts> how do threads in nim access other procs if they have their own mem |
22:56:11 | FromDiscord | <Elegantbeef> Procs are not thread local |
23:06:00 | FromDiscord | <Nilts> what does that mean? I am trying to re-create threads in a different context, and need to know the workings. |
23:06:23 | FromDiscord | <Elegantbeef> Procedures are in static memory, that is not local to a thread |
23:06:56 | FromDiscord | <Elegantbeef> with refc the heap is thread local, but with arc/orc the heap is not |
23:13:12 | * | rockcavera quit (Remote host closed the connection) |
23:13:32 | * | rockcavera joined #nim |
23:15:45 | arkanoid | Elegantbeef, the point is that it seems the mere existance of a future makes it spin into the event loop |
23:17:12 | arkanoid | asyncCheck makes your program fails if that future fails in the background, but it's not in charge of making it spin into the event loop |
23:27:45 | FromDiscord | <jmgomez> IIRC asyncCheck adds a stacktrace to the future |
23:28:12 | FromDiscord | <jmgomez> and make it raise |
23:38:22 | FromDiscord | <Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4qob |
23:39:09 | FromDiscord | <Graveflo> (edit) "https://play.nim-lang.org/#ix=4qob" => "https://play.nim-lang.org/#ix=4qoc" |
23:45:20 | FromDiscord | <Elegantbeef> cause you do not have `:=` called until the finally |
23:46:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qod |
23:50:56 | FromDiscord | <Graveflo> Thanks alot! that does work, but it calls into question my understanding of how the template works. The only difference I see is that `s` is referenced before `body` in your example. Does nim not bother "evaluating" the expression until its needed? Surely this must be a semantic that is exclusive to templates since procs and the like would need the parameters up front. |
23:51:42 | FromDiscord | <Elegantbeef> templates paste the expression of the parameters where they're used |
23:51:45 | FromDiscord | <Elegantbeef> They're lazily evaluated |
23:52:36 | FromDiscord | <Elegantbeef> Templates are code subsitution |
23:54:04 | FromDiscord | <Graveflo> right I realized how bad the "evaluated" sentiment was both while I was writing it and afterward. It makes sense that the template can do formatting stuff like that. It just wasn't obvious at first. Great info though. much appreciated |
23:57:27 | * | Notxor quit (Quit: Leaving) |