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