<< 11-12-2020 >>

00:01:16FromDiscord<shadow.> yeah exactly
00:01:26FromDiscord<shadow.> low verbosity compared to other compiled languages
00:03:41FromDiscord<ElegantBeef> Shadow's taunting me with the use of scanf 😄
00:04:17FromDiscord<ElegantBeef> I just rewrote my `whenScanf` to `scanTuple`, to avoid predeclaring variables with scanf, then i come here and see scanf 😛
00:05:50FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Hul Atleast i think it'll be nice
00:07:59FromDiscord<Quibono> Does anyone use Alpaca as a broker? I'm trying to write a Nim SDK
00:09:20FromDiscord<shadow.> ooh that's sexy
00:09:23FromDiscord<shadow.> what's that a part of?
00:10:51FromDiscord<ElegantBeef> Hopefully if my pr goes through `strscans` 😄
00:10:54FromDiscord<shadow.> ohhh
00:10:55FromDiscord<shadow.> good idea
00:11:01FromDiscord<shadow.> i'd love to see that go through
00:12:02FromDiscord<shadow.> i wonder what i could pr
00:15:22FromDiscord<shadow.> @ElegantBeef would it just return `default` for the rest of the values if success is false?
00:15:31FromDiscord<ElegantBeef> Yes
00:15:35FromDiscord<shadow.> fair fair
00:15:51FromDiscord<ElegantBeef> You should check the success before accessing the other values
00:15:56FromDiscord<shadow.> ye ofc
00:16:03*opal quit (Ping timeout: 240 seconds)
00:16:14FromDiscord<shadow.> well in this example you need to assign the tuple instead of declaring the vars lol
00:16:21FromDiscord<shadow.> but usually thats shorter than declaring all the vars still
00:16:46FromDiscord<Quibono> sent a code paste, see https://play.nim-lang.org/#ix=2Hun
00:16:50FromDiscord<ElegantBeef> `type`
00:16:54FromDiscord<ElegantBeef> shit
00:16:56FromDiscord<shadow.> lol
00:16:57FromDiscord<Quibono> lol
00:16:58FromDiscord<ElegantBeef> backticks before and after
00:17:00FromDiscord<shadow.> \`type\`
00:17:04FromDiscord<Quibono> Cool
00:17:21FromDiscord<Quibono> I thought that was it, but I wasn't sure.
00:17:41FromDiscord<ElegantBeef> Yea shadow you dont have to write them twice, but have to pay the price with tuple unpacking which is afaik is relatively slow afaik
00:17:53FromDiscord<ElegantBeef> god damn i'm dumb today
00:18:06FromDiscord<shadow.> lol
00:18:18FromDiscord<shadow.> i'm tryna contribute to nim too but i can't figure out how to rotate a deque
00:18:20FromDiscord<shadow.> i'm close tho
00:18:39FromDiscord<ElegantBeef> rotate meaning?
00:19:00FromDiscord<shadow.> `deq.addLast deq.popFirst`
00:19:04FromDiscord<shadow.> but that's inefficient
00:19:13FromDiscord<shadow.> so i need to do it just with like indexing and switching head / tail
00:19:26FromDiscord<shadow.> (edit) "`deq.addLast deq.popFirst`" => "`deq.addLast(deq.popFirst)`"
00:20:03FromDiscord<ElegantBeef> https://nim-lang.org/docs/system.html#swap%2CT%2CT↵then pop?
00:20:20FromDiscord<shadow.> no
00:20:20FromDiscord<shadow.> like
00:20:29FromDiscord<shadow.> `[1, 2, 3, 4, 5]` turns to `[2, 3, 4, 5, 1]`
00:20:30FromDiscord<shadow.> ye?
00:20:56FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Huo
00:22:42FromDiscord<ElegantBeef> so you're moving all elements down n wrapped?
00:22:48FromDiscord<shadow.> nah
00:22:50FromDiscord<shadow.> the data is like
00:22:57FromDiscord<ElegantBeef> your example is literally doing that
00:23:04FromDiscord<shadow.> wait
00:23:06FromDiscord<shadow.> wdym?
00:23:09FromDiscord<shadow.> OHH
00:23:10FromDiscord<shadow.> yeah
00:23:25FromDiscord<shadow.> `[1, 2, 3, 4, 5, 0, 0, 0]`↵goes to ↵`[0, 2, 3, 4, 5, 0, 0, 1]` or something at least that's how i have to do it
00:23:31FromDiscord<shadow.> nvm
00:23:32FromDiscord<ElegantBeef> for each element the new index is `(index - n + len) mod len`
00:23:44FromDiscord<shadow.> in which part?
00:23:48FromDiscord<ElegantBeef> The first example
00:24:01FromDiscord<shadow.> oh shoot
00:24:04FromDiscord<shadow.> alright thanks
00:24:20FromDiscord<shadow.> wouldn't that require reindexing every element?
00:24:40*opal joined #nim
00:24:58FromDiscord<ElegantBeef> How else do you move elements around? 😄
00:25:19FromDiscord<shadow.> well in a deque you have head, tail, and mask so ideally you could do it in one change is the idea?
00:25:30FromDiscord<shadow.> im not sure
00:25:36FromDiscord<ElegantBeef> Well in your first example you move all elements down an index
00:25:49FromDiscord<shadow.> well yes in the seq repr
00:25:51FromDiscord<shadow.> but internally no
00:26:36FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Huu
00:26:42FromDiscord<shadow.> that's repr vs internal
00:27:04FromDiscord<shadow.> but that isnt scalable so
00:27:09FromDiscord<shadow.> i needa figure it out lol
00:31:42FromDiscord<Rika> why are you using a seq for this again
00:32:23FromDiscord<shadow.> wdym?
00:32:24FromDiscord<shadow.> i'm not?
00:32:30FromDiscord<shadow.> the deques internal data is a seq
00:32:34FromDiscord<shadow.> i'm just echoing it
00:38:13FromDiscord<shadow.> cls
00:38:17FromDiscord<shadow.> whoops
00:38:55voltistDoes anyone know of a Nim implementation of cartpole?
00:40:33FromDiscord<InventorMatt> I don't think there is. I started creating a rough one in opengl a while back but it is not particularly close to being finished
00:41:39*Tanger joined #nim
00:42:17FromDiscord<shadow.> WAIT I MIGHTA GOT IT
00:42:40FromDiscord<shadow.> YES I THINK I GOT IT
00:43:44FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HuA
00:43:45FromDiscord<shadow.> at least that works and is fast
00:45:05FromDiscord<shadow.> (edit) "https://play.nim-lang.org/#ix=2HuA" => "https://play.nim-lang.org/#ix=2HuB"
00:46:17FromDiscord<shadow.> disruptek art thou heree
00:50:44*Jesin quit (Quit: Leaving)
00:55:00*Jesin joined #nim
00:55:43FromDiscord<shadow.> YES
00:55:44FromDiscord<shadow.> i got it working
00:56:20FromDiscord<shadow.> should i check w ppl here if it's good enough before sending a pr?
00:56:59FromDiscord<ElegantBeef> I havent been 😄
00:57:34FromDiscord<shadow.> havent been what?
00:57:41FromDiscord<ElegantBeef> Checking here
00:57:43FromDiscord<shadow.> oh
00:57:45FromDiscord<shadow.> ohh ok
00:58:03FromDiscord<shadow.> https://play.nim-lang.org/#ix=2HuF
00:58:06FromDiscord<shadow.> that's my solution
00:58:12FromDiscord<ElegantBeef> Although one of my PRs is needed and my other one is the scanTuple
00:58:18FromDiscord<shadow.> fair
01:02:03FromDiscord<ElegantBeef> You'll want `runnableExamples:` probably
01:02:07FromDiscord<shadow.> fair
01:02:13FromDiscord<shadow.> those go above code right?
01:02:18FromDiscord<ElegantBeef> Yea
01:02:43FromDiscord<shadow.> i also needa change to 2-space indent
01:03:08FromDiscord<Rika> ye
01:03:09FromDiscord<Rika> s
01:03:10FromDiscord<Rika> finally
01:03:21FromDiscord<shadow.> what
01:03:29FromDiscord<shadow.> the 2 space indent or me solving deque rotation?
01:04:18FromDiscord<Rika> former duh
01:05:52FromDiscord<shadow.> lmfao
01:07:37FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HuJ
01:07:37FromDiscord<shadow.> @ElegantBeef does this work?
01:08:33*hmmm quit ()
01:08:40FromDiscord<shadow.> i tried to model after their thing
01:09:03FromDiscord<shadow.> alr ima send a pr through then?
01:12:12FromDiscord<shadow.> yeye ima do it lol
01:54:30FromDiscord<shadow.> fingers crossed 🤞 https://media.discordapp.net/attachments/371759389889003532/786772866023817236/unknown.png
01:54:43FromDiscord<shadow.> @ElegantBeef im actually surprised that tuple thing hasnt been added yet, seems much more concise lmao
01:54:57FromDiscord<ElegantBeef> I mean the original version was different
01:55:00FromDiscord<shadow.> i see
01:55:01FromDiscord<shadow.> im guessing that needs a fat chunk of metaprogramming?
01:55:08FromDiscord<ElegantBeef> Only a few lines
01:55:11FromDiscord<shadow.> oh wow nice
01:55:21FromDiscord<shadow.> template or macro
01:55:22FromDiscord<ElegantBeef> ~40 lines of macro
01:55:22disbotno footnotes for `40`. 🙁
01:55:26FromDiscord<shadow.> ah i see lol
01:55:40FromDiscord<ElegantBeef> Well it has to be a macro to emit all that info from the scanf
01:55:59FromDiscord<ElegantBeef> I didnt reimplement scanf i'm still emitting a body that is a blocked scope scanf
01:56:20FromDiscord<shadow.> ah true
01:57:36FromDiscord<shadow.> how does nim handle all the pr's? im sure they get a shit ton every day lmao
01:57:53FromDiscord<shadow.> oh nvm like one a day
01:57:53FromDiscord<ElegantBeef> People review them then merge them if accepted 😄
01:58:12FromDiscord<shadow.> ahh right multiple people have edit perms
01:58:20FromDiscord<ElegantBeef> Yea look at this pr for instance https://github.com/nim-lang/Nim/pull/16276
01:58:21disbotAdds toSet to create sets from iterables
01:58:27FromDiscord<shadow.> well i know how git works lol i just meant i didn't know how they handled the quantity
01:58:44FromDiscord<ElegantBeef> My final code is nowhere near what i started with
01:58:53FromDiscord<shadow.> fair fair
01:59:05FromDiscord<ElegantBeef> it started with a `proc toSet[T: Settypes}` and now we've got a `template toSet` 😄
01:59:35FromGitter<iffy> I'm running into a problem where a `styledEcho` within `std/unittest` is failing with various errors. Right now (with my debugging code inserted) it's "Error: errno: 9 `Bad file descriptor`". Originally I think the error code was a 2. What do I do to debug this?
01:59:35FromDiscord<shadow.> lmao fair enough haha
01:59:44FromDiscord<shadow.> hmm
01:59:59FromDiscord<shadow.> have you ever looked at disruptek's testes?
02:00:04FromDiscord<shadow.> they're quite pretty
02:00:24FromGitter<iffy> I'm spawning several subprocesses in my tests
02:01:06FromDiscord<shadow.> ah i see
02:01:32FromDiscord<shadow.> i don't have experience with that lib so i can't help, sorry
02:03:35FromGitter<iffy> I'm not sure it's the lib's fault -- it just happens to be where the echo is that fails, I think.
02:04:49FromGitter<iffy> Somehow stdout is getting closed is my guess (`stdout.endOfFile() == true` when the error happens). But I'm not closing it explicitly within my tests.
02:06:45FromDiscord<shadow.> all checks passed lets go
02:06:54FromDiscord<shadow.> now lets just see if they think its a worthy addition lol
02:16:05FromGitter<iffy> This reliably fails with a bad descriptor error for me (macOS, Nim 1.4.0): https://gist.github.com/iffy/276527a6a9d14214896747fcf7f9c2ec I'm going crazy
02:21:29FromGitter<iffy> Reduced further: https://play.nim-lang.org/#ix=2HuZ Does this fail for anyone else?
02:25:27*sagax quit (Ping timeout: 260 seconds)
02:30:30FromDiscord<Quibono> Works on my iPhone
02:30:35*rockcavera quit (Remote host closed the connection)
02:32:39FromDiscord<Rika> god damn how in the hell did you run it on your iphone
02:33:13FromDiscord<Quibono> In the browser. :p But that'd be cool otherwise.
02:33:50pixtum[m]what nim extension do you guys recommend for vscode?
02:34:13FromDiscord<ElegantBeef> I've been using the `nimlsp` one as of late
02:35:09mipriiffy: ungetc()'s returning -1
02:35:26mipricompile with -d:danger and ltrace it to see that
02:38:06mipriand a C program that does the same thing gets the same result.
02:38:21mipriconclusion: as expected, it doesn't make any sense to check if stdout has hit EOF
02:40:01miprihm.
02:40:13miprihttps://github.com/bminor/musl/blob/master/src/stdio/ungetc.c#L5
02:42:59miprior rather, io.endOfFile could avoid setting errno by only conditionally calling ungetc
02:45:58FromGitter<iffy> I was able to cause the error by calling `endOfFile` but I'm not certain that's the original issue (which was error 2, not error 9). I'll see if I can learn how to trace on a mac and find the culprit
02:46:07FromGitter<iffy> @mipri shall I file an issue?
02:47:16mipri*shrug*, I'm not sure it's really a problem. If you're getting a different error, it might be related to your problem as well.
02:56:05disrupteki replaced unittest in part because it swallows output like that.
02:58:16disruptekshadow.: if you pr it, i will thumb it.
02:58:28disrupteki mean, i think i basically asked for it, so...
02:58:52FromDiscord<shadow.> if i pr what
02:59:43disruptekdeque rotate
03:00:09disruptekoh i see it.
03:00:18FromDiscord<shadow.> yes
03:00:21FromDiscord<shadow.> i pred it lol
03:00:24FromDiscord<shadow.> passed all checks
03:00:28disruptekis there rotateRight?
03:00:35FromDiscord<shadow.> using negatives
03:00:39FromDiscord<shadow.> in algorithm there's only rotate left
03:00:40disruptekmeh.
03:00:41FromDiscord<shadow.> just with negatives
03:00:43FromDiscord<shadow.> so i modeled after that
03:00:50FromDiscord<shadow.> if you'd like me to change it, i can
03:01:06disruptekeh, template it i guess.
03:01:21FromDiscord<shadow.> so rotateRight is just a template for rotateLeft with a negative?
03:01:22disruptekjust my opinion.
03:01:30disruptekyeah.
03:02:06FromDiscord<shadow.> ?
03:02:08FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hv8
03:02:16disrupteki don't have the bandwidth to load github right now. that's how pathetic it is here.
03:02:29FromDiscord<shadow.> does that template look fair to you?
03:03:07mipriit's useful to support negatives to the same call for code that wants to rotate by a mix of positive and negative values, but it's also useful to not stand down(-1) from this chair and walk away from(-1) the kitchen to empty(-1) my glass so I can dehydrate(-1) a bit.
03:03:17FromDiscord<shadow.> fair
03:03:22FromDiscord<shadow.> alr ill make the template
03:03:32FromDiscord<Quibono> I just spent an unreasonable amount of time trying to replicate httpclient.request() because I didn't know it was a thing
03:03:38FromDiscord<shadow.> i can do `Deque` as type in a template, right?
03:03:44FromDiscord<Quibono> _is going to go read the stdlib as punishment._
03:03:50disruptekyes.
03:03:57FromDiscord<shadow.> cool
03:04:25FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hvd
03:04:38FromDiscord<shadow.> ah right do i have to make it var Deque or nah
03:04:54disruptekdon't waste our time with 3-line pastes, please. just c+p them here.
03:05:10mipriprobably the bot that's doing that
03:05:16FromDiscord<shadow.> yeah the bot does that
03:05:20disruptekit should be the same signature as the Left.
03:05:29FromDiscord<shadow.> wdym?
03:05:29disrupteki know. don't fence it and it won't happen.
03:05:37FromDiscord<shadow.> ah ok
03:06:03disruptekit will need to be a var in order to match correctly.
03:06:32disrupteknice job adding something that's actually useful.
03:06:33FromDiscord<shadow.> should i switch it from `Make n negative for right rotation.` to something else now that there's rotateRight
03:06:36FromDiscord<shadow.> thanks
03:06:51disrupteki don't care. i will let other people demand changes.
03:06:54FromDiscord<shadow.> kk
03:07:04disruptektoo much time is wasted on bullshit.
03:07:25FromDiscord<shadow.> how do i do the "also see this proc" thing again
03:07:27FromDiscord<shadow.> where it quotes
03:07:33FromDiscord<shadow.> nnvm i think i got it
03:07:37FromDiscord<acek7> guys im way too drunk
03:07:44disrupteknot like there aren't other examples...
03:08:02FromDiscord<acek7> WHOOPS wrong chat
03:08:08FromDiscord<acek7> anyways
03:08:12FromDiscord<acek7> hows you guys
03:08:27disrupteknot drunk enough.
03:08:35FromDiscord<shadow.> ## \`rotateRight proc <@rotateRight, var Deque[T], T>\`_
03:08:37FromDiscord<shadow.> is that how i do that?
03:08:46FromDiscord<shadow.> ah shit i forgot asterisks fuck up on your end
03:08:50disruptekdon't know, don't care.
03:08:51FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/786791580672852028/unknown.png
03:09:01disruptekworse than a paste; no, thank you.
03:09:05FromDiscord<shadow.> rip
03:09:44FromDiscord<acek7> lets get married diruptek
03:09:54disruptekjust, y'know, make sure it's obvious which side the rotation moves objects to.
03:10:03FromDiscord<shadow.> yeah
03:10:21disruptekacek7: zevv wouldn't like that.
03:10:31disruptekbut we can fool around on the side, if you want.
03:10:44FromDiscord<acek7> sounds like a plan
03:10:59FromDiscord<acek7> i kinda took a programming break
03:11:11FromDiscord<acek7> i got all sad and felt defeated and didnt know how to make what i wanted
03:11:23FromDiscord<acek7> so here i am just a lousy designer not knowing how to program
03:11:24FromDiscord<shadow.> i can put runnableExamples in a template right-
03:11:37FromDiscord<shadow.> im going to assume yes
03:11:54FromDiscord<shadow.> sent a long message, see https://paste.rs/EZ7
03:11:55FromDiscord<shadow.> alright that's what i did
03:12:00FromDiscord<shadow.> cool if i commit?
03:12:37FromDiscord<shadow.> i commited
03:13:48FromDiscord<shadow.> tests are failing rip-
03:14:19*muffindrake quit (Ping timeout: 272 seconds)
03:14:22FromDiscord<shadow.> ah wait
03:14:28FromDiscord<shadow.> does star go before [T]
03:14:33FromDiscord<shadow.> yes, yes it does
03:15:02FromDiscord<shadow.> thanks for the comment of approval disruptek
03:15:52*muffindrake joined #nim
03:26:08*Tanger quit (Read error: Connection reset by peer)
03:26:23*abm quit (Read error: Connection reset by peer)
03:27:49disruptekacek7: what kind of design?
03:28:11FromDiscord<acek7> graphic and web and im trying to figure out some app designs
03:28:11*Tanger joined #nim
03:28:23FromDiscord<acek7> i mainly just make some dope ass logos sometimes
03:28:33FromDiscord<acek7> idk i can do like anything
03:28:40disruptekwell, nim needs some web-design work done.
03:33:29disruptekhmu if you're interested.
03:34:54disruptekand not drunk.
03:35:25FromDiscord<acek7> Oh damn for real
03:35:53FromDiscord<acek7> wheres a good place to reach you through IRC or discord
03:37:18FromDiscord<acek7> you know when you are coming down off of being drunk when the words turn from 4 words into like 2 and a half
03:40:19disruptekwhich half?
03:40:43disruptekjust send to github at andy.nim.fan or something.
03:44:38FromDiscord<acek7> okie doke
03:50:01*jjido quit (Quit: Connection closed for inactivity)
03:54:46*mika_ joined #nim
03:59:24*mika_ quit (Ping timeout: 256 seconds)
04:03:14FromDiscord<shadow.> disruptek is there anything else useful that needs to be added because school does not assign nearly enough hw and my grades are not nearly low enough for me to spendtime doing anything other than programming
04:03:38disruptekwhich project?
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:36*supakeen joined #nim
04:07:13FromDiscord<Rika> Shadow
04:07:34FromDiscord<Rika> Can't you just do "-n" instead of n -1
04:11:46FromDiscord<shadow.> oh right-
04:11:57FromDiscord<shadow.> time to update lol
04:12:23disruptekyou have a cold drink and a room-temperature drink. do you mix them to have a single cool drink, do you quickly drink the room-temp beverage, or do you drink the cool drink first?
04:12:59disruptekit needs a changelog entry and a .since notation, most likely. i cannot load github.
04:13:01FromDiscord<Rika> Depends on how thirsty I am
04:13:39*cgfuh quit (Quit: WeeChat 2.9)
04:13:47disruptekrika: can you help me with an error message?
04:14:11disruptekwhat does this mean:
04:14:14disruptekSIGSEGV: Illegal storage access. (Attempt to read from nil?)
04:14:26FromDiscord<shadow.> oh lord
04:14:26FromDiscord<Rika> Lol
04:14:50FromDiscord<shadow.> i think it's what happens when a programmer tries to recite their friends
04:15:43disruptekit says that on my paycheck.
04:16:38FromDiscord<shadow.> what does since notation do again
04:16:48disrupteksame thing it did last time.
04:17:37FromDiscord<shadow.> smart
04:18:41*NimBot joined #nim
04:19:09disruptekwhile you're editing the changelog, you can lookup a similar addition to the stdlib to see how to use it.
04:19:22FromDiscord<shadow.> fair enough
04:19:34FromDiscord<shadow.> i might do that tmr, not at my pc rn
04:19:45FromDiscord<shadow.> github on a phone is not a smart idea
04:19:45disruptekyou said that yesterday.
04:20:14FromDiscord<shadow.> at the same time, yes
04:20:23FromDiscord<shadow.> im just a while loop internally
04:20:29disruptekweird.
04:21:06disrupteki really do need to write that what: else: loop.
04:21:24FromDiscord<shadow.> occasionally i stray off discord to watch animated 2d boys hit a volleyball in which case i `continue` that day, but otherwise i'm a straight while loop without fail
04:21:57FromDiscord<shadow.> disruptek: sounds like a job for future me?
04:22:14disruptekcould be.
04:22:33disruptekit requires adding a new hook to cps.
04:23:09disruptekanother weird thing cps allows you to do: named continue
04:23:20disruptekand continue: blocks.
04:24:00FromDiscord<shadow.> considering i've never used cps that might not be a good idea for me to develop
04:24:11FromDiscord<shadow.> deques at least i've used
04:24:14disruptekeh, it's pretty simple.
04:24:32FromDiscord<shadow.> what's it do
04:24:48disrupteknamed continue is pretty obvious.
04:25:03disruptekcontinue: echo "restarting the loop... now!"
04:25:10FromDiscord<shadow.> i meant what else
04:25:22disruptekit's while/else but with a cute name.
04:25:23FromDiscord<shadow.> sorry what: else: loop
04:25:27FromDiscord<shadow.> ohh
04:25:36FromDiscord<shadow.> else being if unbroken?
04:25:49disruptekyes, like python.
04:25:55FromDiscord<shadow.> i see
04:26:18FromDiscord<shadow.> how would you put else under what without nesting it since that'd raise invalid syntax, no?
04:27:14disruptekwith a macro.
04:32:37*thomasross quit (Ping timeout: 264 seconds)
04:33:10*narimiran joined #nim
04:45:01FromDiscord<Varriount> Anything major being worked on at the moment?
04:52:14disruptekaraq is working on isolate.
04:55:24FromDiscord<squid> I am trying to get the second cookie in a response from httpclient
04:55:37FromDiscord<squid> `response.headers["set-cookie"]`
04:55:43FromDiscord<squid> That gives me the first cookie
04:55:53disruptekyou need to iterate over the table.
04:55:59FromDiscord<squid> How?
04:56:09FromDiscord<squid> Do I need to iterate?
04:56:17disruptekthe table can have duplicate keys with multiple values.
04:56:20FromDiscord<squid> or could I just get the second "cookie"
04:56:30disruptekno, you must iterate.
04:56:37FromDiscord<squid> Okay
04:56:47FromDiscord<squid> How?
04:57:16disruptekfor key, value in headers.pairs: if key == "set-cookie": echo value
04:57:36FromDiscord<squid> Thank you 🙂
04:58:09disruptekit's a deprecated quirk of nim tables that contrasts with the exception in http rfc for cookie headers. unfortunately.
05:00:07FromDiscord<squid> Whats the way of doing and in a if statement?
05:00:15disruptekand
05:00:19FromDiscord<squid> Oh.
05:00:23disruptek~manual
05:00:24disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek
05:00:24disbotmanual: 11just good to Ctrl+F in cases like this
05:03:32*Tanger quit (Remote host closed the connection)
05:03:52*Tanger joined #nim
05:04:44*Cthalupa quit (Ping timeout: 256 seconds)
05:05:09*Cthalupa joined #nim
05:08:36FromDiscord<hesman> Anyone can help me how to split a line separare by many whitespace
05:08:46disrupteksee strutils module.
05:09:00FromDiscord<hesman> ex: line = " abc -> xyz <- uft"
05:11:04FromDiscord<hesman> I dont know how to define many Whitespace continuously
05:11:31FromDiscord<sealmove> is there a proc in `streams` that reads a null-terminated string?
05:27:26*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:27:33*njoseph joined #nim
05:29:16*xet7 joined #nim
05:33:02*sagax joined #nim
05:34:37*hpyc9 quit (Quit: 420)
05:35:47FromDiscord<squid> `splitted_phpsessid.removePrefix("PHPSESSID=")`
05:35:59FromDiscord<squid> `expression 'removePrefix(splitted_phpsessid, "PHPSESSID=")' has no type (or is ambiguous)`
05:36:14FromDiscord<squid> I am getting this error and I don't know what is wrong
05:36:41mipriremovePrefix probably returns void, but you are attempting to use its return value
05:37:04FromDiscord<squid> oh.
05:37:08FromDiscord<squid> You're right
05:37:47miprihesman, use a regex for that
05:39:03FromDiscord<squid> Can't he just split it with white space then join it without whitespace?
05:39:38*hpyc9 joined #nim
05:39:56mipri!eval import re; echo ("a b c".findAll(re"\S+"), "a b c".split(re"\s+"))
05:40:00NimBot(@["a", "b", "c"], @["a", "b", "c"])
05:46:11FromDiscord<squid> @hesman https://play.nim-lang.org/#ix=2HvL
05:46:14FromDiscord<squid> That could also work
05:47:05mipriit doesn't
05:47:16miprihttps://play.nim-lang.org/#ix=2HvM
06:01:10FromDiscord<squid> How do you set a variable to null?
06:01:35mipriprovided it's a ref type, v = nil
06:01:53FromDiscord<hesman> oh thank, a_line = line.split(re"\s+") -> work
06:02:36miprior a ptr type of course.
06:04:06FromDiscord<ElegantBeef> Otherwise you'd use an option to get that extra 1 option to the type
06:10:49FromDiscord<squid> It is a pointer type so it works, thank you
06:12:01*waleee-cl quit (Quit: Connection closed for inactivity)
06:36:27*habamax joined #nim
06:42:37voltist@Vindaar Ping
06:43:16*Kaivo quit (Ping timeout: 240 seconds)
06:45:15*Kaivo joined #nim
06:57:46FromDiscord<sealmove> guys, is there a standard way to generate warnings from your code? or just print to yellow to stderr?
07:05:09*kungtotte quit (Read error: Connection reset by peer)
07:05:58*kungtotte joined #nim
07:08:17Prestigemaybe the logging module?
07:09:27Prestigehttps://nim-lang.org/docs/logging.html @sealmove
07:10:47FromDiscord<sealmove> aha
07:17:38*def- quit (Remote host closed the connection)
07:20:10*def- joined #nim
07:52:07*PMunch joined #nim
07:58:20*tane joined #nim
08:26:09ForumUpdaterBotNew thread by Pietroppeter: Let vs var for a sequence inside a proc, see https://forum.nim-lang.org/t/7241
09:00:03FromDiscord<Vindaar> @voltist: Hey! I'm around now
09:04:54*Tanger quit (Quit: Leaving)
09:09:36*JustASlacker joined #nim
09:19:29*habamax quit (Read error: Connection reset by peer)
09:19:49*habamax joined #nim
09:26:11*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:29:18*habamax quit (Quit: leaving)
09:29:34*habamax joined #nim
09:29:39*Cthalupa quit (Ping timeout: 260 seconds)
09:29:40Araqit's 2020. my hard disk is full. what am I doing wrong?
09:30:01*Cthalupa joined #nim
09:31:12FromDiscord<Vindaar> you're not buying more hard drives fast enough, I'd say
09:31:20mipriprebuilt disk sizes are pretty skimpy, they're getting faster instead of larger. But you can supplement that with a cheap 8TB USB external drive these days, or just build a NAS
09:32:15FromDiscord<hugogranstrom> Life hack: instead of buying new storage, just remember it in your head instead. much cheaper 😛
09:33:17FromDiscord<lqdev> Araq: just how big is your drive?
09:34:21*hmmmmm joined #nim
09:34:28hmmmmmyo
09:35:10*spiderstew joined #nim
09:45:57*kenran joined #nim
09:46:20*spiderstew quit (Quit: Konversation terminated!)
09:47:29*Tanger joined #nim
09:47:31PMunchI should really set up a massive NAS.. I keep running out of space all the time
09:47:53dom96I did just that
09:48:18dom96Transferring Steam games over to it is too slow sadly
09:49:09PMunchMy problem is that I have a bunch of drives
09:49:16PMunchNot really that I'm running out of space
09:49:28PMunchBut I have my OS on one SSD, and my /home on another
09:49:36PMunchAnd the /home SSD keeps running full
09:49:39*spiderstew_ joined #nim
09:49:48PMunchSo I must move stuff to the HDD and symlink it back
09:49:50PMunchWhich is a mess
09:50:30PMunchMaybe I should just make a CRON-job that moves every file that hasn't been written to in the past week to the hard-drive :P
09:51:15PMunchAnd then enable the access flag on the HDD so that files that are read from a lot can be put back on the SSD and blacklisted from moving
09:51:24FromDiscord<Rika> how massive are we talking about regards the nas youre interested in
09:52:07FromDiscord<scott> PMunch why not just mount the HDD at `/home`
09:52:57FromDiscord<scott> I have my "home folder" mounted on another physical machine, shared it via NFS to my "compute" box, then mounted like `/home/scott/Videos`, `/home/scott/Music`, etc in /etc/fstab
09:53:42FromDiscord<scott> you could also just use the HDD and set up the SSD as a ZFS L2 (persistent) ARC cache
09:55:05FromDiscord<sealmove> @PMunch I did some work on alignment. Would you let me know what you think?
09:55:26FromDiscord<scott> sent a code paste, see https://play.nim-lang.org/#ix=2HwV
09:55:59FromDiscord<scott> (edit) "https://play.nim-lang.org/#ix=2HwV" => "https://play.nim-lang.org/#ix=2HwW"
09:56:12FromDiscord<sealmove> scott why didn't you quote pname?
09:56:40PMunchThat's not quite how quote works
09:57:03FromDiscord<sealmove> hum, pname is both a for index and proc name?
09:57:32PMunchYou probably want something like this: https://play.nim-lang.org/#ix=2HwX
09:57:35FromDiscord<sealmove> scott check https://nim-lang.org/docs/macros.html#NimSymKind
09:57:43FromDiscord<scott> @sealmove because I don't know what I'm doing and I'm just blindly guessing and couldn't find anything about it in hte docs
09:57:51PMunchAh wait, you need to turn those strings into idents as well before quote do
09:57:51FromDiscord<scott> looking at links
09:57:52FromDiscord<sealmove> each symbol must have the correct type
09:58:22PMunchSomething like this: https://play.nim-lang.org/#ix=2HwY
09:58:42PMunch@scott, interesting
09:58:47FromDiscord<scott> sealmove, I'm not sure what NimSymKind has to do with this
09:58:52PMunchBut then I'd have to change my filesystem to ZFS?
09:59:17FromDiscord<scott> @PMunch thanks I think that's what I'm looking for
09:59:46FromDiscord<sealmove> scott nvm, was just trying to tell you can't use same symbol for a for index and a proc name at the same time
10:00:04FromDiscord<scott> yes if you wanted to go with the latter option you'd have to reformat both disks. not ideal for migrating to but I recently learned that exists and think it's the bees knees
10:00:10FromDiscord<scott> sealmove yeah sorry I just need a name
10:00:50PMunch@scott, crap didn't even think of that.. I would need somewhere to put my files in the meantime..
10:01:25FromDiscord<sealmove> peter is this good? https://github.com/sealmove/binaryparse#alignment
10:01:50PMunchI wish there was some way of formatting drives that would create a partition of the empty space, format that to a filesystem, then move files over to fill it, repartition, etc. Would be horribly inefficient, and terribly unsafe, but pretty neat
10:02:25PMunch@sealmove, yikes
10:02:43FromDiscord<sealmove> no good? :3
10:02:54PMunch"When reading a non-integer type, the bitstream will always be aligned to byte, which means some bits might be skipped" <- is this the current behaviour?
10:03:24FromDiscord<sealmove> Well, I think you hadn't considered this senario
10:03:41FromDiscord<sealmove> So current behavior is undefined really
10:03:46PMunchIs it?
10:04:21FromDiscord<sealmove> not 100% sure
10:04:50FromDiscord<sealmove> I could make it work, but who would ever want to read unaligned floats?
10:05:16PMunchWho knows, but who are we to stop them
10:05:29PMunchThere are some really weird binary formats out there
10:05:38FromDiscord<sealmove> okay okay :> I can fix this
10:05:41FromDiscord<sealmove> thx
10:09:54PMunchAah
10:09:58PMunchCurrently it doesn't work
10:10:06PMunchComplains about shifting a float32
10:10:37FromDiscord<sealmove> yeah I expected so, but I can easily make it work. What do you want to do with strings? Align automatically or generate exception?
10:11:20PMunchDoesn't your bitstream library handle all of this already?
10:11:57PMunchI mean optimally strings should also be shifted..
10:12:00*spiderstew_ quit (Quit: ZNC 1.7.2+deb3 - https://znc.in)
10:12:39PMunchAha, strings currently throw an exception
10:12:45FromDiscord<scott> damn it I'm still stumbling around 😦 https://play.nim-lang.org/#ix=2HwY
10:13:03PMunchI mean you can just keep the current behaviour (maybe throw an exception for floats though)
10:13:08FromDiscord<sealmove> It handles integers and there is a `readBits` proc which can be used for floats too (just casting after). I don't have anything for strings currently.
10:13:26PMunchI don't think alignment is the way to go here, people can easily enough add their own padding fields without a name
10:13:34*spiderstew joined #nim
10:13:36FromDiscord<sealmove> true that
10:13:58FromDiscord<sealmove> so I should remove the whole option about alignment right
10:14:19PMunchTypically a binary format will be aligned and this shouldn't be an issue, and for those rare occasions that it's not I think having it explicitly shown by padding is better
10:14:36FromDiscord<sealmove> ok sounds good
10:15:02PMunch@scott, what's the issue there?
10:15:25FromDiscord<scott> Error: type mismatch: got <NimNode>
10:15:55FromDiscord<scott> newIdentNode is expecting a string but the string is a NimNode inside the macro
10:16:45PMunchhttps://play.nim-lang.org/#ix=2Hx7
10:16:50PMunchSeems to work fine for me
10:17:03PMunch(Just made Prompt an int to avoid it throwing an error)
10:17:24JustASlackerIm trying to get a regex that matches everything inside quotes (")
10:17:26JustASlackerlet regex = re(r"\"(.*)\"")
10:17:45JustASlackercompiler doesnt like that for some reason
10:18:08FromDiscord<myphs> Sorry for this nooby question, but I wonder why I can't call `listFiles(path)` at compile time. Isn't there a way to make compile time listings of directories? I want to create automatic bindings of modules from one directory at compile time
10:18:39FromDiscord<scott> PMunch, I'm trying to pass the strings as arguments though https://play.nim-lang.org/#ix=2Hx7
10:19:38FromDiscord<scott> I don't need to pass them as strings it just seemed like that would work
10:19:57PMunchJustASlacker, that's because you're using it as a raw string, which doesn't have \ to escape
10:20:06PMunchIf you remove the r it works
10:20:25JustASlackerPMunch: thx
10:20:52PMunchOr if you just double the quotes instead: https://play.nim-lang.org/#ix=2Hx9
10:21:35PMunch@scott, did you just copy my paste there?
10:21:48PMunchIf you pass it as an argument you probably want static string and not just string
10:22:22FromDiscord<scott> that still doesn't work https://play.nim-lang.org/#ix=2Hx7
10:26:05narimiranPMunch: are you still involved in parsetoml?
10:27:54FromDiscord<scott> ahh so close.... https://play.nim-lang.org/#ix=2HwX
10:30:07FromGitter<gogolxdong> https://github.com/gogolxdong/2DeFi
10:32:22JustASlackerSo, if I may ask once more, why dont I get a match for users:(("ssh",pid=2908,fd=5))? https://pastebin.com/MFWCGGVV
10:37:15FromDiscord<sealmove> @PMunch I fixed it already 😄
10:37:35FromDiscord<sealmove> unaligned floats work now, not strings though.
10:38:22FromDiscord<sealmove> the alignment is checked at runtime though
10:39:36FromDiscord<sealmove> is this bothering?
10:41:31FromDiscord<scott> Got it!
10:47:07mipriJustASlacker: re.match has an implicit anchor at the beginning of its rege
10:47:08miprix
10:47:45mipriarcheologists believe that this madness was a product of wanting people to use regexes without understanding them.
10:48:07mipris/match/contains/ and your code works as you expected.
10:49:23JustASlackerah, ok
10:49:45JustASlackerthx
10:50:45JustASlackernoice
10:50:52JustASlackerthink Im done now
10:51:12JustASlackeralways nice to have nim projects
10:51:31JustASlackerand regex kinda suck in any language
10:52:27miprithere are always lots of little caveats with them, true.
10:52:55Zevvdont re kids, it's baad for you mkaaay
10:53:39JustASlackerahh, spoke too soon, got a bug
10:53:57mipriI just really hate this one. It's not a nim thing, it's part of pcre, and I first encountered it in Java. The "oh did you write a regex? well, uh, we added something to it for you :)"
10:54:11JustASlackerthink python does the same
10:54:25mipriyeah it does as well
10:54:49JustASlackerthats why I usually use http://www.pyregex.com/ to check my python regex code
10:56:13*literal_ is now known as literal
10:58:37JustASlackergah, that regex breaks if there are more than one quoted strings
10:58:40*JustASlacker shakes fist
10:59:00mipriyes, .* works from right-to-left
10:59:16mipriMastering Regular Expressions is a good book for understanding that in detail.
10:59:38mipriwhat I generally do is match something like "[^"]+"
10:59:48Zevvmubmle mumble npeg mumble
11:00:55mipriI can't recommend the excellent Nim workbook "Mastering PEG with Nim" though :|
11:01:41Zevvhehe
11:02:06JustASlackerare there nim books? I know there is Nim in Action
11:02:22miprino, it's because it doesn't exist that I can't recommend it
11:02:27JustASlackeryeah
11:02:52JustASlacker"[^"]+" looks good, thanks.
11:02:55miprihttps://nim-lang.org/learn.html has a Community resources that's growing some good links though
11:12:01*opal quit (Remote host closed the connection)
11:12:50*opal joined #nim
11:16:57*fredrikhr joined #nim
11:19:27*Gustavo6046 quit (Ping timeout: 272 seconds)
11:34:22*Torro joined #nim
11:37:49*T0rr0 joined #nim
11:40:02*Torro quit (Ping timeout: 256 seconds)
11:41:33*T0rr0 is now known as Torro
11:43:04*hdgoubdo joined #nim
11:43:46hdgoubdowould it work if newStringStream in streams used a sink string instead of a string for its argument? i mean, it might not have to copy there
11:47:29*hdgoubdo quit (Remote host closed the connection)
11:54:30Zevvdid you verify it actually *does* copy then
12:00:35*sacredfrog quit (Quit: ZNC 1.8.2 - https://znc.in)
12:00:55hmmmmmwho is pietroppeter
12:01:05hmmmmmhe is making some awesome aoc blogs
12:01:25hmmmmmI want to send him my <3 <3
12:04:23FromDiscord<mratsim> I would appreciate if people can relate their dev tooling in Nim, especially the new timers. https://github.com/nim-lang/RFCs/issues/300 cc @dom96 .
12:04:23disbotDeveloper tooling
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:35*supakeen joined #nim
12:09:01*kenran quit (Ping timeout: 256 seconds)
12:10:36*kenran joined #nim
12:12:01FromDiscord<haxscramper> @mratsim you want to discuss only (mostly) nimsuggest-related things in this RFC or just anything that can be put under "developer tooling"? I don't have particularly strong opinions on nimsuggest (because I don't use it since ever), but I can put some opinions on error messages and things like that
12:12:35FromDiscord<haxscramper> IDE & nimsuggest-related
12:13:29FromDiscord<mratsim> yes IDE, Code editor and nimsuggest
12:13:48FromDiscord<mratsim> Error message stacktraces, etc should go on another RFC I think
12:15:24FromDiscord<pietroppeter> @hmmmm thanks! Love received and appreciated! 🙇‍♂️
12:15:35hmmmmmpiet!
12:15:41hmmmmmyour stuff is awesome <3
12:15:53hmmmmmand even the platform is cute I will try it when I have time!
12:16:26ZevvI think I am really conservative and I have very low standards regarding tooling. I am *very* happy with nimsuggest and leorizes nvim plugin.
12:16:47Zevvthat's 100% better then support of any other language I program. For the rest I only use editors.
12:16:58Zevvand cscope
12:17:30narimiranyeah, leorize[m]1 did some great magic there!
12:18:18FromDiscord<John Smith> Oh, code with two space indent is really hard to read.
12:19:47FromDiscord<John Smith> Can I write nim code with tab or 4 spaces ? https://media.discordapp.net/attachments/371759389889003532/786930224499523624/unknown.png
12:20:38FromDiscord<John Smith> (edit) Oh, code with two spaces indent is really hard to read.
12:20:39ZevvNo tabs allowed, to avoid confusion between different rendering of tabs
12:20:48Zevvbut you're free to indent spaces as deep as you want
12:20:53*rockcavera joined #nim
12:21:13FromDiscord<kenran> I'm trying to do something with OpenGL using GLFW. With SDL2 everything worked fine. Now I tried using `nimgl/[glfw, opengl]`, and I'm getting a SIGSEGV. I also tried `staticglfw` which produces the same error when I omit the call to `loadExtensions()`. But I can't find an equivalent call in `nimgl`. Can you help me?
12:21:31PMunchnarimiran, yes
12:21:44mipriand, try reformatting that code to use 4 spaces before thinking that the spaces are why it's a lot to take i
12:21:47miprin
12:21:49FromDiscord<kenran> (Also, feedback on whether I should prefer static or dynamic linking is very welcome. I could just keep using `staticglfw` if that's the "solution").
12:22:03*opal quit (Ping timeout: 240 seconds)
12:22:04PMunch@sealmove, what do you mean by the alignment is fixed at runtime?
12:22:10PMunchs/fixed/checked
12:22:24FromDiscord<pietroppeter> Thanks again and also thanks for nimib, first feedback I am receiving! To try it is probably better to wait until I release 0.1, I plan to do it by end of month, currently it is a bit messy...
12:23:05*opal joined #nim
12:23:15narimiranPMunch: could you maybe address these comments: https://github.com/NimParsers/parsetoml/commit/668491edaff1abd5ec31c3f294e1a918d179f13f ? nobody responded in two weeks
12:23:58PMunchAh right, sorry about that
12:24:18PMunchI was hoping you would create a PR out of your suggested fix :P
12:28:38narimiranPMunch: ok, i'll do it
12:29:08FromDiscord<sealmove> PMunch does it make sense to support other sizes for floats?
12:29:18PMunchnarimiran, too late! https://github.com/NimParsers/parsetoml/commit/7126677392aa0c4cc9d16bd79d312ed57f15f8f1
12:29:25narimiran:)
12:29:35FromDiscord<sealmove> For example `f18`
12:29:55PMunch@sealmove, well I mean if you want to implement weird floating point formats I'm not going to stop you :P
12:30:15PMunchBut then we should support arbitrary sized mantissa and such
12:30:54FromDiscord<sealmove> Hmm currently i am reading bits into an uint64 and then its just a matter of casting
12:31:07FromDiscord<sealmove> So `f18` can easily work already
12:32:16PMunchNot exactly :P
12:32:17FromDiscord<sealmove> Or am I missing something? Yeah floats don't work like this eh?
12:32:55FromDiscord<sealmove> Ok ok nvm then :p
12:33:10PMunchhttps://en.wikipedia.org/wiki/IEEE_754
12:33:23PMunchScroll down to the table of "Basic and interchange formats, you kinda get the idea
12:33:49PMunchOr the "Internal representation" table here: https://en.wikipedia.org/wiki/Floating-point_arithmetic
12:33:57FromDiscord<sealmove> Yes I see, that was stupid of me
12:35:15FromDiscord<sealmove> I think I the PR will be ready to merge in a couple of days. Parsing already works, working on serialization now.
12:35:21PMunchI mean you can do it, in a way
12:36:29FromDiscord<sealmove> What do you have in mind? Shifting the bits appropriately to adhear toIEEE 754 before casting?
12:37:07PMunchLike 'f3,14' could mean floating point number with 1 bit sign, 3 bit exponent, and 14 bits fraction for a total of 18 bits
12:37:13PMunchYeah
12:37:36FromDiscord<sealmove> Interesting. Maybe a future feature :p
12:37:48PMunchFind the smallest of float32 and float64 that can accommodate the sizes and mask out and shift things into the correct place before casting
12:38:12PMunchTBH I've never seen a floating point number expressed like that
12:38:15FromDiscord<sealmove> Yes it can work
12:38:24PMunchBut who knows
12:39:41FromDiscord<mratsim> @John Smith use indent rainbow maybe
12:40:37FromDiscord<Rika> Or add empty lines
12:40:40FromDiscord<Vindaar> AoC day 11 fun 😅 warning flashing colors 🙃 https://media.discordapp.net/attachments/371759389889003532/786935479354130452/SPOILER_grid_evolution_part1.gif
12:41:51PMunch@John Smith, some of us will secretly judge you however if you use more than two spaces :P
12:42:19PMunch@Vindaar, now I'm really curious about todays AoC :P
12:42:45PMunchAnd hmmmmm/@pietroppeter where can I find this AoC blog?
12:47:32FromDiscord<hugogranstrom> @Vindaar have you made it in ggplotnim? 😮 It looks great
12:48:03FromDiscord<Vindaar> sure! except the conversion to a gif I did with imagemagick. will upload the code in 5 min
12:49:11FromDiscord<hugogranstrom> Cool 🙂
12:54:06FromDiscord<trippleA> For the linux version of nim, is there a minimal required version of linux or dependencies on a distro to be able to run run?
12:55:08FromDiscord<trippleA> (edit) "run?" => "nim?"
12:55:09PMunchNim the compiler, or programs compiled with Nim?
12:55:34FromDiscord<trippleA> Nim the compiler. I want to know if I were to use an older version of linux everything would still work.
12:56:10PMunchI think there is a minimal version because of the linked C libraries, but it is probably very low
12:56:27PMunchSo low that you shouldn't run a Linux version that old out of security concerns
12:56:35FromDiscord<Vindaar> @hugogranstrom solution is up: https://github.com/Vindaar/AdventOfCode2020/tree/master/day11 but the gifs look a bit broken in thar README
12:56:37FromDiscord<Vindaar> bbl
12:56:42hmmmmmmunchie: https://pietroppeter.github.io/adventofnim/index.html
12:56:44miprivarious issues can crop up. Nim can generate code that gcc is too old to understand. The nim binary might require a newer glibc than is available. Even when nim works you can have issues with openssl that interfere with nimble.
12:56:47PMunchHow old do you plan on running?
12:58:13mipricentos6 had all those problems and Nim could still be made to work, it's just a little bit effort instead of no effort. Again speaking of the compiler.
12:58:28FromDiscord<trippleA> I'm planning on using godot on linux with nim and was thinking about using ubuntu 14.02 or something around that age to make sure it works on all modern distros because exported godot projects for linux only work with something that's either as old as the distro was or newer.
12:58:36mipriand that's now a past EOL distro
13:00:11mipri14.02 seems like it's about as old as CentOS 6, speaking of.
13:01:37FromDiscord<kenran> I got my glfw/opengl thing up and running with both dynamically linking glfw and statically linking it. Which should I prefer?
13:01:40FromDiscord<trippleA> sent a long message, see http://ix.io/2HxU
13:01:41mipriso you might have similar problems. It canbe made to work.
13:02:46FromDiscord<kenran> I'm kinda surprised though that the `nimgl` example doesn't just work for me. I had to switch out `nimgl/opengl` to just `opengl`, and call its `loadExtensions()`, which `nimgl/opengl` doesn't seem to have/need
13:03:12FromDiscord<trippleA> What exactly is the minimal required version of gcc and glibc anyways for nim to work properly?
13:04:31mipriyou have binary compatibility issues with glibc, so nim (compiler) doesn't care about that as much.
13:05:21FromDiscord<trippleA> Is 16.04 new enough to work with nim?
13:05:47PMunchdamn pietroppeter, what a list of hints for day10 :)
13:05:51mipriI said that even 14.02 can be made to work, right? It's with ancient EOL versions that you start running into issues like this.
13:05:54FromDiscord<Recruit_main707> yes, nim uses an older version by default
13:05:58FromDiscord<Recruit_main707> iirc
13:06:06hmmmmmpiet is a gem :3
13:06:23*hmmmmm quit (Quit: brb)
13:06:52mipriin the time that we've talked about this you could, if you have a 16.04 available, install choosenim and install Nim. Give it a try. use nimble to install something useful like cligen.
13:07:19PMunchGotta say though, narimirans solution for day 10 was a bit mind-blowing
13:07:21mipriabsent an actual problem, all this discussion about potential problems will feel a bit wasted.
13:07:22FromDiscord<trippleA> I'll boot up virtualbox and give 16.04 a spin.
13:07:29PMunchTook me a while to understand what was going on there
13:07:53mipriI really wish Eric had given any hint at all about the nature of that one.
13:08:13PMunchEric?
13:08:22mipriEric Wastl of Advent of Code
13:08:23PMunchOh, the guy who makes AoC right?
13:08:26PMunchYeah
13:08:36PMunchI was so stuck on that one..
13:09:00FromDiscord<pietroppeter> I was hoping for you to run into it yesterday... 😛 anyway realized later that they follow too much my approach and there are much better solutions around. But when I got to 25 hints I could not avoid releasing it...
13:09:06PMunchI'm firmly in the other camp of pietroppeter
13:09:45PMunchhttps://github.com/PMunch/aoc2020/blob/master/day10/part2.nim
13:09:55PMunchThat's what I ended up with ^
13:10:11PMunchAfter having peeked at narimirans version >_<
13:11:27FromDiscord<pietroppeter> Yeah that’s one example of much better solutions! I will add a disclaimer and more discussion when I have more time.
13:13:46narimiranPMunch: cheater :P
13:14:00PMunchEy, I said I would blame you if I couldn't solve it :P
13:14:43narimiranPMunch: btw, yesterday it was both painful to watch you struggle, and also i felt relieved i'm not the only one who had some problems there
13:14:50FromDiscord<trippleA> If I compiled nim rather than use the precompiled binaries, there would be far less issues yes?
13:14:51PMunchI'm just really bad at the math ones. I might've converged at a solution if I had spent my evening on drinking coffee and trying to solve it instead of drinking prossecco and playing games with my friends :P
13:15:17narimiranbut tbh, i immediately recognized DP, but forgot i need memoization for that to work in reasonable time
13:15:25mipriNim is written in Nim, so. There are options there, but just try it first.
13:15:43narimiran@trippleA wait what?
13:16:31FromDiscord<trippleA> I'm talking about downloading the source tarball rather than the precompiled binaries.
13:16:48mipriI understood you.
13:16:57narimiranwhy would be there *far less* issues?
13:17:24FromDiscord<trippleA> Because I'm under the assumption it would optimize it for an older version of glibc rather than expect a newer one?
13:18:16mipri$ ldd ~/.choosenim/toolchains/nim-1.4.2/bin/nim not a dynamic executable
13:18:48FromDiscord<trippleA> sh build.sh↵bin/nim c koch↵./koch boot -d:release↵./koch tools
13:18:56FromDiscord<trippleA> That's the order the website says to build from source tarball
13:19:01mipriyep.
13:19:45FromDiscord<pietroppeter> Narimiran: DP?
13:20:03mipridynamic programming.
13:20:07narimiran^
13:20:28narimiran@pietroppeter day10 could be solved via recursion+memoization
13:20:30FromDiscord<trippleA> I'm going try this in both 14.04 and 16.04 to compare the differences.
13:21:14FromDiscord<pietroppeter> yeah, that’s what I did essentially
13:21:31narimiranhaven't looked at yours yet, trying to optimize my day11 :)
13:22:47FromDiscord<pietroppeter> Well, I am not too much into optimizations... have fun 🙂 This year for me is about developing this nimib thing to publish my solution
13:23:01mipribiggest optimiation I've seen is from not copying the 2d array, and instead doing passes over it, first to fudge seats to show that they'll be changed later, and then to actually change them, with tests treating fudged and unfudged seats as the same
13:23:26FromDiscord<pietroppeter> (I do enjoy them actually, not my current priority)
13:23:34mipriwell, biggest in terms of the speed increase.
13:23:52mipriif you want to talk about ratios of speedup / effort, just using --expandArc a few times had the biggest benefit
13:24:19mipribecause it found some unnecessary copies in an inner loop
13:28:10*hmmm joined #nim
13:31:10FromDiscord<trippleA> Did a hello world in 14.04 with zero problems.
13:32:00miprinow do a nimble install cligen, or like
13:33:38FromDiscord<trippleA> cligen installed successfully. I was using 14.0.6 if that makes a difference.
13:33:54miprithen AFAIK you're golden.
13:34:41*Torro quit (Remote host closed the connection)
13:34:51FromDiscord<trippleA> Thanks man for the help. I know that even something as old as 14.04.6 can still run modern versions of nim and that's awesome.
13:45:19FromDiscord<squid> Can a non-async function run async functions?
13:45:25PMunchnarimiran, I could feel there was something I was missing, but especially with an audience it's hard to try to map problems into a mental model
13:45:48PMunchnarimiran, DP?
13:45:50FromDiscord<squid> Or wait. I might be thinking wrong here. I probably need to implement async for everything in my case
13:46:02narimiranPMunch: i can just imagine the pressure. i couldn't do it.
13:46:12*spiderstew quit (Quit: ZNC 1.7.2+deb3 - https://znc.in)
13:46:15PMunchsquid, it can, in a way
13:46:18narimiranPMunch: dynamic programming
13:46:25*spiderstew joined #nim
13:46:37FromDiscord<squid> PMunch, What do you mean?
13:46:59FromDiscord<squid> Also. When threading can the different threads access the same data?
13:47:45PMunchWell you can to run asynchronous methods from a non-async procedure, but that requires you to wait for the result, or pass the async procedure back (essentially making your procedure async)
13:48:09PMunch@squid, yeah they can, but you need to take care
13:49:18*spiderstew quit (Client Quit)
13:49:49*rockcavera quit (Remote host closed the connection)
13:50:55PMunchnarimiran, ah I see
13:52:09FromDiscord<shadow.> you need stuff like locks but yeah
13:52:13FromDiscord<shadow.> just think to yourself like
13:52:29FromDiscord<shadow.> "is there a possibility that two threads using my variable at the same time could pose issues"
13:52:44FromDiscord<shadow.> and then that will probably tell you if you need a lock lol
13:52:48PMunchWhen I was looking at your example trying to figure out what was going on it dawned on me that you're essentially splitting it down into sub-problems and expanding from there
13:52:57PMunchDefinitely was an aha moment
13:53:24PMunch@shadow. with the caveat that the GC will also be looking at your tasty tasty data
13:53:35*rockcavera joined #nim
13:54:10PMunchI'm thinking of streaming today as well by the way, but a bit later than I have been streaming
13:54:36PMunchProbably closer to around 5 UTC
13:54:41PMunch5PM UTC*
13:55:18narimiranif i have `seq[seq[int]]` of known lengths, is there an easy way to reset all values to zero (while keeping lengths)?
13:56:09PMunchmySeq.mapIt(newSeq(it.len))
13:56:16PMunchPerhaps the easiest
13:57:39PMunchOr mySeq.mapIt(it[0].unsafeaddr.zeromem(it.len*sizeof(int))
13:57:42ZevvPMunch: so, you spend the whole day solving your aoc on a anonymous shadow acount. Then you optimize and clean your solution. And then you start your streaming session acting as if you see it for the first time, and you're able to type it in one go, run it and get your star
13:57:47Zevvthat is *pretty smart*
13:57:48Zevvactuall
13:57:58PMunchHaha I wish :P
13:58:10PMunchI think yesterdays stream painfully demonstrated that's not quite how I do it
13:58:53PMunchI actually started working on a little program I called presenttyper a while back
13:59:19PMunchBasically trying to mock live coding by having the program pre-saved and typed out one character for each keypress, no matter what it was :P
13:59:49Zevvyeah I do that
13:59:53PMunchSo that you could spit in the face of the demo-gods and nail your presentation live coding sessions
13:59:54Zevvit impresses people alot
13:59:58Zevvespecially my WPM is
14:00:02PMunchWait you do?
14:00:08Zevvdon't we all?
14:00:12PMunchI mean my WPM is already pretty high :P
14:00:13ZevvI thought everybody does that?
14:00:33FromDiscord<shadow.> when making a pr, i edit changelog.md right?
14:00:42FromDiscord<shadow.> (to the nim repo)
14:00:45PMunchI was helping my sister with some programming things and she couldn't keep up with the code I was typing because I was typing it out too fast :P
14:00:56PMunch@shadow. yes
14:01:00FromDiscord<shadow.> i already edited the file in question but disruptek said i should do since notation and the changelog
14:01:01FromDiscord<shadow.> kk thanks
14:01:09PMunchAt least if you add something people should be aware of
14:01:20FromDiscord<shadow.> rotateLeft to Deques
14:01:26PMunchZevv, what do you use to do it?
14:01:26FromDiscord<shadow.> i would say that's something people should be aware of
14:01:27FromDiscord<shadow.> right?
14:01:36FromDiscord<shadow.> do i add to bottom or top of the lib list
14:01:39PMunch@shadow. added a new proc? Yeah that should go in the changelog
14:01:44FromDiscord<shadow.> kk
14:01:45*spiderstew joined #nim
14:01:46FromDiscord<shadow.> top or bottom lol
14:01:49narimiranPMunch: "mySeq.mapIt(newSeq(it.len))" - wouldn't this be slower (and more expensive?) than just double for loop and setting each member to 0?
14:01:52PMunchBottom I think
14:01:54FromDiscord<shadow.> thx
14:02:18PMunchnarimiran, it would probably be faster until the GC kicks in :P
14:02:43PMunchBut the zeromem version would probably be faster than both
14:02:47narimiranZevv: do you maybe have an idea? (if i have `seq[seq[int]]` of known lengths, is there an easy way to reset all values to zero (while keeping lengths)?)
14:03:00FromDiscord<shadow.> and disruptek said to also do since notation? i'm not familiar with the term could i get a quick explanation?
14:03:23Zevvnarimiran: hm iterate + memset
14:03:42PMunchZevv, I already told him, but he won't listen to me :P
14:04:01*waleee-cl joined #nim
14:04:05Zevvhaha
14:04:06narimiranPMunch: why would i trust a guy who struggles with aoc day10???
14:04:11FromDiscord<shadow.> DAMNN
14:04:14Zevvgood point, good point
14:04:15Zevvbuuurn
14:04:16PMunchOoooooh
14:04:23narimiran(as you can see, i don't trust myself, either)
14:04:25FromDiscord<WalrusNoj> ooh snap u gonna take that show???
14:04:31FromDiscord<shadow.> who me? i already did it smh
14:04:32PMunchHaha :P
14:04:33ZevvI didn't need like, two hours, or so
14:04:34FromDiscord<shadow.> hes talking to pmunch
14:04:35*lritter joined #nim
14:04:35miprihttps://play.nim-lang.org/#ix=2Hyk
14:04:36Zevvno I didn't sir
14:04:37FromDiscord<shadow.> LMAO
14:04:39FromDiscord<shadow.> i took 2.5 dont worry
14:04:53FromDiscord<WalrusNoj> i took 20 hours on day 4
14:05:12FromDiscord<shadow.> programming in your sleep
14:05:15FromDiscord<shadow.> dreams of using npeg
14:05:16FromDiscord<shadow.> over regex
14:05:17FromDiscord<shadow.> lol
14:05:18PMunchI spent an hour on stream, and then 15 minutes stealing from narimiran :P
14:05:23FromDiscord<shadow.> lmaoo
14:05:38narimiranthanks mipri!
14:05:56FromDiscord<shadow.> i spent an hour trying to use recursion, another half hour trying dynamic programming, another half hour doing research on probability, and then the final half hour implementing the math lol
14:06:15FromDiscord<shadow.> wound up with a pretty solution at least
14:06:29FromDiscord<shadow.> https://play.nim-lang.org/#ix=2Hym
14:06:42ZevvI first started coding, going recursive
14:06:48Zevvthen realizing that the space was too big
14:06:53FromDiscord<shadow.> lmao yeah
14:06:55Zevvthen I drew a little tree of the example
14:06:57Zevvand *poof* there it was
14:07:02FromDiscord<shadow.> haha same
14:07:16FromDiscord<speckledlemon> Is <https://github.com/jiro4989/setup-nim-action> the officially sanctions GitHub action?
14:07:42mipriI spent three hours looking for a polynomial solution, with not even the faintest suspicion that f(n) and f(n-1) might be related.
14:07:50FromDiscord<shadow.> lmfao
14:07:54FromDiscord<shadow.> rip
14:08:02mipriyeah I'm still mad.
14:08:15FromDiscord<shadow.> eh same kinda
14:08:30FromDiscord<shadow.> i shoulda realized it was just ap stat under the clothes of programming
14:08:43FromDiscord<shadow.> definitely not taking that class after that ordeal
14:08:44FromDiscord<shadow.> lmao
14:09:19*Q-Master quit (Read error: Connection reset by peer)
14:09:32mipriI did all kinds of programming, technically speaking. I saw that runs of 1 were interesting. I was looking for all possible combinations of removing x[i-1] when x[i]-2==x[i-2], all kinds of completely hopeless dead ends.
14:09:34PMunch@shadow. should've used a CountTable ,)
14:09:57FromDiscord<shadow.> oh damn true
14:10:11*Q-Master joined #nim
14:10:23mipri"maybe if I sum the factorials of the length of the runs"
14:10:42PMunchmipri, I was doing something similar :P
14:10:53FromDiscord<shadow.> i should get started on day 11 lol
14:11:13PMunchTrying to figure out if there was any rule of "length of consecutive numbers" -> combinations
14:12:14FromDiscord<kenran> I just tried building a project on macOS catalina with nim 1.4.2 (installed via `nix-env`). Now building a package with `nimble build` works as long as it has no other dependencies. If I need, say, `opengl`, I can accept to download a `package.json`, but then I get `SIGBUS: Illegal storage access. (Attempt to read from nil?)`. Any ideas?
14:12:51mipriyou're getting that error from nimble?
14:13:09FromDiscord<kenran> Yeah, from `nimble build`
14:13:32FromDiscord<kenran> It says `Downloading official package list` just before crashing
14:13:55FromDiscord<Vindaar> narimiran: damn, your solution to yesterdays problem really is, wow. I spent like 3 hours trying to figure out a smart mathy way without programming required essentially. Ended up with a mix of brute force + a phase space reduction to make that feasible
14:13:57mipriok, it's a bug. If I can make a 20% educated guess, I'd say it's an incompatibility with openssl.
14:14:38miprithat is, the library is loading and nimble is trying to use it, but the API's changed incompatibly or the like.
14:14:49PMunch@Vindaar, yeah the CountTable way really is a thing of beauty
14:14:54narimiran@Vindaar to me, more fascinating is that in my small group of friends (~10 of us), we had 4 solutions that calculated combinations!!
14:15:01FromDiscord<kenran> I can try installing `choosenim`, because there seems to have been something with `openssl` there that should be fixed by now I hope
14:15:14FromDiscord<Vindaar> "small group of friends" "10 of us" eh?
14:15:15mipribecause it looked like a problem of combinations.
14:15:15FromDiscord<Vindaar> haha
14:15:29FromDiscord<Vindaar> damn, you have a smart bunch of people around you, huh?
14:15:51mipriI mean the obvious brute force of part1 is to just nextPermutation until you find a good one, right?
14:15:55narimiranthey never heard about DP, they don't like recursions, so they decided to solve it by counting all the possible ways on the paper
14:16:11FromDiscord<Vindaar> DP?
14:16:19narimiran*all possible ways for N adapters with diff=1
14:16:26mipriyou're already doing combinations. The part2 is infeasible because there are too many combinations. You're looking for combinations of ways to mutate a string. The whole thrust of the text of the problem points you down a dead end.
14:16:26FromDiscord<Vindaar> oh
14:16:46PMunchmipri, of part 1?
14:16:49PMunchI just did this: https://github.com/PMunch/aoc2020/blob/master/day10/part1.nim
14:17:10FromDiscord<Ricky Spanish> can i build my nim programs for musl? not sure iv seen any documentation for it
14:17:11miprithe brute force of it is to do that.
14:17:31PMunch@Ricky, I think so
14:17:38PMunchSeem to recall someone doing it
14:17:44mipriyes. the easiest way is to use musl-gcc, just requires some --gcc.exe and --gcc.linkerexe options
14:17:58miprihttps://scripter.co/nim-deploying-static-binaries/
14:18:19FromDiscord<Ricky Spanish> ah decent thanks i just wanted to know generally if it was conceivably possible before i started thanks guys
14:21:10FromDiscord<kenran> mipri, it works with `choosenim` though. I'm not using macOS as my main system, so that's probably fine. I bet it's something `nix`y that's wrong
14:21:39FromDiscord<Ricky Spanish> also does anyone know if theres a way to exec with osproc or another way and return a id to the process it has createdso you can keep track of any long running child processes by polling the os?
14:21:52FromDiscord<kenran> Plus, I'm surprised: I can immediately build the project, and it runs oO I've never had that, much less with something using OpenGL/GLFW
14:22:32FromDiscord<Ricky Spanish> or do i just poll the os for processes with my nim program as the parent process?
14:22:46miprihttps://nim-lang.org/docs/osproc.html 's startProcess
14:23:44mipriyou can poll with peekExitCode, or do a lot of other things. It's normal systems programming
14:23:56PMunch@kenran, yeah Nim is pretty magical in how easy it is to get stuff to run
14:25:28FromDiscord<Ricky Spanish> ah nice thanks @mipri
14:25:34FromDiscord<kenran> I was so surprised. I'm allocating a PTY, talking to it (though I maybe shouldn't be surprised as macOS should be posix-compatible there), and initializing graphics. blew my mind
14:28:19Araqlibc static linking has its own downsides which is why it's not the default on Linux
14:40:21FromDiscord<shadow.> hmm
14:40:29FromDiscord<shadow.> could i have a quick lookover of my day 11 part one logic?
14:40:33FromDiscord<shadow.> im getting answer too low
14:40:34*PMunch quit (Quit: Leaving)
14:40:41FromDiscord<shadow.> just wanna make sure im understanding the problem correctly
14:40:51miprishow it.
14:41:02FromDiscord<shadow.> thanks
14:41:14FromDiscord<shadow.> https://play.nim-lang.org/#ix=2HyA
14:43:33mipriyou're modifying the grid while testing it
14:43:40FromDiscord<shadow.> yeah
14:43:46FromDiscord<shadow.> am i not suppose to?
14:43:54FromDiscord<shadow.> i thought i seat the people every time i go through?
14:44:00miprino, you're supposed to move from one snapshot of the grid to the next
14:44:06FromDiscord<shadow.> ahh i see
14:44:18FromDiscord<shadow.> do i seat first then remove? or no
14:44:22miprithe next state of each seat depends on the previous snapshot's environment
14:44:40miprino, the order of removal vs. seating doesn't matter. those rules could be performed entirely in parallel
14:44:51FromDiscord<shadow.> i see ok
14:44:53FromDiscord<shadow.> hm
14:44:58FromDiscord<shadow.> thanks
14:45:40mipri>The following rules are applied to every seat simultaneously:
14:46:07mipriwhat you're doing is non-simultaneous
14:47:37*hmmm quit ()
14:47:45FromDiscord<shadow.> thanks, got it this time
14:48:52*habamax quit (Ping timeout: 246 seconds)
14:49:40Araqyay another lockdown coming
14:49:48FromDiscord<shadow.> rip
14:50:45FromDiscord<shadow.> my pr failed like this on checks. what would i have changed that could've caused this? https://media.discordapp.net/attachments/371759389889003532/786968216361762877/unknown.png
14:51:00FromDiscord<shadow.> i just added a rotateLeft and rotateRight proc to deques.nim and updated changelog
14:51:24FromDiscord<shadow.> doesn't seem like i would have touched that file
14:51:40Araqthat test is fragile
14:51:46Araqnothing to do with your PR
14:52:35FromDiscord<shadow.> ahh ok cool
14:54:13FromDiscord<shadow.> so now i just have to add a .since notation?
14:54:19FromDiscord<shadow.> disruptek said that but im not familiar with the term
14:56:36miprigrep -r since: lib/ # from Nim repo
14:56:58FromDiscord<shadow.> not sure i understand
14:57:19FromDiscord<Rika> execute that command in the local git directory
14:57:26FromDiscord<shadow.> ohh ok
14:57:28mipriyou'll get output such as https://play.nim-lang.org/#ix=2HyH
14:59:25*Vladar joined #nim
15:00:27FromDiscord<shadow.> im on windows lmao
15:00:30FromDiscord<shadow.> lemme try my ubuntu subsys
15:00:41FromDiscord<shadow.> worked
15:00:51FromDiscord<shadow.> just lib/ ? or the actual path to the file
15:00:55miprithe only point of the command was to see what you can see already in that paste
15:01:08FromDiscord<shadow.> OH
15:01:14FromDiscord<shadow.> i see
15:01:32FromDiscord<shadow.> since is just the version it was added in or the version it works in
15:01:35FromDiscord<shadow.> im guessing former?
15:01:51FromDiscord<Rika> why would it not work when it was added
15:01:56FromDiscord<Rika> thats just stupid
15:02:00FromDiscord<shadow.> well yeah but it might work earlier to when it was added
15:02:01FromDiscord<shadow.> lmao
15:02:07FromDiscord<shadow.> but kk ill add one
15:02:14FromDiscord<Rika> that doesnt apply to your case though
15:02:22FromDiscord<shadow.> so just `{.since: (1, 6).}` ?
15:02:28FromDiscord<shadow.> devel is on 1.6 right lmao
15:03:16miprithe next non-devel version is 1.6
15:03:29mipriall the since's that I see have odd numbers. they're introduced in devel versions
15:04:15FromDiscord<shadow.> ohh
15:04:38*abm joined #nim
15:04:44FromDiscord<shadow.> then devel is 1.5 currently
15:06:06FromDiscord<shadow.> alright i added `{.since: (1, 5).}` to both procs
15:06:11FromDiscord<shadow.> that's correct?
15:08:54FromDiscord<shadow.> ah wait i think its 1.5.1
15:09:09FromDiscord<shadow.> how do i check current version of devel?
15:11:03FromDiscord<shadow.> nvm got it
15:11:38FromDiscord<tomck> sent a code paste, see https://play.nim-lang.org/#ix=2HyN
15:12:18FromDiscord<tomck> (edit) "https://play.nim-lang.org/#ix=2HyN" => "https://play.nim-lang.org/#ix=2HyO"
15:12:57*hmmmmm joined #nim
15:14:06FromDiscord<Vindaar> I think you have to generate a full type section. Calling a macro within a type section is problematic
15:14:41*gangstacat quit (Quit: Ĝis!)
15:17:06FromDiscord<tomck> sent a long message, see http://ix.io/2HyP
15:17:34FromDiscord<shadow.> `Error: cannot attach a custom pragma to 'rotateRight'`
15:17:34FromDiscord<shadow.> hmm
15:17:49FromDiscord<tomck> Is there a way to forward declare types?
15:21:50*Gustavo6046 joined #nim
15:23:36*gangstacat joined #nim
15:24:32FromDiscord<shadow.> ahh i can't attach a pragma to a template?
15:25:04FromDiscord<shadow.> that wouldnt make sense
15:25:11Araqhardly, the template gets expanded rather quickly
15:25:45FromDiscord<shadow.> nvm fixed
15:25:57FromDiscord<shadow.> it was because i replaced return type of untyped with the .since notation
15:26:01FromDiscord<shadow.> didn't notice it lol
15:26:20hmmmmmhey nimions dumb question if I forward declare a proc can I call it with parameters before I define it
15:26:28FromDiscord<shadow.> failde again what
15:26:31FromDiscord<shadow.> failed
15:26:52FromDiscord<shadow.> isn't that the whole point of forward declarations?
15:27:10FromDiscord<Rika> yes
15:27:13FromDiscord<Rika> thats the point
15:27:15hmmmmmnaisu
15:27:16hmmmmmbut
15:27:17FromDiscord<shadow.> lol
15:27:24hmmmmmcan't make the test work
15:27:27hmmmmmhalp
15:27:36hmmmmmhttps://play.nim-lang.org/#ix=2HyT
15:27:43FromDiscord<shadow.> araq, how do i do since notation on a template?
15:28:05FromDiscord<shadow.> `template rotateRight(deq: var Deque, n = 1): untyped {.since: (1, 5, 1).} =`
15:28:07FromDiscord<shadow.> this is failing
15:28:17FromDiscord<tomck> hmmmmm: works for me
15:28:21hmmmmm:O
15:28:28hmmmmmit's showing nothing to me
15:28:37FromDiscord<tomck> you're not echoing anything
15:28:41FromDiscord<tomck> stick an `echo res` at the bottom
15:28:43hmmmmmOH SHI
15:28:45hmmmmmD:
15:29:01hmmmmmIT WORKS
15:29:04hmmmmmthx <3
15:32:49FromDiscord<shadow.> ah wait idk if i interpreted the earlier message correctly. can you put since notation on a template, or does it get expanded too quickly for that
15:36:12FromDiscord<shadow.> yeah did some tests, seems like you cant
15:36:13FromDiscord<shadow.> fixed pr
15:43:44FromDiscord<Esbeesy> kin'ell Day 11 is something innit
15:43:56*narimiran quit (Quit: leaving)
15:44:23FromDiscord<Esbeesy> Apologise in advance for the state of this 😂 ↵https://github.com/sambeckingham/advent-of-code-2020/blob/main/day11/day11.nim
15:46:42FromDiscord<Esbeesy> is there some kind of sugar around the `low(seq) .. high(seq)` if you want to check an index is in bounds? I know you can do `0 ..< seq.len` also but something like `rangeOf(seq)` would be nice
15:47:18FromDiscord<Rika> can always make the proc
15:47:24FromDiscord<Rika> or template if you want
15:47:52FromDiscord<Esbeesy> Aye I know I just wondered if it was common enough to have warranted being in the core lib
15:48:00FromDiscord<Rika> i dont think so
15:58:06FromDiscord<shadow.> time to add 🏃‍♀️
15:58:07FromDiscord<shadow.> nah jk
15:58:31FromDiscord<shadow.> @Esbeesy i usually just do `if i in 0..a.high`
15:58:54FromDiscord<Esbeesy> yeah dunno why I used low(seq), like arrays don't start at 0
15:59:41FromDiscord<shadow.> lol
16:00:21FromDiscord<shadow.> hmm
16:00:24FromDiscord<shadow.> my part two is infinitely cycling
16:00:26FromDiscord<shadow.> thats odd
16:02:40FromDiscord<shadow.> https://play.nim-lang.org/#ix=2Hz7
16:02:45FromDiscord<shadow.> is there an issue with this logic?
16:05:43FromDiscord<shadow.> @Esbeesy they only difference between parts one and two is the condition in which seated people leave, right?
16:05:49mipritoo much is visible. you should stop when you hit a seat
16:05:59FromDiscord<shadow.> wdym
16:06:55mipri>The leftmost empty seat below would only see one empty seat, but cannot see any of the occupied ones
16:07:09FromDiscord<shadow.> yeah
16:07:10FromDiscord<shadow.> i have a break in plcae
16:07:12FromDiscord<shadow.> place
16:07:26FromDiscord<shadow.> if grid[y][x] != '.':↵ yield grid[y][x]↵ break
16:07:38FromDiscord<shadow.> which skips to the next direction, right?
16:07:53mipriyeah that looks fine then
16:08:01FromDiscord<shadow.> i wonder why it's cycling then
16:08:26Araquh oh I now have a face
16:08:34FromDiscord<shadow.> hm?
16:08:55FromDiscord<shadow.> i wonder what's wrong then hmm
16:09:13miprisomething elsewhere, probably
16:09:35FromDiscord<shadow.> well they both use the same function, i just pass the function that has the exit seat condition
16:09:46miprithat doesn't mean that your earlier code still works for part2
16:09:57FromDiscord<shadow.> hmm
16:09:58FromDiscord<shadow.> ok
16:10:13FromDiscord<shadow.> when they look for a seat to go in, that's still adjacent right?
16:10:15FromDiscord<shadow.> or is that also visible
16:10:45mipriit's a completely separate check, but with steps -- oh
16:10:48mipriyou need to reset steps
16:10:57FromDiscord<shadow.> wdym?
16:11:00FromDiscord<shadow.> not sure i follow
16:11:09mipriok, let's say you look right, and see a chair
16:11:12FromDiscord<shadow.> mhm
16:11:15mipriyou yield the chair, and then you break
16:11:22mipriand then you look in another direction -- farther
16:11:35FromDiscord<shadow.> hmm
16:11:44FromDiscord<shadow.> well yes, right?
16:11:48mipriby the time you get to the last direction you can't see anything nearer than 8 squares away
16:11:54FromDiscord<shadow.> oh shoot
16:12:14FromDiscord<shadow.> wait why would that be?
16:12:17FromDiscord<shadow.> steps is reassigned for each delta
16:12:27miprioh yeah, once again it's fine.
16:12:31FromDiscord<shadow.> weird
16:12:34FromDiscord<shadow.> hmm
16:12:40FromDiscord<shadow.> and this certainly works
16:12:41mipriI'm sleepy and you're asking me about good code instead of broken code.
16:12:41FromDiscord<shadow.> sent a long message, see http://ix.io/2Hzd
16:12:49FromDiscord<shadow.> well somehow it's broken
16:12:53FromDiscord<shadow.> because it's looping
16:12:56FromDiscord<shadow.> lol
16:13:24*^Q-Master^ joined #nim
16:13:25miprisince you don't understand the problem, you shouldn't put too much faith your ability to isolate the problem
16:13:39FromDiscord<shadow.> well
16:13:42FromDiscord<shadow.> i understood part one as that worked
16:13:51FromDiscord<shadow.> and as far as i can tell the only difference is the exit condition
16:14:02FromDiscord<shadow.> so that means my exit condition code for part two is the only thing wrong, correct?
16:14:05miprithere's no difference in the exit condition
16:14:11FromDiscord<shadow.> exit condition as in
16:14:14FromDiscord<shadow.> when someone exits a seat
16:14:15FromDiscord<shadow.> sorry
16:14:24mipriyeah's just +1
16:14:26*Q-Master quit (Read error: Connection reset by peer)
16:14:26FromDiscord<shadow.> in part one its 4 adjacent occupied, in part two its 5 visible occupied
16:14:35FromDiscord<shadow.> yeah?
16:14:36miprithere's nothing tricky there.
16:14:50FromDiscord<shadow.> well doesnt it switch to visible over occupied for the seat exit cond?
16:15:03mipriyeah, you're doing that
16:15:08FromDiscord<shadow.> hm
16:15:40FromDiscord<shadow.> does the visibility rule apply to sitting down as well?
16:15:46FromDiscord<shadow.> open seats in all directions visible?
16:15:50FromDiscord<shadow.> or is it still just adjacent
16:16:04FromDiscord<shadow.> bc if it applies to sitting down as well then that's my issue
16:16:07mipri>The leftmost empty seat below would only see one empty seat, but cannot see any of the occupied ones:
16:16:21mipriof just "L.L.#.#.#.#."
16:16:25FromDiscord<lqdev> @shadow. offtopic but gotta say you have some serious dedication right there o.O you've been trying to solve AoC the whole day, i would've just quit for good
16:16:32FromDiscord<shadow.> well im in school
16:16:38FromDiscord<shadow.> so im just doing it in intervals
16:16:40FromDiscord<shadow.> when i get the chance
16:16:41FromDiscord<shadow.> lol
16:16:44FromDiscord<lqdev> ah kay
16:16:51FromDiscord<shadow.> ccertainly havent been straight coding for 2:20 hours
16:16:52FromDiscord<shadow.> lol
16:16:55FromDiscord<shadow.> tho yesterday i did that-
16:17:02FromDiscord<shadow.> hmm
16:17:15FromDiscord<shadow.> yeah i think ik the issue
16:17:29mipriwhat is it?
16:18:42FromDiscord<shadow.> when going to sit, im only checking adjacent open seats, not visible open seats
16:18:48FromDiscord<shadow.> i just fixed that and it still doesn't work
16:18:54FromDiscord<shadow.> alr that means there's a flaw somewhere else
16:21:42FromDiscord<shadow.> found something
16:21:47FromDiscord<shadow.> visible is only yielding "#" lol
16:23:36FromDiscord<shadow.> no loop
16:23:40FromDiscord<shadow.> lets see if its right
16:23:45FromDiscord<shadow.> YUP
16:23:45FromDiscord<shadow.> gottem
16:24:07FromDiscord<shadow.> issue was i never switched count function to use new seating condition function that was passed
16:24:16FromDiscord<shadow.> it was still hardcoded to use part one's
16:25:24FromDiscord<shadow.> does nim have anonymous iterators?
16:26:20mipriyou mean first class iterators? yes, with closure iterators.
16:27:16FromDiscord<shadow.> kk
16:27:25FromDiscord<shadow.> and can i annotate that using sugar or no
16:27:35FromDiscord<shadow.> or rather the sugar module
16:27:38*habamax joined #nim
16:30:25*PMunch joined #nim
16:34:33PMunchWho's ready for some AoC streaming? https://www.twitch.tv/pmunche https://www.youtube.com/watch?v=YTJZMkV1ZKg
16:35:49PMunch@shadow. narimiran ^
16:36:00AraqI'm ready
16:40:25FromDiscord<martinium> I have a question about the current default Nim GC. Does it force a collection at a specified interval? Golang forces one every 2 mins no matter what and can cause latency spikes on certain apps. Does Nim have something similar with it's default GC?
16:41:24Araqno
16:42:48FromDiscord<martinium> That is very good to know
16:43:08FromDiscord<martinium> similar app may be able to avoid certain issues like those latency spikes if written in Nim
16:44:04FromDiscord<Quibono> Well I believe ARC also removes/reduces those spikes (not that I’m an authority on that.)
16:45:07FromDiscord<lqdev> it removes the GC completely
16:45:10FromDiscord<lqdev> ARC is no GC™
16:45:18FromDiscord<lqdev> it's reference counting
16:46:46FromDiscord<mratsim> @martinium the GC is inlined in some function calls that allocates or deallocates a GC-managed type
16:47:13FromDiscord<mratsim> if you don't use a GC-managed type (seq, ref or string) in a function or don't allocate/deallocate them there will be no GC calls.
16:48:20FromDiscord<mratsim> also you can compile with a tuning parameter to set a max pause https://nim-lang.org/docs/gc.html
16:52:56*Kaivo quit (Ping timeout: 240 seconds)
16:55:46Araqit's a complex topic. They are all "GCs" but the underlying algorithms are very different. it's a bit like comparing bubblesort with quicksort.
17:04:11FromDiscord<pietroppeter> @PMunch : isn't that a seating[yy][xx] in the template?
17:07:26*hmmmm joined #nim
17:08:52*hmmmmm quit (Ping timeout: 246 seconds)
17:19:10*Tanger quit (Remote host closed the connection)
17:21:31*JustASlacker quit (Quit: Leaving)
17:24:09*Q-Master joined #nim
17:24:23*^Q-Master^ quit (Read error: Connection reset by peer)
17:40:09FromDiscord<shadow.> how do i consume rest of string in npeg?
17:40:21FromDiscord<shadow.> for instance you can do 25 to consume 25 chars, how would i do an arbitrary amount?
17:40:48FromDiscord<shadow.> i mean i guess `{'\0'..\255'}` works?
17:46:59FromDiscord<Quibono> Have you tried the last example?
17:55:52FromDiscord<shadow.> lemme see
17:58:39PMunch*\1 should work
17:59:00PMunchOh soryr just *1
17:59:28PMunch@shadow. ^
17:59:59FromDiscord<shadow.> thanks
18:02:23Zevvshadow.: you good?
18:04:09FromDiscord<shadow.> yeye
18:04:34Zevvnice
18:08:34*tefter joined #nim
18:19:58*hnOsmium0001 joined #nim
18:27:40*hmmmm quit (Remote host closed the connection)
18:30:36ForumUpdaterBotNew thread by Snej: Best IDE-like Nim experience?, see https://forum.nim-lang.org/t/7242
18:32:50FromDiscord<m0nsta> yo Zevv: i read your memory management article the other way
18:32:54FromDiscord<m0nsta> good stuff
18:33:00*mbomba joined #nim
18:33:02FromDiscord<m0nsta> other day
18:33:52Zevvta
18:34:07FromDiscord<m0nsta> there was a list at bottom of the thing. the topics did looked interesting if you ever get around to writing those
18:34:12*JustASlacker joined #nim
18:34:14Zevvyeah if ever :/
18:34:16FromDiscord<m0nsta> lmk
18:34:21Zevvit's not about time - I got tons of that
18:34:27Zevvbut motivation, man, motivation
18:34:34FromDiscord<m0nsta> i feel ya
18:34:37JustASlackeris there something like the python set in nim?
18:34:50FromDiscord<m0nsta> does me asking help ?
18:34:51JustASlackeri hate motivation
18:35:05FromDiscord<shadow.> sorry i'm not sure i know what that word is
18:35:07FromDiscord<shadow.> that last one you just used
18:35:08ZevvI was just getting started writing a npeg tutorial to complete the manual
18:35:16Zevvthen I remembered I didn't finish Hollow Knight yet
18:35:21FromDiscord<shadow.> and yes there is a set
18:35:25FromDiscord<shadow.> there's the builtin sets for ordinals
18:35:28FromDiscord<shadow.> hash sets for any types
18:35:39FromDiscord<shadow.> and intsets, tho idk how they compare to normal sets tbh
18:36:09JustASlackerduh
18:36:12FromDiscord<m0nsta> why is everyone so low on motivation lol
18:36:22JustASlackerbecause Im low on pizza
18:36:23FromDiscord<m0nsta> i have to contain it
18:36:34FromDiscord<m0nsta> i dont like pizza
18:36:38FromDiscord<m0nsta> thats it
18:36:44FromDiscord<m0nsta> has to be it
18:36:48JustASlackershadow. thx, dunnow how I missed that
18:36:53FromDiscord<shadow.> np
18:36:59FromDiscord<shadow.> what type do you need it for?
18:38:05JustASlackerwell right I check if an element is inside a sequence before I add it
18:38:08*narimiran joined #nim
18:38:09JustASlackerright now
18:39:05JustASlackerI like it more with a set and without the if statement
18:39:32JustASlacker¯\_(ツ)_/¯
18:42:52FromDiscord<shadow.> ohh
18:42:59FromDiscord<shadow.> what type is the element?
18:43:10FromDiscord<shadow.> sry that's what i meant originally lmao
18:44:06JustASlackera tcp port. so, an int
18:44:16Zevvno, and uint16
18:44:22Zevvwhich fits in a normal set[uint16]
18:44:25FromDiscord<shadow.> yeah
18:44:38JustASlackeryeah, well, MAYBE I USED A STRING
18:44:38FromDiscord<shadow.> set[uint16] or IntSet will both work
18:44:49FromDiscord<shadow.> then a hash set would be needed
18:45:47Zevvperformance & size wize, set[uint16] > Intset > HashSet[int]
18:49:18JustASlackerthe documentation is kinda unclear
18:49:35JustASlacker"Hash sets are different from the built in set type. Sets allow you to store any value that can be hashed and they don't contain duplicate entries."
18:49:51JustASlackerdoes that mean the builtin set type does allow duplicate entries?
18:50:30JustASlackersets with duplicate entries kinda pointless
18:51:06JustASlackerI hate it when pizza is taking long
18:56:55*thomasross joined #nim
19:01:11FromDiscord<mratsim> are Intset that good?
19:01:32FromDiscord<mratsim> I think their array[33, Int] waste a lot of space.
19:03:45FromDiscord<shadow.> fair
19:03:48FromDiscord<shadow.> i'm not sure
19:03:51FromDiscord<shadow.> they're sparse bitsets
19:03:53FromDiscord<shadow.> and no, slacker
19:04:00FromDiscord<shadow.> the builtin sets are bitsets
19:04:07FromDiscord<shadow.> meaning you can't have duplicates
19:04:45Zoom[m]Had no problem with yesterday's AOC task, actually, it was the 2nd fastest one for me to solve. Just had to take pen and paper for part2 and check what's going on.
19:04:58Zoom[m]But I hated today, doing 2d indexing by hand...
19:05:10FromDiscord<shadow.> yeah fair
19:05:18FromDiscord<shadow.> can you not make a default set with `int`?
19:06:53FromDiscord<shadow.> bc my main complaint with the builtin sets for integers is that most of my ints are `int` and afaik you need to specify `int16` or `uint16` for integers of that size or something
19:07:11FromGitter<bung87> https://github.com/status-im/nim-chronos/issues/143 can help with this?
19:07:12disbotprovide api readLineInto similar with asyncdispatch's recvInto
19:16:25*JustASlacker quit (Ping timeout: 240 seconds)
19:23:43cmc[m]Hey there is anyone working on some kind of video decoder bindings for Nim? I'm trying to evaluate how hard that would be for VLC's "dav1d" decoder for AV1
19:29:21*JustASlacker joined #nim
19:31:24FromDiscord<shadow.> can i cross compile for linux on a windows machine?
19:31:30FromDiscord<shadow.> if not ill just use my ubuntu subsys
19:33:39FromDiscord<shadow.> nvm
19:34:00FromDiscord<shadow.> disruptek, you here?
19:35:10FromDiscord<Esbeesy> Yeah you can
19:35:24FromDiscord<Esbeesy> the compiler page in the docs has guides for the various scenarios
19:36:45FromDiscord<shadow.> oh awesome
19:42:47*Torro joined #nim
19:45:32*JustASlacker quit (Read error: Connection reset by peer)
19:50:28*hmmm joined #nim
19:50:47ForumUpdaterBotNew thread by Timothee: How to disable (deprecated) appveyor CI from running (and failing) in your nim fork?, see https://forum.nim-lang.org/t/7243
19:53:22*habamax quit (Ping timeout: 246 seconds)
19:53:49*tefter quit (Ping timeout: 260 seconds)
19:55:05hmmmhey why I never see timmy on irc
19:55:19hmmmthe people want to hear from the timmy
19:55:33hmmm:invoking: disruptek
19:59:08FromDiscord<mratsim> @cmc mantielero had a vapoursynth wrapper iirc
19:59:20FromDiscord<mratsim> so it could use FFMpegSource
19:59:30FromDiscord<mratsim> also pretty sure there is a nim-ffmpeg out there
20:01:54hmmmwow people still use notepad++ in 2020
20:02:04hmmmmratsim I'm looking at your link
20:02:18hmmm30% is an insane stat
20:07:02*tefter joined #nim
20:07:23FromDiscord<acek7> disruptek im not drunk
20:11:08FromDiscord<kenran> I'm trying to communicate with a PTY that I've allocated and started a shell "in". Now using (via `execvp`) either `dash`, `bash`, `sh` or `fish` everything seems to go well. But when I start `zsh` in there (which happens to be the shell I actually use), I get an error when trying the first `read` on the pty's FD, with an `errno == 5`. Any idea how I can debug this?
20:22:47FromDiscord<lqdev> trying to cast between closure types, to no avail because the codegen is wrong
20:23:09*Q-Master quit (Ping timeout: 256 seconds)
20:23:58FromDiscord<lqdev> https://github.com/nim-lang/Nim/issues/5785
20:24:00disbotBad codegen on casting closure proc types ; snippet at 12https://play.nim-lang.org/#ix=2HBA
20:24:29FromDiscord<shadow.> idk if disruptek is here lol
20:24:34FromDiscord<lqdev> guess i'm gonna have to use inheritance
20:25:29*tefter quit (Quit: WeeChat 2.9)
20:33:31FromDiscord<Esbeesy> Nim 1.5.1 huh, that the develop branch? What's new in 1.5
20:36:20FromDiscord<lqdev> @Esbeesy https://github.com/nim-lang/Nim/blob/devel/changelog.md
20:36:29FromDiscord<Esbeesy> Ohhhhh shi, nice one
20:36:41FromDiscord<Esbeesy> Wait 1.6.x
20:37:08FromDiscord<lqdev> it lists all the changes on devel
20:37:14FromDiscord<lqdev> 1.5.1 is the current development version
20:37:17FromDiscord<lqdev> which is what i'm on
20:39:59leorize[m]1I'm waiting for IC :P
20:40:15FromDiscord<Esbeesy> Insane Clown: Posse?
20:40:24*leorize[m]1 is now known as leorize[m]
20:40:53FromDiscord<lqdev> incremental compilation
20:40:57FromDiscord<lqdev> @leorize yeah me too
20:42:20leorize[m]looks like there is a new developer tooling rfc
20:43:43FromDiscord<lqdev> yeah
20:43:50FromDiscord<lqdev> a round 300
20:44:32leorize[m]I find it kinda surprising that no one talks about the terrible debugging experience atm
20:44:34*narimiran quit (Ping timeout: 260 seconds)
20:45:10FromDiscord<Esbeesy> What's wrong with inserting 20 echo statements... 😂
20:45:41FromDiscord<lqdev> idk echo-debugging has been working out fine for me
20:45:57FromDiscord<lqdev> i almost never use the debugger
20:46:27leorize[m]debugger is useful when you're unsure of how the code flows
20:47:08FromDiscord<lqdev> maybe
20:47:14FromDiscord<lqdev> i never had to analyze code flow :p
20:47:20FromDiscord<lqdev> well, i did
20:47:25FromDiscord<lqdev> but just echo-debugged
20:47:29Zevv:)
20:47:48Zevvdebuggers is for tracing segfaults only
20:48:12leorize[m]hmm, looks like many don't understand how nimsuggest actually functions
20:48:17FromDiscord<lqdev> Zevv: my man
20:48:21Zevvlet's marry
20:48:35FromDiscord<lqdev> leorize wdym
20:51:50leorize[m]you can't really "remove" error checking from nimsuggest is what I meant :P
20:52:38leorize[m]well but you can't improve nimsuggest as it is atm
20:52:39Zevvyou say :)
20:53:03leorize[m]caching is near non-existence in nimsuggest
20:53:26leorize[m]so basically every command that concerns a changed file requires re-evaluation of all macros
20:54:02leorize[m]which is the main cause for the 100% cpu usage
20:54:52FromDiscord<lqdev> so THAT's why IC is gonna fix it!
20:54:57leorize[m]when ic arrives macro caching will actually be possible and should solve that pain point
20:55:12FromDiscord<lqdev> now you made me even more hyped up
20:55:46leorize[m]after ic arrives we're probably gonna deprecate the current architecture of nimsuggest
20:56:44FromDiscord<lqdev> TIL https://play.nim-lang.org/#ix=2HBL
20:56:50FromDiscord<lqdev> how is this type conversion even legal
20:57:06FromDiscord<lqdev> nim surprises me on every step
20:57:15FromDiscord<lqdev> even though i'm quite experienced
20:57:26leorize[m]the ic cache is very fast and can be queried directly
20:57:30*Q-Master joined #nim
20:58:08leorize[m]the future might be that nimsuggest not need to be a daemon
20:58:10FromDiscord<lqdev> maybe i'll wait with creating my nimsuggest plugin until this is done 🤔
20:58:24FromDiscord<lqdev> damn that would be so rad
20:58:47FromDiscord<lqdev> just a simple `nimsuggest complete file.nim dirtyfile.nim 1 12` and boom!
20:59:04FromDiscord<lqdev> no IPC needed!
20:59:09FromDiscord<lqdev> vanilla Lua-friendly!
21:00:58FromDiscord<exelotl> that proc type conversion does seem pretty sus
21:01:50leorize[m]just make it now :P
21:01:52leorize[m]the change won't happen overnight
21:02:52*Q-Master quit (Ping timeout: 272 seconds)
21:03:12leorize[m]I wonder if LSP will be what the new nimsuggest use
21:03:34leorize[m]LSP is cool and all but it's also complex
21:03:34leorize[m]not gonna be an issue for big editors
21:03:39FromDiscord<lqdev> @leorize i know, but right now i have more important things to focus on than writing a nimsuggest client
21:04:12FromDiscord<lqdev> yeah hopefully LSP isn't gonna be too much of a pain to implement
21:04:20FromDiscord<lqdev> at least at a small scale (completion + refactoring)
21:07:45FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2HBS
21:07:46FromDiscord<lqdev> noooooooooooooooo
21:07:49FromDiscord<lqdev> not the codegen
21:09:57FromDiscord<lqdev> somebody doesn't like my closures
21:13:19FromDiscord<lqdev> @exelotl well guess wat
21:13:24FromDiscord<lqdev> it is sus af
21:13:31FromDiscord<lqdev> https://play.nim-lang.org/#ix=2HBV
21:14:05FromDiscord<exelotl> lol epic
21:17:01*Gustavo6046 quit (Ping timeout: 264 seconds)
21:19:38FromDiscord<Esbeesy> Hey speaking of LSP I was trying to implement it in a VS Code extension yesterday
21:20:36*Gustavo6046 joined #nim
21:26:23FromDiscord<kenran> I need an `UncheckedArray[cstring]` for interop with C. The manpage mentions that the array must be terminated by a null pointer that has to be cast `(char )NULL`. How can I do this in nim?
21:26:29FromDiscord<kenran> maybe the second part is obsolete?
21:28:52FromDiscord<lqdev> first of all, you probably want `ptr UncheckedArray[cstring]`
21:28:57FromDiscord<lqdev> second of all
21:29:04FromDiscord<lqdev> you just set the last element to `nil` and it should work
21:31:22FromDiscord<lqdev> alright, codegen issue reported. https://github.com/nim-lang/Nim/issues/16325
21:31:25disbotSuspicious type conversion between procs accepting two different types ; snippet at 12https://play.nim-lang.org/#ix=2HC6
21:32:07FromDiscord<haxscramper> Why adding `var` to the argument causes type mismatch error in this code: https://play.nim-lang.org/#ix=2HC5 ?
21:32:37FromDiscord<kenran> @lqdev thanks! also I found `allocCStringArray` which seems to append a `NULL` cstring at the end
21:33:59FromDiscord<lqdev> @haxscramper `var`, `ref`, and inheritance don't play together nicely. you can use an explicit type conversion but since `ref`s are always mutable anyways you can just omit the `var` altogether
21:34:15FromDiscord<Esbeesy> Uh oh https://media.discordapp.net/attachments/371759389889003532/787069761812168704/unknown.png
21:35:02voltist@Vindaar Sorry, wasn't keeping track of chat. I'm having an issue with ggplotnim that I think you ought to see: https://github.com/dizzyliam/randomImgs/blob/master/broken.png?raw=true
21:35:21FromDiscord<kenran> I used to use `execvp("dash", nil)` to start a dash as a child process, and everything worked (as well as for `bash`, `fish` and others), but not for `zsh`. The only thing that I found that I did differently to `st` there except for the PTY handling was that I passed `nil` instead of a `cstringArray` that contained as first argument the executable name again. And behold: that was the reason it didn't work for `zhs`. Very weird that it's
21:35:50FromDiscord<kenran> (edit) "`zhs`." => "`zsh`."
21:36:01*Torro left #nim ("bye")
21:36:36FromDiscord<kenran> Now doing `execvp("zsh", @["zsh", nil])` (pseudocode, does not actually typecheck this way) it works fine.
21:37:11FromDiscord<kenran> Interacting with these low-level functions is just so weird
21:38:35FromDiscord<lqdev> welcome to C.
21:41:35FromDiscord<kenran> seeing this I simultaneously wonder about why anything even works as well as it does, but also find it somehow "elegant". some functions at least
21:42:20FromDiscord<lqdev> things work so well because they've been tested over many, many years.
21:42:26FromDiscord<lqdev> which means most bugs are ironed out.
21:42:33FromDiscord<kenran> yeah
21:42:55FromDiscord<kenran> which kinda brings me back to a question that went unanswered yesterday: how do I test such low-level code in nim?
21:43:19FromDiscord<lqdev> hard to tell
21:43:22FromDiscord<lqdev> just… run it
21:43:34FromDiscord<lqdev> low-level docs are sometimes quite lacking or ambiguous
21:43:38FromDiscord<kenran> I did some C# some years ago, and there I'd have created some interfaces and mocked the low-level stuff out for tests
21:43:53FromDiscord<lqdev> and sometimes there's no examples which is even more infuriating
21:43:59FromDiscord<lqdev> as you have to guess what a function does
21:44:51FromDiscord<kenran> nowadays I only do FP, where things are on a way higher level. it's sometimes hard to test stuff there as well, but in both cases (C#, Haskell) you usually write code in a way s.t. it's easier to test.
21:45:17FromDiscord<kenran> but doing so at such a low level and without losing any performance, if that should matter, seems hard to impossible for me
21:47:09FromDiscord<kenran> I don't hold anything against integration or end-to-end tests, but even those would be a challenge for me to write when interacting with the OS in such a way. it would also not cover any edge cases as I cannot simply "make a call fail" on a whim
21:48:36*Q-Master joined #nim
21:51:41FromDiscord<Rebel> When you were doing C# did you play around with dnpatch, dnlib, or mono.cecil? 😛
21:53:04FromDiscord<kenran> Nope, just boring business stuff 😦
21:56:13*krux02 joined #nim
21:57:39FromDiscord<WilliamDraco> sent a long message, see http://ix.io/2HCi
22:03:56*tribly left #nim ("WeeChat 2.9")
22:06:34FromDiscord<dom96> @WilliamDraco try poEvalCommand
22:07:23FromDiscord<zetashift> Say I have a `Cell` type and have a contructor/initialization func, is it more idiomatic to call that func `Cell()` or `cell()` or `newCell`?
22:07:35FromDiscord<zetashift> kinda bikeshedding but I've seen all 3 in the wild
22:08:26FromDiscord<zetashift> I think NEP-1 suggests init/new based on the type
22:10:41FromDiscord<kenran> Looking at https://nim-lang.org/docs/posix.html#signal%2Ccint%2CSighandler, what's `Sighandler`? How can I write one?
22:11:30FromDiscord<kenran> ah, it's only in the source
22:12:53FromDiscord<lqdev> @zetashift you can't call the func `Cell()` because `Cell` is already a symbol
22:13:12FromDiscord<lqdev> so go with `cell` or `initCell`/`newCell` depending on how expensive the operation is
22:13:24FromDiscord<lqdev> for refs it's always `newT`
22:13:46FromDiscord<lqdev> for everything else `initT` is idiomatic but quickly gets old when you have lots of ctors nested in each other
22:14:22FromDiscord<lqdev> so i personally use the type name with the first letter lowercased for small objects holding data that don't need complex initialization logic
22:16:30FromDiscord<WilliamDraco> @dom96 `poEvalCommand` results in the same behaviour
22:17:19FromDiscord<lqdev> `poUsePath`?
22:17:26FromDiscord<lqdev> though it's on by default on windows
22:17:44FromDiscord<WilliamDraco> tried it anyway, no change
22:21:22FromDiscord<zetashift> @lqdev thanks! Ill go with newT
22:21:29FromDiscord<zetashift> Don't have many cities
22:21:37FromDiscord<zetashift> Constructors
22:23:01FromDiscord<Esbeesy> ~Alright creating a VSCode language server client isn't as easy as I thought it was gonna be 😂 ~
22:23:01disbotno footnotes for `Alright`. 🙁
22:23:16*Q-Master quit (Ping timeout: 240 seconds)
22:23:17FromDiscord<Esbeesy> Oh my god it's working
22:24:37FromDiscord<Esbeesy> Does nimlsp provide syntax highlighting or does it rely on the textmate theme in the editor?
22:26:03FromDiscord<ElegantBeef> Pmunch said it doesnt support syntax highlighting afaik
22:26:07FromDiscord<Esbeesy> Shweet
22:26:52FromDiscord<Esbeesy> Okay so I've hooked it up and.. yeah
22:29:31PMunchYeah, it doesn't support syntax highlighting, yet..
22:31:32FromDiscord<Esbeesy> That's cool, the textmate thing works fine in Code anyway
22:31:49FromDiscord<Esbeesy> Are you actively working on nimlsp?
22:35:21PMunchDefine actively
22:35:27PMunchI'm not working on it right now
22:35:38FromDiscord<Esbeesy> RIGHT THIS SECOND
22:35:51PMunchBut I am maintaining it, and I will probably end up adding some more features to it at some point
22:35:55PMunchRight now I'm soldering :P
22:36:24FromDiscord<Esbeesy> Oo anything interesting?
22:36:39FromDiscord<Esbeesy> And yeah I just meant like it's not abandonware
22:38:08PMunchDefinitely not
22:38:17FromDiscord<scott> in the example for asynchttpserver it shows using the proc `processClient`... where is that proc defined and what does it do?
22:38:22PMunchI'm soldering switches on a keyboard
22:38:29FromDiscord<scott> nice
22:38:35FromDiscord<scott> what a pain in the ass though
22:38:37FromDiscord<Esbeesy> Which switcheesssss
22:38:47PMunchKailh low-profile brown
22:38:55FromDiscord<Esbeesy> And yeah same, I want to do it myself but sod soldering 100+ teeny switches
22:39:07PMunchThis one only has 70
22:39:14PMunchLuckily
22:39:21FromDiscord<scott> also they're not that small
22:39:23PMunchBut I am considering LEDs..
22:39:34PMunch@scott well the tiny diodes are..
22:39:40PMunchAnd I got the kind without legs
22:39:45FromDiscord<scott> not like you're trying to place a bunch of....SMD LEDs...or diodes...yeah ouch
22:39:47PMunchAnd I don't have a PCB..
22:39:56FromDiscord<Esbeesy> Wait what are you soldier them to
22:39:57FromDiscord<scott> wtf are you soldering them to then?
22:40:02FromDiscord<Esbeesy> (edit) "soldier" => "soldering"
22:40:02PMunchEach other
22:40:06PMunchJust a sec
22:40:07FromDiscord<Esbeesy> wat
22:40:24FromDiscord<Esbeesy> Like an everlasting gobstopper?
22:40:47FromDiscord<scott> ☝️ though...
22:42:10FromDiscord<kenran> without a pcb? are you building some manuform keyboard?
22:42:23PMunchhttps://photos.app.goo.gl/Rwdr5Wt1mYDRokrc6
22:42:55PMunchOn the second half I*m doing the rows first though, so it looks a lot neater
22:42:58FromDiscord<Esbeesy> Yeah where IS that processClient coming from 🤔
22:43:11FromDiscord<scott> like every time I manage to do something in Nim, I LOVE how it turns out, but getting there is so hard because the docs are just not adequate...
22:43:53FromDiscord<Esbeesy> Doesn't appear to be in the library std lib at all
22:44:26FromDiscord<Esbeesy> PMunch is that going to be an ortholinear?
22:44:38PMunchYup
22:44:43PMunchSplit ortholinear
22:44:43FromDiscord<Esbeesy> Dope
22:45:00PMunch@scott, you get used to it after a while..
22:45:04PMunchThen it's just bliss
22:45:37FromDiscord<scott> yeah I know which is why I keep coming back but I hate spinning out on stuff like this
22:45:54FromDiscord<kenran> say I have to register a callback via a function that takes a `proc: (a: cint)`, but I need the actual callback to be a closure around another argument. how can I do that? I'll try to write what I mean:
22:45:56PMunch@scrott processClient doesn't come from anywhere AFAIK
22:46:07PMunchIt's used in an example in the asyncnet module
22:46:18leorize[m]PMunch: you been following nim-lang/rfcs#300?
22:46:33FromDiscord<scott> yeah I saw that, do you think the example is referencing that? lol
22:46:35PMunchleorize[m], don't think so, link?
22:46:47PMunch@scott, well it's defined in the example
22:46:51PMunchAs a proc
22:47:10FromDiscord<scott> in the other example on another module?
22:47:32FromDiscord<scott> idk that just seems like a leap to expect people to figure that out
22:47:48leorize[m]!rfcs developer tools
22:47:49disbothttps://github.com/nim-lang/RFCs/issues/300 -- 3Developer tooling
22:47:49disbothttps://github.com/nim-lang/RFCs/issues/179 -- 3Nim source packages
22:47:49disbothttps://github.com/nim-lang/RFCs/issues/58 -- 3RFC: change `dynlib` handling on linux to use standard dynamic linking instead of runtime loading via `dlopen` 7& 6 more...
22:48:13FromDiscord<scott> also `processClient` doesn't accept the same arity of arguments in asyncnet as in asynchttpserver
22:48:56leorize[m]@scott feel free to ask around here. In the future a nim book would be nice but I don't think there's any active collaborative effort on one atm
22:49:46FromDiscord<kenran> sent a code paste, see https://play.nim-lang.org/#ix=2HCD
22:49:52FromDiscord<kenran> (edit)
22:49:58PMunch@scott, literally further up in the same example..
22:50:36PMunchleorize[m], what do you mean, there already is a Nim book..
22:51:00FromDiscord<kenran> How can I register `foo` with the fixed `x` as a handler that only takes one `cint`?
22:51:18FromDiscord<scott> leorize, sorry, I feel a bit defensive about asking questions here...I've been told to RTFM in cases where I just wasn't looking in the right place
22:51:42FromDiscord<scott> PMunch, what?
22:51:47FromDiscord<Esbeesy> I think he means like The Rust Book
22:52:02FromDiscord<Esbeesy> Which is a middle ground between docs and Nim In Action
22:52:45FromDiscord<scott> I'm unemployed and wouldn't be opposed to trying to start something like that but I also am still a bit of a novice at Nim
22:53:18FromDiscord<Esbeesy> I'm employed and currently planning to do it as I change jobs,was going to use it as an excuse to write a markdown book generator in nim. In fact
22:53:27FromDiscord<Esbeesy> Might do some on that now
22:53:40PMunch@scott, we just added that tag :P We're usually pretty accommodating :P
22:53:57PMunchI'm looking in the asyncnet module and the processClient is defined there
22:53:58FromDiscord<scott> what is a tag?
22:54:01PMunchWhere are you looking
22:54:06PMunch~rtfm
22:54:07disbotrtfm: 11read the fucking manual -- PMunch
22:54:07disbotrtfm: 11https://nim-lang.org/documentation.html
22:54:10PMunchThis thing
22:54:13FromDiscord<scott> lol
22:54:16PMunchWell, they're not called tags
22:54:22PMunchNotes?
22:54:27PMunch~scott
22:54:27disbotno footnotes for `scott`. 🙁
22:54:39PMunch~scott is someone on Discord
22:54:39*Q-Master joined #nim
22:54:39disbotscott: 11someone on Discord
22:54:50PMunchYou can add whatever you want :P
22:54:57FromDiscord<scott> I didn't mean that I was literally told that, just got told that my question was easily found in the docs
22:55:09PMunchOh right
22:55:13PMunchThat's not very helpful..
22:56:11FromDiscord<Esbeesy> ~Esbeesy needs a sandwich
22:56:12disbotno matching footnotes for `Esbeesy` with regexps `needs, a, sandwich`. 🙁
22:56:21leorize[m]usually I would be around to help but it's exam season here
22:56:24FromDiscord<scott> anyway under `asyncnet`, `proc processClient` has arity/type `proc processClient(client: AsyncSocket)`, but in `asynchttpserver`, it's called with 5 arguments
22:57:04PMunch@Esbeesy, you need to say "is"
22:57:23FromDiscord<scott> no worries, leorize, I don't mean to be impatient by any means, just don't feel in the mood to be hollered at by Disruptek for asking a stupid question 😂
22:57:45PMunchAh I see
22:58:01PMunchOh yeah, he should come with a disclaimer :P
22:58:09leorize[m]~disruptek
22:58:10disbotdisruptek: 11unsafe at any speed.
22:58:10disbotdisruptek: 11:disruptek:
22:58:10disbotdisruptek: 11an unsafe nil deref
22:58:30FromDiscord<scott> yeah I've said it before, it took me like 10 minutes here to realize he was the local grump
22:58:31FromDiscord<scott> lol
22:58:40PMunch~dispruptek is comes with a disclaimer
22:58:41disbotdispruptek: 11comes with a disclaimer
22:58:54PMunchAnyways
22:58:58PMunchThe processClient
22:59:09*lritter quit (Quit: Leaving)
22:59:12PMunchI think it's just meant as an example
22:59:49PMunchOh wait, it's actually an internal procedure in the asynchttpserver module <_<
22:59:50PMunchhttps://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/asynchttpserver.nim#L293
23:00:15FromDiscord<scott> yeah, but what is it meant to do? This came up because I was looking at the docs for `proc respond(Request)` which explicitly says that it doesn't close the client connection
23:00:49FromDiscord<scott> I want my server to close the client connection after responding in my case.
23:01:51leorize[m]@Esbeesy If you are going to start a collaborative effort on a nim book then please reach out on the forum. I think if it goes well we can adopt and fund your project to be the official Nim book :)
23:01:59*Vladar quit (Quit: Leaving)
23:02:50PMunchThere already is a book!
23:03:00PMunch~Nim in action
23:03:01disbotno footnotes for `Nim`. 🙁
23:03:09PMunch~niminaction
23:03:09disbotno footnotes for `niminaction`. 🙁
23:03:46PMunch~niminaction is a book about Nim written by dom96 - https://www.manning.com/books/nim-in-action
23:03:46disbotniminaction: 11a book about Nim written by dom96 - https://www.manning.com/books/nim-in-action
23:03:49leorize[m]nim in action is nowhere near the rust book for example
23:03:58leorize[m]and it's certainly isn't a collaborative project
23:04:11PMunchWell of course not, Nim in action is on my shelf, and the rust book is nowhere close!
23:04:36PMunchWhy do you specifically want it collaborative?
23:06:01hmmmactually the rust book is very well written
23:06:15hmmmfree as in beer and has a very enthusiastic vibe
23:06:41hmmmif I had the skillz I would write such a book for nim :3
23:06:43leorize[m]PMunch: how are you gonna add new pages when you add new features to the language? :P
23:07:23leorize[m]I want it to be an official book that's free so that everyone can easily pick up nim
23:07:37leorize[m]the rust book have practically everything on how to use the language
23:07:42hmmmleorize you have the skillz! I help with the vibe :3
23:08:26*kenran quit (Quit: leaving)
23:08:33PMunchleorize[m], just print them out and stick them in the back :P
23:08:44PMunchAaah right
23:08:55PMunchMaybe I should check this Rust book out
23:09:12hmmmwhen you read rust book the first thing you notice is that is written from someone that cares and loves the lang, and second thing, it's extremely detailed but in a simple way
23:09:18FromDiscord<Vindaar> @voltist: no worries. That's indeed a bit "broken". This can happen under certain circumstances, but in most code paths points outside the range are handled correctly (it can break for things like ridgeline plots). A bit bizarre to see it broken on a normal line plot. What version of ggplotnim are you on and can you share the code to reproduce? possibly report it as an issue on the repo?
23:09:27*krux02 quit (Remote host closed the connection)
23:10:10*tane quit (Quit: Leaving)
23:12:36FromDiscord<Quibono> I’d help with a free Nim book if I could.
23:13:13*NimBot joined #nim
23:14:59FromDiscord<scott> it's the same with the Crystal book. I read it front-to-back and felt like I could write whatever I wanted in the language after that. Nim documentation feels splintered and targeted at people who've read the source code
23:15:14FromDiscord<scott> (re: the rust book)
23:15:53hmmmI'd love to try crystal but they hate windows plebs
23:16:04FromDiscord<scott> TBF windows sucks
23:16:15hmmm>:|
23:16:26FromDiscord<scott> hehehe
23:16:43hmmmbut yea we need a good "the book"
23:16:47hmmmyou write it scott
23:17:36PMunchI mean I've got enough mammothean projects, why not throw a book on the pile
23:17:52hmmmthat's the spirit munchie!
23:18:09FromDiscord<scott> Like I said I could but I'm pretty novice at nim. would be glad to work together with @Esbeesy and anyone else on it
23:18:47hmmmdude I bet that if we make a RFC something "we writing the book" plenty of people would sign up to help
23:18:54FromDiscord<Esbeesy> Yup
23:19:01FromDiscord<scott> heh that's a good idea. BRB
23:19:41FromDiscord<Esbeesy> I was going to do it to 1. Create a nim version of mdBook 2. Document my learnings
23:21:23hmmmalso who wrote the turorials? there are a few funny gems in there as the "poor guy, who stole your tongue" that were exactly the tone the nim book should have
23:25:58PMunchIt's written by a bunch of different people over the years
23:26:28PMunchBut there are plenty of good blog posts and stuff about Nim
23:26:46*Beckingham joined #nim
23:26:49hmmmyea I've seen nari stuff, pretty good
23:26:54BeckinghamAwwww lawdy
23:28:38FromDiscord<Beckingham> Friendship ended with discord, IRC is new best friend
23:28:54PMunchOne of us, one of us
23:28:55Beckingham:)
23:29:05hmmmgood boy, stallman said it: "discord is bad for ur freedom"
23:29:06Beckingham🦀
23:29:18BeckinghamShit wrong community emoji
23:29:21Beckingham👑
23:29:25hmmmhttps://stallman.org/discord.html
23:29:45PMunchYou came from the crab community?
23:29:50BeckinghamEverytime I think the css hasn't loaded on that site
23:29:59PMunchhmmm, pretty sure he woul've said something about Windows as well..
23:30:12hmmmmunchie!
23:30:14hmmm:|
23:37:32BeckinghamIs there a "standard" config format with nim?
23:37:50BeckinghamYou know how Rust has TOML and C# has a different format with every version
23:38:37FromDiscord<ElegantBeef> Nim's config format is typically just nimscript inside nimble
23:38:54FromDiscord<ElegantBeef> Unless you mean for files outside of the build system
23:41:21BeckinghamHuh I guess thats one way of approaching it
23:44:33FromDiscord<scott> re: discord is bad for your freedom yes but matrix is not and is better than IRC
23:44:58FromDiscord<ElegantBeef> well matrix voip solutions are pretty much non existant
23:46:23FromDiscord<ElegantBeef> For instance element, the client made by the people that made the matrix protocol uses jitsi for group voice, that's a conference call style voip, it's not great imo
23:58:16FromDiscord<Gibson> how can I allocate a string on the shared heap?
23:58:42FromDiscord<Gibson> sent a code paste, see https://play.nim-lang.org/#ix=2HCV
23:59:12FromDiscord<Gibson> nor `deepCopy(s[], blah)`