00:01:09 | * | krux02 quit (Quit: Leaving) |
00:03:20 | FromDiscord | <Bubblie> Hey leorize when you meant the type of the proc, did you mean whether it was void etc.? |
00:04:01 | FromDiscord | <leorize> the type of the proc is its signature |
00:04:15 | FromDiscord | <leorize> ie `proc(a: int, b: string)` |
00:04:16 | FromDiscord | <Bubblie> Signature? |
00:04:34 | FromDiscord | <Bubblie> Is signature its params? |
00:05:08 | * | emery quit (Ping timeout: 255 seconds) |
00:08:44 | FromDiscord | <!Patitotective> and return type |
00:09:26 | FromDiscord | <Bubblie> Ah so void in this case |
00:22:15 | * | ehmry joined #nim |
00:29:23 | FromDiscord | <leorize> void return type is the same as not specifying one in nim btw |
00:50:55 | * | joast quit (Quit: Leaving.) |
01:14:13 | FromDiscord | <Bubblie> In reply to @leorize "void return type is": Thanks! :) |
01:15:37 | FromDiscord | <Forest> Can anyone who understands futhark help us just, make it stop making numbered identifiers public? |
01:15:52 | FromDiscord | <Forest> The numbered identifiers being exported reaaaally fucks with the IDE lmao |
01:15:54 | FromDiscord | <!Patitotective> you could ping its creator, pmunch |
01:16:01 | FromDiscord | <Forest> Already did that yesterday |
01:16:25 | FromDiscord | <Forest> Also made a GitHub issue |
01:16:37 | FromDiscord | <Forest> Just really wanting to get rid of numbered identifiers being exported because it's annoying us- |
01:17:36 | FromDiscord | <Forest> I just don't understand in the code what the numbered identifier is, and what the clean identifier is, it doesn't make it obvious |
01:31:03 | FromDiscord | <Forest> Anyone? I've tried to go through it multiple times but yeah- |
01:34:52 | FromDiscord | <Elegantbeef> Manually going through is pretty much all you can do 😄 |
01:36:27 | FromDiscord | <Forest> In the futhark GitHub repo |
01:36:30 | FromDiscord | <Forest> I just can't understand it sob |
01:54:50 | FromDiscord | <Bubblie> :reducedtoatoms: |
01:54:52 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=479a |
01:55:10 | FromDiscord | <Elegantbeef> Look up the type in the futhark file |
01:56:11 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=479b |
01:56:32 | FromDiscord | <Bubblie> this is what it looks like in the futhark file |
01:56:55 | FromDiscord | <Elegantbeef> `message: cstring` isnot `a2: ptr cuchar` |
01:58:34 | FromDiscord | <Bubblie> oh yeah I changed it to cstring cause ptr cuchar wasn't working |
01:58:46 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=479c |
01:58:47 | FromDiscord | <Bubblie> at least the error |
01:58:51 | FromDiscord | <Bubblie> is a bit different? |
02:01:03 | FromDiscord | <!Patitotective> are you assigning something to that procedure returns type? it has no type |
02:01:15 | FromDiscord | <Bubblie> can I send you what I have? |
02:01:18 | FromDiscord | <!Patitotective> (edit) "procedure returns type?" => "procedures result?" |
02:01:23 | FromDiscord | <!Patitotective> sure you can |
02:01:29 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=479e |
02:01:41 | FromDiscord | <Bubblie> that echo there is a placeholder |
02:01:49 | FromDiscord | <Bubblie> just so I know its at least working and prints something |
02:02:02 | FromDiscord | <!Patitotective> what is `instancerequestadapter`'s signature? |
02:02:46 | FromDiscord | <Elegantbeef> `instanceRequestAdapter` returns nothing |
02:02:54 | FromDiscord | <Elegantbeef> It's here↵(@Bubblie) |
02:03:03 | FromDiscord | <Bubblie> oh |
02:03:04 | FromDiscord | <Bubblie> what... |
02:03:19 | FromDiscord | <Bubblie> oh |
02:03:20 | FromDiscord | <Bubblie> my |
02:03:21 | FromDiscord | <Bubblie> god |
02:03:30 | FromDiscord | <Bubblie> :facepalm: I should quit coding |
02:03:55 | FromDiscord | <Bubblie> that |
02:03:56 | FromDiscord | <Bubblie> fixed it beef |
02:04:16 | FromDiscord | <!Patitotective> In reply to @Bubblie "<:facepalm:664295198318395392> I should": do crochet with me |
02:04:33 | FromDiscord | <Bubblie> LOL |
02:04:37 | FromDiscord | <Bubblie> Sounds wonderful 😭 |
02:05:05 | FromDiscord | <Bubblie> thanks everyone, I am truly the smartest man alive (sarcasm) |
02:05:08 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=479f |
02:05:31 | FromDiscord | <Forest> Is it safe to ignore it? Because binding file is generated anyway and passes `nim check` |
02:05:49 | FromDiscord | <Bubblie> at least now I gained some experience and to check for things properly 😭 |
02:06:38 | FromDiscord | <Forest> Lmao |
02:19:11 | * | joast joined #nim |
02:35:54 | FromDiscord | <zhaozilong> https://i.imgflip.com/6pggbb.jpg |
02:36:26 | FromDiscord | <!Patitotective> In reply to @zhaozilong "https://i.imgflip.com/6pggbb.jpg": <@&371760044473319454> |
02:40:43 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
02:42:24 | FromDiscord | <Prestige> Wat |
02:43:23 | FromDiscord | <zhaozilong> @Moderator ban me |
02:47:32 | FromDiscord | <j-james> annoying |
02:48:33 | FromDiscord | <zhaozilong> ooh oooh so annoying 🤓 |
02:49:17 | FromDiscord | <Rika> LMAO |
02:49:19 | FromDiscord | <Elegantbeef> It's a real shame these people exist, really ruining the goodwill of matrix 😄 |
02:49:55 | FromDiscord | <that_dude> Seems like we've been getting a lot of trash recently lol |
02:50:12 | FromDiscord | <Elegantbeef> The real shame is these are real people and arent spam bots |
02:50:26 | FromDiscord | <that_dude> Well That means I get to make fun of them even more |
02:50:41 | FromDiscord | <Elegantbeef> These people are getting paid to go through AI prevention tools to spam a shitty game URL |
02:52:16 | FromDiscord | <salt rock lamp> hi all, i was surprised to find that by translating a python program to nim, i actually got worse performance than python. does anyone have any profiling tips, or any suggestions about obvious performance improvements to the nim code? here is the code\: https://git.sr.ht/~wintershadows/polyglot-benchmarks/tree/master/item/running-stats-cli/implementations/nim/calc.nim which i am compiling with `nim compile --define:release --mm:o |
02:52:36 | FromDiscord | <Elegantbeef> Cracks knuckles |
02:52:54 | FromDiscord | <salt rock lamp> the equivalent python is here https://git.sr.ht/~wintershadows/polyglot-benchmarks/tree/master/item/running-stats-cli/implementations/python/calc.py |
02:53:08 | FromDiscord | <Elegantbeef> Nim's `lines` might be the culprit |
02:53:34 | FromDiscord | <flywind> In reply to @salt rock lamp "hi all, i was": What's the number? |
02:53:39 | FromDiscord | <salt rock lamp> interestingly on cpython 3.8 (or maybe 3.9?) on my older macbook pro x86, nim 1.6.0 was beating python handily. now on the m1 macbook cpython 3.10 is beating nim 1.6.6 by a significant and repeatable amount |
02:53:49 | FromDiscord | <Elegantbeef> `--threads:off` |
02:54:06 | FromDiscord | <Elegantbeef> Ok so you're doing a lot bad |
02:54:27 | FromDiscord | <salt rock lamp> i generated 30 million input lines for this task, python crunched it in 6.34s and nim did it in 7.59 |
02:54:31 | FromDiscord | <salt rock lamp> lay it on me! |
02:54:47 | FromDiscord | <Elegantbeef> can we get the input? |
02:54:55 | FromDiscord | <that_dude> Is doing static things cheating? |
02:54:58 | FromDiscord | <salt rock lamp> i can give you a sample, i don't think you really want 30 million lines of numbers |
02:55:07 | FromDiscord | <flywind> How did you measure the time? |
02:55:25 | FromDiscord | <Rika> In reply to @salt rock lamp "i can give you": What if we did though |
02:55:36 | FromDiscord | <Elegantbeef> It's the `data-sample.txt`? |
02:55:39 | FromDiscord | <salt rock lamp> i just used `gtime`, i used to be using `hyperfine` but the error is +/- 0.1 seconds so it's not worth my time to run it over and over |
02:55:42 | FromDiscord | <salt rock lamp> yeah actually that's the sample input |
02:55:43 | FromDiscord | <zhaozilong> oooh oooh |
02:55:55 | FromDiscord | <flywind> In reply to @flywind "How did you measure": Probbaly echo is quit heavy |
02:56:12 | FromDiscord | <salt rock lamp> it just echos once at the end, i would hope that is +/- miliseconds at worst |
02:56:16 | FromDiscord | <salt rock lamp> i can upload the full data somewhere if you all want it |
02:56:33 | FromDiscord | <Elegantbeef> I got the data dont worry |
02:57:01 | FromDiscord | <zhaozilong> oooh oooh he's spamming admins admins |
02:57:12 | FromDiscord | <Elegantbeef> Oh fuck off |
02:57:25 | FromDiscord | <zhaozilong> ahahahaha |
02:57:33 | FromDiscord | <zhaozilong> that's what u all sound like |
02:57:39 | FromDiscord | <Elegantbeef> It's really not |
02:57:43 | FromDiscord | <zhaozilong> ooh ooh he's a spammer ban him 🤓 |
02:57:46 | FromDiscord | <Prestige> Can someone make beef an admin |
02:57:57 | FromDiscord | <Elegantbeef> This is a programming language community not shitty game community |
02:58:09 | FromDiscord | <Elegantbeef> Go make your own matrix room if you want to have a shitty game community |
02:58:12 | FromDiscord | <zhaozilong> no |
02:58:16 | FromDiscord | <Elegantbeef> I mean they could prestige |
02:58:17 | FromDiscord | <zhaozilong> I will post it here |
02:58:33 | FromDiscord | <zhaozilong> "admins admins" |
02:58:37 | * | ehmry joined #nim |
02:58:40 | FromDiscord | <Prestige> Maybe I should take down his website so he'll shut up |
02:58:44 | FromDiscord | <salt rock lamp> i ignored them 😬 i dont even see placeholders for their messages. idk if all clients support that |
02:58:50 | FromDiscord | <zhaozilong> ban me im a spammer 🤓 dom96\: |
02:59:04 | FromDiscord | <zhaozilong> skiddosser↵(@Prestige) |
02:59:06 | FromDiscord | <zhaozilong> hahaha |
02:59:11 | FromDiscord | <salt rock lamp> @that_dude\: it's only cheating if it substantially changes the program semantics |
02:59:15 | FromDiscord | <zhaozilong> "omg hes spamming adminsss" |
02:59:17 | FromDiscord | <Elegantbeef> Damn that works well salt 😄 |
02:59:21 | FromDiscord | <Prestige> Not exactly zhaozilong. Lol |
02:59:34 | FromDiscord | <Elegantbeef> I hate that you use stdin for this salt |
02:59:51 | FromDiscord | <zhaozilong> I'll wait for your gigamassive botnet |
03:00:04 | FromDiscord | <zhaozilong> bcc5b84c2b8c0351e0088651dcfa25a3.png https://media.discordapp.net/attachments/371759389889003532/1006758803464802364/bcc5b84c2b8c0351e0088651dcfa25a3.png |
03:00:23 | FromDiscord | <Elegantbeef> What's the correct ressult 99, 2, 0? |
03:00:43 | FromDiscord | <salt rock lamp> yeah i know you could read from a file and probably get a lot of mileage out of memmapping and stuff. the goal of this benchmark was as much testing the performance of "user friendly" language primitives as it was to try to just get the fastest program possible |
03:00:50 | FromDiscord | <salt rock lamp> i remain astounded at how fast cpython's float parser is |
03:00:52 | FromDiscord | <Elegantbeef> That's not why i hate it |
03:00:54 | FromDiscord | <Elegantbeef> It's annoying to run |
03:00:56 | FromDiscord | <zhaozilong> pleas admins why aren't the admins banning me |
03:01:15 | FromDiscord | <Elegantbeef> Give me the full data set |
03:01:23 | FromDiscord | <Elegantbeef> Didnt realize the text was a subsection |
03:01:45 | FromDiscord | <salt rock lamp> sent a code paste, see https://play.nim-lang.org/#ix=479n |
03:01:51 | FromDiscord | <zhaozilong> what the fuck is nim |
03:02:07 | FromDiscord | <Elegantbeef> That's pretty much identical to mine |
03:02:08 | FromDiscord | <Elegantbeef> What cpu do you have? |
03:02:43 | FromDiscord | <Elegantbeef> Wait that's not speed |
03:02:44 | FromDiscord | <Elegantbeef> thought that printed out the speed 😄 |
03:02:51 | FromDiscord | <salt rock lamp> hah no, that's the actual output of the program, mean and standard deviation computed in a single pass |
03:03:08 | FromDiscord | <Elegantbeef> Ok well give me a bigger data set and how are you timing it |
03:03:12 | FromDiscord | <Elegantbeef> That takes like 1.1ms |
03:03:36 | FromDiscord | <Elegantbeef> I already see some improvements |
03:04:03 | FromDiscord | <zhaozilong> did you know there are more than 100 servers in matrix.org that have over 5000 users |
03:04:26 | FromDiscord | <salt rock lamp> let me see if i can compress this down to a reasonable size |
03:04:34 | FromDiscord | <Elegantbeef> ok |
03:04:34 | FromDiscord | <zhaozilong> spamming isn't all bad I'm gathering helpful statistics |
03:04:37 | FromDiscord | <salt rock lamp> i can also give you the data generating script but it's in Hy 😆 |
03:04:44 | FromDiscord | <salt rock lamp> or i can generate a smaller one than 30m |
03:05:02 | FromDiscord | <Elegantbeef> Well give me something to bench this |
03:05:32 | FromDiscord | <zhaozilong> @impbox [ftsf]\: ban me ban me |
03:07:03 | FromDiscord | <salt rock lamp> https://files.catbox.moe/o9z7mt.gz here's 1m lines |
03:07:42 | FromDiscord | <salt rock lamp> i'm timing it with `gtime` which i don't know is a good idea or not (that's just `time` if you're on gnu/linux i think) |
03:11:03 | FromDiscord | <salt rock lamp> two assumptions you are allowed to make\:↵1. the input might include non-ascii junk data, but valid lines can only be ascii (including leading/trailing whitespace)↵2. numbers are only in decimal format, no scientific notation and no weird stuff like double prefix minus signs `--3.235` or prefix plus signs `+1.5` |
03:11:18 | * | arkurious quit (Quit: Leaving) |
03:13:22 | FromDiscord | <Elegantbeef> What's the correct output for the 1m lines? |
03:14:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=479o |
03:14:33 | FromDiscord | <salt rock lamp> yep, was just about to post |
03:15:46 | FromDiscord | <salt rock lamp> does it matter what c compiler i use? or is that not likely to be an issue here? |
03:15:54 | FromDiscord | <Elegantbeef> It likely wont change much |
03:16:01 | FromDiscord | <Elegantbeef> the GC and not allocating as much is the big thing |
03:17:17 | FromDiscord | <salt rock lamp> makes sense, i'm curious how you'd go about that. i know that when i had tried this a while ago in lisp and scheme, people in those communities suggested that the gc's were not well-optimized for this kind of thing and that i was probably "thrashing the gc" as one person eloquently put it |
03:17:40 | FromDiscord | <zhaozilong> OOPS i farted |
03:20:16 | FromDiscord | <Elegantbeef> Well `line = strip(lineRaw)` copies a string |
03:20:20 | FromDiscord | <Elegantbeef> So it's not good for performance |
03:20:35 | FromDiscord | <Elegantbeef> I cut 40ms off with https://play.nim-lang.org/#ix=479p |
03:20:40 | FromDiscord | <Elegantbeef> went 140ms to 100ms |
03:20:57 | FromDiscord | <Elegantbeef> using `-d:release --gc:arc` |
03:21:12 | FromDiscord | <salt rock lamp> ah alright. i was trying to emulate python `float()` or c `strtod()` which ignores leading whitespace, and python ignores trailing whitespace while strtod doesn't even look at it |
03:22:27 | FromDiscord | <salt rock lamp> i see, you're just manually walking through the string then. as you can see in the python version, i don't even check if the line is blank until after i try parsing it, which allows me to avoid doing the expensive regex check so many times |
03:23:03 | FromDiscord | <Elegantbeef> Yea the issue is Nim's parse functions do not skip whitespace |
03:23:26 | FromDiscord | <Elegantbeef> You could use parseutils to make your own parseFloat that did skip whitespace |
03:26:21 | FromDiscord | <Prestige> I assume stripping whitespace would also do a copy |
03:26:40 | FromDiscord | <Elegantbeef> That's what i said |
03:26:53 | FromDiscord | <Prestige> Ah yeah, I didn't read up far enough |
03:27:32 | FromDiscord | <Elegantbeef> As such https://play.nim-lang.org/#ix=479q is about the same as the other method |
03:28:45 | FromDiscord | <Elegantbeef> Should be `line == " "` |
03:28:47 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "As such https://play.nim-lang.org/#ix=479q is": why doesnt people sort imports by length? 💀 |
03:28:57 | FromDiscord | <Elegantbeef> What? |
03:29:22 | FromDiscord | <Elegantbeef> Why the hell would i manually reformat an entire import order for no reason |
03:29:39 | FromDiscord | <!Patitotective> it will look nicer :p |
03:29:46 | FromDiscord | <Prestige> Dang this has been archived https://github.com/dylhack/matrix-nim-sdk are there any other matrix libs available? |
03:29:56 | FromDiscord | <Elegantbeef> Tandy has a fork of it prestige |
03:30:00 | FromDiscord | <!Patitotective> i may not program good but i want to make my code ordered |
03:30:09 | FromDiscord | <Elegantbeef> Tandy's fork is upstream practically now |
03:30:23 | FromDiscord | <Prestige> Thanks for the info |
03:30:32 | FromDiscord | <Elegantbeef> Aw shit i need to PR my macro in |
03:30:56 | FromDiscord | <Prestige> for the matrix sdk? |
03:31:00 | FromDiscord | <Elegantbeef> Yea |
03:31:50 | FromDiscord | <Prestige> I wanted to make a little cli matrix tool so I could view rooms, get notified of keywords as a daemon, etc |
03:32:05 | FromDiscord | <salt rock lamp> thanks Elegantbeef , i need to log off for now but feel free to post more stuff and @ me, i'll look at it tomorrow |
03:33:04 | FromDiscord | <Elegantbeef> Eh i'm mostly done the only thing we can really make faster is to replace `lines` with a slightly better iterator |
03:33:18 | FromDiscord | <Prestige> Why is lines slow? |
03:33:28 | FromDiscord | <salt rock lamp> ah okay. fyi i did also want to treat lines of only whitespace as "blank" |
03:33:57 | FromDiscord | <Elegantbeef> I mean your other implementation did that |
03:34:12 | FromDiscord | <Elegantbeef> The way to do it then would be to attempt to parse, then if it fails check if it's whitespace |
03:34:19 | FromDiscord | <salt rock lamp> it only did that because i stripped unconditionally first! |
03:34:32 | FromDiscord | <Elegantbeef> `line.allCharsInSet(WhiteSpace)` |
03:34:38 | FromDiscord | <salt rock lamp> that's what the python version does. i wasn't sure if there was a not-highly-verbose way to do it |
03:34:40 | FromDiscord | <salt rock lamp> ah great, let me try that |
03:34:58 | FromDiscord | <Elegantbeef> You could also do it in the parser and use an exception to propagate it's all whitespace |
03:35:07 | FromDiscord | <!Patitotective> In reply to @salt rock lamp "that's what the python": to make things less verbose move them to another module 😁 |
03:35:09 | FromDiscord | <Elegantbeef> But yea presetige look at this fancy DSL 😄 |
03:35:11 | FromDiscord | <Elegantbeef> https://github.com/beef331/matrix-nim-sdk/commit/bb6c790a69685236a6cfd1c8d0ac9851cfe840ed#diff-ed293695cfe0a1ec6acc3616843af198a0d57f919dd35b5ea94435d8362e9ba2R10-R34 |
03:35:38 | FromDiscord | <Elegantbeef> Need to document it but yea it's a nice tool |
03:35:41 | FromDiscord | <Prestige> Oh that's pretty nice |
03:37:06 | FromDiscord | <salt rock lamp> sent a code paste, see https://play.nim-lang.org/#ix=479s |
03:37:07 | FromDiscord | <Elegantbeef> Yea |
03:37:19 | FromDiscord | <Elegantbeef> Going to slow it down quite a bit |
03:37:28 | FromDiscord | <Elegantbeef> But should still be faster |
03:37:59 | FromDiscord | <salt rock lamp> yeah it's also safe to assume that the performance should be optimized for "mostly valid" data |
03:41:21 | FromDiscord | <salt rock lamp> well now i'm down to 6.47s vs. python 6.24s |
03:41:44 | FromDiscord | <salt rock lamp> i also set `--threads:off` and switched from orc to arc. that made more of a difference than changing the whitespace detection thing though |
03:41:55 | FromDiscord | <salt rock lamp> the whitespace detection change itself was only a few 1/10ths of a second |
03:42:06 | FromDiscord | <salt rock lamp> anyway good night all, happy to get pings if you have other ideas |
03:45:02 | FromDiscord | <Elegantbeef> salt rock lamp\: https://play.nim-lang.org/#ix=479v might be faster but without using the large dataset + a profiler i'm just spitballing |
03:47:23 | FromDiscord | <denball> nim = python + rust |
03:47:33 | FromDiscord | <Elegantbeef> Kinda |
03:47:37 | FromDiscord | <Elegantbeef> More like pascal + rust 😄 |
03:57:15 | FromDiscord | <Elegantbeef> Well thanks prestige got me to actually PR that macro 😄 |
03:57:41 | FromDiscord | <Prestige> Hehe |
03:59:15 | FromDiscord | <Elegantbeef> I wrote that after I had seen the effort to make an endpoint, and just forgot about PRing it |
03:59:39 | FromDiscord | <Elegantbeef> So I guess when/if tandy accepts that PR, endpoints welcome |
04:46:43 | FromDiscord | <Bubblie> so I updated to 1.6.6 but now I have this error |
04:46:44 | FromDiscord | <Bubblie> https://hastebin.com/ovatugecop.apache |
04:47:18 | FromDiscord | <Elegantbeef> `where gcc.exe`? |
04:47:19 | FromDiscord | <Bubblie> not sure what I did 😓 |
04:47:47 | FromDiscord | <Bubblie> In reply to @Elegantbeef "`where gcc.exe`?": I am not sure |
04:47:57 | FromDiscord | <Elegantbeef> What do you mean you're not sure |
04:48:09 | FromDiscord | <Elegantbeef> The shell doesnt say "I am not sure" |
04:48:33 | FromDiscord | <Bubblie> wait |
04:48:33 | FromDiscord | <Bubblie> OH |
04:48:35 | FromDiscord | <Bubblie> gimmie one sec |
04:50:12 | FromDiscord | <Bubblie> okay yeah 💀 |
04:50:28 | FromDiscord | <Bubblie> got it now thank you! 😭 |
04:53:57 | FromDiscord | <Prestige> Does `lent` only work with a certain gc? |
04:54:25 | FromDiscord | <flywind> It should work for refc too. |
04:54:44 | FromDiscord | <Bubblie> can I clear nimcache? |
04:54:49 | FromDiscord | <Prestige> Guess I'm just hitting a compiler bug |
04:54:54 | FromDiscord | <Bubblie> or am I allowed to without things breaking |
04:56:50 | FromDiscord | <le1039dxl12> https://i.imgflip.com/6pggbb.jpg |
04:57:06 | FromDiscord | <Prestige> More spam... <@&371760044473319454> |
04:58:14 | FromDiscord | <Elegantbeef> What's the error?↵(@Prestige) |
04:59:04 | FromDiscord | <Prestige> sent a code paste, see https://play.nim-lang.org/#ix=479G |
05:00:10 | FromDiscord | <Elegantbeef> `genTypeInfoV1(tyNil)` makes it seem like you have `lent nil` |
05:01:04 | FromDiscord | <Prestige> Hm I do actually |
05:01:33 | FromDiscord | <Prestige> Can you not lent a ref object because of that case? |
05:01:44 | FromDiscord | <Prestige> or does lent only really apply to stack objects |
05:01:46 | FromDiscord | <Elegantbeef> A lent ref object doesnt semantically make sense |
05:02:24 | FromDiscord | <Prestige> Well that simplifies things I suppose |
05:02:38 | FromDiscord | <huantian> but copying a pointer might take a lot of computational resources beef! |
05:02:50 | FromDiscord | <Elegantbeef> Lol huan |
05:02:56 | FromDiscord | <Prestige> Didn't know if it somehow prevented mutations to the object |
05:03:04 | FromDiscord | <Elegantbeef> It does |
05:03:06 | FromDiscord | <Prestige> Same for a seq |
05:03:10 | FromDiscord | <Elegantbeef> Well not `lent ref object` but `lent T` |
05:03:43 | FromDiscord | <Prestige> I believe seqs would be fine |
05:03:58 | FromDiscord | <Elegantbeef> Yea they're considered value types so it makes sense to `lent` them |
05:04:28 | FromDiscord | <Prestige> I wish a had a nice way to have extendable objects without making them ref object of RootObj |
05:04:34 | FromDiscord | <Elegantbeef> `ref`s are not considered value types so a lent one is a pointer to a pointer which isnt very useful |
05:04:50 | FromDiscord | <Elegantbeef> If you dont need to group them in a collection you dont need `ref` |
05:04:59 | FromDiscord | <Elegantbeef> `ref` only is needed if you want to group them |
05:05:26 | FromDiscord | <Prestige> Well they'll be stored in a seq frequently |
05:05:36 | FromDiscord | <Elegantbeef> Well then you need a ref regardless of language 😄 |
05:05:41 | FromDiscord | <Elegantbeef> Unless you use a variant |
05:06:12 | FromDiscord | <Elegantbeef> dont come at me with JS/Python |
05:06:16 | FromDiscord | <Prestige> yeah, I would but I'd like the user of the api to be able to extend the functionality of the base type |
05:06:45 | FromDiscord | <huantian> I mean all python objects are mostly ref kinda |
05:06:53 | FromDiscord | <Elegantbeef> That's why i said "dont" 😄↵(@huantian) |
05:07:23 | FromDiscord | <Elegantbeef> In JS/Python you get this due to the fact all objects are indirected and you arent operating on the the same as Nim/C++/C/Rust/Zig/... |
05:07:56 | FromDiscord | <Elegantbeef> You want to have an extensible type you need to use a reference to indirect the size allocation, unless you make your seq/API for it |
05:07:59 | FromDiscord | <Prestige> Strange, I got rid of that lent and get the same error |
05:08:06 | FromDiscord | <Elegantbeef> But the downside of that seq is you'd have `O(1)` |
05:08:07 | FromDiscord | <Prestige> I still think it has something to do with repr |
05:08:23 | FromDiscord | <Elegantbeef> Is this in a macro? |
05:08:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=479K |
05:09:01 | FromDiscord | <Prestige> ^ yep that's the cause |
05:09:23 | FromDiscord | <Elegantbeef> Why you're calling `repr` on a nil lit is beside me, but yea this is an issue of course |
05:10:04 | FromDiscord | <Prestige> Part of a testing framework to print values of objects when an assertion fails |
05:12:34 | FromDiscord | <Prestige> What's odd is, that block of code isn't even executed |
05:12:41 | FromDiscord | <Elegantbeef> Well yea |
05:12:47 | FromDiscord | <Elegantbeef> It's a compile time error in cgen |
05:12:51 | FromDiscord | <Prestige> Yeah |
05:12:59 | FromDiscord | <Prestige> unfortunate |
05:13:03 | FromDiscord | <Elegantbeef> You're attempting to generate a typedesc for `nil` |
05:13:27 | FromDiscord | <Elegantbeef> How you're getting a typeless`nil` doesnt make any sense |
05:13:47 | FromDiscord | <Prestige> `Takes any Nim variable and returns its string representation.`↵I feel like this case should be handled |
05:13:58 | FromDiscord | <Elegantbeef> what? |
05:14:19 | FromDiscord | <Prestige> Actually it works with orc |
05:14:27 | FromDiscord | <Prestige> That was a docstring from `repr` |
05:14:37 | FromDiscord | <Elegantbeef> But a niil literal isnt a variable |
05:14:46 | FromDiscord | <Elegantbeef> The error here is you're calling `repr(nil)` |
05:15:08 | FromDiscord | <Prestige> I'm giving it a variable that is equal to nil |
05:15:10 | FromDiscord | <flywind> > untyped is useful to make sure the replacement is done before any semantic checking/type resolution.↵Is it documented somewhere? |
05:15:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=479L |
05:15:38 | FromDiscord | <Prestige> hm oh I see |
05:16:01 | FromDiscord | <Elegantbeef> It's not that something is equivalent to nil, it's that you're passing an untyped nil |
05:16:03 | FromDiscord | <Prestige> but curious that it works with orc |
05:16:09 | FromDiscord | <Elegantbeef> You found a bug |
05:16:30 | FromDiscord | <huantian> one man's bug is another man's feature |
05:16:33 | FromDiscord | <Prestige> Lol |
05:16:41 | FromDiscord | <Elegantbeef> Lol |
05:16:46 | FromDiscord | <Prestige> Where is the actual source code for repr, it's just "magic" |
05:16:55 | FromDiscord | <Elegantbeef> It's in the Nim compiler |
05:17:02 | FromDiscord | <Elegantbeef> `Magic` means "Compiler handles it" |
05:17:24 | FromDiscord | <Prestige> I guess I'm not looking at the compiler code then lol |
05:17:41 | FromDiscord | <Prestige> ah found it |
05:18:27 | FromDiscord | <huantian> wait is the bug that refc crashes the compiler or that orc doesn't crash the compiler |
05:18:46 | FromDiscord | <Prestige> The former |
05:19:02 | FromDiscord | <Prestige> A compiler crash is always a bug |
05:19:09 | FromDiscord | <Elegantbeef> I'd argue the compiler shouldnt be capable of giving the repr of an untyped `nil` but i'm an idiot |
05:19:23 | FromDiscord | <huantian> In reply to @flywind "> untyped is useful": there's a section with it in templates I think <https://nim-lang.org/docs/manual.html#templates-typed-vs-untyped-parameters> |
05:19:39 | FromDiscord | <huantian> In reply to @Elegantbeef "I'd argue the compiler": just have it say "you dum dum why you `repr`-ing `nil`" |
05:20:00 | FromDiscord | <Elegantbeef> I mean a niil literal doesnt match any type, why does it semantically pass |
05:20:19 | FromDiscord | <Prestige> I don't see why we shouldn't allow it, returning "nil" is fine |
05:20:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=479M |
05:20:36 | FromDiscord | <Elegantbeef> There is no type to bind the `nil` to |
05:21:07 | FromDiscord | <huantian> Oh I think I see what you mean |
05:21:13 | FromDiscord | <Elegantbeef> `typeof(nil)` is not an type that can be instantiated |
05:21:19 | FromDiscord | <Elegantbeef> It's like having a `seq[void]` |
05:21:37 | FromDiscord | <Prestige> I don't see why that matters, I'm not trying to evaluate a type |
05:21:38 | FromDiscord | <Elegantbeef> There is no reason i can think of that the code compiles |
05:21:52 | FromDiscord | <Prestige> If I pass `nil` to a template, I'd like to still be able to repr it |
05:21:56 | FromDiscord | <Elegantbeef> `repr(nil)` shouldnt dispatch |
05:22:06 | FromDiscord | <Prestige> `template foo(a: untyped) = repr a` should work imo |
05:22:29 | FromDiscord | <Prestige> (and it does with arc and orc) |
05:22:45 | FromDiscord | <Elegantbeef> This should be a fucking error |
05:22:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=479P |
05:22:59 | FromDiscord | <Elegantbeef> How do you specialize a procedure for `typeof(nil)` |
05:23:24 | FromDiscord | <Elegantbeef> `void` makes sense |
05:23:30 | FromDiscord | <Elegantbeef> `typeof(nil)` is.... what? |
05:23:43 | FromDiscord | <Prestige> Idk what your point is, I'm not trying to do `typeof(nil)` I just want a string representation of a `nil` value |
05:23:59 | FromDiscord | <Elegantbeef> no of an untyped `nil` literal |
05:24:00 | FromDiscord | <Prestige> just like how in my template above, you could do `foo(5)` |
05:24:58 | FromDiscord | <Elegantbeef> `repr(nil)` is a procedure which is specialised for `typeof(nil)` which I think is an implementation detail that is escaping |
05:25:27 | FromDiscord | <Elegantbeef> `typeof(nil)` is only supposed to be used for nil inference, and really shouldnt be able to get put through procedures |
05:26:10 | FromDiscord | <Prestige> I don't really care about the implementation details, just the description of the function |
05:26:21 | FromDiscord | <Prestige> https://play.nim-lang.org/#ix=479Q only fails with refc |
05:26:27 | FromDiscord | <Elegantbeef> I mean you do care about the implementationd etails, cause you want `repr(nil)` to work |
05:26:49 | FromDiscord | <Prestige> That doesn't make sense |
05:26:50 | FromDiscord | <Elegantbeef> That should be a compile time error since you cannot reason the type of `nil` |
05:27:11 | FromDiscord | <Prestige> I don't care about the type ... |
05:27:21 | FromDiscord | <Elegantbeef> We're going in circles |
05:27:31 | FromDiscord | <Elegantbeef> you want to call `repr` on a nil literal correct? |
05:27:34 | FromDiscord | <Prestige> I don't know why you keep bringing up the type |
05:27:38 | FromDiscord | <Prestige> Yes |
05:27:50 | FromDiscord | <Elegantbeef> Ok so that means the compiler must be able to dispatch on a nil literal? |
05:28:15 | FromDiscord | <Prestige> It means the compiler should print "nil" if I give `repr` a nil literal |
05:28:28 | FromDiscord | <Elegantbeef> That wasnt the question |
05:28:31 | FromDiscord | <Elegantbeef> I dont care what the procedure does |
05:28:38 | FromDiscord | <Prestige> Well that's all I care about |
05:28:43 | FromDiscord | <Elegantbeef> ... |
05:29:52 | FromDiscord | <Prestige> It's like the same reason `echo isNil(nil)` should return true, and not be a compiler error |
05:30:06 | FromDiscord | <Elegantbeef> No it should be a compiler error |
05:30:14 | FromDiscord | <Elegantbeef> Atleast to me |
05:30:23 | FromDiscord | <Prestige> Why do you want to handicap the compiler so much lol |
05:30:30 | FromDiscord | <Elegantbeef> It's an untyped `nil` literal |
05:30:35 | FromDiscord | <Prestige> Who cares? |
05:30:40 | FromDiscord | <Prestige> nil is nil |
05:30:51 | FromDiscord | <Elegantbeef> Passing an untyped nil literal to a procedure means the type is escaping the internals |
05:31:11 | FromDiscord | <Elegantbeef> `tyNil` is merely there for nil inference |
05:31:17 | FromDiscord | <Elegantbeef> It's not there to be used for anything |
05:31:40 | FromDiscord | <Elegantbeef> As such you're depending on an implementation detail for code to work |
05:33:50 | FromDiscord | <Prestige> I don't think it should be a compiler error for `isNil(nil)` to return true - like it doesn't matter that this literal doesn't have an assignable type, if you can evaluate if it's nil |
05:34:07 | FromDiscord | <Prestige> Should only be a compiler error if the compiler is unable to resolve the code |
05:35:25 | FromDiscord | <Elegantbeef> I dont think it should be an error either, in the case `isNil` checks that the type of the literal is `tyNil` and is a macro not a procedure 😄 |
05:45:05 | FromDiscord | <Elegantbeef> The fun part is that `tyNil` is allowed to be instantiated but it's a nothing type |
05:45:06 | FromDiscord | <Elegantbeef> It's an untyped pointer for all intents and purposes |
05:45:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=479S |
05:45:34 | FromDiscord | <Elegantbeef> I dont think it should be a valid type, but it seems to instantiate fine and dispatch fine |
05:46:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=479U |
05:46:30 | FromDiscord | <Elegantbeef> It doesnt say the above is ambiguous |
05:47:49 | FromDiscord | <flywind> repr is hard; https://github.com/nim-lang/Nim/issues/20155 |
05:49:03 | FromDiscord | <flywind> `template repr(x: distinct): string =` match `range[distinct]` and causes infinite loop. |
05:59:22 | * | rockcavera quit (Remote host closed the connection) |
07:06:05 | FromDiscord | <Shiba> so what if i wanted to make some changes to standard libary and then copy the files to my project , is it gonna use those files or the one that comes with nim lib |
07:06:30 | FromDiscord | <Elegantbeef> It'll import local first then stdlib |
07:07:11 | FromDiscord | <Elegantbeef> You can use `patchFile` if you want |
07:07:14 | FromDiscord | <Shiba> im gonna try to strip/remove stuff from them , and try |
07:07:17 | FromDiscord | <Shiba> see if its breaks |
07:07:35 | FromDiscord | <Shiba> In reply to @Elegantbeef "You can use `patchFile`": whats thas |
07:07:38 | FromDiscord | <Shiba> (edit) "thas" => "that?" |
07:07:53 | FromDiscord | <Elegantbeef> A wait to replace files for you entire project |
07:08:38 | FromDiscord | <Elegantbeef> way to\ |
07:12:38 | FromDiscord | <tandy> owo |
07:15:49 | FromDiscord | <Elegantbeef> Hopefully that makes it more enjoyable to make matrix endpoints 😄 |
07:16:37 | FromDiscord | <tandy> thanks beef |
07:16:52 | FromDiscord | <tandy> @Prestige\: what have you got planned? |
07:17:05 | FromDiscord | <Elegantbeef> Forgot to document that it creates a `type LoginRequestData = ...` |
07:18:09 | FromDiscord | <Prestige> tandy: I want to basically make a little cli tool that will let me read and send messages from my terminal |
07:18:25 | FromDiscord | <tandy> neat okay↵(@Prestige) |
07:18:40 | FromDiscord | <Prestige> And make a little daemon so I can notify-send if someone pings me |
07:19:02 | FromDiscord | <tandy> sounds doable |
07:19:16 | FromDiscord | <Elegantbeef> Why is that better than just a client though 😄 |
07:19:28 | FromDiscord | <Elegantbeef> Do the terminal matrix clients not ping you? |
07:20:06 | FromDiscord | <Prestige> I never got them working |
07:20:43 | FromDiscord | <Prestige> Also I'd just like this workflow more |
07:36:03 | * | CyberTailor joined #nim |
07:53:51 | madprops | what's a toolkit that allows me to have a tree view where i can easily select/deselect files/directories at any level? |
07:54:00 | madprops | like to select all relevant files for some operation |
08:00:03 | madprops | something like this https://stackoverflow.com/questions/42772848/qt-multiple-item-selection-from-a-list-of-files-and-folders |
08:01:55 | madprops | maybe i should look into qtcreator with c++ i guess, for this |
08:02:02 | madprops | the logic is simple anyway |
08:04:22 | FromDiscord | <Prestige> maybe something like ranger or vifm |
08:15:54 | madprops | i like ranger but seems a bit too complicated |
08:16:07 | madprops | for this thing at least |
08:16:17 | madprops | unless it has a dedicated mode for it that makes it easy |
08:16:55 | madprops | i've never done qt stuff anyway, so new thing to learn |
08:41:58 | FromDiscord | <aph> hi beef, or pmunch up? |
08:55:45 | * | xet7 joined #nim |
09:04:59 | * | ixmpp joined #nim |
10:08:03 | FromDiscord | <EyeCon> In reply to @tandy "sounds doable": I was also about to write a very basic Matrix bot, to learn more about the protocol |
10:08:17 | FromDiscord | <EyeCon> What's the best starting point? Is your repo the most up-to-date one? |
10:08:37 | FromDiscord | <EyeCon> Or will you contribute back to the original one? |
10:58:24 | * | jmdaemon quit (Ping timeout: 268 seconds) |
11:01:28 | * | kenran joined #nim |
11:19:27 | NimEventer | New Nimble package! simpleargs - Simple command line arguments parsing, see https://github.com/HTGenomeAnalysisUnit/nim-simpleargs |
11:33:09 | FromDiscord | <tandy> this, the og seems to be archived now, rip↵(@EyeCon) |
11:33:36 | FromDiscord | <tandy> there are some todos on my fork, so il need to get to that some day |
11:34:14 | FromDiscord | <EyeCon> OK, so if one would hypotetically contribute, yours would be the correct target |
11:34:26 | FromDiscord | <EyeCon> Thanks |
11:35:09 | FromDiscord | <EyeCon> The issues from the OG are still valid though, right? |
11:35:18 | FromDiscord | <EyeCon> Yours don't seem to have separate issues |
11:56:04 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=47bt |
11:59:22 | FromDiscord | <Generic> -1..1 |
12:00:21 | FromDiscord | <Hamid_Bluri> I don't want 0 |
12:02:28 | FromDiscord | <Hamid_Bluri> I think using `enum` is a good idea |
12:02:49 | FromDiscord | <Rika> Use enum yes |
12:02:49 | NimEventer | New thread by Xflywind: The Nim team's latest efforts in mitigating the false postives on the Nim binaries, see https://forum.nim-lang.org/t/9358 |
12:10:24 | FromDiscord | <tandy> yes \:)↵(@EyeCon) |
12:10:55 | FromDiscord | <tandy> once beefs new macro is in, it would be helpful to have some prs to move to the new endpoint definiton format↵(@EyeCon) |
12:18:43 | FromDiscord | <tandy> is there any way to see the c / cpp code when using those backends? |
12:18:55 | FromDiscord | <tandy> like how u can see the js code |
12:19:14 | FromDiscord | <leorize> you can look at the nimcache to get the files |
12:53:02 | * | CyberTailor quit (Remote host closed the connection) |
12:55:06 | * | CyberTailor joined #nim |
13:33:06 | FromDiscord | <aMOPel> Is there some way to access fields of objects with a string? like `obj["fieldname"]` in other languages? or what are you supposed to do with the keys from the `fieldPairs` iterator? |
13:39:12 | FromDiscord | <Rika> firstly, the string must be determinable on compile time |
13:43:27 | * | LaughingBubba joined #nim |
13:44:45 | * | LaughingBubba left #nim (#nim) |
13:44:54 | FromDiscord | <aMOPel> sent a code paste, see https://play.nim-lang.org/#ix=47ca |
13:45:11 | * | LaughingBubba joined #nim |
13:45:46 | * | LaughingBubba quit (Client Quit) |
13:46:09 | FromDiscord | <Forest> Is everything that is needed by the JS backend importable from places that aren't the compiler? |
13:46:20 | FromDiscord | <Forest> I wanna make a backend without modifying the actual compiler |
13:49:08 | FromDiscord | <Rika> In reply to @aMOPel "alright then maybe I": cant help today, kind of out of it |
13:51:19 | FromDiscord | <huantian> key should be known at compile time so you probably can use a macro or maybe template to access the value |
13:52:01 | FromDiscord | <Rika> key is a string so yes |
13:52:55 | FromDiscord | <Rika> you can likely write a template \`[]`(o: untyped; k: static string): untyped or something |
14:09:22 | * | LuxuryMode joined #nim |
14:10:45 | * | arkurious joined #nim |
14:17:47 | FromDiscord | <aMOPel> sent a code paste, see https://play.nim-lang.org/#ix=47co |
14:22:10 | * | rockcavera joined #nim |
14:22:10 | * | rockcavera quit (Changing host) |
14:22:10 | * | rockcavera joined #nim |
14:27:18 | * | kenran quit (Quit: WeeChat info:version) |
14:39:20 | * | gsalazar quit (Read error: Connection reset by peer) |
14:39:32 | * | gsalazar joined #nim |
14:39:47 | FromDiscord | <MegaIng> sent a code paste, see https://play.nim-lang.org/#ix=47cx |
14:40:55 | FromDiscord | <MegaIng> (edit) "https://play.nim-lang.org/#ix=47cx" => "https://play.nim-lang.org/#ix=47cy" |
14:40:56 | FromDiscord | <tandy> anyone know why this compiles on CI but not on my pc? |
14:40:58 | FromDiscord | <tandy> https://github.com/tandy-1000/simple-matrix-client/blob/3b3674157e6c815ffd73617727e1f97e9185b543/simple_matrix_client/client.nim#L32 |
15:11:49 | * | def- quit (Quit: -) |
15:15:45 | * | gsalazar quit (Quit: Leaving) |
15:16:01 | * | gsalazar joined #nim |
15:16:21 | FromDiscord | <aMOPel> In reply to @MegaIng "Not sure if this": that works 👍 thank you |
15:27:49 | FromDiscord | <MegaIng> sent a code paste, see https://play.nim-lang.org/#ix=47d1 |
15:29:31 | FromDiscord | <auxym> why do you need the leading zeros in a numeric literals? I assume they are parsed out early by the compiler anyways |
15:29:35 | * | def- joined #nim |
15:29:51 | FromDiscord | <MegaIng> I want to use that info to build up binary patterns to match against a bit stream |
15:30:20 | FromDiscord | <MegaIng> For that a syntax of the form `` `00 ss cccc` `` would IMO be quite nice |
15:30:37 | FromDiscord | <MegaIng> (edit) "nice" => "nice, with that pattern requiring 8bits" |
15:30:55 | FromDiscord | <MegaIng> But the `00` get's collapsed into a single `0`, which makes this unusable |
15:33:38 | FromDiscord | <MegaIng> I could use `"00" ss ccc` I guess |
15:33:44 | FromDiscord | <MegaIng> (edit) "ccc`" => "cccc`" |
15:34:00 | FromDiscord | <MegaIng> (edit) "I could use ... `"00"``" added "``" | "```"00" ss cccc` ... I" added "``" |
15:35:11 | FromDiscord | <auxym> i see. or use a comma separated list format. |
15:35:38 | FromDiscord | <MegaIng> That would still mean I have to use string literals |
15:41:11 | FromDiscord | <Forest> Can't you store it as hex? |
15:41:18 | FromDiscord | <Forest> 0x(hexval) |
16:01:34 | FromDiscord | <Phil> In reply to @aMOPel "Is there some way": There is, if you have the string at compile time , allows you to generate the code x.y , its useful for having checks.↵In your problem you know the fields at compiletime, this can work |
16:02:11 | FromDiscord | <Phil> I'll need to get home before I can start writing sth up properly |
16:04:16 | FromDiscord | <aMOPel> sent a code paste, see https://play.nim-lang.org/#ix=47df |
16:04:43 | FromDiscord | <Phil> Ah you already solved it, nevermind |
16:05:16 | FromDiscord | <Phil> Man tunnel gave me quite a connection blackout |
16:06:21 | FromDiscord | <Phil> Huh, so ident interprets a string into a symbol? Good to know |
16:18:48 | FromDiscord | <leorize> dot operators have terribad implementation, unfortunately |
16:19:07 | FromDiscord | <leorize> your issue might come down to differences in Nim version |
16:19:34 | FromDiscord | <tandy> on CI im using your github action to get nim devel, on my pc im using gitnim devel |
16:19:41 | FromDiscord | <tandy> crazy |
16:22:06 | * | tiorock joined #nim |
16:22:06 | * | tiorock quit (Changing host) |
16:22:06 | * | tiorock joined #nim |
16:22:06 | * | rockcavera quit (Killed (iridium.libera.chat (Nickname regained by services))) |
16:22:06 | * | tiorock is now known as rockcavera |
16:24:02 | * | tiorock joined #nim |
16:24:02 | * | tiorock quit (Changing host) |
16:24:02 | * | tiorock joined #nim |
16:24:02 | * | rockcavera quit (Killed (erbium.libera.chat (Nickname regained by services))) |
16:24:02 | * | tiorock is now known as rockcavera |
17:11:36 | FromDiscord | <creonico> Hello, I am interested in making a simple wayland compositor in nim and I wonder if there is a tool to generate nim bindings for the protocol and wlroots |
17:21:29 | FromDiscord | <leorize> https://github.com/PMunch/futhark \<- this should work well for that |
17:32:16 | FromDiscord | <tandy> there is already bindings to wlroots↵(@creonico) |
17:32:55 | FromDiscord | <tandy> https://github.com/j-james/nim-wlroots↵https://github.com/j-james/nim-wayland↵(@creonico) |
17:34:22 | FromDiscord | <j-james> the bindings are untested, though |
17:34:40 | FromDiscord | <j-james> so if you find any bugs or missing procedures please report them |
17:38:40 | FromDiscord | <gibson> How would I make a custom container that can work with Nim's `algorithm` module? In C++ the strategy would be to implement iterators for the custom container. Nim doesn't have interfaces so I can't say "this container can look like a seq" AFAIK. Would I have to create all the procs in `algorithm` for my specific container type? |
17:39:04 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
17:42:03 | FromDiscord | <j-james> what does the custom container look like? |
17:52:01 | * | neceve joined #nim |
18:08:23 | FromDiscord | <Forest> Wish there was a minimal working example for the JS backend... Welp time for cursed shit |
18:08:54 | FromDiscord | <spoon> uh oh |
18:11:06 | FromDiscord | <Forest> Oh yes 😎 |
18:11:23 | FromDiscord | <Forest> First thing i need to do is isolate the Nim JS backend stuff into a compilable binary |
18:11:40 | FromDiscord | <Forest> Does Nim compiler stuff require the compiler to be installed too? |
18:12:31 | FromDiscord | <Forest> Working on making it so Nim can be compiled to any language you write a backend for by defining rules in a JSON format |
18:12:46 | FromDiscord | <Forest> Though maybe making it use callbacks is better |
18:12:57 | FromDiscord | <Forest> Yeah JSON is not gonna be even remotely flexible enough for this |
18:21:25 | FromDiscord | <EyeCon> Every sufficiently complicated config file schema eventually becomes a DSL/programming language |
18:22:00 | FromDiscord | <Forest> Lmao fair |
18:22:02 | FromDiscord | <Forest> https://github.com/nim-lang/Nim/blob/devel/compiler/jsgen.nim |
18:22:04 | FromDiscord | <Forest> Hm... |
18:22:18 | FromDiscord | <Forest> Doesn't rely on `jstypes`? |
18:31:43 | FromDiscord | <gibson> @j-james The custom container may be simply an `Object` that is storing data in a seq, internally, in addition to some other field values. |
18:37:04 | FromDiscord | <gibson> Would I need to make a `converter` ?.. just brainstorming. |
18:48:57 | * | jmdaemon joined #nim |
18:55:38 | FromDiscord | <Phil> converter? For the uninitiated, what are you trying to achieve? |
18:59:05 | * | derpydoo joined #nim |
19:12:05 | FromDiscord | <gibson> sent a code paste, see https://play.nim-lang.org/#ix=47dW |
19:13:21 | FromDiscord | <gibson> (edit) "https://play.nim-lang.org/#ix=47dW" => "https://paste.rs/riC" |
19:13:52 | FromDiscord | <gibson> (edit) "https://play.nim-lang.org/#ix=47e0" => "https://play.nim-lang.org/#ix=47dZ" |
19:14:48 | Amun-Ra | iirc you have to implement `<`, `==`, … procs |
19:15:46 | FromDiscord | <Elegantbeef> Reverse works on `openArray` so you cannot just use reverse |
19:15:52 | FromDiscord | <gibson> But `reverse` only takes types of `openArray` |
19:15:56 | FromDiscord | <Phil> In reply to @gibson "<@180601887916163073> It's just a": I will admit I have very little knowledge this close to the metal (Haven't written a single line of code without some kind of mechanism cleaning up my memory for me and never ever cared about memory layout).↵At a glance, it's all openarrays so |
19:16:16 | FromDiscord | <Elegantbeef> You need to pass your sequence to it |
19:16:51 | FromDiscord | <Phil> Yeah pretty much that. The closest thing nim has to interfaces or the likes is concepts and I don't think algorithms was implemented with those yet when they're in general not out of the experimental section yet |
19:17:06 | FromDiscord | <Elegantbeef> you need to write your own `proc reverse(chunk: var Chunk32) = chunk.data.reverse` |
19:17:54 | FromDiscord | <gibson> That's what I was afraid of, that I'd have to implement my own for each proc I'd want available to the user, and they'll have to write each proc for use in another library, etc. etc. |
19:18:20 | FromDiscord | <Elegantbeef> This is why concepts are lovely |
19:18:35 | FromDiscord | <gibson> I'm still trying to learn how concepts would help me here. |
19:18:57 | FromDiscord | <Phil> Not for this specific usecase, the std/algorithm would need to work with concepts for that to function |
19:20:03 | FromDiscord | <Phil> If you wrote a wrapper that handled interaction with std/algorithm for all types that implement a specific concept you could make it work. |
19:20:34 | FromDiscord | <gibson> sent a code paste, see https://play.nim-lang.org/#ix=47e1 |
19:20:40 | FromDiscord | <gibson> but openarray is not a good name here |
19:22:19 | FromDiscord | <gibson> Also, I think the new `Iterable` concept only applies to `iterators`, which are more like python's `generators`, and not necessary things like `seq`s or `array`s. |
19:22:38 | FromDiscord | <Phil> Not quite, a Concept is like an interface, it's more about what something can do rather than what it is |
19:23:43 | FromDiscord | <Phil> So yours I guess could be called the `AlgorithmIterator` (I have barely though 5 seconds about that name and not a deeper understanding of the lib to grasp whether that could just be called `Iterator` or not) |
19:23:58 | FromDiscord | <Phil> (edit) "`AlgorithmIterator`" => "`AlgorithmIterable`" |
19:24:06 | FromDiscord | <Phil> (edit) "`Iterator`" => "`Iteratable`" |
19:24:13 | FromDiscord | <Phil> (edit) "`Iteratable`" => "`Iterable`" |
19:24:21 | * | krux02 joined #nim |
19:26:02 | FromDiscord | <Elegantbeef> Eh actually a concept wouldnt work here |
19:26:10 | FromDiscord | <gibson> So probably the concept would validate/verify that my container has an iterator defined for it? |
19:26:13 | FromDiscord | <Elegantbeef> cause it means all types would have `data` |
19:26:49 | FromDiscord | <gibson> Or that my container would conform to using `[]`, `[]=`? |
19:27:08 | FromDiscord | <Elegantbeef> It'd ensure your concept had the require operations for sorting |
19:27:59 | FromDiscord | <Phil> For which there already is a concept of Comparable IIRC |
19:28:02 | FromDiscord | <Elegantbeef> So probably a `items` `[]` `[]=` `len` and `coll[int] is T` |
19:28:38 | * | MightyJoe quit (Ping timeout: 240 seconds) |
19:28:48 | FromDiscord | <Phil> Ohh alright or like that |
19:28:51 | FromDiscord | <gibson> That makes sense! |
19:29:32 | * | cyraxjoe joined #nim |
19:29:54 | FromDiscord | <gibson> Is there any reason such a contributed lib would not be entertained right now? (a rewrite of algorithm to use concepts) |
19:30:28 | FromDiscord | <gibson> Assuming someone volunteers and does the work / it sounds like something I could potentially do. |
19:31:01 | FromDiscord | <Phil> In reply to @gibson "Assuming someone volunteers and": Keep in mind that Concepts are still jumping around in the "Experimental" section of nim features |
19:31:23 | FromDiscord | <gibson> Ah okay, that's the reason. |
19:33:34 | FromDiscord | <Phil> Beef? Can concepts determine whether a user has defined a custom `new` constructor proc? |
19:33:55 | FromDiscord | <Elegantbeef> yes, but no |
19:34:11 | FromDiscord | <Phil> I would imagine the default `new(T)` proc gets in the way |
19:41:54 | NimEventer | New post on r/nim by Ok_World__: First Nim project - qwatcher, see https://reddit.com/r/nim/comments/wl6ooo/first_nim_project_qwatcher/ |
19:49:23 | * | neceve quit (Ping timeout: 268 seconds) |
19:50:33 | FromDiscord | <tandy> come to the nimskull matrix space↵(@Forest) |
19:51:16 | FromDiscord | <tandy> https://matrix.to/#/#nimworks:envs.net |
19:51:22 | FromDiscord | <Forest> No idea what that is, and i prefer Discord tbh but fair |
19:51:36 | FromDiscord | <Forest> I'm called Mythical-Forest-Collective btw on Matrix |
19:52:23 | FromDiscord | <tandy> its a hard fork of nim↵(@Forest) |
19:52:27 | FromDiscord | <Forest> In it now |
19:52:54 | FromDiscord | <Forest> In reply to @tandy "its a hard fork": Oh? Why? And is it still aiming to be compatible with existing Nim code, now and in the future? |
19:53:03 | FromDiscord | <Rika> yes |
19:53:07 | FromDiscord | <Rika> as much as it can |
19:53:27 | FromDiscord | <Forest> Sweet |
19:53:49 | * | gsalazar quit (Ping timeout: 252 seconds) |
19:54:23 | FromDiscord | <tandy> peep the readme, its a hard fork, so stuff will diverge, so compatibility is not guaranteed↵(@Forest) |
19:54:51 | FromDiscord | <tandy> but some of the main ideas behind it are reducing compiler tech debt, making it more of a community maintable / run project |
19:55:01 | FromDiscord | <Forest> That looks neat ngl |
19:58:43 | FromDiscord | <tandy> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1007014064809054238): peep the readme, its a hard fork, stuff will diverge, so compatibility is not guaranteed |
20:12:53 | FromDiscord | <Alea> Oh, they finally picked a name for nimskull? |
20:13:28 | FromDiscord | <Rika> huh they did |
20:16:05 | FromDiscord | <Alea> I hope they create a discord for it eventually, I'd love to see more discussion on it |
20:22:17 | FromDiscord | <Forest> Same, discord would be more ideal |
20:22:37 | FromDiscord | <Forest> Bleh issue is i want most pure Nim code to work- |
20:23:01 | FromDiscord | <Forest> Nimskull may be my best bet though so |
20:31:36 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=47ee |
20:32:18 | FromDiscord | <haxscramper> have you imported `tables` in the `map.nim`? |
20:32:37 | FromDiscord | <jmgomez> yup |
20:33:41 | FromDiscord | <haxscramper> `$` might fail to compile with this error if you are trying to print something whose `$` implementation prints pointers |
20:33:56 | FromDiscord | <haxscramper> if `UScriptStructPtr` is of any indication |
20:34:17 | FromDiscord | <haxscramper> so you might have to define `$` for pointers to your data if it is acyclic |
20:34:27 | FromDiscord | <haxscramper> and then default `$` for objects might kick in |
20:34:41 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=47ef |
20:37:37 | FromDiscord | <haxscramper> In that case, I can't say for sure, but I would bet it is either (1) default `$` cannot handle some types or (2) importing `tables` failed somewhere else. Try printing the table itself, printing keys, values used for the parametrization |
20:37:39 | FromDiscord | <haxscramper> etc. |
20:38:33 | FromDiscord | <jmgomez> I will just reimplemented it for my TMap instead of converting it into a table and then printing the table, did that because I thought it will be quickier |
20:38:34 | FromDiscord | <haxscramper> given your error and types I see in it I'd suggest going in this direction |
20:38:35 | FromDiscord | <jmgomez> thanks! |
20:39:21 | FromDiscord | <jmgomez> In reply to @haxscramper "In that case, I": (I did the second part already before attempting this) |
20:41:32 | * | wallabra_ joined #nim |
20:43:02 | * | wallabra quit (Ping timeout: 268 seconds) |
20:43:16 | * | wallabra_ is now known as wallabra |
20:45:35 | FromDiscord | <Jakraes> Hey guys, perhaps I'm not the only one having this problem but every single browser I use is signaling the nim 1.6.6 zip file as a virus |
20:46:25 | FromDiscord | <Elegantbeef> Yep antivirus thinks nim tooling is a virus |
20:47:43 | FromDiscord | <Jakraes> Yup, and windows doesn't even let me open the zip if I'm able to download it, weird stuff |
20:53:57 | FromDiscord | <!Patitotective> _don't use windows_ |
20:54:17 | NimEventer | New post on r/nim by Mibuna: How would I write a query language in Nim?, see https://reddit.com/r/nim/comments/wl8imw/how_would_i_write_a_query_language_in_nim/ |
21:00:20 | * | derpydoo quit (Quit: derpydoo) |
21:00:35 | FromDiscord | <Jakraes> I think I'll use choosenim for the installation |
21:00:39 | FromDiscord | <Jakraes> Should work well enough |
21:13:50 | FromDiscord | <!Patitotective> In reply to @Jakraes "I think I'll use": it's the best ~~(even though it doesn't work for me 💀 )~~ |
21:14:33 | FromDiscord | <Jakraes> I mean |
21:14:42 | FromDiscord | <Jakraes> It installs stuff easily but I think I messed up somewhere |
21:14:50 | FromDiscord | <Jakraes> I can't compile for windows lul |
21:15:14 | FromDiscord | <Jakraes> Just gives a file without the .exe |
21:16:49 | FromDiscord | <!Patitotective> In reply to @Jakraes "I can't compile for": how are you doing it? |
21:17:03 | FromDiscord | <Jakraes> nim c filename.nim |
21:17:12 | FromDiscord | <Jakraes> I'm also using nim c --os:Windows filename.nim |
21:17:17 | FromDiscord | <Jakraes> The latter gives me an error |
21:17:39 | FromDiscord | <Jakraes> Not related to the os flag, I'll try to see if I can work around it |
21:18:41 | FromDiscord | <!Patitotective> In reply to @Jakraes "nim c filename.nim": that should work, could you send the code you're compiling and the compiler output? |
21:19:07 | FromDiscord | <Jakraes> Nothing special |
21:19:08 | FromDiscord | <Jakraes> sent a code paste, see https://play.nim-lang.org/#ix=47ep |
21:19:08 | FromDiscord | <!Patitotective> In reply to @Jakraes "I'm also using nim": that's not how you use it, it compiles to windows automatically |
21:19:22 | FromDiscord | <Jakraes> That's what I thought as well but it isn't :/ |
21:19:24 | FromDiscord | <!Patitotective> and the compiler output? |
21:19:37 | FromDiscord | <Jakraes> Just a file with no extention |
21:20:02 | FromDiscord | <!Patitotective> when you run `nim c filename.nim`, what is the output? |
21:20:18 | FromDiscord | <!Patitotective> terminal output |
21:20:18 | FromDiscord | <Jakraes> A file named filename |
21:20:21 | FromDiscord | <Jakraes> Ah |
21:20:47 | FromDiscord | <Jakraes> https://media.discordapp.net/attachments/371759389889003532/1007035807133093998/Screenshot_6.png |
21:21:15 | FromDiscord | <!Patitotective> seems like the output is `test` |
21:21:19 | FromDiscord | <Jakraes> Yup |
21:21:20 | FromDiscord | <!Patitotective> try to rename it and see if it runs |
21:21:26 | FromDiscord | <Jakraes> Instead of test.exe |
21:22:36 | FromDiscord | <domosokrat> @Jakraes\: looking the path you're in, I would say it's a wasm binary |
21:22:48 | FromDiscord | <Jakraes> Hmmmm it might be because of the directory actually |
21:22:51 | FromDiscord | <Jakraes> Yup |
21:23:02 | FromDiscord | <Jakraes> I was playing around with wasm, works outside of the directory |
21:24:01 | FromDiscord | <Jakraes> I guess that explains it :p Thank you guys for helping me out |
21:25:56 | FromDiscord | <dom96> In reply to @Patitotective "it's the best ~~(even": it doesn't? Why not? |
21:26:12 | FromDiscord | <domosokrat> you're welcom |
21:26:34 | FromDiscord | <dom96> In reply to @Jakraes "I think I'll use": sadly I've seen Windows Defender prevent a choosenim install |
21:26:45 | FromDiscord | <dom96> might work for you if you're using a different av though, who knows |
21:27:10 | FromDiscord | <dom96> I'd recommend using WSL :) |
21:27:18 | FromDiscord | <!Patitotective> In reply to @dom96 "it doesn't? Why not?": we have already been through this but iirc it's because my cpu is too old↵let me see if i can find the messages |
21:27:30 | FromDiscord | <Jakraes> Nim can get a bit weird on windows sometimes, it's always a bunch of work for me to install a new version but it's definitely worth it |
21:27:36 | FromDiscord | <Jakraes> Can't wait to switch to linux lul |
21:27:40 | FromDiscord | <dom96> In reply to @Patitotective "we have already been": oh, 32bit? is it? |
21:30:16 | FromDiscord | <!Patitotective> In reply to @dom96 "oh, 32bit? is it?": no but still quite old, see #nimble |
21:31:08 | FromDiscord | <dom96> huh, that's Nimble failing not choosenim |
21:31:26 | FromDiscord | <dom96> or not even Nimble, but how the nightlies are built from what I can see |
21:31:46 | FromDiscord | <!Patitotective> then let me try choosenim now lol |
21:34:58 | FromDiscord | <dom96> what you can do as a workaround is force choosenim not to use nightlies: `choosenim \#v1.6.6` should work |
21:35:28 | FromDiscord | <dom96> (this tells choosenim to grab Nim from git with the branch/tag name of "v1.6.6" |
21:35:37 | FromDiscord | <dom96> (edit) ""v1.6.6"" => ""v1.6.6")" |
21:36:12 | FromDiscord | <dom96> which means it will run `koch tools` and hopefully get you a non-SSE3 build |
21:36:49 | FromDiscord | <dom96> might also be worth creating an issue in https://github.com/nim-lang/nightlies |
21:37:02 | FromDiscord | <dom96> and/or ping @leorize :) |
21:39:05 | FromDiscord | <mersenne> How would I make a query language in Nim? |
21:41:09 | FromDiscord | <!Patitotective> wooops |
21:41:11 | FromDiscord | <!Patitotective> suddenly it works |
21:41:22 | FromDiscord | <!Patitotective> (edit) "suddenly it works ... " added "(choosenim)" |
21:41:34 | FromDiscord | <!Patitotective> maybe upgrading to ubuntu 22.04 did fix it |
21:42:54 | FromDiscord | <dom96> did it work without the `#v1.6.6`? |
21:43:24 | FromDiscord | <!Patitotective> yes |
21:47:11 | * | Guest77 joined #nim |
21:47:52 | * | Guest77 quit (Client Quit) |
22:02:28 | FromDiscord | <dom96> nice |
22:09:01 | FromDiscord | <!Patitotective> :] |
22:25:44 | * | CyberTailor quit (Remote host closed the connection) |
22:26:01 | FromDiscord | <leorize> if only nimble has the issue then it's likely coming from the linked openssl, our binaries come from https://github.com/JuliaBinaryWrappers/OpenSSL_jll.jl and maybe they're building with optimization targeting x86\_64-v2↵(@dom96) |
22:27:22 | * | CyberTailor joined #nim |
22:28:26 | FromDiscord | <Bubblie> can you use dlopen in nim? |
22:29:35 | FromDiscord | <leorize> yes, see https://nim-lang.org/docs/dynlib.html |
22:29:43 | FromDiscord | <Bubblie> thank you! |
22:51:16 | FromDiscord | <Tuatarian> If I turn off gc, can I still use stdlib modules? |
22:54:58 | FromDiscord | <Elegantbeef> Yes but gc'd memory will leak |
22:55:14 | FromDiscord | <Elegantbeef> Just use `arc` is the best for your sanity |
22:55:32 | FromDiscord | <Elegantbeef> It's a basic GC that's very low latency |
22:58:27 | FromDiscord | <Tuatarian> Right but let's say I want to avoid the refcount overhead |
23:07:08 | FromDiscord | <Forest> Why aren't changes in Nimskull planned to be included? (Like making the backend code cleaner) |
23:11:21 | * | oz` is now known as oz |
23:15:42 | FromDiscord | <!Patitotective> In reply to @Forest "Why aren't changes in": make a pr |
23:16:30 | FromDiscord | <Forest> Apparently they aren't really wanted by the community tho |
23:16:55 | FromDiscord | <!Patitotective> well, you can get a better answer in the forum or directly making a pr |
23:17:30 | FromDiscord | <dom96> In reply to @Forest "Apparently they aren't really": seems the "PRs welcome" messaging isn't getting through /j |
23:17:51 | FromDiscord | <Forest> Fair enough |
23:19:01 | FromDiscord | <!Patitotective> In reply to @dom96 "seems the "PRs welcome"": we should make an ai that sends "PRs welcome" |
23:19:07 | FromDiscord | <!Patitotective> oh, actually it already exists↵its called beef |
23:19:31 | FromDiscord | <Forest> Lmao |
23:20:23 | FromDiscord | <dom96> haha |