00:00:08 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpL |
00:00:08 | FromDiscord | <shadow.> is that what you're talking about? |
00:00:11 | FromDiscord | <shadow.> where you can mutate the value |
00:00:31 | FromDiscord | <Cohjellah> Why do they call it a procedure in Nim? |
00:00:44 | FromDiscord | <shadow.> i think araq was asked that in an interview once |
00:00:46 | FromDiscord | <shadow.> lemme go find the answer |
00:00:48 | FromDiscord | <Quibono> Why not? :p |
00:00:58 | FromDiscord | <shadow.> alr lemme find this ill find it |
00:01:04 | FromDiscord | <Quibono> Isnβt it like some other language does it and he liked it or something? |
00:01:18 | * | rockcavera quit (Remote host closed the connection) |
00:01:37 | FromDiscord | <shadow.> something like that |
00:01:43 | FromDiscord | <j-james> @Cohjellah Because functions with side effects are technically procedures, iirc |
00:01:46 | FromDiscord | <shadow.> and also because functions are used as no side affect procedures |
00:01:47 | FromDiscord | <shadow.> yeah |
00:01:56 | FromDiscord | <shadow.> (edit) "no side affect" => "no-side-affect" |
00:02:06 | FromDiscord | <Quibono> Someone remind me what counts as a side effect! |
00:02:07 | FromDiscord | <shadow.> @j-james lol did you figure out what you meant? |
00:02:08 | FromDiscord | <Quibono> ? |
00:02:17 | FromDiscord | <shadow.> @Quibono using global vars or io manipulation |
00:02:17 | FromDiscord | <shadow.> iirc |
00:02:26 | FromDiscord | <j-james> not yet |
00:02:28 | FromDiscord | <Quibono> Gotcha |
00:02:29 | FromDiscord | <shadow.> lol |
00:02:34 | FromDiscord | <shadow.> lemme try doing what ur code did james |
00:02:54 | FromDiscord | <j-james> it's not a code-specific thing |
00:03:09 | FromDiscord | <j-james> just the concept of making the parameter mutable but only inside the proc |
00:03:13 | FromDiscord | <shadow.> OHHH |
00:03:18 | FromDiscord | <shadow.> i see what you mean |
00:03:19 | FromDiscord | <shadow.> hmm |
00:04:14 | FromDiscord | <shadow.> i coulda sworn what you did was a shadow but i guess not lmao |
00:04:25 | FromDiscord | <shadow.> lemme see if there's an easier way to do it |
00:05:53 | FromDiscord | <shadow.> yeah idk lmao |
00:10:16 | * | rockcavera joined #nim |
00:14:18 | FromDiscord | <Cohjellah> No side effect?? |
00:14:21 | FromDiscord | <Cohjellah> What |
00:14:52 | FromDiscord | <shadow.> what |
00:15:09 | FromDiscord | <shadow.> it means no global vars used or io manipulation |
00:15:09 | FromDiscord | <shadow.> i believe |
00:15:26 | FromDiscord | <ElegantBeef> It's probably called a procedure cause Nim comes from obscure languages that refer to their blocks of code as procedures asn they're procedural languages |
00:15:36 | FromDiscord | <shadow.> fair enough |
00:15:48 | FromDiscord | <ElegantBeef> No side effect means the proc cannot mutate the global state and can only mutate passed in variables or a return value |
00:16:08 | FromDiscord | <shadow.> i thought they couldn't use io streams either? |
00:16:18 | FromDiscord | <shadow.> or is that just pure functions |
00:16:19 | FromDiscord | <ElegantBeef> Even echo mutates the global state, as it moves the stdout |
00:16:39 | FromDiscord | <shadow.> ohh right |
00:16:39 | FromDiscord | <ElegantBeef> Yea it cannot use io streams either as moving the position is effecting the global state |
00:16:44 | FromDiscord | <shadow.> yeah |
00:17:03 | FromDiscord | <shadow.> basically all they can do is return a value or modifying a passed reference? |
00:17:06 | FromDiscord | <ElegantBeef> They're basically input -> output only if they're "pure" |
00:17:07 | FromDiscord | <shadow.> (edit) "modifying" => "modify" |
00:17:15 | FromDiscord | <shadow.> yeah |
00:17:26 | FromDiscord | <ElegantBeef> Yea you're right shadow |
00:17:26 | FromDiscord | <shadow.> in that case should i be making many of my procs funcs lol? |
00:17:30 | FromDiscord | <shadow.> is there any speed difference |
00:17:43 | FromDiscord | <shadow.> or is it just so the compiler can yell at you |
00:17:45 | FromDiscord | <ElegantBeef> Well procs get turned into funcs implictly but yes if you dont need procs make it a func |
00:17:49 | FromDiscord | <shadow.> ohh ok |
00:18:09 | FromDiscord | <ElegantBeef> The "standard convention" is to use a func unless you cannot |
00:18:15 | FromDiscord | <shadow.> fr? i mostly see procs used |
00:18:19 | FromDiscord | <shadow.> but yeah ill start doing that |
00:18:32 | FromDiscord | <shadow.> im guessing that way you dont accidentally use echo or global vars where you dont mean to since yk compiler warnings |
00:18:38 | FromDiscord | <ElegantBeef> I think it's mostly due to the newer `strictFuncs` where they're actually side effect tracing properly |
00:18:50 | FromDiscord | <shadow.> ohh ok |
00:19:01 | FromDiscord | <ElegantBeef> With strictfuncs if you pass a reference without `var` it's not mutable and it will not compile when you attempt to mutate |
00:19:05 | FromDiscord | <ElegantBeef> Unlike previously |
00:19:25 | FromDiscord | <shadow.> ohhh |
00:19:26 | FromDiscord | <ElegantBeef> I could be wrong about the "standard convention" but there's no harm in doing such |
00:19:29 | FromDiscord | <shadow.> fair enough yeah |
00:19:54 | FromDiscord | <shadow.> but you're saying any proc's that don't mutate global state are automatically converted to func's so it's just for convention to do it manually? |
00:19:59 | FromDiscord | <shadow.> (edit) "proc's" => "procs" |
00:20:06 | FromDiscord | <shadow.> funcs |
00:20:07 | FromDiscord | <ElegantBeef> I believe that's what 4raq has said |
00:20:11 | FromDiscord | <shadow.> ahh ok |
00:21:04 | FromDiscord | <shadow.> lol i still needa figure out type deduction in macros |
00:21:12 | FromDiscord | <ElegantBeef> what do you mean? |
00:21:36 | FromDiscord | <shadow.> well ive talked abt this before but |
00:21:40 | FromDiscord | <shadow.> im making a comprehension thingy bc why not |
00:21:56 | FromDiscord | <shadow.> and id prefer to not have to pass the comprehension type |
00:21:57 | FromDiscord | <ElegantBeef> If you want to read about functions/strictFuncs https://nim-lang.org/blog/2020/09/01/write-tracking.html |
00:22:01 | FromDiscord | <shadow.> thanks |
00:22:09 | * | rockcavera quit (Remote host closed the connection) |
00:22:50 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpO |
00:22:50 | FromDiscord | <shadow.> so this is currently what im doing |
00:22:58 | FromDiscord | <shadow.> but id prefer to not have to pass the seqType lol |
00:23:28 | FromDiscord | <ElegantBeef> oh |
00:23:42 | FromDiscord | <ElegantBeef> Pass the body as `typed` then you can see the lits π |
00:23:50 | FromDiscord | <ElegantBeef> actually that's not needed |
00:23:52 | FromDiscord | <shadow.> hmm well |
00:23:54 | FromDiscord | <ElegantBeef> You can just use the lits if you want |
00:23:57 | FromDiscord | <shadow.> i mean |
00:24:03 | FromDiscord | <shadow.> i need to figure out what the expression type result will be |
00:24:07 | FromDiscord | <shadow.> bc yk someone could do |
00:24:20 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpP |
00:24:22 | FromDiscord | <shadow.> and assuming an int lit wouldn't work |
00:24:36 | FromDiscord | <ElegantBeef> No but you know `$` is the stringification operator π |
00:24:50 | FromDiscord | <shadow.> ahh i see |
00:25:02 | FromDiscord | <shadow.> you're saying i can deduce the result of anything bc yk static typing |
00:25:05 | FromDiscord | <shadow.> so that's all i have to do? |
00:25:14 | FromDiscord | <ElegantBeef> If the left is a call you can look at the procdef using `getimpl` on the typed node |
00:25:23 | FromDiscord | <shadow.> oh bet lemme try that |
00:25:25 | FromDiscord | <ElegantBeef> so make sure your body is typed, and you might be able to |
00:26:11 | FromDiscord | <shadow.> well if i make it typed |
00:26:15 | FromDiscord | <shadow.> then i get unidentified i lmmao |
00:26:28 | FromDiscord | <ElegantBeef> Ok what are you attempting to do in words |
00:26:33 | FromDiscord | <shadow.> hmm |
00:26:41 | FromDiscord | <ElegantBeef> easily populate a sequence? |
00:26:50 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpQ |
00:26:52 | FromDiscord | <shadow.> a way to map and filter basically easily yes |
00:26:56 | FromDiscord | <shadow.> that currently works |
00:27:01 | FromDiscord | <shadow.> buut i have to pass the seq type at the end |
00:27:10 | FromDiscord | <ElegantBeef> ok so what does that replace? |
00:27:28 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpR |
00:27:47 | FromDiscord | <shadow.> and since i have to do a newSeq[]() call |
00:27:52 | FromDiscord | <shadow.> i need to know the type of i i |
00:28:29 | FromDiscord | <ElegantBeef> Ok so the layout right now is `body | iter, conditions`? |
00:28:35 | FromDiscord | <shadow.> yes |
00:28:40 | FromDiscord | <ElegantBeef> Weird idea, why not make those each seperate variables for your macro? |
00:28:50 | FromDiscord | <shadow.> wym |
00:28:58 | FromDiscord | <shadow.> well id like it to be concise i suppose |
00:29:04 | FromDiscord | <ElegantBeef> It's not concise though |
00:29:25 | FromDiscord | <ElegantBeef> `comp(i i, 1..10, i mod 2 == 0)` |
00:29:28 | FromDiscord | <ElegantBeef> It's the same thing |
00:29:35 | FromDiscord | <shadow.> hmm |
00:29:42 | FromDiscord | <shadow.> how would it know i is the sym |
00:29:53 | FromDiscord | <ElegantBeef> well you can just say that it is |
00:29:57 | FromDiscord | <ElegantBeef> or `it` rather |
00:29:58 | FromDiscord | <shadow.> lol fair enough |
00:29:59 | FromDiscord | <shadow.> yeah it |
00:30:08 | FromDiscord | <shadow.> but then for pairs and stuff |
00:30:13 | FromDiscord | <shadow.> alr ill try that thanks |
00:30:39 | FromDiscord | <ElegantBeef> well from this we can now type the iter, and see what it gives you when you loop over it, then check the `it it` operator |
00:30:45 | FromDiscord | <shadow.> true alright thanks |
00:30:48 | FromDiscord | <shadow.> lemme try that |
00:31:07 | FromDiscord | <ElegantBeef> This might be down a path of misfortune as i'm obviously not the smartest with macros, but eh π |
00:31:25 | FromDiscord | <shadow.> we'll see how it goes lmao |
00:32:24 | FromDiscord | <shadow.> thanks for the help ill give that a shot |
00:36:48 | FromDiscord | <shadow.> almost done |
00:37:51 | FromDiscord | <shadow.> hmm |
00:37:51 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpU |
00:39:38 | * | jaggz left #nim ("Leaving") |
00:39:46 | FromDiscord | <shadow.> kk it works |
00:39:51 | FromDiscord | <shadow.> when i give it type |
00:39:55 | FromDiscord | <shadow.> now i needa make it deduce type |
00:40:33 | FromDiscord | <shadow.> @ElegantBeef could you explain that one more time? sorry |
00:41:05 | FromDiscord | <shadow.> im guessing i can do something like |
00:41:39 | FromDiscord | <shadow.> nvm i have no idea i was gonna say do a loop once then break but for loops open up a new scope |
00:41:46 | FromDiscord | <shadow.> so id have to predeclare, and i cant declare it without knowing type |
00:56:49 | FromDiscord | <shadow.> alright i can get the type of the iterable, but now i needa get the type that it holds lol |
00:57:59 | * | d10n-work quit (Ping timeout: 244 seconds) |
00:57:59 | * | hoek quit (Ping timeout: 244 seconds) |
00:57:59 | * | l1x quit (Ping timeout: 244 seconds) |
00:58:49 | * | l1x joined #nim |
00:59:04 | * | d10n-work joined #nim |
01:00:00 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:00:05 | * | hoek joined #nim |
01:01:06 | * | njoseph joined #nim |
01:04:52 | * | nisstyre quit (Quit: WeeChat 2.9) |
01:06:39 | * | nisstyre joined #nim |
01:14:28 | * | rockcavera joined #nim |
01:15:20 | * | Tanger joined #nim |
01:15:46 | * | lritter quit (Ping timeout: 256 seconds) |
01:17:39 | FromDiscord | <ElegantBeef> @shadow. ok let's see if i can make a bodge and a half π |
01:17:51 | FromDiscord | <shadow.> haha |
01:19:01 | FromDiscord | <shadow.> i suppose i could store the string form π |
01:19:08 | FromDiscord | <shadow.> wait nvm |
01:19:19 | FromDiscord | <shadow.> i still couldnt parse that into an ident in the macro since it wouldn't be executed until after compile |
01:19:20 | FromDiscord | <shadow.> yeah idrk |
01:19:27 | FromDiscord | <shadow.> good luck |
01:21:30 | * | lritter joined #nim |
01:21:40 | FromDiscord | <shadow.> just ping me if u figure something out lol |
01:39:45 | FromDiscord | <shadow.> @ElegantBeef i present to you |
01:39:47 | FromDiscord | <shadow.> the ultimate bodge |
01:39:57 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gq7 |
01:40:07 | FromDiscord | <shadow.> behold the most inefficient (iterates entire iterator to get type!) bodge of all time |
01:40:09 | FromDiscord | <ElegantBeef> that's not bad |
01:40:18 | FromDiscord | <ElegantBeef> π |
01:40:20 | FromDiscord | <shadow.> i mean its not verbose but like |
01:40:24 | FromDiscord | <shadow.> it has to iterate the whole thing |
01:40:33 | FromDiscord | <shadow.> lemme see how the toSeq template works |
01:40:37 | FromDiscord | <ElegantBeef> Yea just get the first element |
01:40:44 | FromDiscord | <Rika> Uh |
01:40:49 | FromDiscord | <Rika> Hello |
01:40:51 | FromDiscord | <shadow.> hi |
01:41:06 | FromDiscord | <Rika> Are we iterating a closure iterator or any iterator |
01:41:06 | FromDiscord | <shadow.> what |
01:41:08 | FromDiscord | <shadow.> wait |
01:41:09 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gq8 |
01:41:14 | FromDiscord | <shadow.> oh uh well any iterator i think? |
01:41:24 | FromDiscord | <shadow.> usually it would be a seq or hslice |
01:41:39 | FromDiscord | <shadow.> idk how to "peek" an iterator tho |
01:41:56 | FromDiscord | <Rika> Well for loop then immediately break after? |
01:42:02 | FromDiscord | <shadow.> well you see |
01:42:12 | FromDiscord | <shadow.> for loops open up a new scope right? |
01:42:23 | FromDiscord | <shadow.> and i cant declare a var above the scope bc vars cant hold types |
01:42:33 | FromDiscord | <Rika> param.distinctBase? |
01:42:42 | FromDiscord | <Rika> Or whatever it is in that type thingy module |
01:42:55 | FromDiscord | <shadow.> hm? |
01:43:02 | FromDiscord | <shadow.> im not sure ik what u mean |
01:43:07 | FromDiscord | <shadow.> typetraits? |
01:43:36 | FromDiscord | <Rika> https://nim-lang.org/docs/typetraits.html#genericParams.t%2Ctypedesc |
01:43:59 | FromDiscord | <Rika> This |
01:44:15 | FromDiscord | <Rika> Well this is for the seqs |
01:44:21 | FromDiscord | <Rika> For iterators I do not remember |
01:44:26 | FromDiscord | <shadow.> yeah this needs to work for any iterator with an item proc |
01:44:33 | FromDiscord | <shadow.> (edit) "proc" => "iterator" |
01:44:44 | FromDiscord | <shadow.> is there a way to get the yield type of an iterator using macros? |
01:44:44 | FromDiscord | <Rika> Oh hey |
01:44:46 | FromDiscord | <Rika> https://nim-lang.org/docs/typetraits.html#elementType.t%2Cuntyped |
01:44:48 | FromDiscord | <Rika> Right above it |
01:44:57 | FromDiscord | <shadow.> YO |
01:45:02 | FromDiscord | <shadow.> thank you |
01:45:04 | FromDiscord | <Rika> Lol |
01:45:08 | FromDiscord | <shadow.> haha |
01:45:13 | FromDiscord | <Rika> LMAO |
01:45:27 | FromDiscord | <shadow.> YESSSS |
01:45:28 | FromDiscord | <shadow.> IT WORKED |
01:45:30 | FromDiscord | <shadow.> OML TYSM |
01:45:42 | FromDiscord | <Rika> LMAO |
01:45:48 | FromDiscord | <shadow.> PLS WHY WAS IT THAT SIMPLE IM CRYING- |
01:45:49 | FromDiscord | <shadow.> ASDJAOSJDOAJSG |
01:46:04 | FromDiscord | <shadow.> i was rly aboutta bodge like 50 lines before the toSeq thing πββοΈ |
01:46:19 | FromDiscord | <Rika> I love how I was able to help even if I don't know what you're making |
01:46:21 | FromDiscord | <shadow.> LOL |
01:46:25 | FromDiscord | <shadow.> ill show you once i figure the rest out |
01:48:36 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2Gq9 @shadow. well here is my attempt π |
01:48:46 | FromDiscord | <shadow.> RIP- |
01:48:49 | FromDiscord | <ElegantBeef> Ah that's pretty nice aswell rika |
01:48:51 | FromDiscord | <shadow.> lowkey what i was gonna do tho |
01:49:02 | FromDiscord | <shadow.> like a shit ton of code |
01:49:05 | FromDiscord | <shadow.> ok lemme figure this out now |
01:50:01 | FromDiscord | <shadow.> hmmm |
01:51:21 | FromDiscord | <shadow.> lit it works |
01:51:40 | FromDiscord | <ElegantBeef> Yea i fucked what i was doing up π |
01:51:50 | FromDiscord | <ElegantBeef> i hardcoded the `it it` |
01:51:55 | FromDiscord | <shadow.> oh rip lmao |
01:51:56 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqa |
01:51:58 | FromDiscord | <shadow.> this is what i wound up doing |
01:52:12 | FromDiscord | <ElegantBeef> I dont like that it's all one lined π |
01:52:12 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqb |
01:52:21 | FromDiscord | <shadow.> @ElegantBeef you ever tried haskell? |
01:52:25 | FromDiscord | <ElegantBeef> Clearly not |
01:52:27 | FromDiscord | <shadow.> LOL |
01:52:48 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/784235720918827018/unknown.png |
01:52:52 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/784235740355100743/unknown.png |
01:53:06 | FromDiscord | <ElegantBeef> Yea but haskell is just a research language |
01:53:16 | FromDiscord | <shadow.> fair idk i like the look of FP im weird |
01:53:27 | FromDiscord | <shadow.> prolly bc i overused comprehensions in py |
01:53:35 | FromDiscord | <shadow.> @Rika it worked ty |
01:53:57 | FromDiscord | <ElegantBeef> The worst one line i've ever used is this line for day2 of aoc `line.scanf("$i-$i$s$w:", newPw.min, newPw.max, req)` |
01:54:28 | FromDiscord | <Rika> I don't get comp |
01:54:43 | FromDiscord | <Rika> So it's just filter then a map? |
01:54:44 | FromDiscord | <ElegantBeef> Seems like it's just weird map/apply |
01:54:49 | FromDiscord | <shadow.> its like |
01:54:56 | FromDiscord | <Rika> First filter then map? |
01:55:00 | FromDiscord | <shadow.> yeah |
01:55:03 | FromDiscord | <shadow.> like here lemme make an example |
01:55:10 | FromDiscord | <Rika> Why combine then |
01:55:13 | FromDiscord | <shadow.> you want a list of all numbers 1..100 if they're even and you want them squared |
01:55:19 | FromDiscord | <shadow.> in python it would be |
01:55:36 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqd |
01:55:50 | FromDiscord | <shadow.> you can also do it without the if statement |
01:56:07 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqe |
01:56:31 | FromDiscord | <ElegantBeef> isnt that in nim just `filterit(0..100, it mod 2 == 0` |
01:56:36 | FromDiscord | <shadow.> pretty much yeah |
01:56:41 | FromDiscord | <shadow.> or like |
01:56:42 | FromDiscord | <ElegantBeef> I guess that doesnt work since that's not a sequence |
01:56:45 | FromDiscord | <shadow.> yeah |
01:56:54 | FromDiscord | <shadow.> toSeq() |
01:57:11 | FromDiscord | <shadow.> now i just need a way to call it with [] |
01:57:16 | FromDiscord | <ElegantBeef> So why not just avoid that entire `comp` thing and just make `iter` map/filter/apply π |
01:57:35 | FromDiscord | <shadow.> idk imo comp is easier to read |
01:57:44 | FromDiscord | <shadow.> for instance in the square one |
01:57:51 | FromDiscord | <ElegantBeef> I mean it's one line it's almost always less readable π |
01:58:18 | FromDiscord | <Rika> We need more love for closure iterators but it's understandable why there isn't much |
01:58:36 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqg |
01:58:43 | FromDiscord | <shadow.> idk in python map and filter are verbose so im use to comprehensions |
01:58:55 | FromDiscord | <Rika> Imagine infinitely recursable non-inline iterators aaaa |
01:58:57 | FromDiscord | <shadow.> (edit) "https://play.nim-lang.org/#ix=2Gqg" => "https://play.nim-lang.org/#ix=2Gqh" |
01:58:59 | FromDiscord | <shadow.> lol |
01:59:10 | FromDiscord | <Rika> Not in nim so not comparable |
01:59:15 | FromDiscord | <shadow.> fair enough |
01:59:20 | FromDiscord | <ElegantBeef> i mean i suggested `filterit(0..100, it mod 2 == 0).map(it it)` |
01:59:40 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqi |
01:59:49 | FromDiscord | <shadow.> in your opinion yours is more readable? |
01:59:52 | FromDiscord | <ElegantBeef> Yes |
01:59:53 | FromDiscord | <shadow.> idk to me second makes more sense |
01:59:53 | FromDiscord | <Rika> Yes |
02:00:01 | FromDiscord | <ElegantBeef> It's clear where each step is occuring |
02:00:02 | FromDiscord | <shadow.> i mean there's also |
02:00:14 | FromDiscord | <Rika> I think I'd rather read Beef's version than yours as I have no idea what comp means or does |
02:00:26 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gql |
02:00:27 | FromDiscord | <ElegantBeef> plus your order of declaration is off |
02:00:29 | FromDiscord | <shadow.> that's alehandre's version |
02:00:42 | FromDiscord | <ElegantBeef> the iterator should be first, as it's what is getting worked on |
02:00:42 | FromDiscord | <shadow.> (edit) "alehandre's" => "alehander's" |
02:00:49 | FromDiscord | <ElegantBeef> but it still doesnt help much |
02:01:01 | FromDiscord | <shadow.> i mean yeah obviously i can flip it around lol |
02:01:57 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqn |
02:01:59 | FromDiscord | <shadow.> eh i get what you mean i suppose |
02:02:17 | FromDiscord | <j-james> What's the best way to initialize a multidimensional array? |
02:02:29 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqo |
02:02:30 | FromDiscord | <shadow.> zero-d or filled? |
02:03:09 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqp |
02:03:28 | FromDiscord | <j-james> Whoops, I meant a multidimensional seq |
02:03:39 | FromDiscord | <ElegantBeef> `seq[seq[T]]` |
02:03:42 | FromDiscord | <j-james> Currently my code looks like `var image: seq[seq[seq[int]]]` |
02:04:05 | FromDiscord | <ElegantBeef> I personally tend to just use a `seq[T]` and map the dimensions to 1D |
02:04:07 | * | letto quit (Remote host closed the connection) |
02:05:05 | FromDiscord | <shadow.> @j-james the way you're doing works |
02:05:11 | FromDiscord | <shadow.> you can also do |
02:05:26 | FromDiscord | <j-james> The problem is that I get out of bounds errors when assigning items |
02:05:35 | FromDiscord | <j-james> So I strongly suspect I need to fill it |
02:05:39 | FromDiscord | <j-james> somehow |
02:05:40 | FromDiscord | <shadow.> ohh yeah |
02:05:43 | FromDiscord | <shadow.> you can use like |
02:05:48 | FromDiscord | <shadow.> setLen |
02:06:01 | FromDiscord | <shadow.> i think? |
02:06:44 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqq |
02:06:44 | FromDiscord | <shadow.> ye? |
02:07:04 | * | lum quit (Quit: Lum: Bye!) |
02:08:04 | FromDiscord | <shadow.> does that work lol |
02:08:15 | FromDiscord | <shadow.> and as for in the 3d, i would just use nested loops lol |
02:08:26 | FromDiscord | <shadow.> oh wait a minute |
02:08:34 | FromDiscord | <shadow.> i might be having a big brain moment |
02:08:51 | FromDiscord | <shadow.> BRUH IM SO DUMB ASHDOASJDASD |
02:09:15 | FromDiscord | <shadow.> hmm wait am i |
02:09:16 | * | lum joined #nim |
02:10:24 | * | letto joined #nim |
02:10:37 | FromDiscord | <j-james> hmm hmm hmm |
02:10:42 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqs |
02:10:43 | FromDiscord | <shadow.> LMAO |
02:10:58 | FromDiscord | <shadow.> that should technically work |
02:11:27 | FromDiscord | <j-james> `setLen()` should work too, i was messing around with my implementation |
02:11:28 | FromDiscord | <ElegantBeef> Back to hideous one liners π |
02:11:32 | FromDiscord | <shadow.> YES |
02:11:36 | FromDiscord | <shadow.> we love those here |
02:11:50 | FromDiscord | <shadow.> idk i just think you'd need like 10 lines of nested for loops and variables and shit |
02:11:55 | FromDiscord | <shadow.> and why not just repeat 0's 3 times LMAO |
02:11:58 | FromDiscord | <j-james> yes pretty much |
02:12:16 | FromDiscord | <ElegantBeef> Typically i split code across multiple lines so it's actually easily parsable |
02:12:21 | * | apahl_ joined #nim |
02:12:43 | FromDiscord | <shadow.> ehhh |
02:12:49 | FromDiscord | <shadow.> ehhhhhh |
02:13:03 | FromDiscord | <j-james> i am reevaluating my tendency to make fancy data structures |
02:13:09 | FromDiscord | <shadow.> lol |
02:13:30 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqt |
02:13:40 | FromDiscord | <ElegantBeef> Very unreadable 10/10 |
02:13:43 | FromDiscord | <shadow.> ty ty |
02:14:03 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqu |
02:14:03 | FromDiscord | <shadow.> that's just so much workkk |
02:14:36 | * | apahl quit (Ping timeout: 240 seconds) |
02:14:49 | FromDiscord | <ElegantBeef> solving each part independantly? |
02:15:16 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/784241378418753567/unknown.png |
02:15:17 | FromDiscord | <ElegantBeef> So hard π |
02:15:46 | * | omn1present_ joined #nim |
02:16:23 | FromDiscord | <shadow.> blech |
02:16:26 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=2Gqv |
02:16:28 | FromDiscord | <shadow.> BLECH |
02:16:38 | FromDiscord | <shadow.> lol |
02:17:00 | FromDiscord | <shadow.> jk thats nice |
02:17:02 | FromDiscord | <ElegantBeef> Hey it's against my will power to solve each pt one way |
02:17:08 | FromDiscord | <shadow.> this was my part one |
02:17:12 | FromDiscord | <shadow.> pretty meh |
02:17:12 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqw |
02:17:29 | FromDiscord | <ElegantBeef> My part one was solved in such away i didnt need to write any code for part two aside from calling the original |
02:17:48 | FromDiscord | <shadow.> same |
02:18:04 | FromDiscord | <shadow.> the deltas thing was just automating inserting the 's bc im lazy |
02:18:45 | FromDiscord | <shadow.> what was your guys' day 1's? |
02:18:52 | FromDiscord | <j-james> My part two originally toggled a bool instead of the first modulo |
02:18:55 | FromDiscord | <j-james> it was gross |
02:19:16 | FromDiscord | <shadow.> blech |
02:19:17 | FromDiscord | <shadow.> lol |
02:19:19 | FromDiscord | <ElegantBeef> I originally used closure iterators but moved towards a custom data type here https://media.discordapp.net/attachments/371759389889003532/784242398590271530/unknown.png |
02:19:52 | FromDiscord | <ElegantBeef> Wanted more speed π |
02:20:54 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqx |
02:20:56 | FromDiscord | <shadow.> that was my part one |
02:21:17 | FromDiscord | <shadow.> target being 2020 |
02:21:53 | FromDiscord | <j-james> Brace yourself |
02:21:56 | FromDiscord | <shadow.> uh oh |
02:22:00 | FromDiscord | <shadow.> nested for loop? |
02:22:03 | FromDiscord | <shadow.> WHAT |
02:22:04 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=2Gqy |
02:22:10 | FromDiscord | <j-james> you know it |
02:22:12 | FromDiscord | <shadow.> lol |
02:22:22 | FromDiscord | <ElegantBeef> Hey mine was nested loops just hidden |
02:22:23 | FromDiscord | <shadow.> you coulda used a block instead of a done bool iirc |
02:22:27 | FromDiscord | <j-james> as a bonus, ugly parseInts littered throughout |
02:22:33 | FromDiscord | <shadow.> i believe my solution was O(n) π |
02:23:14 | FromDiscord | <j-james> the done bool over a block is so that the answers output in the correct order |
02:23:30 | FromDiscord | <William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2GqA |
02:26:02 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqB |
02:26:12 | FromDiscord | <shadow.> lol |
02:26:26 | FromDiscord | <j-james> (edit) the done bool over a block is so that the answers output in the correct orderβ΅who needs procedures |
02:27:25 | FromDiscord | <ElegantBeef> Also worth noting shadow you dont need to use a macro for the more idiomatic method https://play.nim-lang.org/#ix=2GqC |
02:28:08 | FromDiscord | <shadow.> true but |
02:28:12 | FromDiscord | <shadow.> once it's hidden inside a package |
02:28:17 | FromDiscord | <shadow.> nobody will see anything π |
02:28:23 | FromDiscord | <ElegantBeef> "hidden" |
02:28:28 | FromDiscord | <shadow.> one sec |
02:28:29 | FromDiscord | <ElegantBeef> Proprietary Nim packages |
02:28:37 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/784244734633574490/unknown.png |
02:28:37 | FromDiscord | <shadow.> rip- |
02:28:38 | FromDiscord | <shadow.> LOL |
02:28:48 | FromDiscord | <shadow.> not hidden π’ |
02:28:55 | FromDiscord | <shadow.> ik i was joking |
02:29:15 | FromDiscord | <shadow.> guess what else i did on day one |
02:29:20 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqD |
02:29:50 | FromDiscord | <ElegantBeef> Well i would've done that if i wasnt slurping the text into the binary |
02:29:55 | FromDiscord | <shadow.> fair enough |
02:30:12 | FromDiscord | <shadow.> is there a way to read files in compile-time |
02:30:15 | FromDiscord | <ElegantBeef> Yes |
02:30:21 | FromDiscord | <ElegantBeef> Slurp/staticread |
02:30:22 | FromDiscord | <shadow.> like making nums a const? |
02:30:23 | FromDiscord | <shadow.> oo |
02:30:33 | FromDiscord | <ElegantBeef> Look at the top of my day one |
02:31:15 | FromDiscord | <ElegantBeef> you can technically do `ints = toSeq(slurp("day1.txt").splitLines).map parseInt` |
02:31:21 | FromDiscord | <shadow.> LOL |
02:31:34 | FromDiscord | <shadow.> you already knowwww |
02:32:27 | FromDiscord | <shadow.> sad |
02:32:29 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqF |
02:37:13 | FromDiscord | <shadow.> im guessing an issue with toSeq |
02:37:13 | FromDiscord | <ElegantBeef> Guess it failed π |
02:37:22 | FromDiscord | <shadow.> suits me right for bringing FP into nim |
02:37:29 | FromDiscord | <ElegantBeef> Hey nim is very FP |
02:37:32 | FromDiscord | <ElegantBeef> It has funcs π |
02:37:34 | FromDiscord | <shadow.> LOL |
02:37:35 | FromDiscord | <shadow.> true |
02:37:46 | FromDiscord | <shadow.> but luckily it doesnt have like |
02:37:51 | FromDiscord | <William_CTO> Mind if I repots my issue when chat settles down? |
02:38:49 | FromDiscord | <shadow.> sent a long message, see http://ix.io/2GqK |
02:39:09 | FromDiscord | <shadow.> go ahead im not saying anything meaningful anyways lmao |
02:40:14 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqL |
02:40:33 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqM |
02:40:36 | FromDiscord | <ElegantBeef> You know it isnt |
02:40:42 | FromDiscord | <shadow.> it's so lovely to look at |
02:40:45 | FromDiscord | <shadow.> and easy to understand |
02:40:57 | FromDiscord | <shadow.> (ima be honest idk wtf this does and this is literally a copy of a program i made in another language) |
02:41:09 | FromDiscord | <shadow.> LOL |
02:43:40 | * | abm quit (Quit: Leaving) |
02:44:55 | FromDiscord | <Rika> Lost me at :: |
02:53:05 | FromDiscord | <William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2GqP |
02:57:55 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqQ |
02:58:01 | FromDiscord | <shadow.> line 55 is the quote |
02:59:53 | FromDiscord | <ElegantBeef> Thats a template bud |
03:00:11 | FromDiscord | <shadow.> fuck |
03:00:20 | FromDiscord | <shadow.> still doesnt work as macro |
03:00:29 | FromDiscord | <shadow.> same error |
03:00:34 | FromDiscord | <ElegantBeef> supposed to be `quote do` |
03:00:47 | FromDiscord | <shadow.> same error |
03:01:08 | FromDiscord | <shadow.> lol |
03:01:23 | FromDiscord | <j-james> Speaking of templates, is there something special that needs to be done to override system methods? |
03:01:33 | FromDiscord | <Rika> I believe quote do and quote are identical now... |
03:01:38 | FromDiscord | <shadow.> yeah thats what i thought |
03:01:38 | FromDiscord | <ElegantBeef> Ah |
03:01:49 | FromDiscord | <shadow.> but i cant get this to work rahh |
03:01:54 | FromDiscord | <ElegantBeef> Collect takes a `var seq` and you pass it bare seq |
03:02:08 | FromDiscord | <shadow.> ohhh |
03:02:09 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqV |
03:02:13 | FromDiscord | <shadow.> thats the repr |
03:02:28 | FromDiscord | <Rika> That's a template |
03:02:34 | FromDiscord | <Rika> Why are you using quote in a templaye |
03:02:43 | FromDiscord | <ElegantBeef> Already went over that π |
03:02:52 | FromDiscord | <Rika> Okay |
03:03:07 | FromDiscord | <shadow.> lol |
03:04:28 | FromDiscord | <shadow.> @ElegantBeef collect takes an init call, no? |
03:05:08 | FromDiscord | <ElegantBeef> No clue |
03:05:27 | FromDiscord | <shadow.> rip |
03:05:32 | FromDiscord | <Rika> I believe |
03:05:37 | FromDiscord | <Rika> So call new seq |
03:06:07 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqX |
03:06:10 | FromDiscord | <shadow.> thats the example given |
03:06:31 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2GqY |
03:06:50 | FromDiscord | <shadow.> you need backticks in templates too? |
03:07:15 | FromDiscord | <ElegantBeef> No, i'm just silly |
03:07:48 | FromDiscord | <shadow.> oh ok lol |
03:08:04 | FromDiscord | <shadow.> ty that worked |
03:09:38 | FromDiscord | <shadow.> welp that was way easier |
03:09:38 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gr0 |
03:09:41 | FromDiscord | <shadow.> than making those entire macros |
03:09:54 | FromDiscord | <ElegantBeef> yep, use the most simple tool |
03:09:58 | FromDiscord | <shadow.> i should remember that templates exist more often lol |
03:10:29 | FromDiscord | <shadow.> i forgot about injecting `it` that's why i didn't use templates originally bc i thought it wasn't working lmao |
03:10:30 | FromDiscord | <Rika> You should consider the practicality of your small projects if you're gonna use them often |
03:10:38 | FromDiscord | <shadow.> wdym |
03:10:38 | FromDiscord | <Rika> :P |
03:11:11 | FromDiscord | <Rika> You should check if comp is practical to use and maintain and document before starting to write :P |
03:11:15 | FromDiscord | <Rika> Unless it's for fun |
03:11:16 | FromDiscord | <shadow.> fair enough |
03:11:19 | FromDiscord | <shadow.> it's for fun lol |
03:11:20 | FromDiscord | <Rika> Otherwise continue |
03:11:35 | FromDiscord | <shadow.> im mostly just doing this to learn metaprogramming |
03:11:43 | FromDiscord | <Rika> Idk I don't like wasting time even if I do it a lot |
03:11:46 | FromDiscord | <shadow.> rip |
03:11:55 | FromDiscord | <shadow.> i wouldn't call it a waste bc i learned about type reflection and other useful stuff |
03:12:10 | FromDiscord | <Rika> At least you learned |
03:12:42 | FromDiscord | <Rika> Also read typetraits since it's useful for macros and templates when you deal with types |
03:13:51 | FromDiscord | <shadow.> yeye ima bookmark it |
03:15:05 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gr1 |
03:15:08 | FromDiscord | <shadow.> lol looks like they basically did what i did |
03:15:11 | FromDiscord | <shadow.> iterate the whole thing |
03:15:16 | FromDiscord | <shadow.> they just did it smarter |
03:15:32 | FromDiscord | <Rika> Huh lol |
03:15:43 | FromDiscord | <Rika> 200 IQ plays |
03:15:47 | FromDiscord | <shadow.> haha |
03:15:51 | FromDiscord | <shadow.> i think its because of the scope thing |
03:15:56 | FromDiscord | <shadow.> that you can't just get the first one |
03:16:04 | FromDiscord | <shadow.> i mean it's compile-time anyways so it's not really an issue |
03:17:02 | FromDiscord | <shadow.> alr well im heading off the pc for tonight, thanks for the help guys |
03:17:07 | FromDiscord | <shadow.> im excited for aoc 4 lol |
03:19:36 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
03:21:10 | FromDiscord | <Rika> See you |
03:21:55 | * | pbb joined #nim |
03:27:32 | FromDiscord | <shadow.> back on phone π |
03:28:59 | FromDiscord | <shadow.> would there ever be a case where the first argument of `newVarStmt` wouldn't be an ident? |
03:29:49 | FromDiscord | <shadow.> bc `newCall`'s first arg is a string so i'm wondering why they didn't do the same for declarations |
03:30:22 | FromDiscord | <Quibono> Is there a generic way to convert something to a string? |
03:32:06 | * | omn1present_ quit (Ping timeout: 260 seconds) |
03:33:22 | FromDiscord | <InventorMatt> other than calling $ on it? |
03:34:16 | FromDiscord | <Quibono> No I just forgot about $, some of the op symbols seem really random. |
03:38:00 | FromDiscord | <shadow.> lmao |
03:38:13 | FromDiscord | <shadow.> make a str template for $ then |
03:39:58 | FromDiscord | <InventorMatt> one could also make a converter for turning everything into strings |
03:52:13 | FromDiscord | <ElegantBeef> I mean `$` is the only operator with a `S` in it π |
03:53:10 | FromDiscord | <shadow.> where can i read the rules for operator names |
03:53:37 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#lexical-analysis-operators |
03:53:43 | FromDiscord | <shadow.> ty |
03:56:05 | FromDiscord | <ElegantBeef> Where would you be without me shadow |
03:56:12 | FromDiscord | <ElegantBeef> Happy is where π |
03:56:17 | FromDiscord | <shadow.> LOL |
03:56:38 | FromDiscord | <shadow.> nahh you have increased my happiness dw |
03:56:41 | FromDiscord | <shadow.> bc code work |
03:56:42 | FromDiscord | <shadow.> i happy |
03:56:45 | FromDiscord | <shadow.> simple man |
03:56:57 | FromDiscord | <ElegantBeef> I'm happy you went for the more idiomatic versions |
03:57:04 | FromDiscord | <shadow.> is there an easier way to alias function? |
03:57:07 | FromDiscord | <shadow.> lol ofc |
03:57:11 | FromDiscord | <shadow.> functions |
03:57:17 | FromDiscord | <ElegantBeef> easier than what? |
03:57:21 | FromDiscord | <shadow.> uhh |
03:57:30 | FromDiscord | <shadow.> making an alias macro LOL |
03:57:56 | FromDiscord | <ElegantBeef> `template newName(): untyped = original` |
03:58:07 | FromDiscord | <ElegantBeef> (edit) "original`" => "original()`" |
03:58:09 | FromDiscord | <shadow.> and w args u have to type them all out? |
03:58:18 | FromDiscord | <shadow.> or would varargs[static] work |
03:58:23 | FromDiscord | <ElegantBeef> I guess if you have args you might need a macro |
03:58:35 | FromDiscord | <ElegantBeef> I havent used templates for anything complex |
03:58:37 | FromDiscord | <shadow.> nvm theres no splat operator in nim |
03:58:45 | FromDiscord | <ElegantBeef> splat operator? |
03:59:27 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gr6 |
03:59:33 | FromDiscord | <shadow.> splats a list out into a call |
03:59:44 | FromDiscord | <ElegantBeef> Well go make it π |
03:59:50 | FromDiscord | <shadow.> SMART |
04:00:20 | FromDiscord | <shadow.> lol |
04:00:46 | FromDiscord | <ElegantBeef> Dont you love the extensibillity here |
04:00:52 | FromDiscord | <ElegantBeef> Want a operator, you can write it π |
04:00:57 | FromDiscord | <shadow.> yes metaprogramming is quite sick |
04:01:37 | FromDiscord | <ElegantBeef> Well it's not just metaprogramming, it's also the whole aside from screwing the parser(unless you want to use a string) you can pretty much do anything |
04:02:26 | FromDiscord | <ElegantBeef> Like want a new operator you've got it, implict converters got it |
04:04:02 | FromDiscord | <shadow.> yeah true |
04:04:21 | FromDiscord | <shadow.> its really cool |
04:04:37 | FromDiscord | <shadow.> i also like whatever f(a, b) == a.f(b) is called |
04:04:44 | FromDiscord | <ElegantBeef> UFCS |
04:04:52 | FromDiscord | <ElegantBeef> Uniform function calling syntax |
04:04:57 | FromDiscord | <ElegantBeef> Command syntax is also nice aswell |
04:05:13 | FromDiscord | <ElegantBeef> the whole `doThing 10, 11, 12` |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:35 | * | supakeen joined #nim |
04:12:07 | FromDiscord | <Quibono> I'm in a hate relationship with websickets right now. |
04:12:25 | FromDiscord | <Quibono> Wait, does nim have command syntax? |
04:12:52 | FromDiscord | <InventorMatt> yes, you typically see it when you call echo |
04:12:59 | mipri | https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax |
04:13:10 | FromDiscord | <Quibono> Hah, right, I didn't think of that. |
04:13:23 | FromDiscord | <ElegantBeef> Fidget also uses it a lot and it makes it look less like code and more like a markup language |
04:13:25 | FromDiscord | <ElegantBeef> so it's nice π |
04:15:21 | FromDiscord | <Quibono> Yeah I need to get on the fidget train, but GUIs scare me. |
04:16:24 | * | apahl_ quit (Ping timeout: 240 seconds) |
04:16:50 | * | spiderstew quit (Ping timeout: 264 seconds) |
04:16:52 | FromDiscord | <ElegantBeef> I mean i dont do GUI much in general π |
04:17:10 | * | spiderstew joined #nim |
04:17:44 | * | apahl joined #nim |
04:19:18 | FromDiscord | <Quibono> Is there something obviously messed up with my websocket code? https://play.nim-lang.org/#ix=2Grc |
04:25:26 | FromDiscord | <Quibono> I keep looking at it, and it keeps looking perfectly fine. |
04:27:32 | FromDiscord | <ElegantBeef> What's the issue runtime or compilation? |
04:28:38 | FromDiscord | <Quibono> Yeah I just don't get a message back from the server. |
04:28:44 | FromDiscord | <Quibono> It compiles fine |
04:29:14 | FromDiscord | <ElegantBeef> Well no clue @treeform could possibly help, but idk π |
04:31:06 | FromDiscord | <Quibono> Itβs going to be some tiny stupid error on my part lol |
04:32:14 | FromDiscord | <shadow.> i also love macros in nim bc of jester-type shenanigans |
04:32:33 | FromDiscord | <shadow.> its such an elegant setup |
04:32:55 | FromDiscord | <ElegantBeef> Metaprogramming, compile time evaluation, and UFCS are like the 3 best features of Nim |
04:33:56 | FromDiscord | <ElegantBeef> Many languages can have DSLs though, not like it's a purely Nim thing |
04:36:49 | * | lritter quit (Ping timeout: 264 seconds) |
04:37:04 | * | lritter joined #nim |
04:37:17 | FromDiscord | <shadow.> true |
04:37:51 | FromDiscord | <shadow.> and as for general features id sayβ΅- speedβ΅- eleganceβ΅- flexibility |
04:38:16 | FromDiscord | <shadow.> i mean for a statically typed, compiled language nim really is quite pretty |
04:38:35 | FromDiscord | <shadow.> it looks much closer to python than c |
04:39:48 | FromDiscord | <Quibono> Yeah the pretty factor is real |
04:40:06 | FromDiscord | <shadow.> fr |
04:40:17 | FromDiscord | <shadow.> oh also blocks are fucking sick |
04:40:29 | FromDiscord | <Rika> Boutta block you then xd |
04:40:30 | FromDiscord | <ElegantBeef> Most C-like also have `{}` for blocks |
04:40:36 | FromDiscord | <Rika> I kid of course |
04:40:42 | FromDiscord | <shadow.> whew |
04:40:51 | FromDiscord | <shadow.> who else would send me typetrait links |
04:41:01 | FromDiscord | <shadow.> lol |
04:41:04 | FromDiscord | <Rika> Dis-- oh. |
04:41:18 | FromDiscord | <shadow.> f |
04:41:33 | FromDiscord | <Rika> I have to go now |
04:42:05 | FromDiscord | <shadow.> rip |
04:42:08 | FromDiscord | <shadow.> peace |
04:42:23 | FromDiscord | <shadow.> @ElegantBeef named blocks? |
04:42:31 | FromDiscord | <ElegantBeef> goto π |
04:42:38 | FromDiscord | <shadow.> i meant the ability to break from nested loops is amazingly cool |
04:42:42 | FromDiscord | <shadow.> ohhh |
04:42:45 | FromDiscord | <shadow.> true |
04:43:01 | FromDiscord | <shadow.> the `result` variable is also genius |
04:43:18 | FromDiscord | <ElegantBeef> expressions aswell |
04:43:41 | FromDiscord | <shadow.> what specifically? |
04:44:05 | FromDiscord | <shadow.> abt expressions |
04:44:23 | FromDiscord | <ElegantBeef> implict returning |
04:46:23 | FromDiscord | <shadow.> ohhh |
04:46:26 | FromDiscord | <shadow.> ye |
04:46:41 | FromDiscord | <shadow.> statement list expressions are nice |
04:46:54 | FromDiscord | <shadow.> oh dont forget ffi lol |
04:47:52 | FromDiscord | <shadow.> its kinda funny i use to use py, c++, c# to make diff programs but now i basically always just use nim LOL |
04:49:13 | * | narimiran joined #nim |
04:54:48 | * | sagax joined #nim |
04:56:35 | * | Tanger is now known as NotTanger |
04:56:59 | * | NotTanger is now known as tAnger |
04:57:02 | * | a_chou joined #nim |
04:57:17 | * | tAnger is now known as Tanger |
04:59:40 | * | kinkinkijkin joined #nim |
05:00:42 | * | lpy quit (Ping timeout: 272 seconds) |
05:04:10 | * | a_chou quit (Quit: a_chou) |
05:20:53 | * | apahl quit (Ping timeout: 244 seconds) |
05:21:48 | * | audiofile joined #nim |
05:22:05 | audiofile | any best practices to know before writing a wrapper for an api in nim? |
05:28:20 | * | lmariscal quit (Quit: I'm Out!) |
05:30:00 | FromDiscord | <ElegantBeef> This has some lessons, but no clue if there is a good instruction https://forum.nim-lang.org/t/7191 |
05:43:13 | * | thomasross quit (Ping timeout: 246 seconds) |
06:03:38 | Zevv | hm if only I had an easy way to parse this :( |
06:06:15 | mipri | it's pretty easy though. string split by {':', ' '} |
06:06:45 | mipri | the blank-separated input is an annoyance, but you could cheat and just put an extra blank line at the bottom of your input |
06:11:03 | Zevv | http://zevv.nl/div/passport.png :) |
06:11:27 | mipri | is this generated by npeg? |
06:11:31 | Zevv | yeah |
06:11:41 | mipri | nice! I'll have to try that out |
06:12:07 | Zevv | I'll have to feed the kids walk the dog brush my teeth work my job, so this'll have to wait until tonigh to finish |
06:25:41 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:34:45 | * | habamax joined #nim |
06:41:43 | narimiran | Zevv: you and your cryptic stuff! |
06:46:51 | FromDiscord | <treeform> @Quibono did you solve your ws problem? |
07:08:04 | FromDiscord | <sealmove> what does `Error: internal error: environment misses: x` mean? |
07:13:30 | FromDiscord | <ElegantBeef> I've no clue |
07:13:40 | FromDiscord | <ElegantBeef> My aoc day 4 is ugly π |
07:14:11 | FromDiscord | <ElegantBeef> For those curious https://play.nim-lang.org/#ix=2GrN |
07:17:43 | FromDiscord | <lytedev> maybe mine can inspire a bit =)β΅β΅https://github.com/lytedev/advent-of-code/blob/master/2020/src/day4.nim |
07:21:23 | FromDiscord | <ElegantBeef> I could always clean mine up but i couldnt be arsed π |
07:22:25 | * | habamax_ joined #nim |
07:23:22 | * | habamax_ quit (Client Quit) |
07:23:45 | * | vicfred quit (Quit: Leaving) |
07:29:54 | FromDiscord | <lqdev> @sealmove you're probably referencing another parameter within a default parameter |
07:30:00 | FromDiscord | <lqdev> which nim doesn't like |
07:31:41 | * | disruptek joined #nim |
07:31:48 | disruptek | well well well. |
07:31:55 | FromDiscord | <ElegantBeef> Welcome back |
07:32:03 | disruptek | sup meathead. |
07:32:36 | disruptek | hmm, you're making me hungry. |
07:33:15 | narimiran | look who's back! |
07:35:40 | FromDiscord | <sealmove> @lqdev not sure what this means |
07:37:46 | disruptek | it means you need to convert your symbols to identifiers. |
07:42:28 | FromDiscord | <Idefau> the king has returned |
07:44:20 | * | PMunch joined #nim |
07:46:51 | mipri | lytedev: you don't have an off-by-one error. your pid test is wrong. |
07:47:30 | mipri | !eval "1234".match re"[0-9]{3}" |
07:47:33 | NimBot | Compile failed: /usercode/in.nim(1, 7) Error: attempting to call undeclared routine: 'match' |
07:47:40 | mipri | !eval import re; "1234".match re"[0-9]{3}" |
07:47:44 | NimBot | Compile failed: /usercode/in.nim(1, 18) Error: expression 'match("1234", re"[0-9]{3}", 0)' is of type 'bool' and has to be used (or discarded) |
07:47:47 | mipri | !eval import re; echo "1234".match re"[0-9]{3}" |
07:47:52 | NimBot | true |
07:52:01 | disruptek | narimiran: dude. is it github actions or is it nimble? |
07:52:17 | narimiran | disruptek: huh? |
07:52:25 | disruptek | everything is broken. |
07:52:42 | narimiran | that's how we roll |
07:52:48 | disruptek | oh, right. |
07:53:00 | FromDiscord | <flywind> see https://github.com/nim-lang/Nim/pull/15701#discussion_r535891048 |
07:53:00 | disbot | β₯ Try to fix CI failures |
07:53:16 | disruptek | yeah, i don't watch the repo anymore. |
07:56:46 | narimiran | @lytedev: `y >= 1920 and y <= 2002` can be `y in 1920..2002`, i find it easier to type |
07:58:58 | FromDiscord | <Idefau> same |
07:59:21 | FromDiscord | <lqdev> yooooo disruptek |
07:59:41 | FromDiscord | <lqdev> @sealmove are you doing something like `proc abc(a: int, b = a)`? |
08:06:39 | FromDiscord | <sealmove> hum πΆ no idea, not my code. there is a proc where I added 1 parameter, and this error showed up. |
08:06:51 | FromDiscord | <sealmove> it's not a default parameter, just regular parameter. |
08:10:46 | * | Tanger quit (Remote host closed the connection) |
08:11:30 | FromDiscord | <sealmove> actually you are right, there is a default parameter, but I can't see how it's related |
08:11:36 | FromDiscord | <sealmove> thanks for the info |
08:17:00 | FromDiscord | <sealmove> nah, I still get the error after removing the default param |
08:17:00 | FromDiscord | <lqdev> i mean this is one case where i've run into this error |
08:17:11 | FromDiscord | <lqdev> but there are probably more |
08:18:48 | FromDiscord | <Idefau> i might stop doing advent of code in favour of nimachine(thats how we decided to name the vm i was talking about a while back) |
08:19:11 | disruptek | too hard for you, huh? |
08:20:16 | disruptek | what is it, day 4? |
08:20:42 | FromDiscord | <Idefau> its day 104 in the idf calendar |
08:20:49 | disruptek | holy shit am i in the wrong channel? |
08:20:53 | * | disruptek left #nim (#nim) |
08:22:03 | * | disruptek joined #nim |
08:22:05 | FromDiscord | <lqdev> haha idf |
08:22:09 | FromDiscord | <lqdev> you lamed out |
08:22:13 | FromDiscord | <lqdev> just like me every year |
08:23:22 | FromDiscord | <Recruit_main707> I know Iβm late but good to see you disruptek :) |
08:23:37 | disruptek | sup buddy. |
08:25:12 | FromDiscord | <Idefau> frens laugh at me π¦ |
08:25:45 | FromDiscord | <Idefau> im not stopping from doing it im just going to put it as a secondary priority |
08:26:04 | disruptek | fer sure. |
08:26:17 | FromDiscord | <Idefau> :nimDog: |
08:26:47 | disruptek | i say the same thing about hygiene. |
08:26:59 | FromDiscord | <Idefau> but i wash your teeth |
08:27:12 | disruptek | oh, so /you're/ the one. |
08:28:30 | FromDiscord | <mrotaru> Hello ! Trying to create a simple type which contains a sequence, and getting a type error. Is this the right place for such questions ?β΅ This snippet shows the issue: https://play.nim-lang.org/#ix=2Gsc Any pointers (no pun intended) would be appreciated ! |
08:29:22 | disruptek | i don't believe insert takes an array, does it? |
08:30:10 | mipri | another problem si that line 10 should have () |
08:30:10 | disruptek | give your proc invocation (). procs /love/ them. |
08:30:14 | FromDiscord | <mrotaru> probably not but changing the array to a sequence doesn't fix it either |
08:30:22 | mipri | nullary functions require them, or they're just functions. |
08:30:34 | disruptek | don't be rude. |
08:30:43 | disruptek | nullary functions are functions, too. all procs matter. |
08:30:54 | FromDiscord | <mrotaru> what's a nullary function ? |
08:31:33 | disruptek | it's when you have a function that fails to leave home at 18. |
08:31:43 | mipri | fixed: https://play.nim-lang.org/#ix=2Gsk |
08:32:05 | PMunch | @mrotari, it's just a function without arguments |
08:32:21 | PMunch | Or rather a procedure without arguments, a function without arguments is pretty useless |
08:32:42 | disruptek | such contempt. |
08:33:28 | PMunch | !eval echo NimVersion |
08:33:31 | NimBot | 1.4.0 |
08:33:36 | PMunch | Hmm, I should fix that.. |
08:33:58 | disruptek | pmunch: i had a dream my father in law was wearing your beard. |
08:34:32 | FromDiscord | <mrotaru> thanks for the help ! |
08:34:56 | FromDiscord | <mrotaru> but if the constructor does not return a ref, does that mean the object will be allocated on the stack ? |
08:35:11 | tribly | doesn't `readFile` return a string/taintedstring? when i try to feed it to `splitLines` it tells me `got <seq[string]> but expected 'string'` |
08:35:31 | mipri | Foo[T] is a ref object. the 'new' tells you that dynamic allocation is happening. |
08:35:36 | disruptek | what do you think splitLines does? |
08:36:20 | FromDiscord | <Idefau> split spaces |
08:36:21 | mipri | yes, readFile returns a string/taintedstring |
08:36:37 | tribly | ah, nvm, i had a brainfart |
08:36:43 | mipri | mrotaru: try giving http://zevv.nl/nim-memory/ a read |
08:37:03 | Zevv | while you're at it, please write the missing sections at the end |
08:37:32 | disruptek | i wrote a section on cuba but i don't see it there. |
08:37:42 | FromDiscord | <Idefau> because sphera is more interesting |
08:37:53 | Zevv | wait waht whose that |
08:38:07 | FromDiscord | <Idefau> its like cuba but round |
08:38:07 | tribly | ah, vscode had me confused because it marked the parameter of `splitLines` |
08:38:26 | * | mbomba quit (Quit: WeeChat 3.0) |
08:42:25 | Araq | I'm back |
08:42:37 | FromDiscord | <lqdev> hi |
08:42:41 | FromDiscord | <Idefau> hi back |
08:44:44 | disruptek | most people don't know this, but araq has a tattoo of church on his back. |
08:44:53 | disruptek | harvey church, alonzo's better-looking brother. |
08:45:07 | Araq | my back is nobody's business |
08:45:15 | disruptek | fair. |
08:45:55 | FromDiscord | <ElegantBeef> Wow everyone's back today |
08:47:19 | FromDiscord | <Idefau> nope |
08:47:20 | FromDiscord | <Idefau> im around |
08:47:29 | PMunch | disruptek, that is oddly specific :P Who wore it best? |
08:47:41 | disruptek | i'd say harvey did. |
08:48:03 | FromDiscord | <sealmove> @lqdev in your case, even though different, how did you solve this error? |
08:48:06 | disruptek | (sorry, araq) |
08:48:19 | FromDiscord | <lqdev> @sealmove i didn't |
08:48:36 | disruptek | sealmove: is there macro involvement? |
08:48:45 | * | JustASlacker joined #nim |
08:48:49 | FromDiscord | <lqdev> just made the param non-default and created another overload that simply calls the proc with my desired param |
08:49:09 | disruptek | lqdev: don't let timmy hear you talk this way. |
08:49:18 | FromDiscord | <sealmove> yes there are macros |
08:49:38 | FromDiscord | <lqdev> disruptek: poor little timmy gonna get his psyche destroyed by default param bugs. |
08:49:43 | FromDiscord | <ElegantBeef> Life was odd without disrupteks nonsensical sentences π |
08:49:54 | FromDiscord | <sealmove> the macro produces a proc, the error appears when I add an extra parameter to this proc |
08:50:03 | disruptek | then i say unto thee again, thou must repent and desym, post haste. |
08:50:19 | FromDiscord | <Idefau> haste |
08:51:21 | FromDiscord | <sealmove> why does nim complain about a generated proc parameter? |
08:51:56 | disruptek | because it's a reuse that needs to be resym'd. |
08:52:57 | FromDiscord | <sealmove> how one does this? π sorry I am clueless |
08:53:28 | FromDiscord | <sealmove> oh |
08:53:33 | disruptek | planetis just PR'd a resym proc. copy it into your code and apply it to your ast before returning it from the macro. |
08:53:58 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2Gsp |
08:54:05 | disruptek | there is similar stuff in cps and half a dozen other projects of mine. |
08:54:09 | FromDiscord | <sealmove> because I use `p` 2 times? |
08:54:37 | disruptek | p p is something best left to young boys. |
08:54:44 | disruptek | they absolutely love it. |
08:54:52 | FromDiscord | <sealmove> >_> |
08:55:31 | disruptek | more important than the proc is the doc, i guess. |
08:55:47 | * | disruptek deletes his safety weasel. |
08:56:18 | mipri | that past with you .add(p)ing twice doesn't communicate much. that code isn't wrong in itself, in isolation. try pasting some code with the problem you have |
08:56:27 | disruptek | ima take a nap. call me if the situation doesn't improve. |
08:57:14 | Araq | it always improves, relax. you won't be called |
08:57:40 | PMunch | @sealmove, you can use the same sym multiple times if it points to the same thing |
08:58:07 | supakeen | Ok I need to up my understanding on `type Foo = object` vs `type Foo = ref object of RootObj` what do I read. |
08:58:25 | mipri | try giving http://zevv.nl/nim-memory/ a read |
08:58:36 | supakeen | Let me do that :) |
08:59:02 | PMunch | This might also be of use: https://peterme.net/nim-types-originally-a-reddit-reply.html |
08:59:08 | disruptek | the first one is ideal, the second suggests you are about to enjoy inheritance bugs. |
08:59:25 | PMunch | Haha, that's good advice :P |
08:59:26 | FromDiscord | <sealmove> the PR I asked you to merge doesn't work when using arrays like `u8: data[size]` T_T I am terrible, I run the new code with my example and didn't run the main binaryparse module with the tests |
08:59:40 | PMunch | Nooooo |
08:59:53 | PMunch | I was about to ask you if you had done that, but I trusted you! |
09:00:07 | FromDiscord | <sealmove> sorry I failed you |
09:00:58 | PMunch | Just out of curiosity, what are you using it for? |
09:01:34 | FromDiscord | <sealmove> well I have an ambitious idea to make a generic file editor |
09:01:35 | FromDiscord | <j-james> @ElegantBeef your day four ugliness doesn't hold a candle to this: https://play.nim-lang.org/#ix=2Gst |
09:01:50 | FromDiscord | <j-james> as far as trash code is concerned |
09:01:52 | FromDiscord | <ElegantBeef> oh god |
09:01:52 | FromDiscord | <sealmove> other than that parsing windows system files for forensics |
09:02:15 | PMunch | @j-james, my eyes! |
09:02:34 | FromDiscord | <j-james> to top it off, that doesn't work with the provided input |
09:02:39 | FromDiscord | <ElegantBeef> I'm dumb cause i forgot that i seen `hexdigits` |
09:02:50 | PMunch | sealmove, ah I see, cool! |
09:02:57 | FromDiscord | <j-james> but i was going to speedy speed speed so |
09:03:02 | FromDiscord | <j-james> (edit) "to" => "for" |
09:04:32 | mipri | j-james: easy way to fix that, make a template that injects the numerical version of fields[1]. and then pull the guts of this code into a validation function that returns a boolean, so that the template mentioned can return false if the parse fails. |
09:05:08 | mipri | you don't check that pids are numeric. |
09:05:34 | mipri | you can pull all that == "gry", == "grn" into a `val in ["gry", "brn", ...]` test |
09:05:44 | FromDiscord | <ElegantBeef> I was pretty chuffed to see that `parseEnum` can parse values to enums |
09:06:06 | mipri | yeah, enums are a great way to handle pid, cid, and such. |
09:06:43 | mipri | anyway you need to clean this code up so that you can have any chance of finding the errors :) |
09:06:45 | FromDiscord | <ElegantBeef> If anything is elegant in what i did, i think it was parsing those and using an `array[Field, T]` for passports |
09:07:52 | mipri | gah, char != 'e', likewise, just look for c in {'0'..'9','a'..'f'}, nicer even than typing the letters out |
09:10:13 | FromDiscord | <ElegantBeef> or just `c in HexDigits` if you `import strutils` |
09:11:51 | FromDiscord | <sealmove> wow |
09:12:01 | FromDiscord | <sealmove> I just duplicated the symbol and the code works |
09:17:52 | PMunch | @j-james, your ugly version inspired me to rewrite mine with some pretty patterns: http://ix.io/2GsB/nim |
09:18:47 | FromDiscord | <ElegantBeef> Do i rewrite mine? |
09:19:05 | PMunch | What's yours? |
09:19:28 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2GrN |
09:19:31 | FromDiscord | <ElegantBeef> Awful in a word |
09:19:58 | PMunch | Shame! The reason why the 1.4.2 auto-build has been failing on the playground is because of the fusion package! |
09:20:03 | PMunch | Error: Cannot satisfy the dependency on regex 0.17.1 and regex 0.18.0 |
09:20:20 | PMunch | Oh wait, maybe not |
09:21:54 | Araq | fusion doesn't depend on regex |
09:21:57 | mipri | j-james: https://play.nim-lang.org/#ix=2GsC , I took your version and cleaned it up without changing any of the logic (much) |
09:22:21 | PMunch | Yeah it was just the log looking like this: http://ix.io/2GsD |
09:22:36 | mipri | it still has bugs (pairs is definitely wrong), but you might have more luck debugging it like that |
09:23:12 | narimiran | PMunch: do you also include "important packages"? |
09:23:20 | Araq | question: when you depend on both regex 0.17.1 and on regex 0.18.0. do you think these are so incompatible that a real probem was detected by semver? |
09:23:25 | FromDiscord | <j-james> mipri: thanks, that's funnily similar to where i am at now: https://play.nim-lang.org/#ix=2GsE |
09:23:48 | Araq | <insert usual rant about semver here> |
09:24:26 | FromDiscord | <j-james> the original ugly code actually worked because of some changes i made to the input file |
09:24:45 | PMunch | narimiran, this is the list of packages installed on the playground: https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble |
09:24:50 | FromDiscord | <j-james> (and it would have been done faster too if it wasn't for that meddling Country ID) |
09:25:39 | FromDiscord | <ElegantBeef> Lets replace semver with color versioning, it's identical but instead of a.b.c you get just get a colour and need a colour picker to figure out the version π |
09:25:50 | FromDiscord | <j-james> after it's cleaned up i'm going to look into the fancy/fun nim features you and ElegantBeef mentioned |
09:26:18 | PMunch | @j-james, you can turn those parseInt(value) >= 1920 and parseInt(value) <= 2002 into parseInt(value) in 1920..2002 |
09:26:30 | FromDiscord | <ElegantBeef> I mentioned fancy/fun features? |
09:27:22 | PMunch | And you don't have to split on both newlines and spaces, just run split without an extra argument and it defaults to split on all whitespace ;) |
09:27:44 | narimiran | there is `splitWhitespace` |
09:28:02 | PMunch | @ElegantBeef, "oh you should update to mauve, lavender is outdated" :P |
09:28:14 | FromDiscord | <ElegantBeef> No |
09:28:20 | FromDiscord | <ElegantBeef> You send an image of the colour |
09:29:08 | FromDiscord | <sealmove> @PMunch Here is the fix: https://github.com/PMunch/binaryparse/pull/11, sorry for the trouble |
09:29:09 | disbot | β₯ Fixed bug regarding extra parameters in write proc |
09:29:15 | PMunch | Much more fun to generate the colour and have that as the official version but colloquially talk about it with vague names :P |
09:29:27 | narimiran | @j-james are you missing a check for height? |
09:29:46 | narimiran | also for colors |
09:30:49 | narimiran | btw, this morning i had a brain-fart and i wrote `if not pid.len == 9`. can you spot the error? |
09:31:42 | FromDiscord | <Idefau> it does not pid.len first? |
09:31:54 | narimiran | :) |
09:32:08 | FromDiscord | <Idefau> B) |
09:32:13 | PMunch | Ouch |
09:32:17 | narimiran | big ouch |
09:32:20 | narimiran | one hour ouch |
09:32:26 | FromDiscord | <Idefau> lel |
09:32:53 | FromDiscord | <sealmove> @PMunch I meant to ask, why is input parameter `var`? |
09:33:06 | FromDiscord | <sealmove> Just style decision? |
09:34:11 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:34:12 | Araq | narimiran, known gotcha |
09:34:29 | narimiran | Araq: it is hard to spot it at 6:30 in the morning |
09:34:53 | Araq | I am in favor of removing the not/and/or bit operators |
09:35:08 | Araq | import bitops is superior you can use names like 'setBit' |
09:35:42 | Araq | but plenty of code uses the old bit operators |
09:35:45 | Araq | fun |
09:35:51 | mipri | Forth waffled on the meaning of not across two standards, so currently has a dedicated "equals 0" word, 0=, and INVERT for the bit operator |
09:36:46 | mipri | if only I didn't know the exact reason (the bad standards) I could make a joke about how *even Forth* thinks this is too confusing |
09:37:25 | Araq | *shrug*, it's Forth |
09:37:42 | PMunch | Prestige, you around? |
09:37:52 | * | abm joined #nim |
09:37:58 | PMunch | @sealmove, hmm don't remember |
09:38:06 | PMunch | Did you try turning it into a not var? |
09:38:37 | FromDiscord | <sealmove> no, I wanted to ask you first in case there is a good reason I am not seeing |
09:39:22 | PMunch | Oh no, I meant if you tried to turn it into not a var and then run the test and see if the compiler complains about anything :P |
09:39:56 | PMunch | I vaguely remember having a reason for it, but not sure what it was |
09:40:30 | Araq | you use Forth when you confused Chuck Moore with Chuck Norris |
09:40:34 | FromDiscord | <sealmove> yeah I wanted to ask first even before doing rudimental experimentation |
09:40:52 | PMunch | Right |
09:41:15 | PMunch | I'm a bit surprised you're even able to make changes to this project :P The code is super messy |
09:41:26 | FromDiscord | <ElegantBeef> Pmunch have you played with nimscripter yet? |
09:41:54 | PMunch | No I haven't gotten around to that yet |
09:42:13 | PMunch | I will though, when I start working on my configuration thingy |
09:45:41 | PMunch | Goodness gracious.. https://old.reddit.com/r/adventofcode/comments/k6hasz/2020_day_4_emojicode_ascii_art_can_only_do_so_much/ |
09:46:07 | Araq | maybe Nim versions should have catchy names like Ubuntu does it. "Nim -- Drunken Elephant" (You know how good this version is when you consider what it takes to get an elephant to be drunk) |
09:47:12 | mipri | 0.1 - drunken mosquito, 1.4 - drunken elephant, 3.0 - drunken sperm whale |
09:48:31 | PMunch | 0.1 - high-on-life mosquito, 1.4 - drunken elephant, 3.0 - cocaine ravaged sperm whale |
09:48:41 | PMunch | You forgot to update your major versions :P |
09:49:56 | Araq | 4.0 -- horny horse, because we love alliterations |
09:50:08 | FromDiscord | <Idefau> 4.2 horny heroine dependant horse |
09:50:19 | FromDiscord | <ElegantBeef> 5.0 Macque... Monkey... whatever the fuck it is |
09:50:26 | FromDiscord | <Idefau> uh oh stinky |
09:50:29 | FromDiscord | <ElegantBeef> (edit) "Macque..." => "Macaque..." |
09:50:31 | Araq | 5.0 mad monkey |
09:50:58 | FromDiscord | <ElegantBeef> Ubuntu is going alphabetically forward we need to go alphabetically backwards |
09:51:10 | FromDiscord | <ElegantBeef> So Xylophone Zebra... wait |
09:51:33 | FromDiscord | <Idefau> Xtra Zealous |
09:51:38 | Araq | 7.0 snipping snake |
09:51:42 | PMunch | Γ
revΓ₯ken Γ
l |
09:55:22 | FromDiscord | <hugogranstrom> Γlg Γpple π |
09:55:38 | FromDiscord | <Idefau> Braping Burrito |
10:01:37 | Zevv | if you need to parse, use parser: https://github.com/zevv/aoc2020/blob/master/04/main.nim |
10:03:04 | FromDiscord | <Rika> xenophobic xerus idk fucking animal names starting with the letter x |
10:07:04 | PMunch | That's a nice solution Zeww |
10:07:07 | PMunch | Zevv* |
10:09:11 | Zevv | natural fit, right |
10:16:53 | FromDiscord | <Vindaar> say hi to another overengineered solution of mine that is still worse than Zevv's: https://github.com/Vindaar/AdventOfCode2020/blob/master/day4/day4.nim π |
10:19:47 | Zevv | well it's not overengineered, is it |
10:22:21 | FromDiscord | <Vindaar> a bit, the whole enum stuff isn't really necessary haha |
10:28:59 | Araq | enums are almost never overengineered |
10:29:12 | Araq | enums are the best thing ever :-) |
10:29:35 | * | MarderIII joined #nim |
10:29:43 | Araq | "oh man, if only I had used fewer enum types" -- never happened in my life |
10:30:48 | ForumUpdaterBot | New thread by Stefan_Salewski: Error: template instantiation too nested, see https://forum.nim-lang.org/t/7201 |
10:32:08 | FromDiscord | <Vindaar> Araq I totally agree, haha. But for AoC it just makes my code longer π |
10:34:10 | FromDiscord | <Cohjellah> Woahh is the Nim forum actually written only with Nim? |
10:34:13 | FromDiscord | <Cohjellah> I'm impressed if so |
10:34:29 | Araq | yeah it is, both backend and frontend |
10:34:38 | FromDiscord | <Cohjellah> What's the frontend written with? Karax? |
10:34:52 | Araq | yeah |
10:35:03 | FromDiscord | <Cohjellah> Cool |
10:35:18 | FromDiscord | <Cohjellah> Really hope this language catches on. Keen to see its growth |
10:36:14 | Araq | we all hope that but it helps to use it already whenever you can |
10:36:26 | FromDiscord | <fwsgonzo> I have what seems like a transpiler bug, and I |
10:36:41 | FromDiscord | <fwsgonzo> (edit) "I have what seems like a transpiler bug, and ... Ican" added "I'm sitting in GDB with it - anything" | "I'm sitting in GDB with it - anythingI ... " added "can do to help?" |
10:36:55 | FromDiscord | <fwsgonzo> (edit) "I have what seems like a transpiler bug, and I'm sitting in GDB with it - anything I can do to help? ... " added "`https://github.com/nim-lang/Nim/issues/16249`" |
10:36:56 | disbot | β₯ Strange behavior when calling into Nim ; snippet at 12https://play.nim-lang.org/#ix=2GsW |
10:41:48 | Araq | with -d:useMalloc there is no rawMalloc in your stack trace, no idea what you're doing |
10:42:12 | FromDiscord | <fwsgonzo> I removed it for the last output and ran regular nim with GDB |
10:42:28 | FromDiscord | <fwsgonzo> then it also happened, so the common thing just seems to be calling into Nim |
10:42:36 | FromDiscord | <fwsgonzo> (edit) "then it also happened, so the common thing just seems to be calling into Nim ... " added "without using gc:stack" |
10:42:59 | FromDiscord | <fwsgonzo> I originally thought the culprit was useMalloc or os:any, but guess not |
10:43:05 | * | Vladar joined #nim |
10:43:59 | FromDiscord | <fwsgonzo> `$ nim c --gc:arc --noMain -g test.nim && gdb ./test` |
10:45:00 | Araq | I valgrinded it without the test.c stuff and it runs fine under valgrind |
10:45:03 | narimiran | Zevv: beautiful!! |
10:45:07 | Araq | no errors and no leaks |
10:45:24 | Araq | nothing "overwrites its own allocations" |
10:45:50 | FromDiscord | <fwsgonzo> the test.c stuff seems to be important then |
10:47:20 | FromDiscord | <fwsgonzo> i added valgrind output |
10:50:03 | Araq | you need to call NimMainModule() too, I think |
10:50:29 | Araq | no wait |
10:50:39 | Araq | NimMain does call that already |
10:51:21 | FromDiscord | <fwsgonzo> `https://gist.github.com/fwsGonzo/34291ba798d3825c7e799d0d70d0851e` valgrind output is very long, but there's clearly some invalid accesses |
10:51:33 | FromDiscord | <fwsgonzo> (edit) "`https://gist.github.com/fwsGonzo/34291ba798d3825c7e799d0d70d0851e`" => "https://gist.github.com/fwsGonzo/34291ba798d3825c7e799d0d70d0851e" |
10:51:35 | FromDiscord | <shad0w> Hi all, how do i loop over the string "0123ε45" with counting the weird char as 1 and access 4 next |
10:51:47 | FromDiscord | <shad0w> i tried the Rune module but no luck |
10:52:12 | FromDiscord | <shad0w> (edit) "Rune" => "~Rune~ unicode" |
10:52:22 | FromDiscord | <shad0w> (edit) "~Rune~" => "_Rune_" |
10:52:39 | FromDiscord | <lqdev> for r in runes("0123ε45") |
10:53:00 | FromDiscord | <lqdev> or convert your string toRunes |
10:54:29 | FromDiscord | <shad0w> yeap, that worked. Thanks lqdev |
10:54:57 | FromDiscord | <shad0w> even `s.len` counts the weird char as 3 chars |
10:55:25 | * | Q-Master quit (Ping timeout: 264 seconds) |
10:55:31 | FromDiscord | <flywind> !eval import unicode;echo"0123ε45".runeLen |
10:55:35 | NimBot | Compile failed: /usercode/in.nim(1, 20) Error: expression 'echo["0123ε45"]' has no type (or is ambiguous) |
10:55:59 | FromDiscord | <flywind> !eval import unicode;echo "0123ε45".runeLen |
10:56:02 | narimiran | !eval import unicode;echo "0123ε45".runeLen |
10:56:05 | NimBot | 7 |
10:56:07 | NimBot | 7 |
10:56:20 | FromDiscord | <shad0w> gotcha guys |
10:56:24 | FromDiscord | <shad0w> thx |
10:56:54 | FromGitter | <alehander92> hey guys |
10:58:47 | FromDiscord | <Idefau> sup |
10:59:48 | FromGitter | <alehander92> just pinging about the nil thing, if I should work on it this month to fix additional stuff for initial merge |
11:00:03 | FromGitter | <alehander92> or if it's not going to make it 2020 |
11:00:10 | FromGitter | <alehander92> otherwise normal, work, life |
11:00:33 | FromGitter | <alehander92> how are you guys |
11:02:57 | * | zahary joined #nim |
11:06:11 | FromDiscord | <shad0w> so, i can do `2'i8` but not `'a''i8` and have to `int8 'a'` |
11:06:47 | FromDiscord | <fwsgonzo> maybe 'a'+0i8 |
11:07:01 | FromDiscord | <fwsgonzo> (edit) "maybe 'a'+0i8 ... " added "(im new to Nim so ignore me!)" |
11:07:29 | FromDiscord | <shad0w> this shouldn't be ambigious to the lexer if the normal `'i8` works |
11:11:54 | * | Q-Master joined #nim |
11:19:44 | PMunch | The 'i8 syntax is just to attach types to literals |
11:19:46 | Araq | fwsgonzo: --noMain is broken with arc :-) |
11:19:56 | Araq | it destroys the global variables too early |
11:20:05 | Araq | shouldn't be too hard to fix |
11:20:06 | FromDiscord | <fwsgonzo> thanks for looking into it! |
11:20:09 | Araq | look into |
11:20:13 | Araq | compiler/cgen.nim |
11:20:35 | Araq | if {optGenStaticLib, optGenDynLib} * m.config.globalOptions == {}: |
11:20:37 | Araq | for i in countdown(high(graph.globalDestructors), 0): |
11:20:37 | Araq | n.add graph.globalDestructors[i] |
11:20:47 | FromDiscord | <Rika> 'i8 syntax only works with number literals |
11:21:02 | Araq | so you can try --app:lib |
11:21:19 | FromDiscord | <fwsgonzo> it was broken for ORC too, so then I guess that they are very alike |
11:21:41 | Araq | orc is a simple extension of arc. build a library for your C code, try --app:lib |
11:22:16 | PMunch | Hmm, is there a way to get more info on what package is causing this regex version mismatch error? |
11:23:52 | FromDiscord | <whisperdev> This is with arc. nim-#devel\lib\windows\registry.nim(58, 54) Error: expression cannot be cast to pointer |
11:24:21 | FromDiscord | <whisperdev> is this fixed in some newer versions of Nim? My is 1.5.1 |
11:24:45 | PMunch | Aha, it's apparently this package: https://github.com/citycide/glob |
11:24:45 | * | Q-Master quit (Ping timeout: 240 seconds) |
11:25:13 | FromDiscord | <flywind> I don't think the issue is fixed, see https://github.com/nim-lang/Nim/issues/14010 |
11:25:15 | disbot | β₯ .choosenim/toolchains/nim-1.2.0/lib/windows/registry.nim(58, 54) Error: expression cannot be cast to pointer ; snippet at 12https://play.nim-lang.org/#ix=2Gt8 |
11:26:50 | FromDiscord | <shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2Gta |
11:27:03 | FromDiscord | <shad0w> There isn't a convention that prevents me from doing |
11:27:29 | FromDiscord | <shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2Gtb |
11:27:35 | FromDiscord | <shad0w> is there ? |
11:27:45 | * | spiderstew quit (Quit: Konversation terminated!) |
11:27:58 | FromDiscord | <shad0w> like Capitalize typenames mean something special? |
11:28:15 | FromDiscord | <Rika> No |
11:28:26 | FromDiscord | <Rika> Other than self enforced convention, no |
11:28:29 | FromDiscord | <salvador> when we'll see nim's LLVM backend ? (is it already decided on Nim 2 ) ? |
11:28:37 | FromDiscord | <Rika> Well, caps enum will conflict with type |
11:28:47 | FromDiscord | <flywind> see nep1, may be useful https://nim-lang.org/docs/nep1.html#introduction-naming-conventions |
11:28:48 | FromDiscord | <Recruit_main707> Itβs not planned |
11:28:55 | FromDiscord | <Rika> Third party made nlvm |
11:29:10 | FromDiscord | <Rika> No plan for core dev to work on I believe |
11:30:08 | FromDiscord | <salvador> yeah , but i had hope for official one , β΅also it could fix most of problems ,, brings better async/corotine/channel |
11:30:41 | FromDiscord | <lqdev> how so? |
11:30:55 | FromDiscord | <salvador> LLVM has native support for async stuffs |
11:31:15 | FromDiscord | <lqdev> sounds bloated |
11:31:18 | FromDiscord | <Rika> It will bring it's own host of problems as well |
11:31:22 | PMunch | It would create a host of other problems tohugh |
11:31:35 | FromDiscord | <Rika> I just said that smh PMunch |
11:31:36 | PMunch | Like compiling for all the microcontroller stuff and the C interop we enjoy |
11:31:49 | PMunch | @Rika, beat me to it by seconds :P |
11:31:58 | FromDiscord | <Rika> Yeah I know ahaha |
11:32:12 | FromDiscord | <Imperatorn> I also thought there where plans for lvvm? |
11:32:25 | FromDiscord | <salvador> much better than supporting and maintaing C stuffs , for the entire lifetime: )) |
11:32:32 | FromDiscord | <Rika> Not really. |
11:32:54 | * | NimBot joined #nim |
11:32:59 | FromDiscord | <Rika> I kid on that remark. |
11:33:13 | FromDiscord | <salvador> yeah , i love it: ) much cooler |
11:33:24 | FromDiscord | <Rika> Then why even be here |
11:33:28 | FromDiscord | <shad0w> refering to the multi minute compile times ? |
11:33:33 | FromDiscord | <salvador> also like nim: )) |
11:33:39 | FromDiscord | <Rika> Or the massive binary size |
11:33:49 | FromDiscord | <Rika> Or that we can smoke rust in many places? |
11:34:13 | FromDiscord | <shad0w> we just happen to ? i dont think that was a goal : P |
11:34:26 | FromDiscord | <Rika> Yes I didn't say it as a goal |
11:34:47 | dom96 | Araq, seeing the awe above around NimForum and Karax. I think it would be cool to do more to market Karax, a dedicated website would go a long way to making people excited about it :) |
11:34:52 | JustASlacker | I like nim better than rust |
11:35:06 | FromDiscord | <Rika> I shall go now before I get too heated |
11:35:54 | * | Q-Master joined #nim |
11:35:56 | FromDiscord | <salvador> its not a problem at all , since we could have excellent result in performance and safety, BTW im not talking about Rust , its another monster ,, β΅talking about size just like you really targeting embedded systems : ) not a good target at-all! |
11:35:58 | JustASlacker | karax looks nice |
11:35:58 | FromDiscord | <shad0w> what rails did for Ruby : ) |
11:36:21 | FromDiscord | <shad0w> do irc people see it was a reply msg ? |
11:36:25 | FromDiscord | <lqdev> no |
11:36:31 | FromDiscord | <flywind> `Karax` is great, but is it easy to be Componential? |
11:36:39 | FromDiscord | <Rika> Not a problem for you might be a problem for me |
11:36:51 | FromDiscord | <Rika> Just like you don't worry about stuff I do |
11:37:03 | FromDiscord | <Rika> I shall go now |
11:37:03 | FromDiscord | <lqdev> @salvador yeah, now imagine a 100MB executable just for an OpenGL game |
11:37:05 | FromDiscord | <lqdev> welcome to rust |
11:37:13 | FromDiscord | <Rika> Please argue with someone more level headed than me right now |
11:37:28 | FromDiscord | <Imperatorn> Are Rust executables big? |
11:37:32 | FromDiscord | <lqdev> yes. |
11:37:39 | FromDiscord | <lqdev> extra thicc, one may say. |
11:37:48 | FromDiscord | <Imperatorn> Static linking or why? |
11:37:50 | FromDiscord | <shad0w> is llvm the cause ? |
11:37:51 | FromDiscord | <Rika> XXL size |
11:37:55 | FromDiscord | <Imperatorn> Oh |
11:38:12 | FromDiscord | <flywind> see https://users.rust-lang.org/t/rust-to-nim-a-comparison/52096/38 |
11:38:15 | FromDiscord | <lqdev> no flippin' clue, my friend always says "lack of a stable ABI and monomorphization" |
11:38:29 | FromDiscord | <Imperatorn> Naa, shouldn't be lvvm |
11:38:30 | FromDiscord | <shad0w> the wut and wut |
11:39:04 | FromDiscord | <whisperdev> Karax is used even less than Nim. You cant find anything about Karax basically XD |
11:39:32 | FromDiscord | <Imperatorn> As an example in D we have 3 compilers and if we compare exe sizes it's not much different from the lvvm one |
11:40:00 | FromDiscord | <Imperatorn> So maybe Rust is just not optimized yet? π€ |
11:40:02 | dom96 | flywind: yeah, you can have components fairly easily :) |
11:40:20 | FromDiscord | <shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2Gtg |
11:40:55 | * | Q-Master quit (Ping timeout: 246 seconds) |
11:40:56 | FromDiscord | <salvador> i dont think its about you! or personal will matters!! β΅so you could see how much ppl are using Rust or huge jvm based langs: )β΅β΅the community and developing features faster , safer are more important |
11:41:21 | FromDiscord | <lqdev> no. |
11:41:30 | FromDiscord | <lqdev> rust's community is bigger because it has corporate backing from mozilla |
11:41:38 | FromDiscord | <lqdev> we? we don't have anyone to promote us |
11:41:43 | dom96 | <Araq> fwsgonzo: --noMain is broken with arc :-) |
11:41:50 | dom96 | That explains why my device is crashing too :O |
11:41:56 | FromDiscord | <lqdev> a bigger community means more packages |
11:41:58 | dom96 | Do we have an issue for this? |
11:42:06 | FromDiscord | <flywind> I tried to make a UI library base on Karax, but failed https://github.com/planety/karax/blob/devel/app.nim. |
11:42:09 | Araq | dom96, yeah, and --app:lib might be a workaround |
11:42:12 | FromDiscord | <salvador> yea , indeed, but not the only reason ,, |
11:42:38 | dom96 | Araq, cool, got an issue so I can track it? |
11:42:54 | FromDiscord | <lqdev> a lot of people also seem to like rust for its inclusive and politically correct community |
11:42:54 | dom96 | Also, big thanks to fwsgonzo for reproducing this! |
11:43:01 | FromDiscord | <Idefau> i like nim because its epic |
11:43:14 | FromDiscord | <salvador> you just mentioned `nlvm` β΅this project developed by few people |
11:43:14 | FromDiscord | <lqdev> which is like, ffs. why does a language have to do anything with politics excuse me? |
11:43:17 | FromDiscord | <flywind> It is not as easy as `React` to build UI library. |
11:43:35 | dom96 | lqdev: because politics affect everything and everyone |
11:44:18 | FromDiscord | <Idefau> my school politics say i cant install nim on the school's CS lab :(β΅I did it anyway π |
11:44:19 | FromDiscord | <lqdev> dom96: yeah, but there are places to spread your political opinion. nim doesn't enforce inclusiveness on everyone and doesn't scream with a big "BLACK LIVES MATTER" banner on its website and it's fine. |
11:44:45 | dom96 | Nim could do with a hell of a lot more inclusivity in its community |
11:45:01 | FromDiscord | <lqdev> no. please let's not enforce politics onto people. |
11:45:20 | dom96 | What? How does inclusivity equal politics? |
11:45:29 | FromDiscord | <lqdev> let this be my one place where i can talk about a programming language and my projects without feeling like i'm bombarded by opinions i don't support. |
11:46:23 | JustASlacker | do people really decide on a programming language based on the diversity or blm support? |
11:46:38 | FromDiscord | <flywind> The discussion should move to off-topic I think |
11:46:38 | FromDiscord | <lqdev> i'm sure that at least some people do |
11:46:46 | FromDiscord | <lqdev> @flywind yeah, good idea |
11:47:29 | dom96 | The inclusivity of our community and this channel in particular shouldn't be considered "off-topic" and it has absolutely nothing to do with politics. |
11:48:15 | dom96 | But yes, we should discuss the politics of Rust and other programming languages in off-topic |
11:48:18 | FromDiscord | <shad0w> justASlacker: i dont think so. but it's better to have a stratergy for it than pretend it doesn't exist |
11:48:26 | FromDiscord | <Idefau> i still dont know what this nim thing is |
11:48:38 | Zoom[m] | Do we have any iterator transformers, such as `stepBy` |
11:48:51 | Zoom[m] | * Do we have any iterator transformers, such as `stepBy`? |
11:49:29 | FromDiscord | <salvador> that was about `LLVM` , they brought off-topics here xDD ,, β΅i dont think its relevent to mention politics or company name behind X , β΅β΅its obvious that Nim could reach much faster development speed , less issues,, and maturity in some places like corotines , |
11:50:00 | FromDiscord | <flywind> See https://github.com/nim-lang/RFCs/issues/295 |
11:50:02 | disbot | β₯ next steps for CPS ; snippet at 12https://play.nim-lang.org/#ix=2Gti |
11:50:04 | FromDiscord | <flywind> May be useful |
11:50:06 | FromDiscord | <lqdev> nim's coro are far from mature though |
11:50:16 | FromDiscord | <salvador> (edit) "that was about `LLVM` , they brought off-topics here xDD ,, β΅i dont think its relevent to mention politics or company name behind X , β΅β΅its obvious that Nim could reach much faster development speed , less issues,, and maturity in some places like corotines ," => "sent a long message, see http://ix.io/2Gtj" |
11:50:27 | FromDiscord | <lqdev> ah |
11:50:28 | FromDiscord | <lqdev> i misread |
11:51:18 | FromDiscord | <flywind> `llvm` backend would be better if more people contribute to and use it https://github.com/arnetheduck/nlvm |
11:52:12 | FromDiscord | <salvador> yeah , maybe if its could be one of official backends |
11:52:20 | FromDiscord | <salvador> (edit) "its" => "it" |
11:54:25 | FromDiscord | <InventorMatt> would it really add any significant difference compared to the existing backends? |
11:56:50 | dom96 | salvador: it's definitely relevant to know what political contributions a company or organisation is making |
11:57:00 | dom96 | (or any contributions for that matter) |
11:57:20 | JustASlacker | does nim make any sizable contribution to anything? |
11:58:12 | dom96 | Not as far as I'm aware. |
11:59:34 | FromDiscord | <lqdev> i'd much prefer if nim stayed politically neutral |
12:00:28 | JustASlacker | well, weapons research always needs additional funds |
12:00:47 | FromDiscord | <lqdev> america moment |
12:03:30 | FromDiscord | <salvador> i just wanted to know about future roadmaps , and sperared discussion about politicals, |
12:03:49 | PMunch | JustASlacker, we just make contributions to nice code :) |
12:04:09 | JustASlacker | yay for nice code |
12:04:17 | dom96 | salvador: You didn't :) |
12:04:40 | FromDiscord | <salvador> talking about Rust means politicals? xDD wow , |
12:04:47 | FromDiscord | <flywind> You could find some roadmaps in nim forum |
12:04:57 | PMunch | Where do you think the rust belt comes from? /s |
12:05:10 | Zoom[m] | #295 was an interesting read and I find myself mostly agreeing with disruptek Threads are easier for me to reason about |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:34 | * | supakeen joined #nim |
12:06:56 | FromDiscord | <Rika> I am back |
12:07:04 | FromDiscord | <Rika> Suddenly got political |
12:07:06 | FromDiscord | <salvador> i couldnt find a clear decision about llvm , so i asked here , i wanna know core team's opinion |
12:07:06 | PMunch | Hi back, I'm PMunch |
12:07:10 | Zoom[m] | And the numbers speak for themselves. They don't mean anything, if the interface is contrived |
12:07:12 | FromDiscord | <Rika> Ok dad |
12:07:23 | dom96 | Zoom[m], what numbers? |
12:07:35 | PMunch | I'm seriously starting to think I might have a bastard child somewhere.. |
12:07:52 | dom96 | With that beard of your PMunch I wouldn't be surprised ;) |
12:07:55 | dom96 | *yours |
12:08:01 | PMunch | dom96, a website for Karax would indeed be nice |
12:08:17 | PMunch | Haha, how does beard == child? :P |
12:08:55 | PMunch | !eval echo NimVersion |
12:08:57 | NimBot | 1.4.2 |
12:09:02 | PMunch | ^ narimiran |
12:09:05 | FromDiscord | <Rika> If you had sex on February of around the 2000s perhaps you did |
12:09:20 | dom96 | PMunch, well... I won't spell it out lol |
12:09:30 | PMunch | Haha :P |
12:09:36 | * | Q-Master joined #nim |
12:09:38 | narimiran | PMunch: nice! did you find the offending package(s)? |
12:09:53 | PMunch | Yup, it was the glob package |
12:09:58 | Zoom[m] | dom96: some benchmarks in this Issue. i understand that's too unrealistic of an example to take them too seriously |
12:10:17 | PMunch | It had pinned it's regex version to 0.17.x, so it conflicted with the newer 0.18.0 |
12:11:23 | Zoom[m] | BTW, any rules on repeating questions before being banned here? Just in case... |
12:11:41 | narimiran | Zoom[m]: what do you mean repeated questions? |
12:11:42 | narimiran | Zoom[m]: what do you mean repeated questions? |
12:11:43 | narimiran | Zoom[m]: what do you mean repeated questions? |
12:11:56 | FromDiscord | <Rika> Lol |
12:12:25 | FromDiscord | <Rika> Zoom no, that's absurd, as long as it isn't annoyingly repeated like what narimiran did haha |
12:12:58 | * | audiofile quit (Quit: Connection closed) |
12:13:09 | Zoom[m] | Righty... Do we have any iterator transformers? I'd like a stepBy. We have countUp/Down with a step |
12:13:27 | PMunch | Zoom[m], we have a very open and accepting community here, even to repetitionists |
12:13:42 | PMunch | Zoom[m], hmm, not really |
12:14:02 | PMunch | Iterators in Nim can be a lot of things, so there isn't an easy way to create a general case stepBy |
12:14:18 | PMunch | (apart from just iterating all the values and discarding the unused values) |
12:14:57 | * | Q-Master quit (Ping timeout: 256 seconds) |
12:15:46 | Zoom[m] | Isn't it inevitable in some cases, such as iterating over string lines? |
12:16:00 | PMunch | What'd mean? |
12:16:18 | FromDiscord | <Rika> Yeah I believe Nim has kinda poor support for iterators |
12:16:30 | FromDiscord | <Rika> In std I mean |
12:16:50 | FromDiscord | <Rika> There's always that iterator lib I keep on forgetting the name of |
12:17:28 | Zoom[m] | PMunch: you can't index a stream, so you'd need to discard the input to skip |
12:19:10 | ForumUpdaterBot | New thread by Lihf8515: I would like to know how this affects SSL when compiled with Release and danger mode., see https://forum.nim-lang.org/t/7202 |
12:33:06 | * | Q-Master joined #nim |
12:38:59 | PMunch | Zoom[m], exactly |
12:39:25 | PMunch | Think of Nim iterators as a stream, and you realise why there isn't a stepBy |
12:40:10 | PMunch | I mean a simple convenience that wraps an iterator in an iterator that discards a couple entries before returning it to you could be a nice thing to have |
12:40:49 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
12:41:37 | * | pbb joined #nim |
12:42:57 | * | PMunch quit (Quit: Leaving) |
12:45:02 | FromDiscord | <sealmove> @PMunch I found another bug caused for the same reason π although it doesn't cause your tests to fail |
12:45:02 | Zoom[m] | alehander92 you here? |
12:46:21 | FromDiscord | <sealmove> these bugs are really fun, lol |
12:47:33 | * | PMunch joined #nim |
12:48:30 | Zoom[m] | clyybber: are you here? |
12:55:36 | * | tane joined #nim |
12:55:52 | FromDiscord | <sealmove> @PMunch check this out! I wrote a macro called `createConditionalParser` that wraps the macro `createParser`. Do you like the idea of writing more macros like this as plugins to your project? https://github.com/sealmove/n4n6/blob/main/parsers/windows_link_file.nim |
12:58:00 | FromDiscord | <fwsgonzo> is it possible to define a function that returns two strings? |
12:58:12 | PMunch | @fwsgonzo, yes |
12:58:29 | PMunch | sealmove, ooh how did you do that? |
12:59:04 | PMunch | Aah, you somehow generate the output that should go to binaryparse? |
12:59:08 | PMunch | I'm all for it :) |
12:59:37 | PMunch | @fwsgonzo, to elaborate; you can return a tuple containing two strings |
13:00:50 | PMunch | Like so: https://play.nim-lang.org/#ix=2Gtw |
13:01:54 | FromDiscord | <sealmove> yeee, first I generate a `createParser` invocation forwarding it the body passed to `createConditionalParser`, then I generate "custom" parser that uses the parser generated by `createParser` and adds a condition on top of it (and it outputs an Option). |
13:02:47 | FromDiscord | <sealmove> would you like to have these "plugins" in your repo in a separate directory? or in a different repo? |
13:08:26 | Araq | don't have "plugins" if you can avoid it. plugins imply really solid API design |
13:08:37 | Araq | and "really solid design" implies "hard" |
13:09:12 | FromDiscord | <sealmove> Araq I think in this case the API is pretty good. Adding more complexity to the DSL is a inferior solution. |
13:09:45 | Araq | simply offer the features that you need and leave out the features that you don't. And then ignore your users, it'll be great. |
13:09:48 | FromDiscord | <sealmove> or maybe "plugin" is the wrong word of what I am doing |
13:10:43 | FromDiscord | <sealmove> what would you call a macro that wraps another macro? π |
13:11:00 | narimiran | Marco. |
13:11:11 | Araq | Pollo! |
13:13:23 | PMunch | Hmm, just having it in a folder so that you can do `import binaryparse/conditionals` or something like that would be great |
13:13:40 | FromDiscord | <sealmove> yeah, I think so too π |
13:17:57 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GtA |
13:21:03 | * | matthias_ joined #nim |
13:24:31 | Araq | most likely you want some explicit calling convention |
13:25:59 | FromDiscord | <fwsgonzo> in this case its nim to nim, so hopefully no problems like that |
13:38:43 | matthias_ | Is a pragma the only way for a macro to get access to a `proc`'s actual AST? E.g., if I do `someMacro(someProc)` the macro only sees `Ident "someProc"`, is there any way to get the AST from that like a pragma receives? |
13:39:44 | FromDiscord | <flywind> `getImpl`? |
13:39:55 | leorize[m]1 | getImpl probably work, but the parameter would have to be `typed` so that someProc resolves into a sym |
13:42:32 | * | hmmm joined #nim |
13:43:29 | hmmm | why every single syntax error that has nothing to do with identation get flagged as "invalid indentation" :| |
13:44:13 | hmmm | I mean I would be grateful for something like "you missed a ) you dumbnut" |
13:45:22 | matthias_ | Thanks! That got it. Some day I'll figure out all these little things with macros. :) |
13:45:24 | matthias_ | Maybe I need to start building a cheat sheet |
13:47:04 | leorize[m]1 | hmmm: it's because of the way the compiler currently works |
13:48:46 | leorize[m]1 | indentation is checked during AST building afaik, and I don't think we have wired a lot of analysis logic there other than the basics |
13:52:16 | hmmm | leo ty, is this something that will get worked on in the future? as a newbie half of my errors are mismatch type and I know where to look, the other half are indentation and it's always a slog |
13:52:22 | * | vsantana joined #nim |
13:52:25 | FromGitter | <alehander92> Zoom i am around sometimes |
13:52:29 | FromGitter | <alehander92> Zoom[m] * |
13:52:59 | Zoom[m] | alehander92: I think I cought a bug in zero_functional |
13:53:35 | FromGitter | <alehander92> possible! |
13:53:44 | Zoom[m] | Tried to add a modifier with the DSL and it won't compile. Even the filter example gives me an error |
13:53:46 | FromGitter | <alehander92> please, open an issue :) |
13:53:59 | FromGitter | <alehander92> hmm, sounds strange |
13:54:18 | FromGitter | <alehander92> i don't look at it a lot these days, but later i might be able to at least look at the issue |
13:54:22 | leorize[m]1 | hmmm: I think it will be worked on eventually, those stuff takes time and we currently have higher priority elsewhere |
13:54:29 | FromGitter | <alehander92> bb |
13:55:09 | Zoom[m] | `zero_functional.nim(959, 24) Error: undeclared identifier: 'newIdentNode'` |
13:59:17 | FromDiscord | <shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2GtO |
13:59:41 | leorize[m]1 | hmmm: it would help if you open an issue requesting better error messages |
14:00:54 | FromDiscord | <shad0w> doesn't this kindda waste space if all i care about is 0..10 ? |
14:02:01 | FromDiscord | <shad0w> (edit) "0..10" => "`0..10`" |
14:06:51 | leorize[m]1 | !eval echo sizeof(set[range[0i8..10]]) |
14:06:52 | NimBot | Compile failed: /usercode/in.nim(1, 26) Error: type mismatch |
14:07:44 | leorize[m]1 | !eval echo sizeof(set[range[0i8..10i8]]) |
14:07:46 | NimBot | 2 |
14:08:43 | leorize[m]1 | !eval echo sizeof(set[range[0..10]]) |
14:08:45 | NimBot | 2 |
14:09:41 | Prestige | PMunch: hey |
14:10:10 | leorize[m]1 | shad0w: how did you make a 8kb set? |
14:10:54 | FromDiscord | <shad0w> leorize: var a = {0..10} |
14:11:05 | FromDiscord | <shad0w> then echo sizeof a |
14:11:09 | FromDiscord | <lqdev> i think that's because 0..10 is interpreted as a slice of uint16 |
14:11:23 | FromDiscord | <shad0w> why |
14:11:49 | FromDiscord | <lqdev> the manual mentions that nim uses the largest possible datatype to represent integers in syntax |
14:11:51 | FromDiscord | <lqdev> i think that's why |
14:11:52 | FromDiscord | <shad0w> !val echo sizeof({0..10}) |
14:11:56 | FromDiscord | <shad0w> (edit) "!val" => "!eval" |
14:12:10 | FromDiscord | <shad0w> !eval echo sizeof({0..10}) |
14:12:11 | FromDiscord | <lqdev> !eval echo {0..10}.sizeof |
14:12:15 | NimBot | 8192 |
14:12:15 | NimBot | 8192 |
14:12:19 | FromDiscord | <lqdev> yeah |
14:12:21 | FromDiscord | <lqdev> told ya |
14:12:27 | Araq | fwsgonzo: https://github.com/nim-lang/Nim/pull/16251/files |
14:12:29 | disbot | β₯ fixes #16249 [backport:1.4] |
14:12:48 | FromDiscord | <shad0w> . |
14:13:09 | FromDiscord | <lqdev> well, it's reasonable to assume that you'll want to use u?int16 by default |
14:13:17 | FromDiscord | <shad0w> no ? |
14:13:19 | FromDiscord | <lqdev> yes? |
14:13:34 | FromDiscord | <lqdev> if it used ranges you wouldn't be able to do `{1..5} + {10..15}` |
14:13:58 | Araq | type R = range[0..10]; {R(0)..R(10)} |
14:14:06 | FromDiscord | <lqdev> and you can always restrict the range like araq did |
14:14:19 | Araq | sometimes the compiler is a dog and you need to help it |
14:14:22 | leorize[m]1 | edits doesn't work for irc |
14:14:31 | FromDiscord | <Rika> !eval type R = range[0..10]; echo sizeof {R(0)..R(10)} |
14:14:34 | NimBot | 2 |
14:14:37 | FromDiscord | <Rika> interested in the size |
14:14:38 | FromDiscord | <Rika> ooh nice |
14:14:47 | Zevv | "sometimes the compiler is a dog and you need to help it". I'm saving that one |
14:14:52 | leorize[m]1 | shad0w: because that set can contain more than 0..10 |
14:15:01 | FromDiscord | <shad0w> i still cant do {-10..10} + {1..5} if it assumes its uint8 |
14:15:12 | leorize[m]1 | !eval echo typeof({0..10}) |
14:15:14 | NimBot | set[range 0..65535(int)] |
14:15:15 | FromDiscord | <lqdev> it doesn't assume uint8 |
14:15:39 | FromDiscord | <shad0w> why does it assume my set will be positive 16 bits be default ? i'd tell it if i want unsigned ? |
14:16:05 | FromDiscord | <lqdev> that's simply the most common use case |
14:16:13 | FromDiscord | <shad0w> : / |
14:16:35 | FromDiscord | <lqdev> as always, you can do {1.int16..10.int16} |
14:16:36 | FromDiscord | <shad0w> i wouldn't even have noticed this if i wasnt looking |
14:16:40 | Araq | the spec says that and the compiler tries to follow it |
14:16:43 | FromDiscord | <mratsim> just to type Foo = set[int16], creating a type in Nim is really easy |
14:17:06 | FromDiscord | <shad0w> and keep on allocation 8kbs along everywhere : P |
14:17:21 | FromDiscord | <shad0w> that's alright. i can see subranges get me out of this |
14:17:38 | FromDiscord | <lqdev> if you're really worried about allocating a measly 8KiB you can always specify the type of your set explicitly |
14:17:41 | FromDiscord | <shad0w> but if i didn't look. i'd just assume it only allocates 0..10 |
14:17:50 | Araq | you can write an RFC that it sucks |
14:18:08 | FromDiscord | <lqdev> !eval var x: set[range[1..10]] = {5..7}; echo x.typeof |
14:18:09 | NimBot | Compile failed: /usercode/in.nim(1, 28) Error: type mismatch: got <set[range 0..65535(int)]> but expected 'set[range 1..10(int)]' |
14:18:10 | Araq | because I agree, it's foolish guesswork |
14:18:22 | FromDiscord | <lqdev> yeah i guess that's a bit bad |
14:18:35 | Araq | form the days before I knew how to design PLs |
14:18:38 | FromDiscord | <shad0w> it doesn't suck per say. it can see what it gets me. but i'd like to tell it i want that and not assume i want that |
14:18:41 | FromDiscord | <mratsim> there is no allocation, it's on the stack. The cost is more in terms of cache line used. |
14:18:57 | FromDiscord | <Quibono> Anyone on who can help debug an issue I'm having with websockets? I'm totally lost. |
14:19:05 | FromDiscord | <lqdev> !eval var x = set[range[1..10]]({5..7}); echo x.typeof |
14:19:06 | NimBot | Compile failed: /usercode/in.nim(1, 26) Error: type mismatch: got <set[range 0..65535(int)]> but expected 'set[range 1..10(int)]' |
14:19:44 | FromDiscord | <shad0w> while we're at it. can we have sets of objects : P |
14:19:52 | FromDiscord | <lqdev> import sets |
14:19:59 | FromDiscord | <lqdev> https://nim-lang.org/docs/sets.html |
14:20:15 | * | Vladar quit (Quit: Leaving) |
14:25:36 | FromDiscord | <shad0w> uhm, what's a cache line ? |
14:25:48 | Zevv | it's hardware |
14:26:01 | FromDiscord | <Quibono> Yay, fixed my issue, apparently I needed to use waitfor. |
14:26:15 | FromDiscord | <mratsim> The CPU can only retrieve data 64B chunk by 64B chunk, that's called a cache line. |
14:26:18 | * | waleee-cl joined #nim |
14:26:34 | Zevv | its tightly coupled memory on your CPU that remembers the last few things you did in memory; it doesn't actually go all the way to your RAM chips but stays there for a bit |
14:26:37 | FromDiscord | <mratsim> they can load 1 or 2 cache line per cycle |
14:26:38 | FromDiscord | <shad0w> like a `word` ? |
14:26:44 | FromDiscord | <mratsim> at least for Intel |
14:26:45 | FromDiscord | <mratsim> no |
14:26:46 | Zevv | as long as you keep working in that local area, it'll be blazingly fast |
14:26:55 | Zevv | it's typically tens or hundreds of bytes |
14:27:01 | FromDiscord | <mratsim> a word on 64B is 8B only a cache line is 64B |
14:27:22 | FromDiscord | <mratsim> well 64B usually because Samsung CPU for phones are 128B for example |
14:27:32 | FromDiscord | <mratsim> this matters a lot for high performance computing |
14:27:44 | Zevv | it makes all the difference if you know what you're doing |
14:27:51 | FromDiscord | <mratsim> but Nim default sets are pretty efficient because they are on the stack. |
14:28:30 | Prestige | PMunch: did you need something ? |
14:28:40 | FromDiscord | <mratsim> the main issue with them is that they don't support random item pop-ing basically but that's a design tradeoff with what they provide |
14:28:45 | FromDiscord | <shad0w> wut |
14:29:05 | FromDiscord | <mratsim> on 64-bit CPU sorry |
14:29:27 | narimiran | ah, ye old `for x in mySet: y = x; break` popping |
14:29:41 | Araq | hardly a design tradeoff, when the code was written I had no bitops.nim for finding the first set bit |
14:30:46 | * | Vladar joined #nim |
14:30:47 | Araq | what the heck is up with our CIs... |
14:32:00 | FromDiscord | <mratsim> @Araq even if you had bitops, random poping from a structure that doesn't support random access is complex |
14:32:06 | FromDiscord | <shad0w> doesn't 64 bit mean a 64 bit ISA |
14:32:37 | Araq | what do you mean, "doesn't support random access", incl and excl are O(1) for bitsets |
14:32:51 | Zevv | I hope so :) |
14:32:59 | Araq | it's packed but still random accessible |
14:33:36 | FromDiscord | <mratsim> how do you exclude the randomly chosen 4th item of a set containing {1, 10, 3000, 5000}? |
14:34:16 | FromDiscord | <mratsim> if you want to read more: https://github.com/mratsim/weave/issues/5 |
14:34:17 | disbot | β₯ Refactor the bitset data structure |
14:35:23 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2Gu1 |
14:35:40 | FromDiscord | <fwsgonzo> nice @Araq |
14:35:41 | FromDiscord | <mratsim> This is the way to do from a uint64 bitset |
14:35:59 | Araq | I think we are talking about different things |
14:36:38 | Araq | to "pop" an item from a bitset, find an element via fsb. then excl it. |
14:36:52 | FromDiscord | <mratsim> So my need was: I'm running on a CPU with say 128 cores.β΅half of them are busy and I need to pick a core at random from the other 64 to steal work from. |
14:37:03 | FromDiscord | <mratsim> at random being key |
14:37:49 | FromDiscord | <mratsim> and picking at random from a set is needed for any monte-carlo simulation, my go playing bot also needs that for example. |
14:38:20 | Araq | you have some constraint here, "random", that I don't |
14:38:33 | FromDiscord | <mratsim> This is called "select", pick the n-th set bit from a bitset |
14:38:51 | FromDiscord | <mratsim> but I was talking about random for the start |
14:38:53 | Araq | I missed the "random" word, sorry |
14:39:00 | FromDiscord | <mratsim> np |
14:39:00 | Araq | :-) |
14:39:17 | Araq | I thought it's about "pop", we have seq.pop and not set.pop |
14:39:33 | FromDiscord | <mratsim> set.pop was added in the summer iirc |
14:39:39 | FromDiscord | <mratsim> or at least tables.pop |
14:39:50 | Araq | I mean bitset.pop |
14:39:56 | FromDiscord | <mratsim> ah |
14:45:55 | FromDiscord | <Quibono> Sorry for newb question, how do I check if a string is within another string? |
14:46:22 | narimiran | "first" in "second" |
14:46:26 | Araq | import strutils |
14:46:35 | Araq | "bc" in "abcdefg" |
14:46:43 | Araq | narimiran, CI! |
14:46:44 | FromDiscord | <Quibono> Ahh I need strutils, thanks |
14:46:58 | FromDiscord | <Quibono> Awesome language btw @Araq |
14:47:06 | Araq | clyybber removed some crucial logic from testament, please add it back |
14:47:17 | narimiran | Araq: i thought clyybber/timothee were on it. ok, will do it |
14:47:27 | Araq | well ask them |
14:47:33 | Araq | but it's super annoying |
14:48:29 | Araq | Quibono, thanks, glad you like it |
14:49:13 | FromDiscord | <Quibono> I was literally complaining to a friend "I wish there was something with the readability of python but /fast/" and his response was "Uh yeah there is, it's Nim" |
14:49:16 | FromDiscord | <Quibono> Love at first sight |
14:50:46 | * | hmmm quit () |
14:52:20 | Araq | :-) |
14:52:53 | narimiran | Araq: looking into it. but it still remains to be seen (after it is fixed), why the problems started just now, all of the sudden |
14:52:58 | * | matthias_ quit (Remote host closed the connection) |
14:54:39 | narimiran | "error: RPC failed; curl 18 transfer closed with outstanding read data remaining" :/ |
14:56:17 | narimiran | "fatal: expected flush after ref listing" |
15:00:36 | leorize[m]1 | something is wrong with CI? |
15:00:43 | leorize[m]1 | I can take a quick look if needed |
15:03:00 | PMunch | Prestige, hi, sorry. I was off printing something |
15:03:04 | PMunch | 3D printing* |
15:03:13 | PMunch | I just had some issues with nimdom |
15:03:17 | PMunch | nimdow* |
15:03:28 | PMunch | It doesn't seem to properly launch my startup programs.. |
15:03:37 | Prestige | ah, can you open an issue? |
15:03:46 | PMunch | Sure |
15:04:02 | Prestige | Working atm but I can check it out in like, 8 hrs |
15:05:37 | narimiran | leorize[m]1: yeah, everything fails with the above error |
15:06:11 | FromDiscord | <mratsim> Github is broken right now |
15:06:19 | narimiran | oh, it is not us? |
15:06:19 | leorize[m]1 | then it's just github |
15:06:19 | Prestige | PMunch: also if you feel like debugging it, you could enable logging and see if any errors are thrown |
15:06:26 | FromDiscord | <mratsim> all the Status repo have the same issue on git submodule |
15:06:32 | narimiran | yay |
15:06:50 | PMunch | It's super weird |
15:06:59 | PMunch | I can see the process in htop |
15:07:05 | PMunch | It just doesn't appear to work |
15:07:12 | Prestige | hm, that's odd |
15:07:27 | Prestige | was this after a log out and log back in? |
15:07:38 | PMunch | Yeah, I just rebooted |
15:07:55 | Prestige | ah, should be fine then. Idk |
15:07:59 | PMunch | It's the watch -n1 -p settime.sh command that I use to update the bar |
15:08:32 | FromDiscord | <mratsim> it's lovely when doc PR crash on git ls-remote https://media.discordapp.net/attachments/371759389889003532/784435978101850122/unknown.png |
15:10:24 | leorize[m]1 | https://www.githubstatus.com/ <- Github doesn't seem to be aware yet |
15:11:23 | FromDiscord | <mratsim> I've had this since this morning |
15:14:04 | * | Gustavo6046 is now known as NameThatExists |
15:14:14 | * | NameThatExists is now known as Gustavo6046 |
15:15:21 | narimiran | nim repo has this error since yesterday |
15:16:27 | FromDiscord | <dom96> Gotta love distributed systems becoming centralised |
15:19:23 | ForumUpdaterBot | New question by quasi: Using pairs on the lines iterator, see https://stackoverflow.com/questions/65146107/using-pairs-on-the-lines-iterator |
15:20:50 | * | habamax quit (Ping timeout: 256 seconds) |
15:22:39 | leorize[m]1 | does anyone knows that Nim has enumerate now? https://nim-lang.org/docs/enumerate.html |
15:23:00 | leorize[m]1 | we really have to expose these things somewhere... |
15:23:17 | FromDiscord | <flywind> known issue |
15:23:41 | FromDiscord | <flywind> see https://github.com/nim-lang/Nim/issues/16046 |
15:23:42 | disbot | β₯ No link to std/exitprocs in docs (+enumerate,jsonutils etc) |
15:25:46 | FromDiscord | <hugogranstrom> I feel like enumerate is the kind of thing that you shouldn't have to import to use. It should just work |
15:26:11 | narimiran | well, there is pairs iterator for most of the things |
15:26:19 | narimiran | (not for lines) |
15:26:46 | narimiran | so you already can do `for i, x in someSeq`, without any imports |
15:27:40 | FromDiscord | <hugogranstrom> Yes that's what I'm used to but then for some things it "randomly" (ie no pairs defined) and then I get confused hehe |
15:28:44 | FromDiscord | <hugogranstrom> Are there any downsides to importing it by default other than cluttering the namespace? |
15:29:13 | Gustavo6046 | The documents on learning Nim in the Learn page are kind of confusing. I always fail to remember anything I learn from them. |
15:29:14 | FromDiscord | <lqdev> bloating system.nim probably |
15:29:30 | Gustavo6046 | I think there was a kind of struct that was moved around, and another kind that lies in the heap and is referenced or something? |
15:29:31 | FromDiscord | <lqdev> araq is quite against adding new stuff to system |
15:30:24 | FromDiscord | <haxscramper> Maybe put it in `sequtils` then. What is the reason for a separate module that contains exactly one macro and nothing else |
15:30:43 | narimiran | what if you want to enumerate something that's not a seq? |
15:30:46 | Gustavo6046 | I had read them already, now I have to do it again.... |
15:30:47 | FromDiscord | <hugogranstrom> Yeah, sequtils and strutils |
15:31:14 | narimiran | it had to be a separate new module |
15:31:22 | Gustavo6046 | This is like school, you're spoonfed everything, and you retain nothing. I really like the language's premise, and I find the documentation to be of good quality, but I think something more... interactive... would be delightfully effective. |
15:31:26 | FromDiscord | <haxscramper> narimiran: `sequtils` already works for anything that is `items`-iterable, |
15:31:40 | narimiran | putting it into an existing one broke important packages because some packages used their own `enumerate` |
15:31:41 | Gustavo6046 | I mean with regards to learning, of course. |
15:31:52 | FromDiscord | <hugogranstrom> Oh |
15:32:36 | FromDiscord | <hugogranstrom> That's a more convincing argument. |
15:33:34 | FromDiscord | <hugogranstrom> Then we "just" change them to use the correct one π |
15:33:56 | FromDiscord | <hugogranstrom> unless their version is more sofisticated that is |
15:34:26 | FromDiscord | <lytedev> Hey, thanks! You were totally right! I changed it to "^\d{9}$" π |
15:34:40 | FromDiscord | <lytedev> (edit) ""^\d{9}$"" => "`re"^\d{9}$"`" |
15:43:09 | * | sacredfrog joined #nim |
15:50:14 | FromDiscord | <exelotl> > Gotta love distributed systems becoming centralisedβ΅ikr freaking epic |
15:51:51 | * | suchasurge quit (Quit: Ping timeout (120 seconds)) |
15:52:11 | * | suchasurge joined #nim |
16:21:11 | * | crem quit (Ping timeout: 244 seconds) |
16:22:01 | * | PMunch quit (Quit: Leaving) |
16:32:11 | * | crem joined #nim |
16:34:59 | * | superbia joined #nim |
16:39:05 | * | Gustavo6046 quit (Quit: WeeChat 2.9) |
16:39:20 | * | Gustavo6046 joined #nim |
16:54:03 | FromDiscord | <lytedev> is there a way to get regex match captures without first setting up a `var`? |
16:57:30 | FromDiscord | <Digitalcraftsman> Does anyone know if the Nim-compiler is able to transform an expression like `someNumber in 18..65` into `18 < someNumber and someNumber < 65`?β΅β΅`someNumber in 18..65` is (subjectively) easier to read than `18 < someNumber and someNumber < 65` and an alternative to `18 < someNumber < 65`β΅ which doesn't seem be supported in Nim without using macros |
16:59:15 | FromDiscord | <Digitalcraftsman> (edit) "65`?β΅β΅`someNumber" => "65`? My main concern is that this approach is not very performant.β΅β΅`someNumber" |
17:01:04 | mipri | yeah, with a rewriting macro |
17:01:36 | * | hnOsmium0001 joined #nim |
17:01:50 | mipri | https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros |
17:02:17 | FromDiscord | <lqdev> @Digitalcraftsman actually the performance is the same |
17:02:26 | FromDiscord | <lqdev> `18..65` does not allocate any memory |
17:02:37 | FromDiscord | <lqdev> it's the same as storing these two variables on the stack |
17:02:44 | FromDiscord | <lqdev> and the C compiler can easily optimize this case |
17:02:47 | federico3 | Upcoming CCC https://events.ccc.de/2020/09/04/rc3-remote-chaos-experience/ some talks about Nim could be welcome! |
17:06:00 | * | vicfred joined #nim |
17:06:05 | * | habamax joined #nim |
17:08:56 | FromDiscord | <Digitalcraftsman> thanks @lqdev. I've assumed that but not so much familiar with Nim's computer-internals |
17:10:56 | FromDiscord | <dom96> federico3: ooh, tempting |
17:15:15 | Zoom[m] | Too bad the support for iterators is so underprioritized in the lang itself. Just a few minutes with zero_functional and I'm hitting some ridiculous bugs https://github.com/zero-functional/zero-functional/issues/66 If it was a language feature, it would be caught and fixed on a PR stage :( |
17:15:17 | disbot | β₯ Enumeration sticks to the first one in chain, doesn't enumerate actual iterations ; snippet at 12https://play.nim-lang.org/#ix=2Gv4 |
17:29:13 | planetis[m] | well i m glad nim is not filled with shitty fp ideas like map, unmap, filtered, |
17:29:13 | planetis[m] | unfiltered. I just can't read code like that. |
17:30:07 | planetis[m] | when im thinking of a useless module, sequtils comes in mind |
17:30:32 | planetis[m] | count it? comeone r u serious? |
17:30:39 | planetis[m] | come on |
17:31:10 | FromDiscord | <lytedev> is that sarcasm? sequtils is great! I had a blast semi-golfing with it in today's AoC |
17:31:21 | FromDiscord | <lytedev> I even used countIt specifically =D |
17:32:23 | FromDiscord | <dom96> fp is awesome when it's used right |
17:33:34 | Zevv | shame on you narimiran, getting away with part1 like that |
17:33:56 | narimiran | :) |
17:34:03 | Zevv | you're not even _trrying_ |
17:34:08 | narimiran | true |
17:34:30 | FromDiscord | <dom96> how's the AoC this year? similar to last year? Any surprises? |
17:34:37 | Zevv | nah slow start as always |
17:34:46 | mipri | nothing exciting so far. Tonight should be good since it's the weekend. |
17:34:46 | narimiran | we'll tell you after this weekend |
17:35:37 | mipri | I've mostly been surprised by the mistakes I'm seeing others make. Python including the line terminator was the worst offender last night. |
17:35:48 | Zevv | if all you have is a parser, everything looks like a gramma |
17:36:11 | mipri | also a lot of people discovered that regexes don't have implicit anchors on both ends. |
17:36:30 | Zevv | I'd like to point out that PEG's *do* |
17:36:47 | narimiran | @dom96 if you haven't seen Zevv's brilliant solution for today, you're missing out |
17:37:06 | Zevv | inkoppertje |
17:37:25 | mipri | the fun for me last night was taking my incredibly long part2 validation and shrinking it with a proc-local template. Not something a lot of languages can do... |
17:37:50 | FromDiscord | <dom96> narimiran: oooh, would love to see it, link? |
17:37:57 | FromDiscord | <dom96> will check later though, brb shop |
17:37:58 | Zevv | mipri: share |
17:38:05 | narimiran | it's all over the internet ;P |
17:38:11 | Zevv | ooh, that one! |
17:38:17 | Zevv | yeah that's crazy |
17:38:39 | narimiran | zevv, wait, did you clean it up? :'( |
17:38:50 | Zevv | well yes, is that not allowed? |
17:39:02 | Zevv | I aligned the rules and split one |
17:39:19 | mipri | I think seeing rough-cut solutions is fun too. |
17:39:39 | Zevv | true |
17:40:11 | narimiran | @dom96 https://github.com/zevv/aoc2020/tree/master/04 |
17:40:54 | Zevv | mipri: where's your day 3 |
17:41:55 | mipri | you mean day 4? |
17:42:05 | mipri | well, none of them are posted anywhere |
17:42:38 | Zevv | aw |
17:50:35 | reversem3 | is there a way to reset inim variables back to none ? |
17:50:53 | reversem3 | inim is the nim interpreter for cli |
17:53:15 | mipri | 'help' shows you its commands, which aren't many. I just quit and restart |
17:53:35 | reversem3 | yeah thats what I do now , ok thanks |
17:59:11 | narimiran | Zevv: regarding me not even trying - it might bite me later on, as this one feels like its gonna be reused (why would there be a field mentioned and then ignored?) |
18:02:56 | * | abm quit (Read error: Connection reset by peer) |
18:03:24 | FromDiscord | <lytedev> does the basic example here work for anybody? https://nim-lang.org/docs/asynchttpserver.htmlβ΅β΅I'm on choosenim's nim 1.4.2 -- should I be on something else? |
18:03:24 | * | abm joined #nim |
18:14:30 | Prestige | Is there an error message? |
18:15:33 | FromDiscord | <lytedev> sent a code paste, see https://play.nim-lang.org/#ix=2Gvv |
18:17:17 | mipri | that example doesn't work on 1.4.2, 1.4.0, 1.2.0, or 1.0.0 |
18:18:47 | FromDiscord | <lytedev> fair, but the error "undeclared field" has gotta be wrong, because I can flip over to the source and see the field there -- does it have something to do with it being a ref?β΅β΅am I stupid in the first place for trying to use asynchttpserver? haha |
18:19:27 | mipri | no, that wouldn't matter |
18:20:44 | mipri | you see the field there, but you don't see an export marker * next to it |
18:20:46 | * | thomasross joined #nim |
18:20:48 | mipri | so it's not visible to you |
18:23:54 | mipri | this works: https://play.nim-lang.org/#ix=2GvA |
18:28:33 | reversem3 | can the webmaster put this link into the learning path for nim? http://ssalewski.de/nimprogramming.html#_our_first_nim_program |
18:41:49 | * | rockcavera quit (Remote host closed the connection) |
18:43:38 | FromDiscord | <dom96> reversem3: the website is on github please make a PR: https://github.com/nim-lang/website |
18:44:52 | * | mbomba joined #nim |
18:46:04 | FromGitter | <deech> Is `getTypeImpl` the best way of statically get the parent of an object type? |
18:49:33 | * | rockcavera joined #nim |
18:49:41 | FromDiscord | <lytedev> thanks much! |
18:49:56 | FromDiscord | <whisperdev> Can anyone explain me this fizzbuzz solution in Nim? https://play.nim-lang.org/#ix=2GvE |
18:52:45 | FromDiscord | <lytedev> https://news.ycombinator.com/item?id=1623844 |
18:54:32 | FromDiscord | <whisperdev> Thanks! |
18:57:59 | FromDiscord | <sealmove> π nice one Zevv |
18:59:01 | disruptek | whisperdev: nope. |
18:59:33 | * | hmmm joined #nim |
19:01:19 | mipri | whisperdev: fizzbuzz has a cycle of 15, doing one of four things at each step in the cycle. acc is a 30-bit number made up of 15 sets of 2-bit pairs that encode which of the four things should be done |
19:02:18 | mipri | that's all there is to it. |
19:03:14 | FromDiscord | <shadow.> is there a way to scan until the end of the string using a symbol? |
19:03:26 | FromDiscord | <shadow.> using scanf |
19:05:33 | * | Perkol joined #nim |
19:07:05 | FromDiscord | <shadow.> nvm |
19:07:15 | mipri | did you find an answer? |
19:09:01 | FromDiscord | <Esbeesy> `$` isn't it? |
19:09:47 | FromDiscord | <shadow.> i believe that matches until the token after is found |
19:09:54 | mipri | whatever that is gets mangled by the relay, but OK. |
19:10:20 | FromDiscord | <shadow.> @Esbeesy that matches until end? |
19:10:21 | FromDiscord | <shadow.> lemme test it |
19:11:49 | FromDiscord | <Avatarfighter> disruptek: \o/ |
19:12:38 | FromDiscord | <shadow.> oh shoot disruptek is back nice |
19:13:21 | * | disruptek throbs. |
19:13:26 | FromDiscord | <shadow.> yes |
19:13:28 | disruptek | someone must be talking about me. |
19:13:31 | FromDiscord | <shadow.> well |
19:13:39 | FromDiscord | <shadow.> we missed your sarcasm |
19:13:42 | FromDiscord | <Avatarfighter> yeah |
19:13:44 | FromDiscord | <shadow.> @Esbeesy that worked thanks |
19:13:46 | FromDiscord | <Avatarfighter> we missed you specifically |
19:15:05 | hmmm | oh disruptek is back :o |
19:17:25 | FromDiscord | <shadow.> :o |
19:17:28 | * | MarderIII quit (Quit: Leaving) |
19:21:13 | FromDiscord | <Idefau> its time to wash your teeth :nimDog: |
19:23:12 | disruptek | it's about the only thing that'd make me login to discord. |
19:24:36 | FromDiscord | <Idefau> πͺ₯ |
19:28:12 | * | Perkol quit (Remote host closed the connection) |
19:29:00 | FromDiscord | <treeform> @enthus1ast I can add "create websockets beforehand". Why do you need to? |
19:32:14 | FromDiscord | <treeform> @Quibono I made `morepretty` as a "extra" nimpretty. It can calls `nimpretty` recursively. So I just type `morepretty` in the directory and it `nimpretty`everything `.nim`. It also alphabetizes imports, converts windows utf16 files to utf8 and trims spaces at the end so that it makes github happy. |
19:36:12 | FromDiscord | <Quibono> Tree Iβve started using Morepretty and Iβm definitely loving it, I really wanted a lβinter. |
19:38:33 | disruptek | how many people do you know who respond to the name, `larry`? |
19:39:05 | disruptek | okay, now how many respond to `GargantuanShlongSlinger`? |
19:39:15 | FromDiscord | <Avatarfighter> me |
19:39:20 | FromDiscord | <Avatarfighter> is that your nickname or something |
19:39:24 | disruptek | so, just one? |
19:39:36 | FromDiscord | <Avatarfighter> im sure others will react as well |
19:39:39 | FromDiscord | <Avatarfighter> right @shadow. |
19:39:54 | Zevv | Leisure Suit GargantuanShlongSlinger in the land of the Lounge Lizards |
19:39:59 | FromDiscord | <shadow.> of course i react |
19:40:14 | FromDiscord | <Avatarfighter> Its settled disruptek, I guess you gotta change your nickname π€·ββοΈ |
19:40:21 | disruptek | i wish we still had age checks in video-games. |
19:40:37 | Zevv | i hand-wrote-copied the booklet |
19:40:46 | FromDiscord | <shadow.> i mean how difficult is it for a 9 year old to click 1900 |
19:40:48 | Zevv | really no clue what all that wa about |
19:41:02 | FromDiscord | <shadow.> this part 2 of day 4 is rly tripping me up lmao |
19:41:11 | FromDiscord | <shadow.> ive got it working but not well π |
19:41:16 | disruptek | oh, you mean "what's the third word at the top of page 32 in the manual?" |
19:42:02 | FromDiscord | <shadow.> lmao |
19:42:15 | disruptek | i only have room for 319 more friends. |
19:42:19 | disruptek | get in line, chumps. |
19:42:24 | FromDiscord | <shadow.> rip |
19:42:26 | FromDiscord | <j-james> so a quick question about templates |
19:42:29 | FromDiscord | <shadow.> ye? |
19:42:41 | FromDiscord | <j-james> can they be used to make new types and control flow statements? |
19:42:49 | FromDiscord | <shadow.> yeah |
19:42:53 | FromDiscord | <shadow.> i mean |
19:42:54 | FromDiscord | <shadow.> wdym? |
19:43:02 | FromDiscord | <shadow.> new control flow statements? or just writing an existing one |
19:43:18 | FromDiscord | <j-james> replacing `for` with something else, for example |
19:43:23 | FromDiscord | <shadow.> uhh |
19:43:29 | FromDiscord | <shadow.> hmm |
19:43:54 | FromDiscord | <shadow.> i think in general the answer for metaprogramming is |
19:43:54 | disruptek | !repo foreach |
19:43:55 | disbot | https://github.com/disruptek/foreach -- 9foreach: 11A sugary for loop macro with syntax for typechecking loop variables 15 7β 0π΄ |
19:43:58 | FromDiscord | <shadow.> if it can be parsed, yeah |
19:44:17 | FromDiscord | <shadow.> ooo |
19:44:23 | FromDiscord | <shadow.> i like the type checking |
19:44:35 | FromDiscord | <j-james> interesting |
19:44:43 | FromDiscord | <j-james> i'll play around with that, thanks |
19:44:45 | FromDiscord | <shadow.> idk how far you can get wiht templates tho |
19:44:47 | FromDiscord | <shadow.> might need macros |
19:46:32 | FromDiscord | <shadow.> what does `scanf` return as bool? |
19:46:35 | FromDiscord | <shadow.> is it just if the scan failed or not? |
19:46:58 | * | rockcavera quit (Remote host closed the connection) |
19:50:29 | FromDiscord | <lqdev> i think it's whether it parsed the whole string successfully |
19:50:45 | FromDiscord | <lqdev> you can always just try on the playground |
19:51:06 | FromDiscord | <shadow.> true |
19:51:11 | FromDiscord | <shadow.> yeah ur right i tried it |
19:51:15 | mipri | manual says that macros have to return NimNodes. only =~, scanf, scanp return bool. scanp blatantly sets result to newTree(...) |
19:51:18 | mipri | so, no idea. |
19:51:26 | FromDiscord | <shadow.> i mean |
19:51:30 | FromDiscord | <shadow.> scanf can return newLit() right |
19:51:49 | FromDiscord | <shadow.> could technically just return a bool lit nimnode |
19:51:57 | FromDiscord | <lqdev> yeah |
19:52:02 | FromDiscord | <lqdev> that's how macros work after all |
19:52:04 | FromDiscord | <shadow.> yeah |
19:52:07 | FromDiscord | <shadow.> ive done that before |
19:52:12 | FromDiscord | <lqdev> you do an AST transformation so you need to return AST |
19:52:15 | FromDiscord | <shadow.> ye |
19:52:17 | disruptek | it's a convenience for documentation. |
19:52:26 | FromDiscord | <shadow.> i needa figure out why my day 4 is wrong for aoc lmao |
19:52:36 | FromDiscord | <shadow.> my code is incredibly ugly |
19:53:02 | disruptek | that's what my parents said on my first birthday. |
19:53:16 | FromDiscord | <shadow.> lovely |
19:53:41 | disruptek | i think my mother's words were, "i didn't order this. did you order this? can we get an exchange?" |
19:53:58 | FromDiscord | <Avatarfighter> "why is this thing running at O(n^2)" |
19:54:21 | disruptek | "it's leaking and i haven't even alloc'd yet." |
19:55:07 | FromDiscord | <shadow.> "so i can't use variables with the same names as arg refs in my function?" |
19:55:18 | hmmm | heeey you can't use floats in sets? |
19:55:23 | disruptek | sure you can, shadow. |
19:55:26 | hmmm | bummer :| |
19:55:40 | disruptek | use a HashSet. |
19:55:43 | FromDiscord | <dom96> hmmm: use the sets module |
19:55:48 | hmmm | oh |
19:55:50 | hmmm | ty |
19:55:59 | FromDiscord | <Esbeesy> https://github.com/sambeckingham/advent-of-code-2020/tree/main/day4β΅β΅Day 4 done - Tried using some doAsserts this time so I knew if my validations were working. That's a really quick way of writing basic unit tests |
19:56:23 | disruptek | should we talk about my testes? |
19:56:27 | disruptek | !repo testes |
19:56:30 | disbot | https://github.com/disruptek/testes -- 9testes: 11a small unittest framework with decent support π΄π‘π’ 15 16β 0π΄ 7& 29 more... |
19:56:39 | FromDiscord | <Esbeesy> Do they have a lot of coverage? |
19:57:02 | disruptek | less than they used to, if i'm being honest. |
19:57:13 | disruptek | it's hard out here for a package with three balls. |
19:57:24 | FromDiscord | <shadow.> i love being one off on my aoc day 4 answer because i forgot to end my regex with "$" |
19:57:33 | FromDiscord | <shadow.> guess i wont make that mistake again |
19:57:37 | FromDiscord | <shadow.> lol |
19:57:45 | FromDiscord | <Esbeesy> I bailed on using regex, couldn't get it to match the hex code for shit |
19:57:58 | disruptek | there's a special hex code for shit? |
19:58:01 | hmmm | disruptek your utilities are v pretty |
19:58:09 | hmmm | I like colors |
19:58:21 | disruptek | you are in the minority. |
19:58:23 | FromDiscord | <Esbeesy> Yeah that is super cool |
19:58:38 | FromDiscord | <Avatarfighter> what about his testes are cool? |
19:58:45 | FromDiscord | <Idefau> yeah i like how colorful your testes are |
19:58:55 | FromDiscord | <Esbeesy> There's not much coverage now so very smooth, aerodynamic |
19:58:58 | FromDiscord | <shadow.> @Esbeesy #[\da-f]{6}$ |
19:58:59 | FromDiscord | <shadow.> ? |
19:59:04 | FromDiscord | <shadow.> (edit) "#[\da-f]{6}$" => "`#[\da-f]{6}$`" |
19:59:18 | FromDiscord | <shadow.> lol |
19:59:23 | FromDiscord | <Avatarfighter> You really ironed out all the bumps in your testes and it runs smoothly disruptek |
19:59:27 | FromDiscord | <Esbeesy> Mine was far more ghetto, [0-9a-f]{6}$ |
19:59:34 | FromDiscord | <shadow.> you didnt start it with a hashtag? |
19:59:38 | FromDiscord | <Esbeesy> I think it's cause I was using it in a `scanf ` |
19:59:44 | disruptek | i know; it was pretty hairy at first. |
19:59:45 | FromDiscord | <shadow.> ohh lol |
20:00:08 | FromDiscord | <Esbeesy> Yeah obviously I should have just put the hash in the re, but I'd just come off a blinder of a day at work haha |
20:00:09 | FromDiscord | <shad0w> hey, welcome back disruptek: |
20:00:18 | FromDiscord | <Avatarfighter> At least you were about to clean it disruptek, not all of us have that opportunity |
20:00:54 | disruptek | shadows rolling deep up in this bitch. |
20:01:31 | FromDiscord | <Esbeesy> I felt like, making a "Passport" object from the text was really difficult. Is there a succinct way to parse them without using a 3rd party package? Like Zevv's package is mind blowingly awesome but I'm trying to do AoC with just the core lib to learn Nim |
20:01:47 | FromDiscord | <shadow.> wdym |
20:01:53 | FromDiscord | <shadow.> i mean |
20:02:00 | FromDiscord | <shadow.> i split them into string entries on "\n\n" |
20:02:02 | FromDiscord | <shadow.> and then i did |
20:02:13 | FromDiscord | <Esbeesy> Like I'm iterating through the k:v pairs and using a chungus case statement for every key |
20:02:15 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gzn |
20:02:20 | FromDiscord | <shadow.> oh you mean |
20:02:24 | FromDiscord | <shadow.> checking if they're valid? |
20:02:45 | FromDiscord | <shadow.> all keys were three long haha |
20:03:33 | FromDiscord | <shadow.> https://hatebin.com/dpvpuqwrfq not exactly the sexiest solution |
20:03:35 | FromDiscord | <Esbeesy> Kind of? So like if you give me that chunk k:v pairs, I want to be able to instantiate a Passport object from it, it would be nice if right there I could be like, "Eye colour is "Bumface", so it's invalid" and straight away the Passport is invalid |
20:03:49 | FromDiscord | <shadow.> check my solution lol |
20:03:53 | FromDiscord | <shadow.> i just did a break block |
20:03:53 | FromDiscord | <j-james> who needs regex: https://play.nim-lang.org/#ix=2Gz7 |
20:04:05 | FromDiscord | <shadow.> jesus |
20:04:15 | FromDiscord | <shadow.> ohhhh |
20:04:23 | FromDiscord | <shadow.> your indexing was pretty smart |
20:04:28 | FromDiscord | <shadow.> prolly more efficient than scanf for the height |
20:04:49 | FromDiscord | <Avatarfighter> ugh why do colleges make you select alternative programs |
20:05:09 | disruptek | probably because we need more gay folks. |
20:05:18 | FromDiscord | <Avatarfighter> thats not what I meant |
20:05:19 | disruptek | wait, alternative how? |
20:05:29 | FromDiscord | <Avatarfighter> Well I want computer science |
20:05:39 | disruptek | select Gay CS, then. |
20:05:43 | FromDiscord | <Avatarfighter> but then they say choose something else in case the first option is full |
20:05:52 | FromDiscord | <Avatarfighter> so when I go to pick computer engineering I cant π¦ |
20:06:27 | disruptek | choose psych. |
20:06:51 | FromDiscord | <Avatarfighter> im tryna make algorithms not have human interactions π |
20:07:18 | FromDiscord | <Esbeesy> disruptek I'm giving your github a follow, even if all of your CI chains are failing π |
20:07:31 | FromDiscord | <Avatarfighter> @Esbeesy you like his testes? |
20:07:54 | disruptek | eh, it's due to github being broken. |
20:07:56 | FromDiscord | <Esbeesy> I'm going to put his testes on everything |
20:08:02 | disruptek | that's the spirit. |
20:08:33 | FromDiscord | <Esbeesy> When people say to me, "wow! You terminal is so colourful!" I will say "Thank you. It's dusruptek's testes" |
20:08:42 | FromDiscord | <Avatarfighter> You're going to inspect it inside out ? |
20:08:43 | FromDiscord | <Esbeesy> (edit) "dusruptek's" => "disruptek's" |
20:09:06 | disruptek | my testes are pretty recognizable. |
20:09:09 | FromDiscord | <Idefau> are disruptek's testes configurable? |
20:09:10 | disruptek | you'd be surprised... |
20:09:18 | FromDiscord | <Avatarfighter> @Idefau they have color |
20:09:26 | FromDiscord | <Avatarfighter> they are unlike no other testes |
20:09:28 | disruptek | configuration is generally code smell. |
20:09:41 | FromDiscord | <Idefau> ill just recompile them |
20:09:59 | FromDiscord | <Idefau> i might expand something inside his testes at compile-time |
20:10:24 | disruptek | it's about the only project i haven't really documented. sorry about that. |
20:10:35 | disruptek | it's just a hack i needed while writing cps. |
20:13:06 | FromDiscord | <Idefau> i might document your testes dw |
20:13:10 | FromDiscord | <Esbeesy> I've lost the last two days at work just trying to configure deployments in dev environments |
20:13:14 | FromGitter | <alehander92> disruptek |
20:13:15 | FromGitter | <alehander92> good |
20:13:25 | FromGitter | <alehander92> it's easier to write you here |
20:13:26 | FromGitter | <alehander92> than on irc |
20:13:34 | disruptek | wait, i thought rimworld was about rimjobs. |
20:13:41 | FromDiscord | <Idefau> it can be |
20:13:45 | disruptek | it's running but i don't feel anything. |
20:13:47 | FromDiscord | <Esbeesy> You do get a job in rimworld don't you? |
20:14:08 | FromDiscord | <shadow.> idf have you done day 4 yet |
20:14:17 | FromDiscord | <Avatarfighter> rimworld is so fun |
20:14:19 | disruptek | it really says something that programmers feel irc is too difficult to use. |
20:14:20 | FromDiscord | <Avatarfighter> highly recommend |
20:14:22 | FromDiscord | <shadow.> your last parsing challenge was very clean so im interested to see how your day 4 goes lol |
20:14:22 | FromDiscord | <Idefau> i havent |
20:14:25 | FromDiscord | <shadow.> oh rip |
20:14:37 | FromDiscord | <Idefau> its half finished |
20:14:38 | FromDiscord | <shadow.> its basically just parsing and a big ass case statement |
20:14:40 | FromDiscord | <shadow.> ohh |
20:14:40 | FromDiscord | <Esbeesy> I love IRC but no one uses it anymore. In fact this is the first programming community I've found in a while that has one |
20:14:45 | FromDiscord | <shadow.> you mean part one is finished? |
20:14:46 | FromDiscord | <Esbeesy> Or one that's busy anyway |
20:14:46 | FromDiscord | <Idefau> i mean my second part is half finished |
20:14:46 | FromDiscord | <j-james> searchable history is really very nice |
20:14:53 | FromDiscord | <shadow.> explain |
20:14:54 | FromDiscord | <shadow.> lol |
20:14:57 | FromDiscord | <shadow.> ohhh |
20:14:58 | FromDiscord | <shadow.> i see |
20:15:00 | FromDiscord | <shadow.> second part |
20:15:04 | FromDiscord | <Idefau> its nearly working |
20:15:05 | FromDiscord | <Idefau> im just |
20:15:06 | FromDiscord | <Idefau> laz |
20:15:08 | FromDiscord | <shadow.> fair enough |
20:15:12 | FromDiscord | <shadow.> is it just a big case statement |
20:15:21 | FromDiscord | <Idefau> ye |
20:15:47 | FromDiscord | <Idefau> i wasted time on part 1 because i was reseting the counter every line instead of every empty newline |
20:15:50 | FromDiscord | <Idefau> that separates the passport |
20:15:53 | FromDiscord | <shadow.> rip |
20:15:55 | FromDiscord | <Idefau> i always fuck up the minuscule details |
20:16:02 | FromDiscord | <shadow.> same |
20:16:14 | FromDiscord | <shadow.> i finished but my part two was one off bc i forgot a $ to terminate my regex |
20:16:16 | FromDiscord | <shadow.> :weirdleave: |
20:16:27 | FromGitter | <alehander92> disruptek |
20:16:45 | FromGitter | <alehander92> i am just lazy |
20:16:58 | FromGitter | <alehander92> dont base large analysis of irc on me |
20:17:26 | disruptek | um, okay. |
20:17:51 | FromDiscord | <Avatarfighter> lmao |
20:18:24 | FromGitter | <alehander92> and this is not good |
20:18:33 | FromGitter | <alehander92> καλιΟΟΞ΅ΟΞ±Ξ± |
20:18:34 | disruptek | esbeesy: says a discord user. π |
20:18:41 | FromDiscord | <Idefau> whats discord |
20:18:43 | disruptek | no, that is not good at all. |
20:18:51 | * | habamax quit (Quit: leaving) |
20:18:51 | FromDiscord | <Avatarfighter> yeah we're just using fancy irc |
20:19:08 | FromDiscord | <shadow.> yeah wym this isnt discord |
20:19:55 | FromDiscord | <Esbeesy> is the best IRC app for windows still mIRC? π |
20:20:13 | disruptek | it really says something that programmers feel linux is too difficult to use. |
20:20:27 | FromDiscord | <Avatarfighter> what is a linux |
20:20:42 | * | krux02 joined #nim |
20:21:01 | FromDiscord | <Esbeesy> Do they? I love linux (I use Arch btw) but always gaming so Windows is the way for me |
20:21:16 | FromDiscord | <Esbeesy> Also doing .NET by day, not a chance I can use Linux π¦ |
20:21:39 | FromDiscord | <Avatarfighter> mono |
20:21:39 | disruptek | i thought mono was a thing. |
20:21:54 | FromDiscord | <Avatarfighter> mono should have all .NET apis |
20:22:02 | FromDiscord | <dom96> Linux sucks |
20:22:04 | FromDiscord | <dom96> _hides_ |
20:22:07 | FromDiscord | <Esbeesy> Yeah but the Framework 4.6.2 thing I'm developing definitely does not use mono |
20:22:14 | FromDiscord | <Avatarfighter> basically what we're saying is sell off all your other devices and adopt a linux monk lifestyle @Esbeesy |
20:22:15 | FromDiscord | <Idefau> finds dom |
20:22:40 | FromGitter | <alehander92> guys |
20:22:45 | disruptek | i think i would use windows if i was developing .net shite. |
20:22:45 | FromDiscord | <Idefau> guy |
20:22:52 | FromDiscord | <shadow.> i mean yeah |
20:22:55 | FromGitter | <alehander92> i feel that i love you more today |
20:22:57 | FromDiscord | <Esbeesy> @Avatarfighter Will be doing soon, start a new job in January that's language agnostic/Anything but .NET |
20:23:00 | FromGitter | <alehander92> because its time for rest |
20:23:03 | FromGitter | <alehander92> friday evening |
20:23:05 | FromDiscord | <Idefau> :3 |
20:23:08 | FromDiscord | <Idefau> comfy friday |
20:23:13 | FromGitter | <alehander92> yeah |
20:23:15 | disruptek | alehander92: mdma is a powerful thing, ain't it? |
20:23:18 | FromGitter | <alehander92> Ξ΅Ο
ΟΞ±ΟΞΉΟΟΞΏΞΏ |
20:23:19 | FromDiscord | <shadow.> trying to develop like WPF or winforms on linux would probably not be a thing |
20:23:20 | FromDiscord | <Esbeesy> Genuinely going to take .NET off my CV and when they ask what I was doing for the last 6 years just say homeless with a meth addiction |
20:23:26 | FromDiscord | <Esbeesy> Less embarrassing |
20:23:27 | FromDiscord | <shadow.> lmfao |
20:23:29 | FromDiscord | <shadow.> true |
20:23:30 | FromGitter | <alehander92> i don't use drugs disruptek |
20:23:34 | disruptek | why not? |
20:23:39 | FromGitter | <alehander92> they are an earthly pleasure. |
20:23:44 | disruptek | um, what? |
20:23:49 | FromDiscord | <shadow.> or just say you were documenting disruptek's testes |
20:23:51 | FromDiscord | <shadow.> it's a worthy cause |
20:23:52 | disruptek | where are you calling from? |
20:23:55 | FromDiscord | <Idefau> im drinking grape juice |
20:23:57 | FromDiscord | <Avatarfighter> lovely https://media.discordapp.net/attachments/371759389889003532/784515353656164452/unknown.png |
20:24:00 | FromGitter | <alehander92> they are a worldly pleasure |
20:24:02 | FromDiscord | <shadow.> of course |
20:24:24 | disruptek | i repeat: |
20:24:25 | disruptek | where are you calling from? |
20:24:34 | FromDiscord | <Idefau> from another module |
20:24:45 | FromDiscord | <Avatarfighter> lmao |
20:24:48 | FromDiscord | <Avatarfighter> idf04 |
20:24:56 | FromDiscord | <Idefau> who's that |
20:24:58 | FromDiscord | <Avatarfighter> https://media.discordapp.net/attachments/371759389889003532/784515611514241034/unknown.png |
20:24:59 | FromGitter | <alehander92> we're citizen of another kingdom |
20:25:02 | FromDiscord | <Avatarfighter> i love this |
20:25:10 | FromDiscord | <shadow.> what kind of discord theme |
20:25:12 | FromDiscord | <shadow.> are you using |
20:25:15 | FromDiscord | <Idefau> kek |
20:25:23 | FromDiscord | <Avatarfighter> its called nocturnal |
20:25:30 | FromDiscord | <shadow.> oh nice |
20:25:31 | FromDiscord | <Avatarfighter> requires Better Discord |
20:25:47 | FromDiscord | <Avatarfighter> I've been working on writing a lib to write discord plugins with nim π |
20:25:59 | FromDiscord | <dom96> Mine isn't much different and it's stock Discord https://media.discordapp.net/attachments/371759389889003532/784515868310634516/unknown.png |
20:26:03 | FromDiscord | <kaletaa> israeli defence forces is my friend |
20:26:13 | FromDiscord | <Idefau> who's that |
20:26:18 | FromDiscord | <kaletaa> hello israeli defence force 04 |
20:26:29 | FromGitter | <alehander92> seriously |
20:26:42 | FromDiscord | <exelotl> IRC is easy to use until you want to not miss the conversation when your computer is switched off or your internet shits its pants |
20:26:48 | FromDiscord | <kaletaa> VNC |
20:26:50 | FromGitter | <alehander92> drugs are not good, and one can still eat and drink without going into such excesses |
20:26:52 | FromDiscord | <kaletaa> or whatever they call it |
20:26:54 | FromGitter | <alehander92> oh, i like the iDF |
20:26:54 | FromDiscord | <kaletaa> BNC? |
20:26:57 | FromDiscord | <kaletaa> i have no clue |
20:27:00 | FromGitter | <alehander92> i met a girl that was in IDF |
20:27:01 | FromDiscord | <shadow.> welp i dont use compact mode sadly |
20:27:12 | FromDiscord | <exelotl> compact mode is just not quite right |
20:27:17 | FromGitter | <alehander92> i find israelis very interesting |
20:27:18 | FromDiscord | <Idefau> a lot of girls were in me |
20:27:25 | FromGitter | <alehander92> and I hope they have their own programming language |
20:27:29 | FromDiscord | <j-james> can't wait for matrix to get more stable |
20:27:34 | FromGitter | <alehander92> from right to left, it would be interesting to analyze |
20:27:42 | FromDiscord | <Idefau> in my mind i mean i think of them haha |
20:27:45 | FromGitter | <alehander92> ldefau i didn't mean it in this way. |
20:27:48 | disruptek | there's this thing called a `mirror`. |
20:27:50 | FromDiscord | <exelotl> wtf is this discussion |
20:28:11 | FromGitter | <alehander92> disruptek but what is the mirror for our souls |
20:28:14 | FromDiscord | <dom96> yeah, might be time to pack it up and move it to offtopic |
20:28:18 | FromDiscord | <shadow.> true |
20:28:37 | disruptek | !repo disruptek/nigel |
20:28:37 | disbot | no results π’ |
20:29:30 | FromDiscord | <shadow.> disruptek i must say your github repo names are quite nice |
20:29:41 | FromGitter | <alehander92> is it the nigel song |
20:29:50 | disruptek | always has been. |
20:29:57 | FromGitter | <alehander92> making plans .. |
20:30:06 | FromGitter | <alehander92> ah memories |
20:30:08 | FromGitter | <alehander92> peanut butter |
20:30:16 | FromDiscord | <shadow.> i must say dim looks very promising |
20:30:20 | disruptek | memories, like peanut butter, yes. |
20:30:24 | FromGitter | <alehander92> programming in nim and `freaks and geeks` run |
20:30:27 | FromDiscord | <shadow.> impossible to create errors in its current state |
20:30:28 | FromDiscord | <shadow.> i like it |
20:30:31 | FromGitter | <alehander92> i might be wrong |
20:31:07 | disruptek | dim is extremely tight right now. nothing remains to be removed from the design. |
20:31:46 | FromDiscord | <shadow.> i also like how every function in the language can be ran at compile time |
20:32:02 | FromDiscord | <shadow.> every single implemented function has this feature, correct? |
20:32:17 | FromGitter | <alehander92> eh, hm, not sure |
20:32:24 | FromGitter | <alehander92> there are limitations |
20:32:26 | disruptek | right. it's already self-hosted and can reproduce itself without any input at all. |
20:32:33 | FromDiscord | <shadow.> yeah that's crazy |
20:32:41 | FromDiscord | <shadow.> also it's a really fast install |
20:32:43 | FromDiscord | <shadow.> and cross platform |
20:32:54 | disruptek | the entire language is completely documented, in itself, naturally. |
20:33:06 | FromDiscord | <shadow.> yeah i especially like that part |
20:33:26 | FromDiscord | <mratsim> you cannot use pointers or IO at compile-time |
20:33:32 | FromDiscord | <shadow.> we're talking about the superior language, not nim |
20:34:01 | FromDiscord | <mratsim> The > language? |
20:34:04 | FromDiscord | <shadow.> dim |
20:34:08 | FromDiscord | <shadow.> https://github.com/disruptek/dim |
20:34:11 | FromDiscord | <shadow.> have a look for yourself |
20:34:17 | disruptek | it's inspired by nim. |
20:34:20 | FromDiscord | <shadow.> its almost as nice as disruptek's testes |
20:34:20 | FromGitter | <alehander92> mratsim |
20:34:34 | FromGitter | <alehander92> how is life, and do you know latin |
20:34:36 | FromDiscord | <Cloufish> wow |
20:34:43 | FromGitter | <alehander92> oh disruptek you're going into |
20:34:45 | FromGitter | <alehander92> nim 3.0 |
20:34:48 | FromGitter | <alehander92> directly |
20:34:57 | disruptek | yeah, who needs nim-2? |
20:35:12 | disruptek | i mean, really, it's a mess. |
20:35:12 | FromGitter | <alehander92> i wanted to write nim 2.0 |
20:35:18 | FromDiscord | <Cloufish> XD |
20:35:21 | FromDiscord | <shadow.> hm |
20:35:22 | FromDiscord | <Cloufish> wtf |
20:35:22 | FromGitter | <alehander92> but you're building the 4.0 |
20:35:39 | disruptek | well, i can't write nim 4 in nim 1 or nim 2, so... yeah. |
20:35:48 | FromDiscord | <shadow.> i vote that we replace nim with dim, it's much more reliable |
20:35:53 | FromDiscord | <Cloufish> ?!?! YOU SAID HE WAS BUILDING 3.0 |
20:35:58 | FromDiscord | <shadow.> i don't think i've seen anyone get an error in dim before |
20:36:05 | FromDiscord | <mratsim> @alehander92, Life's Good is copyrighted by LG and I did take 4 years of latin courses in middle school but I can't say I know it. |
20:36:14 | FromGitter | <alehander92> diruptek drugs are truly bad tho |
20:36:15 | disruptek | no, just look at stack overflow. not a single problem or complaint. |
20:36:21 | FromDiscord | <shadow.> exactly |
20:36:27 | FromDiscord | <shadow.> zero issues or pr's either |
20:36:30 | FromGitter | <alehander92> i am interested in looking at lang design tho |
20:36:36 | FromGitter | <alehander92> do you plan to have rust |
20:36:36 | disruptek | yep. immaculate conception. |
20:36:38 | FromGitter | <alehander92> support! |
20:36:58 | FromDiscord | <shadow.> zero memory leaks |
20:37:03 | FromDiscord | <shadow.> and the parser is incredibly fast |
20:37:03 | FromDiscord | <Cloufish> O.O |
20:37:27 | FromGitter | <alehander92> not a correct usage |
20:37:31 | disruptek | the memory usage is probably my favorite part. |
20:37:37 | FromDiscord | <shadow.> exactly yeah |
20:37:44 | FromDiscord | <shadow.> well cpu usage is very nice as well |
20:38:01 | disruptek | that part was easy. |
20:40:06 | FromDiscord | <Cloufish> I wanted to believe that I'm not a hipster but it looks like its inevitable |
20:41:09 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=2GBt |
20:41:19 | FromDiscord | <j-james> Why can't this find its parameters? |
20:41:25 | FromDiscord | <Cloufish> (edit) "I wanted to believe that I'm not ... a" added "going to become" |
20:41:27 | FromDiscord | <shadow.> wdym |
20:41:31 | FromDiscord | <shadow.> how are you calling it |
20:41:44 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=2GBw |
20:41:50 | FromDiscord | <shadow.> not an operator |
20:41:56 | FromDiscord | <shadow.> operators can only be made of some symbols |
20:42:05 | FromDiscord | <shadow.> and you didn't even backtick it haha |
20:42:33 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GBB |
20:43:07 | FromDiscord | <j-james> same issue |
20:43:29 | FromDiscord | <j-james> > operators can only be made of some symbols |
20:43:45 | FromDiscord | <j-james> that's too bad |
20:43:52 | FromDiscord | <shadow.> ye |
20:44:01 | FromDiscord | <shadow.> well |
20:44:04 | FromDiscord | <shadow.> im guessing it's for parsing reasons |
20:44:18 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/784520476658892820/unknown.png |
20:44:33 | FromDiscord | <shadow.> here's a fun template |
20:44:42 | FromGitter | <deech> Anyone know of benchmarks for the JS backend, especially interested in payload size? |
20:44:47 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GBJ |
20:44:57 | * | narimiran quit (Ping timeout: 256 seconds) |
20:44:58 | FromDiscord | <j-james> i mean it's not really bad i was planning to do some atrocious things otherwise |
20:45:07 | FromDiscord | <shadow.> (edit) "https://play.nim-lang.org/#ix=2GBJ" => "https://play.nim-lang.org/#ix=2GBL" |
20:45:12 | FromDiscord | <shadow.> haha |
20:51:51 | FromDiscord | <haxscramper> @j-james you can sort-of-kind-of get necessary behavior for any identifier - https://gist.github.com/haxscramper/04cab2f6abc410d2e5b5df950415fb81#can-put-basically-anything-as-identifier |
20:52:39 | FromDiscord | <haxscramper> Although it should only be used for things like `echo {'c', 'd'} .Γ {'a', 'b'}` |
20:55:12 | FromDiscord | <For Your Health> This might be a silly question, but does using a c++ library tie me to using the c++ backend? |
20:55:16 | FromDiscord | <UNIcodeX> sent a code paste, see https://play.nim-lang.org/#ix=2GCl |
20:56:08 | FromDiscord | <haxscramper> Technically you can wrap C++ in C, or use C++ ABI ... in theory. In practice I would choose to preserve one's sanity and answer "yes it does" |
20:56:30 | FromDiscord | <haxscramper> "it does tie you to C++ backend" |
20:56:46 | FromDiscord | <Esbeesy> deech I'm interested in that too - been compiling my AoC solutions in to JS and they size of the JS is relatively huge. |
20:58:52 | FromDiscord | <For Your Health> @haxscramper I see, thanks for the info! If I were to use something like Box2D, would I be better off trying to compile from source in my project, or linking a binary somehow? |
21:01:38 | FromDiscord | <shadow.> what are the benefits of the js backend? |
21:02:04 | FromDiscord | <Esbeesy> It's... JS? You can run it in a browser |
21:02:22 | FromDiscord | <Esbeesy> or Node if you're some kind of delinquent |
21:02:58 | FromDiscord | <shadow.> fair enough |
21:02:59 | FromDiscord | <shadow.> lemme try |
21:03:15 | FromDiscord | <shadow.> ive never been able to get it to work lol |
21:03:17 | FromDiscord | <shadow.> at least with node |
21:03:18 | FromDiscord | <Esbeesy> literally just `nim js <filename>` |
21:03:23 | FromDiscord | <haxscramper> I'm not familiar with box2d specifically, but when possible I try to link against whatever is installed by my package manager. But that is only because I'm lazy and don't want to do extra work on building C things. |
21:03:30 | FromDiscord | <Esbeesy> you have to put -d:nodejs I think if you want it node compatible |
21:03:39 | FromDiscord | <shadow.> ohh |
21:04:08 | FromDiscord | <shadow.> still didnt work |
21:04:09 | FromDiscord | <shadow.> rip |
21:04:23 | FromDiscord | <shadow.> i think its bc of my fileread |
21:04:31 | FromDiscord | <shadow.> fopen is not defined |
21:04:46 | FromDiscord | <haxscramper> So if you can link then try to do it first. There is no difference for on nim side - e.g. wrapping linked vs compiled is the same in my experience. |
21:05:16 | FromDiscord | <Esbeesy> Maybe it needs a certain version of JS? No idea tbh. Would have thought someone here is Nim JS pro though |
21:06:16 | FromDiscord | <For Your Health> @haxscramper If I link to a binary am I still tied to the c++ backend? |
21:08:17 | FromDiscord | <treeform> It looks like you need to update typography as well? |
21:10:02 | * | abm quit (Quit: Leaving) |
21:11:19 | FromDiscord | <haxscramper> If you use C++ API - classes, overloading, templates and so on then I suppose yes. I'm not an expert on this topic, so you might need to research it more. If library is implemented in C++, but uses only C functions you only need to `{.passl: "-lstdc++".}` |
21:12:32 | disruptek | nim doesn't support node. |
21:13:01 | disruptek | you need to build with cpp when you want to use import patterns for c++ symbols. |
21:13:25 | FromDiscord | <For Your Health> @haxscramper Alright cool, thanks for the info! |
21:14:00 | FromDiscord | <fwsgonzo> how can you take a void()() function pointer as argument in Nim? |
21:14:29 | disruptek | proc foo(x: proc(): int) = echo x() |
21:14:48 | disruptek | proc foo(x: proc()) = x() |
21:14:55 | FromDiscord | <haxscramper> `proc acceptsCallback(callback: proc() {.cdecl.})` if you are asking about C callback specifically |
21:15:09 | FromDiscord | <fwsgonzo> aha, that's fairly straight-forward! |
21:16:14 | FromDiscord | <haxscramper> !eval proc test(arg: proc(): proc(): proc(): proc(): tuple[a: proc(), b: proc()]) = discard |
21:16:16 | NimBot | <no output> |
21:16:25 | FromDiscord | <Quibono> How many LoC do you figure for a small web browser? |
21:16:51 | disruptek | if the web is only one page, i'd say one. |
21:17:31 | * | superbia quit (Quit: WeeChat 2.9) |
21:18:17 | FromDiscord | <Quibono> Lol. |
21:18:30 | FromDiscord | <Quibono> Was just thinking Nim would be cool for a browser |
21:19:17 | FromDiscord | <Esbeesy> Yeah is there any kind of wasm backend going on? |
21:20:34 | disruptek | !repo nlvm |
21:20:35 | disbot | https://github.com/arnetheduck/nlvm -- 9nlvm: 11LLVM-based compiler for the Nim language 15 352β 25π΄ 7& 1 more... |
21:22:28 | FromDiscord | <shadow.> ive noticed this a few times...why do people word out their emailsβ΅> arnetheduck on gmail point comβ΅? |
21:22:34 | FromDiscord | <shadow.> is it to prevent scrapers or something? |
21:22:39 | disruptek | yes. |
21:22:44 | FromDiscord | <shadow.> ahh that makes sense |
21:22:55 | * | rockcavera joined #nim |
21:29:33 | FromDiscord | <Avatarfighter> @shadow. its to prevent pesky scraper like myself from spamming emails |
21:29:38 | FromDiscord | <Avatarfighter> (edit) "scraper" => "scrapers" |
21:30:19 | FromDiscord | <shadow.> smart |
21:30:49 | FromDiscord | <Quibono> Can you get paid to scrape emails, or is it just to be an asshole? |
21:30:55 | disruptek | yes. |
21:31:12 | FromDiscord | <Avatarfighter> yeah you can |
21:31:24 | FromDiscord | <Quibono> _builds email scraper_ |
21:31:32 | FromDiscord | <Avatarfighter> yeah basically |
21:31:33 | disruptek | i sign up for most services using arne's email address. |
21:31:42 | FromDiscord | <shadow.> lovely |
21:31:50 | mipri | don't know why anyone bothers though. If I wanted a list of chumps I'd start with breached password lists and pick out the emails with bad passwords |
21:31:56 | FromDiscord | <shadow.> true |
21:32:01 | FromDiscord | <Avatarfighter> what some people do is scrape recruitment emails for companies and bulk apply to them |
21:32:13 | FromDiscord | <Quibono> I just recently got a shitton more spam on my main email, so clearly someone scraped me |
21:32:25 | FromDiscord | <Avatarfighter> you probably ended up on a public email list |
21:39:21 | FromDiscord | <UNIcodeX> no dice. |
21:40:10 | FromDiscord | <treeform> i'll look into it this evening then |
21:40:24 | FromDiscord | <treeform> the build tests passes? |
21:40:35 | FromDiscord | <treeform> maybe pixie needs updating? |
21:40:49 | FromDiscord | <treeform> https://github.com/treeform/flippy |
21:41:06 | FromDiscord | <treeform> I have updated tons of packages to their new versions: https://github.com/treeform/flippy/blob/master/flippy.nimble |
21:41:13 | FromDiscord | <treeform> flippy can't work with old versions of the packages. |
21:47:25 | FromDiscord | <fwsgonzo> can you take the address of a function in Nim and cast to uintptr_t similarly to C? |
21:47:50 | disruptek | i will permit it. |
21:48:31 | FromDiscord | <fwsgonzo> (edit) "can you take the address of a function in Nim and cast to uintptr_t similarly to C? ... " added "I need to take a register value out of Nim and pass it back in (and cast back to the function pointer) later on" |
21:51:43 | FromGitter | <iffy> I'm getting this odd bug (that I haven't been able to reduce): `Error: unhandled exception: errno: 35 'Resource temporarily unavailable' [IOError]` when calling `stderr.writeLine somelargestring` Any ideas on debugging? |
21:54:18 | Zoom[m] | Looking at std/pegs docs and what I can say it's the least friendly piece of documentation I've seen in a while (not counting zero docs) |
21:54:44 | FromDiscord | <lqdev> !repo npeg |
21:54:45 | disbot | https://github.com/zevv/npeg -- 9npeg: 11PEGs for Nim, another take 15 129β 7π΄ |
21:56:06 | Zoom[m] | I'm trying to stick to std until I'm at least confident what's there |
21:56:08 | Zoom[m] | But thanks |
21:56:28 | disruptek | well, no one uses std, so... |
21:57:11 | FromDiscord | <Esbeesy> Hey, so, Zevv's npeg sample for day4 is super cool however.. It gives me the wrong answer |
21:57:19 | FromDiscord | <Avatarfighter> speaking of stdlib i really want to use chronos for async but they dont have an httpclient and I'm crying inside |
21:57:32 | disruptek | weird. |
21:58:44 | FromDiscord | <Avatarfighter> ur weirds |
21:59:12 | Zoom[m] | I've managed to get through pegs docs to pass d4p1 and then I looked at the p2. I knew it from the start :) |
21:59:42 | mipri | zevv's solution throws away the last line of the input |
22:00:17 | Zoom[m] | I'd probably be better off with RE. Now, that's a line you don't hear often. |
22:00:59 | hmmm | doodes can I nest a bunch of seqs in a seq |
22:01:26 | disruptek | you're blowin' my mind right now. |
22:01:36 | hmmm | or maybe a tuple |
22:01:43 | hmmm | so I can untuple it |
22:02:10 | * | rockcavera quit (Remote host closed the connection) |
22:02:40 | Zoom[m] | Yes you can, and it would be quicker to just try. |
22:02:47 | hmmm | hmm |
22:02:50 | hmmm | oke |
22:02:52 | mipri | lame fix: `& "\n"` the readFile |
22:04:41 | mipri | you can also prefix ? to the second Space in valid |
22:13:40 | FromDiscord | <ajusa> Does anyone know if https://github.com/nim-lang/Nim/pull/5101 ended up going anywhere? Seems like the ability to skip text would be very useful inside of scanf. |
22:13:40 | disbot | β₯ strscans: skip input until next token is found |
22:15:22 | FromDiscord | <Esbeesy> Mipri I used `(field Space[1..2])` instead of the ? prefix, but still works either way I guess |
22:15:43 | mipri | whatever that is doesn't survive the trip to IRC, but ok |
22:16:04 | FromDiscord | <Esbeesy> Once more without backtick formatting: Mipri I used (field Space[1..2]) instead of the ? prefix, but still works either way I guess |
22:16:18 | FromDiscord | <Avatarfighter> http://prntscr.com/vw24w1 |
22:16:22 | FromDiscord | <Avatarfighter> that is what was said |
22:16:31 | mipri | it's not the formatting (that just shows up as backticks). it's the asterisk I guess |
22:16:49 | FromDiscord | <Esbeesy> How annoying |
22:20:16 | FromDiscord | <shadow.> has anyone used discordnim and dimscord? |
22:20:20 | FromDiscord | <shadow.> and can recommend one over the other |
22:20:24 | FromDiscord | <shadow.> im unsure of which one to choose |
22:31:46 | FromDiscord | <fwsgonzo> how can you cast a ByteAddress to a function type in Nim? |
22:32:37 | * | hmmm quit (Ping timeout: 264 seconds) |
22:33:03 | FromDiscord | <fwsgonzo> (edit) "Nim?" => "Nim, given the function type?" |
22:33:19 | FromDiscord | <ElegantBeef> Shadow i believe yardanico made the discord bot using dimscord and krispurg in here is the author of it |
22:33:35 | FromDiscord | <fwsgonzo> I am transporting a function pointer out of Nim and back in again, and I need to cast it back |
22:33:50 | FromDiscord | <ElegantBeef> `cast[ptr proc](pointer)`? |
22:34:11 | * | hmmm joined #nim |
22:34:16 | FromDiscord | <ElegantBeef> Yea ircord uses dimscord |
22:37:15 | FromDiscord | <ElegantBeef> @krisppurg cmon update dimscords readme to say "if you want to compress stuff, use https://github.com/guzba/zippy" π |
22:41:37 | FromDiscord | <UNIcodeX> no, sir. same error. |
22:42:00 | hmmm | is there any difference between strutils replace and re replace :o |
22:42:18 | disruptek | nope. they are exactly the same. totally identical. |
22:42:25 | hmmm | hmmmm |
22:42:34 | disruptek | usename checks out. |
22:42:43 | FromDiscord | <Daniel> @disruptek welcome back bro π» |
22:42:51 | disruptek | howdy. |
22:42:58 | hmmm | I never know when trust your answers disruptek :| |
22:42:58 | mipri | hmmm: the obvious difference is that one replaces a regex and one only replaces a substring. |
22:43:06 | mipri | as a rule, if disruptek says something, it's not true. |
22:43:21 | hmmm | I suspected that mipri :o |
22:43:34 | disruptek | lies. |
22:43:39 | mipri | you have to compel him to enter a magic triangle to get the truth. |
22:44:17 | mipri | as documented: https://en.wikipedia.org/wiki/Furfur |
22:45:31 | disruptek | looks legit. |
22:45:38 | disruptek | especially the `Be safe` line. |
22:46:13 | mipri | random bit of vandalism. |
22:46:43 | disruptek | it used to say, "Be safe, motherfuckers." |
22:47:01 | disruptek | section 230 ftw. |
22:48:41 | FromDiscord | <ElegantBeef> Ah yes the freedom of speech removal section π |
22:51:05 | hmmm | what is the char version of "" |
22:51:18 | hmmm | I thought '' but it doesn't work |
22:51:28 | mipri | a char isn't a sequence, so it can't be empty. |
22:51:33 | hmmm | hmmm |
22:51:47 | FromDiscord | <ElegantBeef> These are all the possible chars http://www.asciitable.com/ |
22:51:54 | hmmm | ty both |
22:51:55 | mipri | if you want to return something that might be a char or might be not a char, use an option[char] |
22:52:14 | FromDiscord | <shadow.> you could try a '\0' |
22:52:26 | FromDiscord | <ElegantBeef> Well null terminated is a possibllity, but just use an option |
22:52:36 | FromDiscord | <ElegantBeef> It's entirely designed for adding another state |
22:52:54 | FromDiscord | <shadow.> fair enough |
22:53:07 | mipri | I'd do what C does even before '\0', and return an int instead |
22:53:21 | mipri | if ret == -1: fail else: dosomething(ret.char) |
22:53:39 | FromDiscord | <ElegantBeef> I mean that's just an annoying option π |
22:53:53 | hmmm | well \0 worked just fine, no idea why tho :O |
22:53:59 | mipri | it's very annoying. it's optionals without optionals, by widening the type. But as bad as that is, '\0' is worse. |
22:54:20 | mipri | '\0' is just ascii 0. whether it "works" depends on what you're doing. |
22:54:31 | FromDiscord | <ElegantBeef> Yea i'm very opinionated in that i dislike the C way of things, but i also havent really used C so i'm jusut daft |
22:54:48 | FromDiscord | <ElegantBeef> You will pretty much never find a `\0` but if you ever do it'll fuck it up |
22:54:51 | mipri | if you've got a readByte that you're feeding binary data that can contain 0 bytes, you're not going to like your '\0' solution |
22:55:16 | FromDiscord | <ElegantBeef> Most places `\0` marks the end of a string or file |
22:56:02 | mipri | od -c $(which nim)|head -1 |
22:56:03 | hmmm | nunu it's just a very simple call to replace from strutils, I wanted to try the char version because it looked cool, but I'll use the string one, it seems less fiddly |
22:56:19 | mipri | \177ELF\2\1\1\0\0\0\0 <- zero bytes. well before the end of the file. |
22:56:21 | FromDiscord | <ElegantBeef> the char version is for a set of characters no? |
22:56:33 | hmmm | nu it works for a single char |
22:56:51 | mipri | hmmm: if you're using '\0' with replace, and think it works, it's very not actually working at all, and just introducing garbage into your string that you're not seeing. |
22:56:51 | FromDiscord | <ElegantBeef> Oh i'm thinking contains |
22:57:05 | hmmm | oh mipri I wasn't aware of that :o |
22:57:24 | hmmm | I'll probably just stick to the string version to be safe |
22:57:38 | FromDiscord | <ElegantBeef> I mean the default `replace` parameter will handle that for you |
22:57:49 | hmmm | I have some results as seqs and wanted to get rid of the "@" |
22:57:50 | mipri | at a shell, run this: echo -e "hi\0there" |
22:58:00 | mipri | you'll see "hithere", but only because the \0 isn't displayed. it's still printed. |
22:58:02 | FromDiscord | <ElegantBeef> !eval import strutils; echo "Hello world".replace("o"); |
22:58:05 | NimBot | Hell wrld |
22:58:17 | mipri | pipe it to |od -c to see it |
22:58:29 | FromDiscord | <ElegantBeef> Or just echo the `toHex` of the string |
22:58:35 | FromDiscord | <ElegantBeef> It'll have `00` in a spot |
22:59:06 | FromDiscord | <ElegantBeef> !eval import strutils; echo "Hello world".replace('o','\0\).toHex; |
22:59:08 | NimBot | Compile failed: /usercode/in.nim(1, 52) Error: missing closing ' for character literal |
22:59:19 | FromDiscord | <ElegantBeef> !eval import strutils; echo "Hello world".replace('o','\0').toHex; |
22:59:22 | NimBot | 48656C6C00207700726C64 |
22:59:50 | FromDiscord | <ElegantBeef> Where `o` what you see it's now `00` which isnt what you want since the string is still the same size just has useless info |
23:00:23 | FromDiscord | <ElegantBeef> But i'm just parroting mipri mostly, so i'll shush π |
23:01:18 | hmmm | it seems quite dangerous |
23:01:55 | FromDiscord | <ElegantBeef> Well yea cause it's purely not what you want π |
23:04:53 | FromDiscord | <shadow.> lmao hmm i was not suggesting \0 as an argument for replace |
23:05:11 | FromDiscord | <shadow.> i thought you were returning some sort of null char and that would be the closest thing without using an option |
23:05:51 | hmmm | shadow if you see my nick always assume I'm abusing something very dangerous that I understand 10% of |
23:18:14 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GEG |
23:20:54 | * | mbomba quit (Quit: WeeChat 3.0) |
23:21:13 | FromDiscord | <shadow.> may i ask why you're casting a function to a pointeR? |
23:21:15 | FromDiscord | <shadow.> (edit) "pointeR?" => "pointer?" |
23:23:42 | * | luis joined #nim |
23:24:10 | disruptek | it turns out that if you understand 10% of thai ladyboys, you basically know all the necessaries. |
23:24:47 | FromDiscord | <fwsgonzo> Sure. I am working on an enterprise product that is split into a frontend and backend side - when you generate content for the backend, it's done by passing a function that generates that content. It's not the same VM that runs the the front and backend sides, for "obvious" reasons. |
23:25:15 | FromDiscord | <shadow.> hmm |
23:25:15 | FromDiscord | <fwsgonzo> (edit) "Sure. I am working on an enterprise product that is split into a frontend and backend side - when you generate content for the backend, it's done by passing a function that generates that content. It's not the same VM that runs the the front and backend sides, for "obvious" reasons. ... " added "So, the ABI is to pass an address to the generator." |
23:25:25 | FromDiscord | <shadow.> how are they communicating? |
23:25:29 | FromDiscord | <shadow.> in a way that you can pass a pointer |
23:25:32 | disruptek | doesn't matter. |
23:26:31 | disruptek | you don't have pointers in the vm, regardless of platform. |
23:27:01 | FromDiscord | <fwsgonzo> `https://fwsgonzo.medium.com/virtual-machines-for-multi-tenancy-in-varnish-1c619ea3276` |
23:27:15 | FromDiscord | <fwsgonzo> maybe that will help explain some details ^ |
23:28:00 | disruptek | if this is your own vm, then you can send whatever you want. |
23:28:33 | FromDiscord | <fwsgonzo> what am I supposed to say to that? yes? |
23:28:46 | FromDiscord | <shadow.> i believe it's suppose to make you wonder |
23:28:53 | FromDiscord | <shadow.> "why am i using a pointer?" |
23:29:06 | FromDiscord | <fwsgonzo> indeed, I am wondering about things now |
23:29:16 | FromDiscord | <shadow.> you realize you can pass functions as arguments, correct? |
23:29:23 | FromDiscord | <shadow.> just making sure lmao |
23:29:37 | FromDiscord | <fwsgonzo> yes π |
23:29:42 | * | luis quit (Quit: WeeChat 2.9) |
23:30:04 | FromDiscord | <shadow.> then why use a pointer |
23:30:40 | disruptek | ot |
23:30:54 | disruptek | oops. it's a cast of something serialized/deserialized, i guess. |
23:31:17 | disruptek | the answer is, yes, that will deref the pointer. (what else?) |
23:31:53 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GEK |
23:32:15 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GEL |
23:32:32 | FromDiscord | <fwsgonzo> it's not turning farg into a forge_cb properly |
23:32:50 | disruptek | remove the space in your cast call; it's invalid syntax. |
23:33:24 | disruptek | function parens must abut their symbols, else it's "command syntax". |
23:33:26 | disruptek | ~ufcs |
23:33:27 | disbot | ufcs: 11a misnomer. See https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d for one set of opinions. -- disruptek |
23:33:30 | ForumUpdaterBot | New thread by Doofenstein: Alternative term for addr, see https://forum.nim-lang.org/t/7203 |
23:35:30 | FromDiscord | <fwsgonzo> it didn't fix the warning, at least |
23:36:27 | disruptek | sweet. i'd hate to see it go. |
23:36:58 | FromDiscord | <shadow.> sorry but i don't remember getting an answer lol, why not just pass the function as an argument? |
23:37:01 | FromDiscord | <shadow.> instead of messing around with pointers |
23:37:14 | FromDiscord | <fwsgonzo> because you can't pass a nim function to outside of a VM |
23:37:19 | FromDiscord | <fwsgonzo> and into another |
23:37:32 | disruptek | maybe we should make it work in frosty. |
23:37:36 | disruptek | !repo frosty |
23:37:37 | disbot | https://github.com/disruptek/frosty -- 9frosty: 11serialize native Nim types to strings, streams, or sockets β 15 20β 1π΄ |
23:39:05 | FromDiscord | <shadow.> true |
23:39:19 | FromDiscord | <fwsgonzo> so I can freeze a function? |
23:39:34 | disruptek | i honestly don't know what it would do. |
23:39:51 | disruptek | so basically, yes. we could come up with a solution. |
23:40:14 | disruptek | if it doesn't already work, i mean. |
23:40:16 | hmmm | calling procs without ()? that's bold of you mr d.tek |
23:40:32 | disruptek | i'm a fuckin' mad man. |
23:40:37 | FromDiscord | <ElegantBeef> "bold" π |
23:40:56 | FromDiscord | <Avatarfighter> stupid question, can I use karax to generate raw ? I'm considering using it as an xml dsl |
23:41:03 | disruptek | wtf is raw? |
23:41:17 | FromDiscord | <ElegantBeef> https://github.com/juancarlospaco/nim-html-dsl |
23:41:24 | FromDiscord | <Avatarfighter> (edit) "stupid question, can I use karax to generate raw ... ?" added "xml" |
23:41:31 | FromDiscord | <Avatarfighter> disruptek: I forgot the word xml |
23:41:31 | FromDiscord | <ElegantBeef> HTML is just slightly weirder XML |
23:41:33 | * | tane quit (Quit: Leaving) |
23:41:50 | FromDiscord | <Cohjellah> So I missed out on the first few days of AoC because I was moving house. Reckon I could catch up? |
23:41:54 | FromDiscord | <Cohjellah> Completely new to Nim |
23:41:55 | FromDiscord | <Avatarfighter> @ElegantBeef yeah ik but i need to make xml files not html lmao |
23:41:56 | hmmm | squared and halved is genius |
23:42:01 | FromDiscord | <Avatarfighter> im just lazy and wanted to use karax |
23:42:14 | FromDiscord | <ElegantBeef> XML is super similar to html, so use that dsl then modify whatever you need π |
23:42:17 | * | suchasurge quit (Quit: Ping timeout (120 seconds)) |
23:42:25 | FromDiscord | <Avatarfighter> smart |
23:42:36 | * | suchasurge joined #nim |
23:42:39 | FromDiscord | <Recruit_main707> @Cohjellah I think so |
23:42:47 | FromDiscord | <ElegantBeef> Yea day4 is the only one that takes anytime |
23:42:51 | FromDiscord | <ElegantBeef> The rest are stupid simple |
23:42:55 | FromDiscord | <Cohjellah> Hahah good |
23:42:58 | FromDiscord | <Cohjellah> I'll get on it now |
23:43:01 | FromDiscord | <Cohjellah> Got free time finally |
23:43:08 | FromDiscord | <ElegantBeef> day4 only takes time since they're being a pain π |
23:43:10 | FromDiscord | <Cohjellah> Moving blows ass. Can I be rich so I can afford movers ty |
23:43:12 | disruptek | eh learn clojure instead. |
23:43:36 | * | luis joined #nim |
23:43:44 | FromDiscord | <ElegantBeef> Or rust/python |
23:43:51 | FromDiscord | <ElegantBeef> Will be swimming in money Soon TM π |
23:44:13 | hmmm | ufcs was a nice read but too short, do more examples please |
23:45:08 | FromDiscord | <ElegantBeef> Is it really that complicated? UFCS passes the left hand of the dot operator if it matches the proc's first argument |
23:45:18 | FromDiscord | <ElegantBeef> and you can omit the `()` if there are no other arguments |
23:48:38 | disruptek | fwsgonzo: this is an interesting read, thanks. |
23:48:45 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GEP |
23:48:58 | FromDiscord | <ElegantBeef> Is Zevv about? Or anyone that knows how to write patterns for Npeg? π |
23:49:00 | FromDiscord | <shadow.> did you not just read what disruptek sent |
23:49:01 | FromDiscord | <shadow.> LMAO |
23:49:18 | FromDiscord | <shadow.> > `unsafeAddr(callback)` |
23:49:26 | FromDiscord | <shadow.> rip |
23:49:31 | FromDiscord | <Quibono> Anyone with good eyes, I'm getting a data-format error with my JSON and I can't see why... |
23:49:41 | FromDiscord | <shadow.> use an unminifier maybe? |
23:49:45 | FromDiscord | <shadow.> and see what it says |
23:49:51 | FromDiscord | <ElegantBeef> and throw it in something with a linter π |
23:51:19 | FromDiscord | <Quibono> https://play.nim-lang.org/#ix=2GEO The format it's supposed to follow is commented on top, I'm so lost. |
23:51:40 | * | hmmm quit (Quit: catching z's) |
23:51:43 | disruptek | fwsgonzo: it's a stack address because it's a parameter from the function that is copied to the stack. |
23:52:04 | disruptek | you could, for example, make a lookup table. |
23:52:09 | FromDiscord | <fwsgonzo> I'm trying to look for alternatives to C++. For various reasons I can't use languages that don't compile down to C/C++ due to size and memory contraints. So I am really just trying to make a MVP in Nim right now, and see how that goes. So far I've added 32-bit RISC-V support and helped fixed an ARC/ORC bug. |
23:52:09 | FromDiscord | <shadow.> you should try jason |
23:52:25 | FromDiscord | <shadow.> he's a cool guy |
23:52:29 | FromDiscord | <fwsgonzo> and yes, I did suspect that, but I'm not sure how to get the real address |
23:52:33 | FromDiscord | <shadow.> disruptek might be able to introduce you |
23:52:40 | FromDiscord | <ElegantBeef> I am? |
23:52:47 | FromDiscord | <Quibono> Lol why will disruptek's json lib help? |
23:52:56 | FromDiscord | <shadow.> idk i just like the name |
23:54:22 | disruptek | the lookup table doesn't need the real address. it just needs a handle, right? |
23:54:38 | FromDiscord | <ElegantBeef> I also like the name, but i'm biased π |
23:54:47 | disruptek | jason was really a poc for frosty. |
23:55:01 | disruptek | they both suffer from flaws due to missing concept support. |
23:55:49 | disruptek | i need to put cps into frosty to make it feature complete but i cannot do that until the compiler bug(s) are fixed. |
23:56:47 | * | NimBot joined #nim |
23:56:49 | disruptek | s/until/into/ |
23:56:52 | disruptek | damn english. |
23:59:32 | ForumUpdaterBot | New thread by Jaybill: Random float based on unsigned int, see https://forum.nim-lang.org/t/7204 |