<< 08-01-2021 >>

00:09:50FromDiscord<Anonymous Poet> this is hopefully a dumb question but
00:10:38FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2Le9
00:17:40FromDiscord<InventorMatt> if request.headers["Transfer-Encoding"] is returning a string then looping through it would return each char in the string
00:18:28FromDiscord<Anonymous Poet> right but the definition is that its a `seq[string]`
00:18:49FromDiscord<Anonymous Poet> it seems that theres an overloaded `[]` operator that does some funny things
00:18:58FromDiscord<Anonymous Poet> i think i can work around it though, thanks!
00:28:17FromDiscord<shadow.> @Anonymous Poet what does it print?
01:16:08*disruptek throbs.
01:29:05*taprack quit (Ping timeout: 240 seconds)
01:39:42FromDiscord<Anonymous Poet> it prints the characters (the typing is accurate)
01:39:55FromDiscord<shadow.> of what string?
01:39:58FromDiscord<shadow.> what relevance does the string have
01:39:58FromDiscord<Anonymous Poet> the issue was that HttpHeaders overloads `[]` on its internal table
01:40:00FromDiscord<shadow.> ohh
01:40:40FromDiscord<Anonymous Poet> calling `headers["Transfer-Encoding"]` internally works out to `headers[headers.toCaseInsensitive("Transfer-Encoding")][i]`
01:40:53FromDiscord<Anonymous Poet> i just added an iterator for the `[i]` bit
01:41:16FromDiscord<Anonymous Poet> id actually like to submit this as a PR, but before that, i'd like to add some tests if its reasonable
01:41:54FromDiscord<Anonymous Poet> but i havent found a good place for them, and while I'd like to use runnableTests, i dont know how to create Request objects
01:45:52FromDiscord<XxDiCaprioxX> Hey quick question everyone, cause I dont undertsaand it
01:47:14FromDiscord<XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2Les
01:49:04FromDiscord<XxDiCaprioxX> acutally let me rephrase that
01:49:20FromDiscord<XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2Let
01:50:11FromDiscord<XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2Leu
01:57:22FromGitter<deech> Noticed that the header pragma seems to work fine without a colon, `{.header"MyHeader.H".}`. Are all pragmas like that?
01:57:35FromDiscord<Anonymous Poet> i think you want the proc signature to be `proc drawCard(hand: var Hand)`
01:57:59FromDiscord<Anonymous Poet> nim defaults to immutable parameters
01:58:20FromDiscord<XxDiCaprioxX> okay
01:58:26FromDiscord<XxDiCaprioxX> thank you i didnt know that
01:58:37FromDiscord<Anonymous Poet> im not sure if that applies transitively to seqs, but see if that works
01:58:49FromDiscord<XxDiCaprioxX> yup, fixed the issue, thanks a lot
01:58:53FromDiscord<Anonymous Poet> ๐Ÿ˜„
01:59:10FromDiscord<XxDiCaprioxX> I understand the thought behind it now, too
01:59:17FromDiscord<XxDiCaprioxX> cause otherwise it could break at runtime
01:59:54FromDiscord<Anonymous Poet> i think its really awesome because its a lot easier to verify if someone elses function might change your object
02:00:26FromDiscord<XxDiCaprioxX> I just got into the language so I haven't been able to see a specific use like that yet but sounds useful
02:00:37FromDiscord<XxDiCaprioxX> anyways, I can finally continue programming ๐Ÿ˜„
02:06:07*abm quit (Quit: Leaving)
02:20:53FromDiscord<XxDiCaprioxX> One more quick (and pretty stupid) question: when I use `for i in foo..bar` or `var foo = rand(bar)`, is `bar` included or excluded?
02:21:10*NimBot joined #nim
02:21:17FromDiscord<XxDiCaprioxX> So rand(100) can also give me 100 back?
02:21:19FromDiscord<shadow.> yep
02:21:23FromDiscord<shadow.> 0..100
02:21:27FromDiscord<XxDiCaprioxX> aight, thanks
02:21:29FromDiscord<shadow.> np
02:21:48FromDiscord<ElegantBeef> `Returns a random integer in the range 0..max.`
02:21:50FromDiscord<XxDiCaprioxX> and `0..10` is 10 or 11 iterations then?
02:21:54FromDiscord<ElegantBeef> 11
02:21:57FromDiscord<shadow.> yeah
02:21:58FromDiscord<XxDiCaprioxX> alright, got it
02:22:00FromDiscord<XxDiCaprioxX> thanks a lot
02:22:04FromDiscord<shadow.> typically if u just want like a number of iterations and dont care abt number do like
02:22:04FromDiscord<ElegantBeef> Both sides are incldued
02:22:09FromDiscord<shadow.> `for _ in 0..<n:`
02:22:09FromDiscord<shadow.> or
02:22:13FromDiscord<shadow.> `for _ in 1..n:`
02:22:14FromDiscord<shadow.> i do second
02:22:23FromDiscord<shadow.> but first is more idiomatic in other languages so might feel more normal
02:22:25FromDiscord<ElegantBeef> or even worse `for _ in countUp(n)`
02:22:26FromDiscord<ElegantBeef> ๐Ÿ˜„
02:22:28FromDiscord<shadow.> goodbye.
02:22:32*taprack joined #nim
02:22:39FromDiscord<shadow.> @ElegantBeef you want me to ttry n figure out the constructor thing and pr it?
02:22:50FromDiscord<shadow.> (edit) "ttry" => "try"
02:22:58FromDiscord<shadow.> i cant figure out my raytracer and im bored so i need somethin to do
02:22:59FromDiscord<shadow.> lol
02:23:04FromDiscord<ElegantBeef> Up to you ๐Ÿ˜„
02:23:07FromDiscord<shadow.> lol bet
02:23:10FromDiscord<XxDiCaprioxX> okay thanks for the advice
02:23:16FromDiscord<XxDiCaprioxX> but really, why does countUp exist
02:23:20FromDiscord<shadow.> for step
02:23:26FromDiscord<shadow.> `for i in countup(0, 10, 2):`
02:23:34FromDiscord<XxDiCaprioxX> didnร„t know that existed
02:23:36FromDiscord<XxDiCaprioxX> nice
02:23:36FromDiscord<shadow.> lol
02:23:41FromDiscord<shadow.> also bc `countdown`
02:23:43FromDiscord<shadow.> so idk
02:23:44FromDiscord<XxDiCaprioxX> (edit) "didnร„t" => "didn't"
02:23:48FromDiscord<shadow.> lol
02:23:50FromDiscord<XxDiCaprioxX> okay makes sense
02:24:06FromDiscord<Avatarfighter> I have a bad habit of using `countup` instead of `..<` lol
02:24:10FromDiscord<shadow.> EW
02:24:45FromDiscord<ElegantBeef> So shadow you going to do it?
02:24:50FromDiscord<shadow.> yeah probably
02:24:53FromDiscord<shadow.> can i ask your opinion on something else?
02:24:59FromDiscord<ElegantBeef> Sure
02:25:03FromDiscord<shadow.> so would you say that
02:25:05FromDiscord<ElegantBeef> I'm not a doctor though
02:25:14FromDiscord<shadow.> object with fields `x, y, z: int` for instance
02:25:20FromDiscord<shadow.> is making a constructor where all are required in order
02:25:22FromDiscord<shadow.> fairly common?
02:25:27FromDiscord<shadow.> bc i find that's what im doing 90% of the time
02:25:34FromDiscord<shadow.> and it'd be nice to do that without having to type them all out
02:25:37FromDiscord<shadow.> some sort of macro magic yk?
02:25:50FromDiscord<ElegantBeef> Well yea you can add that aswell, a constructor that takes all fields as parameters
02:25:59FromDiscord<shadow.> hmmm
02:26:01FromDiscord<shadow.> what if it was like
02:26:16FromDiscord<shadow.> ?
02:26:21FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Ley
02:26:23FromDiscord<shadow.> idk what would be prettiest
02:26:25FromDiscord<shadow.> that might get confusing
02:27:06FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2Lez
02:27:34FromDiscord<Quibono> Bad shadow work on your tracer. :p
02:28:04FromDiscord<shadow.> hmm
02:28:06FromDiscord<shadow.> i see
02:28:14FromDiscord<shadow.> how are you like parsing the body?
02:28:17FromDiscord<shadow.> welp, lemme look
02:28:17FromDiscord<shadow.> lol
02:28:26FromDiscord<ElegantBeef> It's heavily documented as i was using it for my macro writeupt
02:29:04FromDiscord<shadow.> ohhhh lol
02:29:29FromDiscord<shadow.> git clone time
02:29:57FromDiscord<ElegantBeef> Also remember to make more tests for those new cases
02:30:00FromDiscord<shadow.> oh the code's not that long
02:30:00*taprack quit (Ping timeout: 272 seconds)
02:30:01FromDiscord<shadow.> yeah i will
02:30:22FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LeA
02:30:28FromDiscord<shadow.> like other fields
02:30:30FromDiscord<shadow.> that aren't required
02:30:34FromDiscord<shadow.> and can that format go anywhere?
02:31:17FromDiscord<ElegantBeef> Well i guess ideally we support the `x, y, z: required`
02:31:28FromDiscord<ElegantBeef> Then it's the exact same as it is now
02:32:30FromDiscord<ElegantBeef> Your proposed case still suggested manually typing identifiers so i just dont see why we just dont stay true to Nim syntax ๐Ÿ˜„
02:34:02FromDiscord<ElegantBeef> So all you really have to do is support `a, b: required` and `a,b = 10`
02:34:58FromDiscord<ElegantBeef> @shadow. any counter views?
02:35:47FromDiscord<shadow.> hmmm
02:35:56FromDiscord<shadow.> yeah i agree
02:36:11FromDiscord<shadow.> lemme figure out the like
02:36:27FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LeB
02:36:56FromDiscord<ElegantBeef> Oh you want to make objects using a macro?
02:37:06FromDiscord<ElegantBeef> Make an object + constructor?
02:41:09FromDiscord<shadow.> wait wdym?
02:41:13FromDiscord<shadow.> nono like the
02:41:18FromDiscord<shadow.> multiple variables on one line thing lmao
02:41:22FromDiscord<shadow.> (edit) "variables" => "fields"
02:41:56FromDiscord<shadow.> i don't think this worked
02:41:58FromDiscord<shadow.> iirc
02:41:59FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LeC
02:42:04FromDiscord<shadow.> maybe im being dumb
02:42:49FromDiscord<ElegantBeef> oh it probably didnt, it'll be an issue with the reclist logic
02:43:14FromDiscord<ElegantBeef> https://github.com/beef331/constructor/blob/master/src/construct.nim#L43
02:43:16FromDiscord<ElegantBeef> Here exactly
02:43:43FromDiscord<shadow.> makes sense
02:43:50FromDiscord<shadow.> ahhh i see
02:43:53FromDiscord<shadow.> so lemme just look at
02:43:54FromDiscord<shadow.> the repr ig
02:46:13FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/796932741823332392/unknown.png
02:46:38FromDiscord<ElegantBeef> yea it's just adding `[0..^3]` to the table
02:46:59FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/796932935730331698/unknown.png
02:47:02FromDiscord<shadow.> and that's normal?
02:47:05FromDiscord<shadow.> i see
02:47:10FromDiscord<shadow.> this shouldn't be too difficult lol
02:47:29FromDiscord<ElegantBeef> Nope it's a very simple fix ๐Ÿ˜„
02:49:39FromDiscord<shadow.> `$vari[1]`
02:49:42FromDiscord<shadow.> what does this do?
02:49:52FromDiscord<shadow.> second letter of the identifier?
02:49:56FromDiscord<shadow.> or am i being dum
02:50:19FromDiscord<ElegantBeef> It gets the ident if it's an exported symbol
02:50:28FromDiscord<shadow.> ahh i see
02:50:50FromDiscord<shadow.> so then i just want [^2] right
02:51:06FromDiscord<shadow.> works for me
02:51:39FromDiscord<ElegantBeef> think there is proc for this specifically, but yea
02:51:43FromDiscord<ElegantBeef> like `getBaseName`
02:51:46FromDiscord<shadow.> ohh
02:51:47FromDiscord<shadow.> i mean
02:51:54FromDiscord<shadow.> do you want me to use that?
02:52:09FromDiscord<ElegantBeef> If you want to
02:52:29FromDiscord<ElegantBeef> it's just `basename`
02:53:31FromDiscord<shadow.> wait what does that do?
02:53:33FromDiscord<shadow.> lemme check
02:54:03FromDiscord<shadow.> oh u mean to replace ur postfix thing?
02:54:04FromDiscord<ElegantBeef> If it's a postfix or prefix'd node it gets the name
02:54:07FromDiscord<shadow.> wait
02:54:18FromDiscord<shadow.> the [^2] thing was for the multiple fields on one line fix?
02:54:21FromDiscord<shadow.> not the postfix thing
02:54:24FromDiscord<ElegantBeef> Yes
02:54:33FromDiscord<shadow.> so where do you want me to use basename
02:54:54FromDiscord<ElegantBeef> `[0..^3]` is for getting all the identsโ†ต`var[1]` is the same as `var.baseName` in that case
02:55:11FromDiscord<shadow.> that cool?
02:55:12FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LeI
02:55:24FromDiscord<ElegantBeef> Nope cause basename wil fail on idents
02:55:29FromDiscord<shadow.> wait really?
02:55:36FromDiscord<shadow.> `of nnkIdent: result = a`
02:55:37FromDiscord<shadow.> ?
02:55:39FromDiscord<shadow.> does that not work?
02:55:55FromDiscord<shadow.> should work fine, no?
02:55:56FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LeL
02:56:22FromDiscord<shadow.> seems to work fine for me
02:56:23FromDiscord<ElegantBeef> Oh nvm it works
02:56:26FromDiscord<shadow.> yep
02:56:34FromDiscord<ElegantBeef> then yea it's fine
02:56:35FromDiscord<shadow.> `toneline.nim` sound good?
02:56:37FromDiscord<shadow.> lol tone line
02:56:39FromDiscord<shadow.> t one line
02:56:39FromDiscord<shadow.> idk
02:56:49FromDiscord<shadow.> idk how else to name it ๐Ÿ’€
02:56:50FromDiscord<ElegantBeef> `tcommasep.nim`
02:56:53FromDiscord<shadow.> smart
02:59:55FromDiscord<shadow.> is this ok?
02:59:59FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LeU
03:00:13FromDiscord<ElegantBeef> Well while we're at it might as well support `x, y, z: required`
03:00:18FromDiscord<shadow.> all in one pr?
03:00:23FromDiscord<shadow.> dont you think two commits for clarity?
03:00:24FromDiscord<shadow.> or na
03:00:38FromDiscord<ElegantBeef> I mean i'm indifferent it's a small package
03:00:42FromDiscord<shadow.> or would you consider these both commasep?
03:00:57FromDiscord<ElegantBeef> These are both
03:00:57FromDiscord<shadow.> (the other reason is bc im heading up soon so idk if i can finish the other one tonight)
03:01:08FromDiscord<ElegantBeef> Well if you throw in the towel make the pr and i'll do it
03:01:14FromDiscord<shadow.> nono i can do it tmr
03:01:24FromDiscord<shadow.> eh whatever ill just finish tmr and pr ye?
03:01:35FromDiscord<ElegantBeef> I'm not paying you so i dont care
03:01:38FromDiscord<shadow.> lmfao fair enough
03:02:18FromDiscord<shadow.> this is the part that needs editing right
03:02:20FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Lf4
03:02:22FromDiscord<ElegantBeef> yep
03:02:39FromDiscord<ElegantBeef> Feel free to make it readable ๐Ÿ˜›
03:02:44FromDiscord<shadow.> hmmmm
03:02:47FromDiscord<shadow.> it says invalid indentation
03:02:49FromDiscord<shadow.> is it not parsable?
03:02:55FromDiscord<ElegantBeef> let's see
03:02:56FromDiscord<shadow.> or is that ur macro output
03:02:59FromDiscord<shadow.> lemme test
03:03:15FromDiscord<shadow.> not parsable.
03:03:26FromDiscord<shadow.> hmm
03:03:40FromDiscord<shadow.> `(x, y, z: required)` this is parsable, somehow-
03:03:58FromDiscord<shadow.> tho that doesn't look good
03:04:14FromDiscord<shadow.> `(x, y, z): required`โ†ตhow about this?
03:04:24FromDiscord<ElegantBeef> That or `[]`
03:04:26FromDiscord<shadow.> hmm
03:04:37FromDiscord<shadow.> prolly `()` bc like `let (a, b) = (0, 1)`
03:04:52FromDiscord<shadow.> tuples go brr
03:05:01disruptektuples suck a big donkey dick.
03:06:51FromDiscord<shadow.> tuples are hot
03:06:56FromDiscord<shadow.> like your ex-gf apparently
03:07:14*Tanger joined #nim
03:07:20FromDiscord<Avatarfighter> dont talk to my disruptek like that ๐Ÿ˜ค
03:07:27disrupteksmokin'.
03:07:29FromDiscord<shadow.> he said it himself
03:07:32FromDiscord<shadow.> see.
03:07:38FromDiscord<Avatarfighter> ๐Ÿ˜ญ
03:07:48FromDiscord<shadow.> hmm i guess i can just check for nnkPar as kind?
03:08:16FromDiscord<ElegantBeef> Yea
03:08:42FromDiscord<shadow.> is there a speed difference between `v.add(a); v.add(b); v.add(c)` and `v &= @[a, b, c]`?
03:09:39FromDiscord<shadow.> bc i use the second but maybe it's doing some shenanigans i don't want
03:10:09disruptekit is.
03:10:37FromDiscord<shadow.> rop
03:10:40FromDiscord<shadow.> rip
03:10:45FromDiscord<shadow.> is there a cleaner way?
03:10:47FromDiscord<ElegantBeef> you know the `.add` tends to take sequences aswell ๐Ÿ˜„
03:10:55FromDiscord<shadow.> wdym?
03:10:58FromDiscord<shadow.> oh.
03:11:04FromDiscord<shadow.> LMAO
03:11:04FromDiscord<ElegantBeef> Lol
03:11:13FromDiscord<shadow.> is that worse than string add?
03:11:21FromDiscord<shadow.> stringing
03:11:41disruptekwhat?
03:11:56FromDiscord<shadow.> like chaining add calls on single items
03:11:57FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Lfv
03:12:10FromDiscord<ElegantBeef> adding all at once allows you to allocate a new seq the size of all 4 elements at once
03:12:20FromDiscord<shadow.> i see
03:12:21FromDiscord<ElegantBeef> Instead of allocating 3 different times
03:12:32FromDiscord<shadow.> wait a min doesnt &= just call add anyway?
03:12:45disruptekno, chucklehead.
03:12:55FromDiscord<shadow.> i swear last time i checked it did
03:13:04FromDiscord<shadow.> welp im dumb then
03:13:12FromDiscord<shadow.> but we already knew that
03:13:56FromDiscord<shadow.> @ElegantBeef i suppose `(a, b, c): 0` could be useful as well?
03:13:59FromDiscord<exelotl> you can add an array to a seq, might be a little faster
03:14:05FromDiscord<shadow.> ohh yeah
03:14:12FromDiscord<shadow.> well i mean
03:14:20FromDiscord<shadow.> seq's default to what size 8?
03:14:23FromDiscord<shadow.> but arrays are simpler
03:14:26FromDiscord<shadow.> so maybe?
03:14:33FromDiscord<ElegantBeef> Yes `(a, b, c) = 0` and `(a, b, c): 0 `
03:14:38FromDiscord<shadow.> cool
03:14:58FromDiscord<shadow.> im guessing u dont use case bc of those pesky and statements?
03:15:15FromDiscord<ElegantBeef> Probably
03:15:18FromDiscord<shadow.> rip
03:15:59FromDiscord<shadow.> time to invent complexCase boom
03:17:10FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LfK
03:17:25FromDiscord<shadow.> (edit) "https://play.nim-lang.org/#ix=2LfK" => "https://play.nim-lang.org/#ix=2LfL"
03:17:29FromDiscord<ElegantBeef> https://dev.to/beef331/demystification-of-macros-in-nim-13n8
03:17:32FromDiscord<ElegantBeef> Already exists in there ๐Ÿ˜„
03:17:37disruptek!repo quic
03:17:37disbothttps://github.com/status-im/nim-quic -- 9nim-quic: 11QUIC for Nim 15 21โญ 0๐Ÿด 7& 8 more...
03:17:39FromDiscord<ElegantBeef> `Compact if statement`
03:18:02FromDiscord<shadow.> oh lol
03:18:47FromDiscord<shadow.> wait a minute ive seen that article beef
03:18:52FromDiscord<shadow.> never knew u wrote it loll
03:18:55FromDiscord<ElegantBeef> Lol
03:19:05FromDiscord<shadow.> i was like "wait i kinda get this" haha
03:19:59*dddddd quit (Remote host closed the connection)
03:20:42FromDiscord<shadow.> is an nnkPar's children all just the expressions inside?
03:20:49FromDiscord<shadow.> which in our case would be all idents?
03:20:52FromDiscord<ElegantBeef> `dumptree` exists
03:20:53disruptekwhat else?
03:20:58FromDiscord<shadow.> fair enough
03:21:09FromDiscord<shadow.> yeah, not at my pc rn
03:21:19FromDiscord<shadow.> still dreaming of working on constructor tho ๐Ÿ™„โœ‹
03:21:24disruptekthere is also a tuple constructor node.
03:21:52FromDiscord<shadow.> tuple constructor?
03:21:55FromDiscord<shadow.> as in
03:22:01FromDiscord<shadow.> yeah my brain stopped
03:24:28saemSup?
03:24:38FromDiscord<ElegantBeef> My ceiling
03:25:12saemThe snow hasn't caused a collapse?
03:25:15FromDiscord<Avatarfighter> @ElegantBeef your ceiling?
03:25:29FromDiscord<ElegantBeef> Doesnt snow much in 'berta
03:25:31FromDiscord<ElegantBeef> Yea it's up
03:25:37disruptek 42 continuation.fn = ifClause_385876488
03:25:37disruptek 43 return continuation
03:25:38disruptek 44 r = env_385876198(continuation).i_385876415
03:25:45disruptekzevv: ^ ๐Ÿคฆ
03:26:05*lritter quit (Ping timeout: 240 seconds)
03:27:05*lritter joined #nim
03:29:54FromDiscord<Anonymous Poet> random question: i have a PR for nim that had some tests fail for unrelated reasons (gmake not found, etc). can i retrigger without pushing another commit?
03:30:26disrupteknope.
03:31:06*lritter quit (Client Quit)
03:32:42*dddddd joined #nim
03:35:41FromDiscord<flywind> close and reopen your pr
03:37:00FromDiscord<flywind> see also https://nim-lang.github.io/Nim/contributing.html#the-git-stuff-debugging-ci-failures-flaky-tests-etc
03:37:23disruptekdon't do it.
03:50:26*taprack joined #nim
03:51:47FromDiscord<Anonymous Poet> :/ hmm ... if theres no comments/requests for changes ill reopen
03:52:12FromDiscord<Anonymous Poet> i dont suppose anyone here is willing to take a look? its a small change https://github.com/nim-lang/Nim/pull/16636
03:52:13disbotโžฅ Add support for Transfer-Encoding: chunked
03:56:25*Tlangir joined #nim
03:59:01*Tanger quit (Ping timeout: 264 seconds)
04:08:13FromDiscord<Anonymous Poet> thanks for the review flywind. ive made changes per the comments. it looks like the sourcehut builds are still failing for unrelated reasons, so ill leave it here for today and hopefully the flakiness gets fixed soon. id be happy to fix any other comments/feedback
04:09:34*dddddd quit (Ping timeout: 256 seconds)
04:09:55FromDiscord<shadow.> @ElegantBeef what if we made a splat operator that would just give the rest of the fields a rule lol like `: required` ik that prolly isnt parseable but just the idea? idk
04:10:06FromDiscord<shadow.> like it just consumes any non-specified fields
04:10:30*dddddd joined #nim
04:10:38FromDiscord<ElegantBeef> Seems very error prone
04:10:42FromDiscord<ElegantBeef> `: 10`
04:11:12FromDiscord<shadow.> hm
04:11:25FromDiscord<shadow.> that'd make all others optional 10?
04:11:33FromDiscord<shadow.> ah bc they could be dif types?
04:11:36FromDiscord<ElegantBeef> Yes
04:11:39FromDiscord<shadow.> hmm
04:12:36FromDiscord<ElegantBeef> `type int: 10` could work i suppose where all unset values of a given type are given a default
04:12:46FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LgI
04:12:50FromDiscord<ElegantBeef> I hate it
04:12:53FromDiscord<shadow.> f
04:13:46FromDiscord<ElegantBeef> Idk about using anything automatic for all remaining fields though
04:13:51FromDiscord<shadow.> hmm fair fair
04:14:00FromDiscord<shadow.> ig it'd only be for the all required case like a mentioned
04:14:03FromDiscord<ElegantBeef> with the `a, b, c: defaultValue` it should cover most cases
04:14:07FromDiscord<shadow.> fair
04:14:33FromDiscord<shadow.> i dont hate the tuple syntax either i think it shows precedence better
04:14:42FromDiscord<shadow.> like hey a b and c get defaultValue not just c
04:14:56FromDiscord<ElegantBeef> Yea i'm fine with it, it's not an overly bad bodge
04:15:14FromDiscord<shadow.> yeye
04:16:17FromDiscord<shadow.> makes it easy to loop the idents too
04:16:27FromDiscord<shadow.> tho this if statement is gonna be ugly
04:17:04FromDiscord<shadow.> also has an implicit else discard w maybe a compiler hint ever been discussed for case? im guessing u guys hate that idea lol
04:18:09disruptekyes, it's a great feature you'd be neutering.
04:18:18FromDiscord<shadow.> lol wdym
04:20:26*D_ quit (Ping timeout: 264 seconds)
04:21:35*D_ joined #nim
04:22:19PrestigeHaving to put discard explicitly is a feature of the language
04:22:46FromDiscord<shadow.> ah i see
04:23:08FromDiscord<shadow.> i guess ill just make it myself lol macro time
04:23:34FromDiscord<m0nsta> https://tenor.com/view/thanos-infinity-gauntlet-ill-do-it-myself-marvel-villain-gif-16087834
04:23:39disrupteki don't say this as often as the youngsters, but...
04:23:40disruptekrip
04:23:50FromDiscord<shadow.> yes
04:24:03FromDiscord<shadow.> as a youngster i can confirm you are very swag hip gamer for that one.
04:24:18FromDiscord<ElegantBeef> Yea i very much thing `discard` is just a good feature and dont remove it ๐Ÿ˜„
04:24:21FromDiscord<ElegantBeef> (edit) "thing" => "think"
04:24:22FromDiscord<m0nsta> we dont say rip either.
04:24:36FromDiscord<m0nsta> we just use the flavour of the day meme
04:25:10FromDiscord<shadow.> @m0nsta how youngster art thou
04:25:39FromDiscord<m0nsta> no doxxing
04:25:45FromDiscord<shadow.> bc i certainly say rip
04:25:57FromDiscord<shadow.> fair enough ๐Ÿ’€
04:26:21FromDiscord<shadow.> did you not doxx your face in your pfp
04:26:55FromDiscord<shadow.> lol
04:27:06FromDiscord<m0nsta> shadow. is not in the sudoers file. This incident will be reported.
04:27:18FromDiscord<shadow.> hmm
04:27:34FromDiscord<shadow.> ima take a wild guess and say i win the youngster contest.
04:27:42FromDiscord<shadow.> min(shadow, m0nsta) is mine.
04:28:48FromDiscord<shadow.> lol im on a cpp thread for "if you could do a language breaking change what would it be" and it's just people describing rust in varying ways ๐Ÿ’€
04:28:49*spiderstew joined #nim
04:29:28FromDiscord<shadow.> "const default"โ†ต"more type inference"โ†ต"shorter primitive names (u16, i32)"โ†ตetc
04:29:35*spiderstew_ quit (Ping timeout: 272 seconds)
04:30:40FromDiscord<Rika> i hate shorter primitive names
04:30:57FromDiscord<Rika> theyre too short, loses the meaning if you arent used to it
04:32:35FromDiscord<m0nsta> https://tenor.com/view/michael-scott-the-office-thats-what-she-said-gif-4084628
04:33:11FromDiscord<Rika> nice lol
04:34:54saemHmm, if I buy this cool new monitor maybe it'll help me see what's wrong with my code?
04:35:01saemThat's totally how it works right?
04:35:06disruptektotally.
04:35:11saemI knew it
04:35:32disruptekthe one i usually use is, "a nice monitor lasts 10 years and it makes every computer upgrade better during that time"
04:35:46disrupteki mean, "this is the window onto my work. i'm gonna use it all day, every day."
04:35:59disruptekand, "there's literally no part of my workstation i use more."
04:36:04FromDiscord<Rika> its the peripheral you notice the most, i believe
04:36:34FromDiscord<m0nsta> CPU - "Am i joke to you?"
04:36:49disrupteklet's face it; we barely use our CPUs.
04:37:17FromDiscord<JSONBash> is there deconstructing in nim? like var {v1, v2} = @[1, 2]
04:37:24FromDiscord<m0nsta> i used to. then the gens advanced. then people shipped more shitty code in the name of apps
04:37:34FromDiscord<m0nsta> now the same cpu is mostly utilised
04:37:40saemDude, I'm a joke to my CPU
04:37:40FromDiscord<Rika> destructuring only exists for tuples
04:37:56FromDiscord<Rika> there is a third party package for destructuring other data types
04:38:00saemI'm the same way when it comes to monitors, but I still upgrade often
04:38:02FromDiscord<Rika> i think its called unwrap or something
04:38:14FromDiscord<m0nsta> i wonder if CPU's judge us silently everytime we run our code
04:38:22FromDiscord<m0nsta> "huh, pathetic."
04:38:35FromDiscord<m0nsta> "that the best you can do, pretty boy"
04:38:40FromDiscord<Rika> i mean we made a rock think
04:38:41saemNah, the fans can get pretty loud and if they're quiet you know they're judging you.
04:38:52FromDiscord<JSONBash> @Rika thanks!
04:39:36disruptek!repo unpack
04:39:36disbothttps://github.com/technicallyagd/unpack -- 9unpack: 11sequence/object unpacking/destructuring for nim 15 33โญ 0๐Ÿด 7& 2 more...
04:39:38FromDiscord<ElegantBeef> Well when the fans cheer they're happy arent they?
04:39:46disrupteki think unpacking is dumb.
04:40:08FromDiscord<ElegantBeef> So when i put a `while true: echo "die cpu die"` and they kick in they're happy no?
04:40:34FromDiscord<JSONBash> not for functional languages & pattern matching
04:41:04disrupteknim is a dysfunctional language.
04:41:19FromDiscord<JSONBash> lol
04:41:27FromDiscord<JSONBash> funny man
04:45:28*a_chou joined #nim
04:45:37FromDiscord<Rika> lol
04:45:37*a_chou quit (Client Quit)
04:45:42FromDiscord<Rika> its not wrong to some degree
04:45:58*tiorock joined #nim
04:45:58*rockcavera is now known as Guest59907
04:45:58*tiorock quit (Changing host)
04:45:58*tiorock joined #nim
04:45:58*Guest59907 quit (Killed (verne.freenode.net (Nickname regained by services)))
04:45:58*tiorock is now known as rockcavera
04:46:42FromDiscord<ElegantBeef> is it wrong to 110 degrees?
04:50:37*rockcavera quit (Ping timeout: 264 seconds)
05:17:01*Tlangir quit (Read error: Connection reset by peer)
05:20:07*taprack quit (Ping timeout: 246 seconds)
05:22:39*taprack joined #nim
06:02:08*greenfork joined #nim
06:12:36*taprack quit (Ping timeout: 240 seconds)
06:18:27*narimiran joined #nim
06:24:00FromDiscord<treeform> @mratsim I am closing the gap, your code is super fast, you gave me quite a challenge: https://gist.github.com/treeform/2353a4679d3a2862ebba8251ac483614 Thank you!
06:25:11disruptekrip fidget
06:25:59greenforkwhat's wrong with fidget? I was going to use it some day
06:26:02FromDiscord<treeform> Fidget going a faster as well. Finally got the tiger drawing fast.
06:27:08disruptekwhen you're ready to work on something important, come help me with cps.
06:28:07FromDiscord<treeform> I looked into it, when I though async/await was too verbose and wanted greenlets.
06:28:32disruptekthat was long ago.
06:28:47FromDiscord<treeform> I was thinking about high concurrency networking ... every one is trying streams this and stream that... but what if you base the io system around packets instead.
06:29:03FromDiscord<treeform> No need for sockets and stuff
06:29:08FromDiscord<treeform> you get packet you return a packet
06:29:42FromDiscord<treeform> Much either to have a workq that just deals with packets (which are just buffers of memroy)
06:30:06FromDiscord<treeform> Very raw ideas ... not sure if it would work.
06:30:07disruptektoo much churn.
06:30:22disruptekfaststreams is really more what you want.
06:30:39FromDiscord<treeform> I don't think I want any kind of stream
06:30:44disruptekyou want to get a certain amount of data. it's not packets per se.
06:31:02disruptekwell, you can impl it in cps. ๐Ÿ˜‰
06:31:02FromDiscord<treeform> well packet could be big, less them memory size of machine ofc
06:32:06disruptekare they fixed-length?
06:32:10FromDiscord<treeform> well the idea is to ban await for the system... if you can't a wait on some thing no need for green threads or trying to cut execution flow in the middle
06:32:33disruptekcome to the dark side. i promise it's what you want.
06:32:44FromDiscord<treeform> kind of like ECS but for network IO.
06:33:19disruptekbut not limited to network.
06:33:36FromDiscord<treeform> ECS forces you into this weird paradigm, can a weird paradigm speed up network IO too?
06:34:41disruptekif you do the work to understand it, you will be excited by it.
06:35:02FromDiscord<mratsim> The dark side has cookies
06:35:17FromDiscord<treeform> @greenfork, I think disruptek was trying to make a joke on that this JSON stuff has all of my attention now. Don't worry fidget is fine...
06:36:03disruptekif you want to reimplement everything i write, you may as well code stuff that matters. ๐Ÿ˜œ
06:36:14greenforkI should have been more polite and laugh at this joke, thank you for explaining
06:37:11FromDiscord<mratsim> More voice to petition clyybber
06:37:24FromDiscord<treeform> about what?
06:37:26FromDiscord<mratsim> but yeah @treeform, CPS is legit
06:37:34FromDiscord<mratsim> about fixing macros and types ๐Ÿ˜‰
06:37:49FromDiscord<treeform> do you have a link?
06:38:00disruptek!repo cps
06:38:00disbothttps://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim ๐Ÿ”— 15 49โญ 2๐Ÿด
06:38:16FromDiscord<treeform> No I mean petition to clyybber?
06:38:41FromDiscord<mratsim> This is an "introductory" talk, but Kotlin exposes only coroutines not the raw continuations: https://www.youtube.com/watch?v=YrrUCSi72E8
06:39:15FromDiscord<mratsim> This is my current design thinking: https://github.com/weavers-guild/weave-io/blob/master/design/design_2_continuations.md
06:39:57FromDiscord<treeform> I been using async/await in production now for more then a year. Before I had a problem with it mainly because I had to type asycn/await everywhere, but now am largely fine with async/await...
06:40:01FromDiscord<treeform> It has stood the test of time.
06:40:11FromDiscord<mratsim> And I've also collected a hopefully exhaustive views from all other languages: https://github.com/weavers-guild/weave-io/tree/master/research
06:40:31FromDiscord<mratsim> We're not changing async/await, at least not for now
06:40:59FromDiscord<mratsim> async/await is: a resumable function + stashing them in a scheduler
06:41:37FromDiscord<mratsim> we're changing the resumable function part, and enabling more efficient in terms of codesize, more grounded in terms of theory, transformation.
06:41:55FromDiscord<treeform> Cool
06:42:04FromDiscord<mratsim> rather than closure iterators. And for IO we can wrap the API into something more flexible.
06:42:16FromDiscord<mratsim> and, we increase interop
06:42:28FromDiscord<treeform> Is the arc work about passing stuff between OS threads done?
06:42:33FromDiscord<treeform> The isolate idea?
06:42:40FromDiscord<mratsim> it reduces the differences between asyncdispatch and chronos AND Weave to only the scheduler
06:43:17FromDiscord<mratsim> in my design, search for the paragraph "This is an example with 2 schedulers integration. Having continuations as the building blocks allows Network IO, AsyncStreams, async/await and multithreading compose seamlessly in an efficient manner. Furthermore scheduler development becomes extremely simple, and cross-thread synchronization can even be done without"
06:46:02FromDiscord<treeform> What are your thoughts on Win32 Fibers?
06:47:05FromDiscord<treeform> It appears to me that windows provides this cool thread like but not threads API which allows you to go fast... but linux does not?
06:47:31FromDiscord<treeform> Shouldn't the os provide this stuff?
06:48:07disruptekyou don't really want to fuck with the kernel.
06:48:18disruptekit's faster to just stay hot.
06:48:27FromDiscord<treeform> But I think I do...
06:48:42*waleee-cl quit (Quit: Connection closed for inactivity)
06:48:46disruptekdid you read 1011?
06:48:53disruptekthe 1011 paper from the cps repo?
06:49:01FromDiscord<treeform> I don't understand why OS does not provide a concurrency primitive based on IO that works with regular threads?
06:49:16disruptekwhat kind of primitive?
06:49:18FromDiscord<treeform> But wait windows does provide it... its just linux thats left behind?
06:49:23disruptekthe os /does/ from such stuff.
06:49:31FromDiscord<treeform> win32 Fibers?
06:49:44disruptekwell, i don't know what those are.
06:49:49FromDiscord<treeform> https://docs.microsoft.com/en-us/windows/win32/procthread/fibers
06:50:07disrupteki know how linux does fast i/o, though, and it's not via the kernel.
06:50:16disruptekas often as possible, you want to elide kernel operations.
06:50:25disruptekthe fastest stuff is all userspace.
06:50:26greenforkare there any examples of interfacing with va_list from stdarg.h? I have this example where I want to print all va_list arguments https://play.nim-lang.org/#ix=2LgY
06:51:02disrupteki will read about your fibers, but only so i can shit on them in convos later.
06:51:07FromDiscord<treeform> disruptek, I don't know if win32 fibers are part of the kernal or os lib... windows is different from linux in this regard.
06:51:30disruptekthat's why i don't care: it's not linux so i'd rather not admit it exists.
06:51:35FromDiscord<treeform> @disruptek I don't think windows gets them quite right.
06:51:47FromDiscord<treeform> But linux even does not have them.
06:51:54FromDiscord<treeform> So we reinvent the wheel
06:52:05disruptekno.
06:52:14disruptekcps is much lighter than fibers.
06:52:23disruptekyou like going fast, right?
06:52:27FromDiscord<treeform> yes
06:52:36disruptekalso, it's x-platform.
06:53:01disruptekit runs in native nim. on js, c, c++, even windows or that turd of a potato android handset you carry around.
06:53:30saemHah, handset
06:54:23disruptekeven saem is embarrassed for you, and he doesn't even have a phone.
06:55:45FromDiscord<treeform> I hate all mobile platforms and the wall gardens they represent.
06:56:03FromDiscord<treeform> do you have a cps web server?
06:56:15disruptekmaybe ๐Ÿ˜ˆ
06:56:33disruptek!repo disruptek/httpleast
06:56:34disbothttps://github.com/disruptek/httpleast -- 9httpleast: 11an experimental http server 15 1โญ 0๐Ÿด
06:56:42*disruptek ๐Ÿ™„
06:57:27FromDiscord<treeform> it looks to be very efficient no lines
06:57:49disruptekit's entirely written in dim.
06:59:06saemhttps://github.com/kelseyhightower/nocode
07:02:00disruptekhooray for spurious orc crashes.
07:02:17disruptekhttps://github.com/disruptek/jason/runs/1666990247?check_suite_focus=true
07:09:40FromDiscord<mratsim> @treeform, both Windows via Windows Fibers and Mac via Grand Central Dispatch provide one place for threads because it's more efficient to schedule tasks when you see them all.
07:09:55FromDiscord<mratsim> instead of having every applications managing its own threadpool(s)
07:10:50FromDiscord<mratsim> Fibers can be built on top of stackless coroutines and stackless coroutines can be built on top of CPS
07:11:28FromDiscord<mratsim> Fibers are likely the wrong core primitive: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2018/p1364r0.pdf
07:12:15FromDiscord<mratsim> For really fast IO, you want to avoid the kernel: http://highscalability.com/blog/2013/5/13/the-secret-to-10-million-concurrent-connections-the-kernel-i.html
07:12:34FromDiscord<mratsim> all of that is here btw: https://github.com/weavers-guild/weave-io/tree/master/research
07:14:11FromDiscord<mratsim> Another issue with fibers, is that they create their own separate stack which requires:โ†ต- Using GCC splitstack functionโ†ต- or allocating a full memory page (4k) which prevents it from working in JS or on embedded or for use-cases where you want fast switching without waiting for memory
07:14:46FromDiscord<mratsim> Both Rust and Go struggled and then abandoned the fibers idea due to the split stack
07:15:26FromDiscord<mratsim> same with Java 1.0 when it had fibers.
07:16:05disrupteki think treeform is asleep.
07:16:28FromDiscord<mratsim> If you don't roundtrip to memory you can have context switching that are cheaper than memory fetch: https://github.com/weavers-guild/weave-io/tree/master/research#use-cases
07:16:36FromDiscord<mratsim> he'll see he uses discord
07:18:30FromDiscord<mratsim> so instead of a state machine, you could also implement fast async json parsers in coroutines ๐Ÿ˜‰
07:19:52FromDiscord<treeform> @mratsim thank you for the links!
07:21:13*opal quit (Remote host closed the connection)
07:21:34FromDiscord<mratsim> if you look into stackless python, they build the primitives like this: continulet (continuation) -> stacklet (stackless coroutine) -> greenlet (green threads / user-mode threads / fibers)
07:21:41*opal joined #nim
07:21:52*habamax joined #nim
07:22:21FromDiscord<mratsim> https://doc.pypy.org/en/latest/stackless.html#application-level-interface
07:23:00FromDiscord<mratsim> ah it's stacklet -> continulet -> greenlet sorry, then i don't know what their stacklet is
07:24:02FromDiscord<mratsim> anyway, the main point is that continuation allows to naturally build greenlets, coroutines or closure iterators.
07:24:55FromDiscord<mratsim> and they can be made efficient and as they are a way to represent suspendable computation, they can be used for streams or interleaving lexing, parsing, processing in a json parser ๐Ÿ˜‰
07:25:29FromDiscord<mratsim> and you can suspend and resume from any thread/scheduler if you make them isolated
07:26:25FromDiscord<mratsim> (if you allow copy of a continuation instead of =move, you would have memory management problem because you could open a connection once but close it twice, once per copy).
07:30:02FromDiscord<treeform> I see.
07:34:13disruptektreeform isn't asleep, he just wishes he was.
07:39:24FromDiscord<sheerluck> hey remember that "happy new year 2021" PR #16537 that changed `copying.txt` and `readme.md` ? Well someone need to change `compiler/options.nim` too, bc line 22 ` copyrightYear = "2020"` should be `copyrightYear = "2021"` ๐Ÿ™‚
07:39:25disbothttps://github.com/nim-lang/Nim/pull/16537 -- 6happy new year 2021
07:41:08narimiran@sheerluck why not you?
07:41:14FromDiscord<sheerluck> ok
07:43:42FromDiscord<sheerluck> #16638
07:43:43disbothttps://github.com/nim-lang/Nim/pull/16638 -- 3happy new year 2021 again
07:49:43ForumUpdaterBotNew thread by Greenfork: Interfacing with va_list from stdarg.h, see https://forum.nim-lang.org/t/7352
07:53:02*adnan338 joined #nim
07:53:07*adnan338 quit (Client Quit)
07:53:25*adnan338 joined #nim
07:53:39*PMunch joined #nim
08:03:56Araq9 o'clock in the morning
08:04:07Araqhome schooling is over
08:13:06FromDiscord<treeform> hey Araq
08:14:50FromDiscord<treeform> @mratsim, https://gist.github.com/treeform/7aade9d7a4a702f0aad0cd586bbbe139 I can now go to sleep, i have cracked your secrets. Thank you for teaching me the ways.
08:15:13*habamax quit (Ping timeout: 264 seconds)
08:15:18FromDiscord<mratsim> lol, not mine, i have nothing to do with faststreams or nim-json-serialization
08:15:42FromDiscord<treeform> Thank you for teaching the status im ways
08:15:43FromDiscord<mratsim> though it's great that we have something to replace marshall with ๐Ÿ˜‰
08:17:42PMunchOh nice work treeform
08:17:46ForumUpdaterBotNew thread by PMunch: LibSSL DLLs and DLL collections for older versions, see https://forum.nim-lang.org/t/7353
08:19:31narimiran@treeform very nice!
08:44:30FromDiscord<whisperdev> Is there a pure nim fs watch for windows?
08:54:17PMunchHow would that work? At some point you'll need to do some system calls
08:57:42FromDiscord<whisperdev> I believe there's a windows api for that.
09:00:35PMunchYeah, but then it would arguable not be "pure Nim"
09:01:06*jkiesian joined #nim
09:01:45Araqtreeform: when you come back, please patch my ic serializer
09:05:04*MarderIII joined #nim
09:05:24*letto quit (Quit: Konversation terminated!)
09:08:35*letto joined #nim
09:16:31*radgeRayden joined #nim
09:19:12FromDiscord<whisperdev> Ok what I mean is without having to use a separate c/cpp lib that is not easy to build on Windows.
09:23:16PMunchThis one looks pretty good: https://github.com/xflywind/fsnotify
09:26:20FromDiscord<whisperdev> It does not work with ARC but it's better than nothing. Thanks!
09:26:59*Vladar joined #nim
09:27:21*jkiesian_ joined #nim
09:29:40*jkiesian quit (Ping timeout: 246 seconds)
09:29:40*jkiesian_ is now known as jkiesian
09:37:35*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:57:38*hmmm joined #nim
10:03:54*hmmm quit (Quit: WeeChat 2.8)
10:08:37*hmmm joined #nim
10:09:16*jkiesian_ joined #nim
10:11:10*jkiesian quit (Ping timeout: 256 seconds)
10:11:11*jkiesian_ is now known as jkiesian
10:14:10*hmmm quit (Quit: WeeChat 2.8)
10:27:25FromDiscord<whisperdev> I cant make it work at all
10:28:57greenforkcan someone explain to me what this means from manual: An object type can be marked with the pure pragma so that its type field which is used for runtime type identification is omitted. https://nim-lang.org/docs/manual.html#pragmas-pure-pragma
10:30:07FromDiscord<mratsim> Nim insert a hidden pointer that describes the object runtime time when an object uses inheritance
10:30:18FromDiscord<mratsim> this is to allow runtime selection of procs
10:30:58greenforkdoes it make sense to use it for a tuple? https://github.com/nim-lang/sdl2/blob/master/src/sdl2.nim#L540
10:31:25FromDiscord<mratsim> it only makes sense for "object of Parent"
10:31:35greenforkokay, thanks!
10:31:42FromDiscord<mratsim> tuples and plain object or plain ref object don't use inheritance and don't have that
10:48:06PMunchStill sad that we don't have `pure` for enums any longer..
10:50:19*adnan338 quit (Quit: adnan338)
10:50:46FromDiscord<Vindaar> Wasn't the point of pure for enums that one doesn't have to qualify the enum name and didn't that just become the standard? I don't remember the details
10:51:27FromDiscord<mratsim> pure means you had to qualify their use
10:51:33FromDiscord<mratsim> well meant
10:51:44FromDiscord<mratsim> and I think "qualified" would have been a better name
10:52:16FromDiscord<mratsim> Did I ever mention how I hate working with types in macro?
10:53:04FromDiscord<Vindaar> oh so it was the other way around, haha
10:53:24FromDiscord<Vindaar> no, never. And neither have I, I believe
10:53:27PMunchYeah, and it made a lot of sense for some usecases..
10:54:37PMunchTypes in a macro?
11:01:58FromDiscord<Rika> pmunch what usecases?
11:07:30PMunchWhere the names of each value doesn't really say much about what it is
11:08:01PMunchI now tend to not give my enum types as good names, and writing longer names for the value
11:08:52FromDiscord<mratsim> @PMunch, yes, if you want to compete in the most bugs and crashes raised on the tracker you need to start using typed, type, typedesc, getType, getTypeInst and getTypeImpl in your code
11:08:59FromDiscord<mratsim> you're missing all the fun
11:09:24PMunchHaha, I've already done that in binaryparse :P
11:09:43FromDiscord<mratsim> It's like a maze with only few exits and many very deep and very dark pits
11:09:59PMunchKinda feels like that yeah
11:10:46FromDiscord<mratsim> you will be proud to make commit like this and solve a compiler crash: https://github.com/status-im/nimbus-eth2/commit/ce0f7af862a5319a49e74ef3539d9ad8016e181d#diff-db5b104cb3b226d062424e32e4a6d862585c8f68d90bb0cde2350052c6439443R219
11:12:56PMunchOkay, that is just horrible
11:16:02FromDiscord<mratsim> auto will solve semcheck issues that neither typed or untyped templates can solve
11:18:48giacoI have a seq[uint8] that I want to write to FileStream, but outstream.writeData(addr(myseq), len(myseq)) results in SIGSEGV: Illegal storage access. (Attempt to read from nil?)
11:19:30PMunchoutstream.writeData(myseq[0].addr, myseq.len)
11:19:57giacooh! thanks :D
11:20:01PMunchmyseq.addr is the address of the sequence itself
11:20:12*adnan338 joined #nim
11:20:16*adnan338 quit (Client Quit)
11:20:28PMunchAnd sequences in Nim contain two ints (length and capacity) and a pointer (to the actual data)
11:20:32*adnan338 joined #nim
11:20:44FromDiscord<mratsim> I think this should be in a tutorial for unsafe programming
11:20:50FromDiscord<mratsim> always gets people
11:21:28FromDiscord<mratsim> but isn't there a writeData that accepts an openarray?
11:22:07giacois there a safe way to write date to FileStream?
11:22:54PMunch@mratsim, nope
11:23:05PMunchNot in the `streams` module anyways
11:23:35PMunchThere really should be one though..
11:24:21giacomakes sense, thanks
11:34:12*xet7 joined #nim
11:49:20*rockcavera joined #nim
12:00:02*habamax joined #nim
12:11:24*jkiesian quit (Ping timeout: 272 seconds)
12:20:29*jkiesian joined #nim
12:23:15FromDiscord<XxDiCaprioxX> Is there a way to limit a program to a certain amount of repetitions per second?
12:24:24PMunchWhat do you mean?
12:24:51PMunchLike have a "while true" loop but which can only loop a set amount of times a second?
12:25:00FromDiscord<XxDiCaprioxX> yes
12:27:08PMunchSure, just use epochTime from the times module to calculate how long one iteration takes, then use os.sleep (or sleepAsync if you're doing async stuff) to sleep (timesPerSecond/1000 - takenTime) milliseconds.
12:27:30FromDiscord<Randall> Shouldn't you use some kind of monotonic time in case time goes backwards?
12:27:41PMunchMaybe check if takenTime < timesPerSecond/1000 is true first though
12:28:38FromDiscord<Rika> You can find a monotonic timer in std/monotimes
12:28:47PMunch@Randall, sure that could be a good idea
12:31:10PMunchFor some extra fun you can also use -d:useRealtimeGC and GC_disable then GC_step for the same amount of time you would sleep before sleeping the remaining time
12:32:39FromDiscord<XxDiCaprioxX> I'm trying to figure it all out now lol
12:35:02*abm joined #nim
12:35:38FromDiscord<Daniel> Time will go backwards this year, its official.
12:36:09FromDiscord<mratsim> If only all gamedev didn't while True ad infinitum on their welcome screen draining all battery ....
12:36:20PMunchHaha :P
12:36:20FromDiscord<Daniel> ...by 4ms, if i remember correctly.
12:36:59FromDiscord<Rika> First time Iโ€™ve heard of a backwards change
12:37:00PMunchGotta remember to set my watch back then!
12:37:37FromDiscord<mratsim> I remember a leap second in 2012, it crashed a lot of systems in the bank.
12:37:49FromDiscord<Daniel> @Rika Indeed, ...i think in last 25-30 years there hasnt been backwards change...usually it was always adding few milliseconds.
12:37:56FromDiscord<mratsim> the DB were all crashing with "inconsistnt time" or something
12:38:11FromDiscord<Rika> I believe the leap second system was abolished
12:38:11FromDiscord<mratsim> that was wild
12:38:34FromDiscord<Rika> There was supposed to be one on 2020 (to much of everyoneโ€™s dismay)
12:38:45FromDiscord<Rika> Imagine another second of that year
12:39:01FromDiscord<mratsim> it might be this: https://www.wired.com/2012/07/leap-second-glitch-explained/
12:39:18FromDiscord<Daniel> We still cant control planet spin ยฏ\_(ใƒ„)_/ยฏ
12:47:32PMunchIs there a difference between a Windows clong and a Linux clong? https://github.com/PMunch/wxnim/issues/21
12:47:33disbotโžฅ \private\scrolwin.nim(6, 58) Error: cannot convert 3221225472 to clong
13:01:00PMunchhttps://github.com/nim-lang/Nim/blob/1d8b7aa07ca9989b80dd758d66c7f4ba7dc533f7/lib/system.nim#L1368-L1379
13:01:02PMunchHuh
13:01:40PMunchAre long's on Windows 32-bit independent of CPU architecture?
13:12:19*Arrrrrrrr joined #nim
13:15:44*Gustavo6046_ joined #nim
13:16:25*Gustavo6046 quit (Ping timeout: 264 seconds)
13:17:29*clemens3 quit (Read error: No route to host)
13:17:51*Gustavo6046_ is now known as Gustavo6046
13:21:27federico3TIL: implicit range types! var a: 0 .. 3
13:22:01narimiranTIL2
13:22:38PMunchTIL^3
13:22:53federico3this is really powerful, it should be recommended in the manual
13:22:59FromDiscord<Clyybber> Not today, but IL that static lambdas are a thing
13:23:18*hmmm joined #nim
13:23:51FromDiscord<Clyybber> proc(a: static proc (a: int): int): int = a(1)โ†ตecho a(proc (a: int): int = a 2
13:24:36PMunchWhat?
13:25:24FromDiscord<Clyybber> https://play.nim-lang.org/#ix=2LiD
13:25:24narimiranfederico3: hmmm, `a + 1` works, `a += 1` doesn't
13:25:29FromDiscord<haxscramper> ~lfeatures is https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features
13:25:29disbotlfeatures: 11https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features
13:25:40federico3narimiran: huh?
13:25:44FromDiscord<Clyybber> yeah, I was about to add it there :P
13:26:05FromDiscord<mratsim> `+` is a builtin
13:26:16FromDiscord<mratsim> it used to not work as a lambda
13:26:50narimiranfederico3: https://play.nim-lang.org#ix=2LiE
13:27:23PMunchBut how is a static lambda any different from a normal lambda?
13:27:47FromDiscord<Clyybber> It can be inlined
13:28:06PMunchNot sure what you do narimiran, but all your play.nim-lang.org links lack a / before the # so they don't register properly as links for me..
13:28:22PMunch@Clybber, the example you sent works just fine without `static` though..
13:28:24FromDiscord<Clyybber> PMunch: It's essentially what timothees alias sym thing does
13:28:25FromDiscord<mratsim> they have it for me
13:28:32FromDiscord<Clyybber> PMunch: Yeah, of course
13:28:33narimiranPMunch: i copy it directly from my address bar
13:28:47FromDiscord<Clyybber> PMunch: But the code it generates is different
13:28:47*literal_ is now known as literal
13:29:09federico3narimiran: https://play.nim-lang.org/#ix=2LiF
13:29:29PMunch@Clyybber, aha
13:30:08narimiranPMunch: and now i see that my address bar is wonky. it shows `/`, but when i select the address - it removes it!?
13:30:19ForumUpdaterBotNew thread by BeardPower: SSLError WebSocket, see https://forum.nim-lang.org/t/7354
13:30:20narimiranwill copy from the output window in the future
13:30:40PMunchI mean when I copy-paste URLs like that into my browser it works fine
13:30:46PMunchIt's just that HexChat doesn't work
13:31:43PMunchOr doesn't recognise it as a URL
13:31:46narimiranyep
13:35:19narimiranbtw, i wrote an article about different parsing methods in nim. by the time i finished writing it, i realized it didn't turn out as i initially expected. anybody interested to give it a read?
13:36:16PMunchDifferent parsing methods?
13:36:19PMunchSounds interesting
13:36:30narimiranok, sending you a link privately :)
13:46:02federico3https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features#using-enums-as-array-indexes
13:49:48FromDiscord<shadow.> nari could you send it?
13:49:56FromDiscord<shadow.> ah wait im on discord lol
13:52:54*ofelas quit (Remote host closed the connection)
13:53:38*adnan338 quit (Quit: adnan338)
13:53:38FromDiscord<haxscramper> I would be interested to read this too
13:53:57FromDiscord<mratsim> I hope you talk about coroutines
13:54:33Oddmongeri see samples in marshal module documentation are using streams
13:54:45Oddmongeris the goal is to avoid a temp buffer ?
13:54:57FromDiscord<mratsim> https://eli.thegreenplace.net/2009/08/29/co-routines-as-an-alternative-to-state-machines
13:56:46FromDiscord<shadow.> @ElegantBeef this is gonna be one big if statement lol
14:05:18FromDiscord<shadow.> hmm i think we need to do the nnkPar if statement first
14:05:26FromDiscord<shadow.> because `$` fails on nnkPar's i think
14:19:02FromDiscord<shadow.> @ElegantBeef kk, i think i got it working
14:20:57FromDiscord<shadow.> it's quite ugly tho.
14:23:55FromDiscord<shadow.> now the `_:` block is failing tho so i might need ur help on that lmao
14:29:28FromGitter<iffy> Is there an AsyncEvent type that can be reset and reused? I'm trying to send data from one thread to a thread running `runForever()`. I thought of sharing a channel between the threads and letting the main thread know there's something in the thread via an AsyncEvent. Or would it be fine to change `runForever()` to my own `poll/drain` loop and also check the channel for data at the same time? Suggestions?
14:33:55*hmmm quit (Quit: WeeChat 3.0)
14:55:54PMunchAre there seriously no-one who knows anything about this? https://forum.nim-lang.org/t/7353 I need to get that build back up and running..
14:56:27FromDiscord<flywind> !eval var x: range[1 .. 5]; echo x
14:56:30NimBot0
14:56:55PMunchYeah, that is a known issue..
14:57:32FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2LiX
14:57:45FromDiscord<flywind> How about this one? should this compile or be consistent with the codes above?
14:58:33FromDiscord<haxscramper> This should compile and produce `Test(x: )`
14:58:42FromDiscord<haxscramper> But everything is broken so it gives 0
14:59:02FromDiscord<haxscramper> The same applies to code above
14:59:14*waleee-cl joined #nim
14:59:16FromDiscord<haxscramper> !rfc 252
14:59:16disbothttps://github.com/nim-lang/RFCs/issues/252 -- 3User-defined implicit initialization hooks 7& 6 more...
14:59:18FromDiscord<flywind> https://github.com/nim-lang/Nim/issues/3816
14:59:26FromDiscord<haxscramper> !rfc 290
14:59:27disbotโžฅ Initialization of base class variable ; snippet at 12https://play.nim-lang.org/#ix=2LiY
14:59:28disbothttps://github.com/nim-lang/RFCs/issues/290 -- 3`=default` type bound operator to override `default` and `var` initialization 7& 1 more...
15:00:06FromDiscord<haxscramper> Memory is just zeroed on initialization so that's how it works right now
15:01:54FromDiscord<flywind> I see, I was thinking whether it is worth making the codes compile successfully (fix the half of the issue)
15:02:36*Arrrrrrrr quit (Ping timeout: 240 seconds)
15:03:49FromDiscord<haxscramper> I didn't know that `range[1..5]` creates implicit `{.requiresinit.}`, but making this compile
15:03:54*clemens3 joined #nim
15:04:24FromDiscord<haxscramper> I won't say unnecessary, but I hope this will be fixed in the future, so we get non-broken initalization
15:04:46FromDiscord<flywind> make sense
15:09:00FromDiscord<lqdev> write an RFC
15:09:13FromDiscord<lqdev> i'd write one for this myself but i'm not home atm
15:11:55FromDiscord<flywind> It doesn't matter to me. I use range types seldom.
15:12:40FromDiscord<flywind> except `Natural` type.
15:14:28FromDiscord<mratsim> ranges type are broken with generics meaning they're dead to me
15:14:36FromDiscord<mratsim> range types
15:15:47FromDiscord<haxscramper> You mean you can't put some custom types for ranges?
15:17:21FromDiscord<mratsim> I mean https://github.com/nim-lang/Nim/issues/7447 https://github.com/nim-lang/Nim/issues/7872 https://github.com/nim-lang/Nim/issues/9136
15:17:26disbotโžฅ Range type + varargs type mismatch ; snippet at 12https://play.nim-lang.org/#ix=2Ljd
15:19:41FromDiscord<shadow.> all custom operators have no precedence right?
15:19:45FromDiscord<shadow.> like `^` from math?
15:20:14FromDiscord<haxscramper> No, precedence is controlled by characters used
15:20:33FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#syntax-precedence
15:22:00*NimBot joined #nim
15:22:20*tane joined #nim
15:23:13FromDiscord<shadow.> ahh that makes sense
15:23:17FromDiscord<shadow.> so ^ has really high precedence then
15:23:19FromDiscord<shadow.> (highest)
15:27:28FromDiscord<mratsim> dot calls have higher precedence
15:27:31*PMunch quit (Ping timeout: 256 seconds)
15:27:52FromDiscord<shadow.> ah well yeah that makes sense
15:35:50FromDiscord<Anuke> Is there a way to forward-declare a macro that is generated by another macro later on?
15:36:25leorizeno
15:36:30leorizebut why do you need that?
15:38:53FromDiscord<Rika> you're generating macros with macros? that sounds like here be dragons territory
15:39:38FromDiscord<Anuke> sent a long message, see http://ix.io/2Ljn
15:40:00FromDiscord<Anuke> a workaround is to make all the procs templates, but that's... undesirable
15:40:11FromDiscord<Randall> Could be useful. Maybe a python decorator type usecase, where you define a pragma for a proc, that replaces the proc with a newly generated macro with the proc's name and does whatever the pragma does
15:40:35*PMunch joined #nim
15:40:52federico3I miss python's decorators indeed
15:41:21FromDiscord<lqdev> custom pragmas: exist
15:41:41leorize@Randall what you describes can be done and I've already done something like that before :P
15:41:57FromDiscord<Randall> @leorize I know it can be done, that's why I mentioned it
15:43:36FromDiscord<Rika> you can use macros as pragmas if you didnt know
15:45:36*clemens3 quit (Quit: rebot)
15:50:15*jkiesian quit (Ping timeout: 265 seconds)
16:01:50*D_ quit (Ping timeout: 264 seconds)
16:05:50*BT40 joined #nim
16:06:11*BT40 left #nim (#nim)
16:16:46*D_ joined #nim
16:17:38*lritter joined #nim
16:23:38disruptekWHAT?
16:26:03FromDiscord<Imperatorn> sent a long message, see http://ix.io/2LjQ
16:27:31FromDiscord<haxscramper> nOtNiM == bad
16:27:38FromDiscord<haxscramper> On the more serious note see https://github.com/timotheecour/D_vs_nim
16:27:52FromDiscord<Imperatorn> Will take a look
16:28:07FromDiscord<haxscramper> I personally haven't used D, but it seems like a nice language overall
16:28:14FromDiscord<shadow.> cUrLy BrAcEs InStAnT nO
16:28:18FromDiscord<shadow.> /s
16:28:54FromDiscord<haxscramper> calypso project for wrapping C++ seems really good though
16:29:34FromDiscord<haxscramper> Even I personally would prefer to generate wrappers once and then import in main code
16:29:50FromDiscord<shadow.> how do i write to stderr?
16:29:55FromDiscord<shadow.> ah
16:29:57FromDiscord<shadow.> stderr.write()
16:29:57FromDiscord<haxscramper> stderr.write`
16:29:58FromDiscord<shadow.> lol
16:30:03FromDiscord<shadow.> man do i love nimsuggest
16:30:29FromDiscord<shadow.> `std::cerr << "\rScanlines remaining: " << j << ' ' << std::flush;`โ†ตanyone know cpp? tryna recreate this and im not sure what flush is
16:30:33FromDiscord<shadow.> nvm google
16:30:34FromDiscord<shadow.> im dumb
16:30:47FromDiscord<shadow.> how would i flush stream in nim?
16:30:57FromDiscord<shadow.> stderr.flushFIle?
16:31:01FromDiscord<shadow.> (edit) "stderr.flushFIle?" => "stderr.flushFile()?"
16:31:07FromDiscord<haxscramper> Yes
16:31:11FromDiscord<shadow.> cool
16:31:13FromDiscord<shadow.> ty
16:32:42*clemens3 joined #nim
16:34:57FromDiscord<shadow.> what if tutorial said https://media.discordapp.net/attachments/371759389889003532/797141300352385054/img-1.png
16:35:02FromDiscord<shadow.> but my code said
16:35:09FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/797141350394232892/unknown.png
16:35:14FromDiscord<shadow.> :thonk:
16:35:20FromDiscord<shadow.> close enough
16:36:09FromDiscord<mratsim> @shadow. https://github.com/mratsim/trace-of-radiance/blob/99f7d85dec857f0efa0c9b0eafd339871599c0e1/trace_of_radiance_animation.nim#L88-L89
16:36:26FromDiscord<shadow.> yep that's what i wound up doing
16:36:36FromDiscord<mratsim> seems like a perfect fit for the red green 3d googles
16:36:48FromDiscord<shadow.> i wonder why this is producing that
16:36:51FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LjS
16:37:31FromDiscord<mratsim> can you decode and reencode a PPM to make sure it's not your PPM code that is buggy
16:37:37FromDiscord<shadow.> hmm
16:37:44FromDiscord<shadow.> well one thing looked a little sketch
16:38:00FromDiscord<shadow.> where x, y, and z are floats
16:38:03FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LjT
16:38:05FromDiscord<shadow.> is that really how you're supposed to do it lol?
16:38:16FromDiscord<shadow.> ah shit
16:38:18FromDiscord<shadow.> i forgot to cast to int
16:38:19FromDiscord<shadow.> lmao
16:38:24FromDiscord<shadow.> convert
16:39:09FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/797142353277222972/unknown.png
16:39:10FromDiscord<shadow.> there we go lol
16:39:38disruptekare there any heros with a mac that want to narrow down an arc crash?
16:40:09Zevvits your stack size
16:40:50Zevvevery single time i helped you with strange crashes on strange platforms, it was
16:42:18disruptekit's an index defect.
16:42:36disruptekanyway, why does arc pop my stack?
16:42:58FromDiscord<shadow.> @Quibono this is your time to shine
16:43:05FromDiscord<shadow.> disruptek: are you referring to arm?
16:43:12FromDiscord<shadow.> i know quibono has an arm mac
16:43:16disrupteknah.
16:43:19FromDiscord<shadow.> ah
16:43:19FromDiscord<shadow.> rip.
16:43:20FromDiscord<Quibono> Lol
16:43:25FromDiscord<shadow.> qui do you have
16:43:27FromDiscord<shadow.> a normal mac
16:43:27FromDiscord<shadow.> too
16:43:28FromDiscord<shadow.> lmao
16:44:41disruptekit's something spurious and i think it's recent. it's really breaking my balls.
16:44:46disruptek!repo testes
16:44:48disbothttps://github.com/disruptek/testes -- 9testes: 11the unittest framework with balls ๐Ÿ”ด๐ŸŸก๐ŸŸข 15 24โญ 1๐Ÿด 7& 29 more...
16:47:31FromDiscord<shadow.> breaking your testes
16:47:32FromDiscord<shadow.> of course
16:47:43*vsantana joined #nim
16:56:47*jkiesian joined #nim
17:00:33*vsantana1 joined #nim
17:00:49*clemens3 quit (Ping timeout: 246 seconds)
17:01:37*Gustavo6046 quit (Quit: ZNC 1.7.5 - https://znc.in)
17:02:37*vsantana quit (Ping timeout: 272 seconds)
17:02:37*vsantana1 is now known as vsantana
17:08:46ForumUpdaterBotNew thread by Czietz: Documentation for osAllocPages etc.?, see https://forum.nim-lang.org/t/7355
17:12:02*Gustavo6046 joined #nim
17:14:43*sixtyten quit (Quit: Leaving)
17:23:07FromDiscord<treeform> @mratsim I am getting close on the parsing benchmark, I am faster when using --gc:arc, status stuff does not seem to support arc yet. I still can't go faster with --gc:refc. With parsing most of the time is in object allocation, is very noisy. The trick is to remove every object allocation that is possible to remove. https://gist.github.com/treeform/64fd31c9f4d732df9d1a35f85f0c9e2c
17:23:28disruptekit's almost like memory is slower than the processor.
17:23:57FromDiscord<treeform> How crazy was it when memory was faster ...
17:24:07FromDiscord<treeform> people made lookup tables for everything
17:25:03FromDiscord<mratsim> it is way slower than processors
17:25:26FromDiscord<mratsim> high performance computing is basically optimizing data movement
17:25:28disrupteki guess i needed the /s
17:25:38FromDiscord<mratsim> no you didn't
17:25:46FromDiscord<mratsim> I caught the /s ๐Ÿ˜‰
17:25:54disrupteksorry, i'm salty today.
17:25:57disruptekno sleep and red CIs.
17:26:27disruptektestes no longer considers arc failures to be damning.
17:26:32FromDiscord<mratsim> I made a vow in december not to spend my weekends fixing CI and not trying to attempt to look at damn Travis
17:28:05FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Lkk
17:28:07FromDiscord<shadow.> trace of radiance was ray tracing in one weekend right mratsim?
17:28:09FromDiscord<shadow.> im tryna recreate rn
17:28:13FromDiscord<shadow.> and im not sure of how to do this in nim
17:28:15FromDiscord<treeform> Back with Intel 80486 you could access memory in like 2 clock cycles... while division would take like 60, you could go faster with division tables... the times have changed.
17:28:17FromDiscord<mratsim> yes it is
17:28:35FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Lkl
17:28:39FromDiscord<mratsim> division is still 57 clock cycles on my CPU
17:29:03FromDiscord<treeform> but memory access is now like in the 100-1000s
17:29:07FromDiscord<mratsim> no
17:29:11FromDiscord<mratsim> that's for L3
17:29:17FromDiscord<mratsim> L1 and L2 are much cheaper
17:29:27FromDiscord<lqdev> @shadow. you wanna put the proc as Hittable's field
17:29:28FromDiscord<mratsim> something like 10 cycles
17:29:34FromDiscord<treeform> yes but its harder to predict when you hit that
17:29:38FromDiscord<lqdev> that's how vtables workโ„ข๏ธ
17:29:40FromDiscord<shadow.> how would i do that, with an anonymous proc?
17:29:44FromDiscord<lqdev> yea
17:29:48FromDiscord<shadow.> fair enough
17:29:58*jkiesian quit (Ping timeout: 272 seconds)
17:29:58FromDiscord<lqdev> just `hit: proc (your params whatev): bool`
17:30:11FromDiscord<lqdev> and set that field
17:30:35FromDiscord<shadow.> ?
17:30:40FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Lkn
17:30:41FromDiscord<lqdev> making it a {.nimCall.} would be more efficient but also a bit more annoying to work with since you drop the closure
17:30:45FromDiscord<lqdev> yeah that should work
17:30:48FromDiscord<shadow.> cool
17:30:51FromDiscord<shadow.> i love sugar lol
17:31:01FromDiscord<mratsim> @treeform https://gist.github.com/jboner/2841832โ†ตโ†ต0.5 ns is 2 cycle for L1 cache
17:31:03FromDiscord<lqdev> although personally i don't like the -> sugar, it looks out of place tbh
17:31:05FromDiscord<shadow.> fr?
17:31:12FromDiscord<shadow.> i kinda like it, tho i do think it is a little hidden sometimes
17:31:38FromDiscord<mratsim> The `=>` is very weird with a comparison operator as well
17:31:58FromDiscord<mratsim> I have `x => x <= 10` in one of my proc
17:32:06FromDiscord<lqdev> oof
17:32:24disruptekligatures ftw
17:32:28FromDiscord<lqdev> i guess `(x) => (x <= 10)` is a little cleaner
17:32:38FromDiscord<lqdev> ligatures are for wimps.
17:33:05FromDiscord<treeform> `(x => x) <= 10`
17:33:31FromDiscord<shadow.> yeah i just use more parentheses with sugar
17:33:40FromDiscord<mratsim> @treeform That's also why I advocate for stackless coroutine and continuation without GC. There are use-cases like database optimization where you do nothing but wait on random memory access and a coroutine allows you to hide that and improve throughput by more than 3x to 5x: https://github.com/weavers-guild/weave-io/tree/master/research#use-cases
17:34:43FromDiscord<lqdev> @treeform oh? how would that work even?
17:34:44FromDiscord<treeform> so you can switch and do some other task while memory loads? whaaaat
17:34:49FromDiscord<lqdev> you're comparing a closure to a number
17:35:09FromDiscord<treeform> @lqdev operator overloading ๐Ÿ™‚
17:35:44FromDiscord<lqdev> maybe precedence is weird in that case. would have to check. which is why you should use parens in cases like this
17:40:06*vsantana1 joined #nim
17:41:15*vsantana quit (Ping timeout: 272 seconds)
17:41:15*vsantana1 is now known as vsantana
17:41:44FromDiscord<mratsim> I think a syntax "lambda x: x <= 10" would be clearer
17:42:37*MarderIII quit (Read error: No route to host)
17:42:50FromDiscord<Rika> Ooh python like
17:43:06*MarderIII joined #nim
17:44:47FromDiscord<sheerluck> `ฮป x: x <= 10`
17:45:16FromDiscord<shadow.> hmm
17:45:26FromDiscord<shadow.> maybe
17:45:51FromDiscord<sheerluck> or Scala way `_ <= 10`
17:46:03FromDiscord<mratsim> just spell out the function
17:46:07FromDiscord<mratsim> easier to search
17:46:08FromDiscord<lqdev> that's what we already have no?
17:46:33FromDiscord<lqdev> we all know `proc (x: int): int = x <= 10` is the best
17:47:04FromDiscord<mratsim> you mean `proc (x: int): int {.nimcall, gcsafe, locks:0.} = x <= 10` surely?
17:48:52*vsantana1 joined #nim
17:49:42FromDiscord<lqdev> oh yeah totally
17:50:45*vsantana quit (Ping timeout: 272 seconds)
17:50:45*vsantana1 is now known as vsantana
17:55:46*Vladar quit (Remote host closed the connection)
17:56:02FromGitter<wrq> is Nim planning on turning Github Discussions on?
17:57:27FromDiscord<dom96> I'd rather implement GitHub sign-ins in the forum tbh
17:58:34FromGitter<wrq> yikes
17:59:25FromDiscord<dom96> Why yikes?
18:00:09FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LkB
18:00:12FromDiscord<lqdev> remove the extra hit definition
18:00:15FromDiscord<shadow.> ah ok
18:00:19FromDiscord<shadow.> in c++ they overrided it idk why
18:00:28FromDiscord<lqdev> it's already defined in Hittable, you just need to assign it a different value
18:00:32FromDiscord<shadow.> ohh i see
18:00:39FromDiscord<shadow.> (edit) "https://play.nim-lang.org/#ix=2LkB" => "https://play.nim-lang.org/#ix=2LkD"
18:00:51FromDiscord<lqdev> they override it in C++ because of how virtual methods work there
18:00:56FromDiscord<shadow.> makes sense
18:01:40FromDiscord<shadow.> ?
18:01:40FromGitter<wrq> Why would anybody want to use the forum instead of github discussions? I mean, tbh, and I mean no offense, but why would anybody want to use the forum instead of *anything* else? It's strange and clunky, there's perfectly good software like Discourse, now Github has solved the issue entirely by just giving people hosted forums for free.
18:01:44FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LkF
18:01:45FromGitter<wrq> I guess I don't really get it.
18:02:15*Vladar joined #nim
18:02:27disruptekwrq: apparently, it's because they are afraid of losing control of their data.
18:02:52FromDiscord<dom96> One good reason is that we can "eat our own dogfood"
18:03:02disruptekplease, no thank you.
18:03:30disrupteki am really fucking tired of eating dogfood.
18:03:42FromDiscord<Balen> Is there a way to have a debug build with without nimfr_ calls because for some reason nimFrame crashes on `(s).calldepth = (NI16)((framePtrHRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));` I plan on only debugging the generated cpp code.
18:04:00disruptekespecially when the flavor of dogfood doesn't change for years at a time...
18:05:31FromDiscord<shadow.> @lqdev sorry, just wondering if there's a cleaner way to do it i guess
18:05:32FromDiscord<dom96> wrq: btw which aspects of it do you find "clunky"?
18:05:41FromDiscord<shadow.> i could probably use a first class function right?
18:05:59FromDiscord<lqdev> @shadow. there's `method` but it's not really great for performance
18:06:13FromDiscord<lqdev> worse than vtables i think but ask mratsim
18:06:24disruptekyes, worse than vtables.
18:06:35FromDiscord<shadow.> would that work?
18:06:36disruptek!repo iface
18:06:36FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LkH
18:06:37disbothttps://github.com/yglukhov/iface -- 9iface: 11 15 23โญ 0๐Ÿด & 1 more...
18:06:39FromDiscord<lqdev> ye
18:06:41FromDiscord<shadow.> sick
18:06:51FromDiscord<lqdev> ah yes, you can also use an interface package
18:07:29FromDiscord<shadow.> fair
18:07:30FromDiscord<jken> how I am just discovering iface
18:07:33FromDiscord<shadow.> im not sure i wanna complicate it just yet
18:07:40disruptekjken: it's new.
18:07:48FromDiscord<shadow.> kinda trying to do a raytracer where i understand everything thats going on to some extent
18:07:49FromDiscord<shadow.> lol
18:08:40FromDiscord<jken> disruptek, gotcha. It's exactly what I've been needing!
18:08:48FromDiscord<dom96> Cool package
18:09:05Zevvso what's the overhead
18:09:06Zevvone call?
18:09:19FromDiscord<mratsim> @shadow. I use object variants in my raytracer
18:09:34Zevvis there documentation about the innar workings?
18:09:35FromDiscord<mratsim> I have a class emulator based on variants
18:09:50FromDiscord<mratsim> the repo is like 500 lines @zevv
18:09:57disruptekZevv: nnkVarSection: env_402656914(continuation).x_402656918: int = env_402656914(continuation).x_402656915 + 2
18:10:00Zevvwas just peeking inside yes
18:10:11disrupteki'm pretty sure you wrote this garbage. ๐Ÿ˜
18:10:34FromDiscord<dom96> yess, object variants ftw
18:10:35FromDiscord<mratsim> gensym wrote it
18:10:38Zevvdisruptek: hmm that's one extra pointer dereference more then a nim closure iterator I guess
18:10:39disruptekrude.
18:10:49Zevvor is it
18:10:59FromDiscord<mratsim> @dom96 they don't solve the plugin problem though
18:11:10FromDiscord<mratsim> if you have things in a DLL and you want to add new stuff
18:11:23disruptekit's just bad rewrite. but i'm trying to understand how to fix "shadow F" test properly...
18:11:24FromDiscord<jken> Is there a decent solution for object variants with conflicting fields yet? Or is the answer still "wrong use case"
18:11:35FromDiscord<dom96> @mratsim of course, lack of interfaces is one of the biggest things we should have solved before even writing the stdlib ๐Ÿ™‚
18:11:41disruptekthere is not a decent solution, no.
18:12:03disruptekyou can always hack something up using a macro to generate templates...
18:12:09Zevvyeah, that would be nice to have, right
18:12:12FromDiscord<mratsim> we should make the stdlib a collection of interface and a reference implementation (that can be switched out)
18:12:46disrupteki think iface is a cute idea but it's not something i would build on.
18:12:58FromDiscord<JSGRANT> Still waiting on that Gitlab rewrite in Nim. lol
18:12:59FromDiscord<mratsim> @jken what conflicting fields? same field name with different type?
18:13:10FromDiscord<jken> exactly
18:13:19Zevvdisruptek: well, it's different but not worse then the alternatives, is it?
18:13:35FromDiscord<Rika> same field name with same type can still be an issue if the kinds have more fields which are not common between each other
18:13:45disrupteki will look at it again, but my impression was that it was too brittle.
18:13:50FromDiscord<mratsim> that's begging for maintenance issue
18:13:58FromDiscord<shadow.> @lqdev hittable's hit's first param should be a hittable, if sphere's hit uses sphere-specific fields do i override the field proc with Sphere as first param?
18:14:03FromDiscord<mratsim> same field name same type is OK
18:14:24FromDiscord<lqdev> @shadow. convert the hittable to a sphere in the proc's body
18:14:24FromDiscord<Rika> how do you solve the issue i said then?
18:14:34FromDiscord<lqdev> you can make a template for that boilerplate if you wanna
18:14:34FromDiscord<shadow.> hmmm
18:14:41FromDiscord<shadow.> that's how i have to do it?
18:14:45FromDiscord<Rika> i mean i know a solution but its clunky
18:14:52disruptekmratsim: the use-case to focus on is a field existing for only /some/ cases.
18:15:09FromDiscord<shadow.> my initSphere is the thing that defines the hit proc so wouldn't that cycle?
18:15:10FromDiscord<mratsim> Either you use variants, or you put callbacks in your spheres or you use methods @shadow.
18:15:23FromDiscord<shadow.> which did you use for trace of radiance?
18:15:27FromDiscord<shadow.> we are doing the same project after all lol
18:15:32FromDiscord<mratsim> variants with a class generator
18:15:35FromDiscord<shadow.> hmm
18:15:41FromDiscord<shadow.> are methods basically made for this?
18:15:50FromDiscord<mratsim> https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/support/emulate_classes_with_ADTs.nim
18:15:58FromDiscord<mratsim> yes but they are not made for raytracing
18:16:02FromDiscord<shadow.> hmm
18:16:16FromDiscord<shadow.> how much slower would they really make it?
18:16:19FromDiscord<shadow.> i dont care about performance too much
18:16:20FromDiscord<mratsim> with methods you need ref object, with ref object you will kill your performance
18:16:24FromDiscord<shadow.> ah
18:16:24FromDiscord<shadow.> i see
18:16:33FromDiscord<shadow.> im just trying not to overcomplicate this lol
18:16:49FromDiscord<mratsim> spheres are pretty stable and allocated once, in raytracing in one weekend so that's fine
18:16:55FromDiscord<mratsim> so just use them
18:16:58FromDiscord<shadow.> methods?
18:17:10FromDiscord<mratsim> ref + methods
18:17:15FromDiscord<shadow.> so then which has to become a ref object, sphere or hittable?
18:17:43FromDiscord<mratsim> but in a dynamic environment where spheres are created and destroyed from scenes to scenes, or on GPU you can't use ref + methods
18:17:47FromDiscord<mratsim> both
18:17:56FromDiscord<mratsim> hittable: ref object of RootObj
18:18:04FromDiscord<mratsim> spheres ref object of Hittable
18:18:41FromDiscord<shadow.> ah i see
18:18:55FromDiscord<shadow.> and then how do i implement the method usage?
18:19:00FromDiscord<shadow.> `hit: (Hittable, Ray, float, float, HitRecord) -> bool`
18:19:02FromDiscord<shadow.> does that still work?
18:19:08FromDiscord<shadow.> or does sugar make that a proc type
18:19:16FromDiscord<mratsim> not sure
18:19:23FromDiscord<mratsim> I avoid methods like the plague
18:19:27FromDiscord<shadow.> ahh
18:19:37FromDiscord<mratsim> I still use inheritance from time to time but methods, no
18:19:40FromDiscord<lqdev> you just use method instead of proc
18:19:47FromDiscord<lqdev> and declare them like normal procs
18:19:49FromDiscord<shadow.> wait so
18:19:55FromDiscord<mratsim> he is talking about the => ambda
18:20:01FromDiscord<mratsim> lambda
18:20:01FromDiscord<shadow.> first off, can the field's type still be the `->`
18:20:03FromDiscord<lqdev> remove the field
18:20:04FromDiscord<shadow.> the arrow function type
18:20:05FromDiscord<shadow.> oh
18:20:05FromDiscord<shadow.> ok
18:20:11FromDiscord<mratsim> I'm lost xD
18:20:14FromDiscord<shadow.> so first off i remove the field from hittable?
18:20:19FromDiscord<shadow.> yeah same
18:20:20FromDiscord<lqdev> and declare your method like you would declare a normal proc
18:20:23FromDiscord<shadow.> hm ok
18:20:28FromDiscord<shadow.> so now hittable has no fields lol
18:20:32FromDiscord<shadow.> and then you're saying
18:20:34FromDiscord<mratsim> that's fine
18:20:35FromDiscord<shadow.> declare like a normal proc ok
18:20:41FromDiscord<shadow.> does sphere have to have a hit field or no
18:20:49FromDiscord<lqdev> just use the `method` keyword instead of proc
18:20:51FromDiscord<lqdev> it doesn't
18:20:55FromDiscord<shadow.> i see
18:21:05FromDiscord<lqdev> methods don't need extra fields, they just work โ„ข๏ธ
18:21:09*adnan338 joined #nim
18:21:14*adnan338 quit (Client Quit)
18:21:20FromDiscord<shadow.> is first param a Sphere?
18:21:27*adnan338 joined #nim
18:21:33FromDiscord<shadow.> i suppose i'd need it to be
18:21:38FromDiscord<mratsim> the Nim by example has a good tutorial on methods
18:21:51FromDiscord<shadow.> ohh ok
18:22:07FromDiscord<lqdev> wherever you have your hittable declared, do `method hit(h: Hittable, ...) {.base.} = discard`
18:22:21FromDiscord<lqdev> and then the same for sphere but without .base
18:22:44FromDiscord<mratsim> method hit(h: Hittable, ...) {.base.} = raise newException(ValueError, "Not Implemented. Please override this.")
18:23:33FromDiscord<shadow.> like that?
18:23:39FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LkS
18:23:54FromDiscord<shadow.> and then on the sphere one i make it not base?
18:25:28FromDiscord<lqdev> ye
18:25:35FromDiscord<lqdev> and swap the first param out for a Sphere
18:27:19FromDiscord<shadow.> ye ye
18:27:26FromDiscord<shadow.> ah that's pretty cool
18:28:27FromDiscord<Meowz> Does nimble install the latest master branch?
18:28:34FromDiscord<Rika> no
18:28:44FromDiscord<Rika> unless it is told to, no
18:29:05FromDiscord<dom96> yes, if the git repo has no tags
18:29:08FromDiscord<Rika> usually its the last release tag, unless none
18:29:18FromDiscord<Rika> in which case yes, but usually no
18:29:57disruptekbasically, nimble throws a dart.
18:30:05FromDiscord<Meowz> lol
18:30:35FromDiscord<dom96> yep lol
18:30:48FromDiscord<Meowz> So since nimpy for example has to tags it should just install the latest code right
18:30:50FromDiscord<Meowz> https://github.com/yglukhov/nimpy
18:31:02FromDiscord<Rika> yeah
18:34:21*jkiesian joined #nim
18:36:56FromDiscord<Meowz> (edit) So since nimpy for example has no tags it should just install the latest code right
18:38:41*hnOsmium0001 joined #nim
18:52:01FromDiscord<shadow.> well
18:52:03FromDiscord<shadow.> if you wanna be gamer
18:52:04FromDiscord<shadow.> just nimph
19:02:45disrupteknimph fails CI now, so, y'know, you may have missed your window to try it.
19:04:51Zevvworks fine for me
19:05:50disruptekthe bootstrap w/o nimble works but the bootstrap with nimble fails.
19:08:19disruptekactually, that's wrong. it's some kinda nimterop issue.
19:24:07FromDiscord<xCFF> In osproc, is there a way to gr fprocesshandle and fthreadhandle? https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/osproc.nim#L53-L58 they aren;t exported and i don't see any helper function to yield them
19:25:07*clemens3 joined #nim
19:25:45*radgeRayden quit (Ping timeout: 272 seconds)
19:26:04*jkiesian quit (Ping timeout: 246 seconds)
19:27:33*jkiesian joined #nim
19:28:01*hmmm joined #nim
19:29:05leorizexCFF you can't
19:30:02FromDiscord<shadow.> for module names is lowercase preferred? like `hittablelist` over `hittableList`?
19:30:13FromDiscord<shadow.> (edit) "preferred?" => "preferred over camelCase?"
19:30:48FromDiscord<dom96> sorta, I would personally prefer camelCase but it always looks weird for module names
19:31:00FromDiscord<shadow.> hm fair
19:32:19*joast joined #nim
19:32:35FromDiscord<Avatarfighter> snake case ๐Ÿ˜ฉ
19:32:50FromDiscord<Avatarfighter> `hit_table_list`
19:32:56FromDiscord<shadow.> lol
19:32:58FromDiscord<shadow.> it's
19:32:59FromDiscord<shadow.> HittableList
19:33:08FromDiscord<Avatarfighter> no no
19:33:10FromDiscord<shadow.> or hittable_list
19:33:12FromDiscord<Avatarfighter> That makes too much sense
19:33:14FromDiscord<shadow.> it's not a hit table
19:33:15FromDiscord<shadow.> lmao
19:33:18FromDiscord<Avatarfighter> It is now
19:33:20FromDiscord<shadow.> its a hittable
19:33:20FromDiscord<shadow.> ugh
19:33:22FromDiscord<shadow.> ๐Ÿ™„๐Ÿคš
19:33:25FromDiscord<Avatarfighter> hit table list
19:33:33FromDiscord<shadow.> should i just use normal ptr?
19:33:33FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Llt
19:33:38FromDiscord<Avatarfighter> Why you got a hit list for tables @shadow.
19:33:43FromDiscord<shadow.> dw abt it
19:33:47FromDiscord<shadow.> ๐Ÿ˜‰
19:33:57FromDiscord<Avatarfighter> ๐Ÿฅฒ
19:34:02disruptekshadow just really fuckin' hates tables.
19:34:10FromDiscord<Avatarfighter> fr
19:34:36FromDiscord<Avatarfighter> disruptek how is your amazingly fast and stdlib async supporting httpclient replacing library?
19:36:20FromDiscord<haxscramper> Shared pointer is just a regular object
19:36:31FromDiscord<shadow.> ohh
19:36:33FromDiscord<haxscramper> So you should really work around it like `Option[]`
19:36:37FromDiscord<shadow.> i mean
19:36:43FromDiscord<shadow.> Hittable is a ref object right
19:36:45FromDiscord<shadow.> so if its in a list
19:36:48FromDiscord<shadow.> and i modify it in the list
19:36:51FromDiscord<shadow.> it modifies the original var too right>
19:36:52FromDiscord<shadow.> (edit) "right>" => "right?"
19:37:07FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Llw
19:37:44FromDiscord<haxscramper> oh, I forgot you are porting this raytracer from C++, right?
19:37:47FromDiscord<shadow.> yep
19:38:40FromDiscord<haxscramper> `std::vector<shared_ptr<hittable>> objects;` should map to `seq[ref hittable]` IIUC
19:39:09FromDiscord<shadow.> hmm
19:39:14FromDiscord<shadow.> if hittable is already a ref object then
19:39:19FromDiscord<shadow.> wouldn't that make each item a ref ref hittable?
19:39:27FromDiscord<haxscramper> then just `seq[hittable]`
19:39:31FromDiscord<shadow.> yeah that's what i did
19:39:33FromDiscord<shadow.> i think it
19:39:34FromDiscord<shadow.> should work
19:39:34FromDiscord<shadow.> lol
19:41:24FromDiscord<shadow.> is `reset seq[T]` idiomatic to clear?
19:41:26FromDiscord<shadow.> or is there a better way
19:42:13*habamax quit (Ping timeout: 264 seconds)
19:44:19FromDiscord<haxscramper> I just do `=@[]`
19:44:46FromDiscord<haxscramper> But just because I have never bothered to do anything else, there might be some performace
19:44:54FromDiscord<haxscramper> Considerations for raytracer
19:44:54FromDiscord<lqdev> i think setLen(0) is better
19:45:25FromGitter<bung87> setLen more common
19:45:25FromDiscord<lqdev> but if the nim compiler is smart it should optimize x = @[]
19:46:08FromDiscord<shadow.> fair fair
19:46:17FromDiscord<shadow.> i just like `reset` bc it's clearer to read
19:46:28FromDiscord<shadow.> so `seq[T].setLen(0)` it is
19:46:30FromDiscord<shadow.> (edit) "is" => "is?"
19:46:37FromDiscord<haxscramper> `template destroy() = quit(1)` will certainly clear all sequences, I think you should use it
19:46:43FromDiscord<shadow.> i agree
19:46:51FromDiscord<lqdev> reset should actually work fine
19:47:10FromDiscord<shadow.> kk
19:47:15FromDiscord<lqdev> since an empty seq is just a nil pointer afaik
19:47:24FromDiscord<lqdev> efficiencyโ„ข๏ธ
19:48:02FromDiscord<shadow.> lol
19:58:34FromDiscord<shadow.> `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`
19:58:36FromDiscord<shadow.> fuck.
19:58:44FromDiscord<shadow.> love this error
19:58:48FromDiscord<Avatarfighter> same
19:59:13FromDiscord<shadow.> ah i know why
19:59:20FromDiscord<shadow.> how do i correctly initialize a ref object again
19:59:20FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LlB
19:59:23FromDiscord<shadow.> i needa use new or something right
19:59:27FromDiscord<shadow.> nvm ill go look in nim in action lol
19:59:29FromDiscord<haxscramper> `Object()`
19:59:34FromDiscord<shadow.> hm?
19:59:40FromDiscord<haxscramper> `result = Shpere()`
19:59:44FromDiscord<shadow.> ah ok
19:59:53FromDiscord<shadow.> does it default to nil?
20:00:15FromDiscord<shadow.> result
20:00:20FromDiscord<haxscramper> All ref type variables default to nil, so yes
20:00:22FromDiscord<shadow.> ah kk
20:00:24*MarderIII quit (Read error: Connection reset by peer)
20:00:31FromDiscord<haxscramper> pointer-like
20:00:55FromDiscord<shadow.> yeah
20:01:08FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/797193188451549184/unknown.png
20:01:09FromDiscord<shadow.> AYYYYYYYY
20:02:15FromDiscord<shadow.> so spicy
20:03:05ForumUpdaterBotNew thread by Alexeypetrushin: Bug? Compiled code throws some C-lang error., see https://forum.nim-lang.org/t/7356
20:05:55FromDiscord<haxscramper> I once managed to crash tcc with C backend output generated by macro
20:10:33FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LlK
20:10:33FromDiscord<shadow.> i like the look but ive heard tuple unpacking is bad
20:10:53FromDiscord<Avatarfighter> sometimes unpacking is just so useful though
20:10:55FromDiscord<InventorMatt> if it's a const it probably doesn't matter
20:11:04FromDiscord<shadow.> nvm it has to be var lol
20:11:08FromDiscord<Anuke> Where is the `end` keyword used in Nim? (if at all)
20:11:17FromDiscord<shadow.> there's an end keyword?
20:11:33FromDiscord<Anuke> yes, can't use it as a proc name
20:11:37FromDiscord<shadow.> hmm
20:11:40FromDiscord<shadow.> well ive never used it
20:11:43FromDiscord<shadow.> so i guess not often?
20:11:44FromDiscord<shadow.> lol
20:11:48FromDiscord<Anuke> is it just reserved for future use?
20:11:55FromDiscord<shadow.> check the index maybe
20:12:37FromDiscord<shadow.> nvm yeah im not sure
20:12:56FromDiscord<Anuke> the keyword is listed in the manual, but I can't find any use for it
20:13:19FromDiscord<Avatarfighter> in the manual it says that some keywords are reserved for future development
20:13:22FromDiscord<Avatarfighter> probably that ๐Ÿ˜›
20:16:17FromDiscord<haxscramper> https://godbolt.org/z/KK7bbx
20:17:19FromDiscord<haxscramper> With optimizations etc. it should not be different from accessing fields one by one
20:17:27FromDiscord<haxscramper> I guess
20:18:26FromDiscord<Filipe Duarte> How to declare a procedure with an optional arg. Also, how to annotate the return type when it could be different based on the opt arg?
20:18:58FromDiscord<haxscramper> First one is just `optional: type = defaultValue()`
20:19:09FromDiscord<haxscramper> Second - what exactly do you mean
20:19:45FromDiscord<haxscramper> You want to change return type based on value of optoinal argument?
20:19:53FromDiscord<haxscramper> non-static optional argument
20:19:53FromDiscord<Filipe Duarte> there are two possibilities for the return value
20:20:18*l1x joined #nim
20:20:31FromDiscord<Filipe Duarte> returning two `Tensors` or three `Tensors`
20:20:48FromDiscord<haxscramper> Use `seq[Tensor]` for this?
20:21:15FromDiscord<haxscramper> This does not show exactly tw/three tensors but should be fine in the most cases
20:21:32FromDiscord<Filipe Duarte> Understand, thnks
20:22:10FromDiscord<Filipe Duarte> is `optional` the name of the arg?
20:22:33FromDiscord<haxscramper> Yes, `proc(optiona; Type = defaultValueExpression)`
20:22:41FromDiscord<haxscramper> (edit) "`proc(optiona;" => "`proc(optional:"
20:23:16FromDiscord<Filipe Duarte> is this valid? `proc train_test_split[T](X: Tensor[T], perc_train: int, perc_val: int = 0.2): seq[Tensor[T]] =`
20:23:37FromDiscord<haxscramper> If it compiles then yes
20:23:58FromDiscord<Filipe Duarte> (edit) "int," => "float," | "int" => "float"
20:24:02FromDiscord<Filipe Duarte> `float`
20:24:41FromDiscord<haxscramper> Yes, this should be correct
20:25:27FromDiscord<mratsim> The shared_ptr part is useless, not sure why they introduced shared_ptr
20:25:27FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/797199308285411348/unknown.png
20:25:28FromDiscord<shadow.> woohoo
20:25:36FromDiscord<shadow.> yeah they dont even mutate it
20:25:37FromDiscord<mratsim> but a ref is a shared ptr
20:25:39FromDiscord<shadow.> but yeah
20:25:40FromDiscord<shadow.> i just used ref
20:25:41FromDiscord<shadow.> so like
20:25:44FromDiscord<shadow.> seq[Hittable]
20:25:45FromDiscord<shadow.> works fine
20:26:00*jkiesian quit (Ping timeout: 256 seconds)
20:32:51FromDiscord<shadow.> how would i namespace static methods? pure enum or something?
20:33:35FromDiscord<haxscramper> this one is about wrapping C++?
20:33:43FromDiscord<shadow.> yes
20:33:44FromDiscord<shadow.> wait
20:33:45FromDiscord<shadow.> what
20:33:45FromDiscord<shadow.> no
20:33:54FromDiscord<shadow.> i just like the look of `Vec.random()`
20:33:55FromDiscord<shadow.> lol
20:34:08FromDiscord<shadow.> i suppose i could just do randomVec
20:34:08FromDiscord<haxscramper> Then you can use `typedesc` probably
20:34:12FromDiscord<shadow.> fair
20:34:14FromDiscord<shadow.> and just ignore it
20:34:15FromDiscord<shadow.> lmaoo
20:34:25FromDiscord<shadow.> ig that'd be slightly less efficient tho ๐Ÿ™„
20:34:29FromDiscord<shadow.> ill just do `randomVec()` haha
20:37:00FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LlP
20:37:56FromDiscord<InventorMatt> i think it's preferred
20:38:13FromDiscord<haxscramper> I've never seen anyone do this
20:38:43FromDiscord<shadow.> really?
20:39:00FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2LlQ
20:39:11FromDiscord<shadow.> looks cleaner and aligns with the general ufcs-inspired styles (imo)
20:39:25Zevvl0
20:42:59FromDiscord<shadow.> hm?
20:43:30FromDiscord<shadow.> @mratsim how long did this one take to render single-threaded? i'm wondering how much of an impact method is having since it's taking a very long time compared to others, though i know ray bouncing is a big part of the time lol https://media.discordapp.net/attachments/371759389889003532/797203848665759744/img-1.png
20:43:32FromDiscord<mratsim> I don't do that for proc but I do it for aliasing templates
20:43:58FromDiscord<shadow.> maybe i should lower the bouncing limit from 50 that sounds a bit high
20:44:18FromDiscord<mratsim> I don't remember, but I know it's very slow
20:44:23FromDiscord<shadow.> i changed it to 5 lol
20:44:33FromDiscord<shadow.> ill optimize this later i guess
20:44:40FromDiscord<shadow.> optimize after not first
20:44:55FromDiscord<mratsim> benchmark and make sure you spend your time in "hit" and not in the RNG or memory allocation.
20:45:20FromDiscord<mratsim> unfortunately this is a bad advice here
20:45:35FromDiscord<mratsim> check the next chapters but I think there are no optimization in book 1
20:45:42FromDiscord<mratsim> and glass spheres will kill your rendering
20:45:43FromDiscord<shadow.> ah i see
20:45:47FromDiscord<shadow.> wait a min
20:45:50FromDiscord<shadow.> i turned off gc orc and it went way faster
20:45:51*krux02 joined #nim
20:45:52FromDiscord<shadow.> does that make sense?
20:46:08FromDiscord<shadow.> max depth 10 on gc refc was way faster than max depth 5 on orc
20:46:18FromDiscord<mratsim> you know that missiles don't need a GC because one they explode all memory is reclaimed at once?
20:46:24FromDiscord<shadow.> ah yeah
20:46:26FromDiscord<shadow.> that makes sense
20:46:26FromDiscord<shadow.> lol
20:46:36FromDiscord<shadow.> so like an arena type allocator would do better here?
20:46:44FromDiscord<mratsim> anyway, profile your code
20:46:49FromDiscord<shadow.> sure thing
20:46:53FromDiscord<shadow.> also, my image is darker than theirs
20:46:59FromDiscord<shadow.> would that be bc im doing max bounce 10 instead of 100?
20:47:02FromDiscord<shadow.> 50?
20:47:04FromDiscord<mratsim> yes
20:47:06FromDiscord<shadow.> ah ok
20:47:09FromDiscord<shadow.> ill profile
20:47:10FromDiscord<shadow.> nimprof?
20:47:13FromDiscord<mratsim> each ray brings light
20:47:20FromDiscord<mratsim> too much overhead
20:47:28FromDiscord<shadow.> what should i use then
20:47:29FromDiscord<mratsim> it needs stacktraces and you want danger for raytracing
20:47:38FromDiscord<mratsim> what OS are you on?
20:49:55*clyybber joined #nim
20:50:14*clyybber quit (Client Quit)
20:50:35FromDiscord<lqdev> btw mratsim what's better than nimprof on linux?
20:50:56FromDiscord<shadow.> im on windows
20:51:01FromDiscord<shadow.> sadly
20:51:18FromDiscord<shadow.> i also havent done gamma correction yet lol
20:51:27FromDiscord<mratsim> on Linux, perf record + perf annotate
20:51:33FromDiscord<mratsim> on Windows Intel Vtune
20:51:57FromDiscord<mratsim> gamma correction is slow because it involves exponentiation.
20:52:17FromDiscord<mratsim> Vtune on linux is a GUI arounf perf
20:52:17FromDiscord<shadow.> oof fair
20:52:36FromDiscord<shadow.> as you can tell im
20:52:40FromDiscord<shadow.> very new to this lmao
20:52:49FromDiscord<shadow.> just trying to learn some science
20:52:57FromDiscord<mratsim> well aren't you not even 18
20:53:27FromDiscord<mratsim> you're new to everything basically ๐Ÿ˜‰
20:53:35FromDiscord<shadow.> lmaooo
20:53:37FromDiscord<mratsim> enjoy that feeling ^^
20:53:43FromDiscord<shadow.> i am
20:53:44FromDiscord<shadow.> 18 - 4
20:53:45FromDiscord<shadow.> lmao
20:53:48FromDiscord<shadow.> 15 in a month
20:53:53FromDiscord<mratsim> because afterwards you'll just be bored
20:53:56FromDiscord<shadow.> yep.
20:54:04FromDiscord<shadow.> im already bored in school i think i spent most of my classes doing this tbh
20:54:05FromDiscord<shadow.> ๐Ÿ’€
20:54:09FromDiscord<shadow.> tho thats bc its freshman year
20:54:11FromDiscord<jken> @mratsim speaks the truth.
20:54:13FromDiscord<shadow.> im sure next yr im gonna go thru hell
20:54:21FromDiscord<mratsim> at school I was reading mangas underneath the desk
20:54:59FromDiscord<shadow.> fair enough
20:55:02FromDiscord<mratsim> We had 2 hours of internet per month at 56k speed
20:55:05FromDiscord<shadow.> that's more like it ay https://media.discordapp.net/attachments/371759389889003532/797206765896204358/unknown.png
20:55:11FromDiscord<mratsim> that limited what you could do
20:55:16FromDiscord<shadow.> me just vibin with 150mbps up/down
20:55:31FromDiscord<lqdev> i want your internet connection shadow
20:55:32FromDiscord<mratsim> I have 2500Mbps since tuesday (changed ISP)
20:55:37FromDiscord<lqdev> give me your internet connection
20:55:44FromDiscord<shadow.> lmao
20:55:46FromDiscord<shadow.> damn
20:55:50FromDiscord<mratsim> come in France, it's 40โ‚ฌ/month
20:55:52FromDiscord<shadow.> wtff
20:55:55FromDiscord<lqdev> i want the sweet megabits per second god damnit
20:56:00FromDiscord<lqdev> what the hell is that pricing
20:56:01FromDiscord<Avatarfighter> @mratsim what provider lol
20:56:11FromDiscord<shadow.> its $50/month here east coast usa for 150mpbs up/down
20:56:11FromDiscord<Vindaar> I pay 55 in Germany for "only" 250/40 ๐Ÿ˜ฎ
20:56:17FromDiscord<mratsim> it's actually 5Gbps but only 2.5 per PC due to ethernet limits
20:56:17FromDiscord<Avatarfighter> 10 gbit is pretty cheap with Free @mratsim
20:56:17FromDiscord<shadow.> mine 150/150
20:56:31FromDiscord<lqdev> quite expensive converting that to zล‚
20:56:40FromDiscord<mratsim> Free is 8Gbps for 40 AFAIK
20:56:45FromDiscord<Vindaar> whaaat
20:56:48FromDiscord<mratsim> well I have free but the medium-end
20:56:59FromDiscord<lqdev> that's crazy fast, too bad i live in a shithole
20:57:04FromDiscord<mratsim> https://www.free.fr/freebox/
20:57:09FromDiscord<Avatarfighter> We just got a 10Gbps installed with Free Delta S box
20:57:14FromDiscord<mratsim> 8Gbps for 50 sorry
20:57:27FromDiscord<mratsim> but you need SFP+ no?
20:57:38FromDiscord<shadow.> isnt vtune only for x86?
20:57:45FromDiscord<Avatarfighter> details details ๐Ÿ˜› mratsim ๐Ÿ˜›
20:57:46FromDiscord<mratsim> are you on ARM?
20:57:52FromDiscord<shadow.> oh wait a min
20:57:57FromDiscord<shadow.> nvm my brain stopped working no im not on arm
20:57:57FromDiscord<shadow.> lol
20:57:58FromDiscord<mratsim> but no it works for OpenCL as well ๐Ÿ˜‰
20:58:09FromDiscord<shadow.> how do you bench nim w vtune?
20:58:17FromDiscord<Avatarfighter> I guess technically its not true 10Gbps because its 10Gbit EPON
20:58:24FromDiscord<mratsim> and perf is platform agnostic, and I know that Intel has tool for ARM as well
20:58:43FromDiscord<mratsim> you compile with --debugger:native so you get the nim symbols and that's all
20:58:57FromDiscord<mratsim> open Vtune, put the command to the executable and run
20:59:19FromDiscord<mratsim> you might have errors about needing some tracing permission, I don't remember exactly
20:59:28FromDiscord<mratsim> last time I use Vtune on windows was over a year ago
20:59:40FromDiscord<mratsim> I thought you were in the US @Avatarfighter ?
20:59:49FromDiscord<Avatarfighter> 50% of my year is in FRance ๐Ÿ™‚
21:00:18FromDiscord<Avatarfighter> Je suis Francais techniquement ๐Ÿ™‚
21:00:53FromDiscord<Avatarfighter> well 50% if im lucky
21:01:26FromDiscord<Avatarfighter> some minor inconveniences this year thanks to covid
21:04:11FromDiscord<mratsim> "minor"
21:04:15FromDiscord<Avatarfighter> ๐Ÿ˜›
21:07:20*vsantana quit (Quit: vsantana)
21:09:44FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/797210453460910100/unknown.png
21:09:46FromDiscord<shadow.> what did i do this time
21:09:48FromDiscord<shadow.> oh lord
21:09:57FromDiscord<Avatarfighter> i can see a bit of the sphere at the bottom
21:10:06FromDiscord<Avatarfighter> it is working !
21:10:40FromDiscord<dom96> needs less light
21:10:46FromDiscord<shadow.> well
21:10:52FromDiscord<shadow.> maybe the camera's angled?
21:10:55FromDiscord<shadow.> beceause i can see the sphere
21:10:59FromDiscord<shadow.> but i didnt even edit the camera
21:11:34FromDiscord<shadow.> i just changed constant names from `camelCase` to `CAPS_SNAKE_CASE_WHATEVER_THIS_IS_CALLED`
21:11:56FromDiscord<haxscramper> Inner world of C++ programmer
21:12:20FromDiscord<haxscramper> Put all your love for the language in SCREAMING_IDENTIFIERS
21:12:22FromDiscord<shadow.> fair enough
21:12:30FromDiscord<shadow.> i wonder why it'd get messed up though
21:16:17FromDiscord<shadow.> lemme try spamming ctrl x
21:16:45FromDiscord<shadow.> ok now it works?
21:16:49FromDiscord<shadow.> lmao lemme make sure im changing the right names
21:18:57FromDiscord<dom96> I personally prefer the Spongebob case: cApSSnaKeCasEWhaTevErTHiSIScALLed
21:20:03*opal quit (Ping timeout: 240 seconds)
21:21:02FromDiscord<Avatarfighter> Mixing and matching is my favorite though `cApS_SnaKeCasE_WhaT_evEr_THiS_IS_cALLed`
21:21:32*opal joined #nim
21:25:43disruptek./kick avatarfighter
21:25:51FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/797214507478679562/unknown.png
21:25:54FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/797214518363160586/img-1.png
21:25:58FromDiscord<shadow.> @mratsim top is mine bottom is theirs
21:25:59FromDiscord<shadow.> same depth
21:26:10FromDiscord<shadow.> i messed something up-
21:26:46FromDiscord<shadow.> lmaoo
21:28:15FromDiscord<shadow.> wauit
21:28:18FromDiscord<shadow.> the gamma number in the book is wrong
21:28:33FromDiscord<shadow.> ;-;
21:29:15FromDiscord<shadow.> now mine is too bright why.
21:29:22FromDiscord<shadow.> gotta love raytracer debugging
21:32:26FromDiscord<shadow.> ok last update fixed it the issue wasnt my gamma lol
21:36:28*xet7 quit (Ping timeout: 260 seconds)
21:43:02*opal quit (Remote host closed the connection)
21:46:31FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2Lmm
21:46:33*opal joined #nim
21:46:47FromDiscord<shadow.> could prolly be done with code filters right?
21:47:08FromDiscord<shadow.> or are you saying that's in vanilla nim
21:51:44FromDiscord<shadow.> how can i fix cyclic imports
21:51:54FromDiscord<shadow.> (edit) "imports" => "depedencies?"
21:52:04FromDiscord<shadow.> two modules need an object from each other
21:53:10FromDiscord<shadow.> forward declarations im guessing?
21:53:37FromDiscord<shadow.> seemed to work
22:00:32FromDiscord<Avatarfighter> What performance issues should I expect with the parseEnum proc in strutils ?
22:00:48FromDiscord<Avatarfighter> Should I be expecting any performance issues
22:01:02FromDiscord<treeform> It depends on how performant your other code is.
22:01:22FromDiscord<Avatarfighter> perfect, I will be expecting medium performance issues ๐Ÿ˜›
22:02:22FromDiscord<Avatarfighter> Oh it generates a case statement
22:02:25FromDiscord<Avatarfighter> neeat
22:11:38*adnan338 quit (Quit: adnan338)
22:15:48FromDiscord<shadow.> kk nvm idk how tf to do this
22:15:58FromDiscord<shadow.> i have two objects in different files
22:16:01FromDiscord<shadow.> and each object has a field
22:16:03FromDiscord<shadow.> that is the other object
22:16:06FromDiscord<shadow.> idk how to import correctly
22:16:15FromDiscord<shadow.> nvm
22:16:19FromDiscord<shadow.> only one has a field which is another object
22:16:22FromDiscord<shadow.> but still idk how to impot
22:16:23FromDiscord<shadow.> (edit) "impot" => "import"
22:23:50*sixtyten joined #nim
22:30:21FromDiscord<shadow.> @mratsim i see you used some macro magic?
22:30:27FromDiscord<shadow.> is that something you made or stl
22:31:44FromDiscord<Avatarfighter> Is there a way to check if a certain file is imported ?
22:32:14FromDiscord<Avatarfighter> i can just use switches nvm
22:33:06FromDiscord<shadow.> probably using defined() or something
22:33:18FromDiscord<Avatarfighter> yeah that's what I'm going to do lol
22:33:34FromDiscord<shadow.> i mean
22:33:38FromDiscord<shadow.> you could do like
22:33:54FromDiscord<shadow.> `when (compiles do: somethingFromModule())`
22:33:56FromDiscord<shadow.> loll
22:35:42*narimiran quit (Ping timeout: 256 seconds)
22:37:38*jkiesian joined #nim
22:42:15FromDiscord<shadow.> i have `material.nim`: https://play.nim-lang.org/#ix=2LmFโ†ตand `hittable.nim`: https://play.nim-lang.org/#ix=2LmGโ†ตhow can i do the import without getting an error?
22:45:50*jkiesian quit (Remote host closed the connection)
22:50:21FromDiscord<Quibono> Make them one file?
23:09:44*l1x quit (Quit: Connection closed for inactivity)
23:13:18FromDiscord<shadow.> but
23:13:20FromDiscord<shadow.> organizinggg
23:14:46FromDiscord<shadow.> is there a way to forward-declare a type?
23:14:54FromDiscord<shadow.> nvm that wouldn't help
23:15:39*opal quit (Remote host closed the connection)
23:16:08*opal joined #nim
23:18:06FromDiscord<ElegantBeef> You could use codeReordering and include
23:19:22FromDiscord<shadow.> coreReordering?
23:21:37FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual_experimental.html#code-reordering
23:23:21FromDiscord<shadow.> thanks
23:32:09leorizecode reordering is super buggy, mind you
23:34:06FromDiscord<Anuke> oh no
23:34:11FromDiscord<ElegantBeef> No oh
23:34:35*leorize quit (Remote host closed the connection)
23:35:00*leorize joined #nim
23:37:48FromDiscord<Meowz> on ho?
23:38:38FromDiscord<Quibono> Oh wow
23:40:54FromDiscord<ElegantBeef> Shamwow
23:42:32*Vladar quit (Quit: Leaving)
23:47:31*tane quit (Quit: Leaving)
23:50:30FromDiscord<Anuke> https://github.com/nim-lang/Nim/issues/14308 I can see what you mean now
23:50:37disbotโžฅ Experimental code reordering does not work on macro generated content ; snippet at 12https://play.nim-lang.org/#ix=2LmZ
23:51:28FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2Ln0
23:51:33*lritter quit (Quit: Leaving)
23:53:13FromDiscord<exelotl> not sure if that counts as an actual occurrence of "the `end` keyword" since I'm not sure how it's implemented under the hood