<< 04-12-2020 >>

00:00:08FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpL
00:00:08FromDiscord<shadow.> is that what you're talking about?
00:00:11FromDiscord<shadow.> where you can mutate the value
00:00:31FromDiscord<Cohjellah> Why do they call it a procedure in Nim?
00:00:44FromDiscord<shadow.> i think araq was asked that in an interview once
00:00:46FromDiscord<shadow.> lemme go find the answer
00:00:48FromDiscord<Quibono> Why not? :p
00:00:58FromDiscord<shadow.> alr lemme find this ill find it
00:01:04FromDiscord<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:37FromDiscord<shadow.> something like that
00:01:43FromDiscord<j-james> @Cohjellah Because functions with side effects are technically procedures, iirc
00:01:46FromDiscord<shadow.> and also because functions are used as no side affect procedures
00:01:47FromDiscord<shadow.> yeah
00:01:56FromDiscord<shadow.> (edit) "no side affect" => "no-side-affect"
00:02:06FromDiscord<Quibono> Someone remind me what counts as a side effect!
00:02:07FromDiscord<shadow.> @j-james lol did you figure out what you meant?
00:02:08FromDiscord<Quibono> ?
00:02:17FromDiscord<shadow.> @Quibono using global vars or io manipulation
00:02:17FromDiscord<shadow.> iirc
00:02:26FromDiscord<j-james> not yet
00:02:28FromDiscord<Quibono> Gotcha
00:02:29FromDiscord<shadow.> lol
00:02:34FromDiscord<shadow.> lemme try doing what ur code did james
00:02:54FromDiscord<j-james> it's not a code-specific thing
00:03:09FromDiscord<j-james> just the concept of making the parameter mutable but only inside the proc
00:03:13FromDiscord<shadow.> OHHH
00:03:18FromDiscord<shadow.> i see what you mean
00:03:19FromDiscord<shadow.> hmm
00:04:14FromDiscord<shadow.> i coulda sworn what you did was a shadow but i guess not lmao
00:04:25FromDiscord<shadow.> lemme see if there's an easier way to do it
00:05:53FromDiscord<shadow.> yeah idk lmao
00:10:16*rockcavera joined #nim
00:14:18FromDiscord<Cohjellah> No side effect??
00:14:21FromDiscord<Cohjellah> What
00:14:52FromDiscord<shadow.> what
00:15:09FromDiscord<shadow.> it means no global vars used or io manipulation
00:15:09FromDiscord<shadow.> i believe
00:15:26FromDiscord<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:36FromDiscord<shadow.> fair enough
00:15:48FromDiscord<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:08FromDiscord<shadow.> i thought they couldn't use io streams either?
00:16:18FromDiscord<shadow.> or is that just pure functions
00:16:19FromDiscord<ElegantBeef> Even echo mutates the global state, as it moves the stdout
00:16:39FromDiscord<shadow.> ohh right
00:16:39FromDiscord<ElegantBeef> Yea it cannot use io streams either as moving the position is effecting the global state
00:16:44FromDiscord<shadow.> yeah
00:17:03FromDiscord<shadow.> basically all they can do is return a value or modifying a passed reference?
00:17:06FromDiscord<ElegantBeef> They're basically input -> output only if they're "pure"
00:17:07FromDiscord<shadow.> (edit) "modifying" => "modify"
00:17:15FromDiscord<shadow.> yeah
00:17:26FromDiscord<ElegantBeef> Yea you're right shadow
00:17:26FromDiscord<shadow.> in that case should i be making many of my procs funcs lol?
00:17:30FromDiscord<shadow.> is there any speed difference
00:17:43FromDiscord<shadow.> or is it just so the compiler can yell at you
00:17:45FromDiscord<ElegantBeef> Well procs get turned into funcs implictly but yes if you dont need procs make it a func
00:17:49FromDiscord<shadow.> ohh ok
00:18:09FromDiscord<ElegantBeef> The "standard convention" is to use a func unless you cannot
00:18:15FromDiscord<shadow.> fr? i mostly see procs used
00:18:19FromDiscord<shadow.> but yeah ill start doing that
00:18:32FromDiscord<shadow.> im guessing that way you dont accidentally use echo or global vars where you dont mean to since yk compiler warnings
00:18:38FromDiscord<ElegantBeef> I think it's mostly due to the newer `strictFuncs` where they're actually side effect tracing properly
00:18:50FromDiscord<shadow.> ohh ok
00:19:01FromDiscord<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:05FromDiscord<ElegantBeef> Unlike previously
00:19:25FromDiscord<shadow.> ohhh
00:19:26FromDiscord<ElegantBeef> I could be wrong about the "standard convention" but there's no harm in doing such
00:19:29FromDiscord<shadow.> fair enough yeah
00:19:54FromDiscord<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:59FromDiscord<shadow.> (edit) "proc's" => "procs"
00:20:06FromDiscord<shadow.> funcs
00:20:07FromDiscord<ElegantBeef> I believe that's what 4raq has said
00:20:11FromDiscord<shadow.> ahh ok
00:21:04FromDiscord<shadow.> lol i still needa figure out type deduction in macros
00:21:12FromDiscord<ElegantBeef> what do you mean?
00:21:36FromDiscord<shadow.> well ive talked abt this before but
00:21:40FromDiscord<shadow.> im making a comprehension thingy bc why not
00:21:56FromDiscord<shadow.> and id prefer to not have to pass the comprehension type
00:21:57FromDiscord<ElegantBeef> If you want to read about functions/strictFuncs https://nim-lang.org/blog/2020/09/01/write-tracking.html
00:22:01FromDiscord<shadow.> thanks
00:22:09*rockcavera quit (Remote host closed the connection)
00:22:50FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpO
00:22:50FromDiscord<shadow.> so this is currently what im doing
00:22:58FromDiscord<shadow.> but id prefer to not have to pass the seqType lol
00:23:28FromDiscord<ElegantBeef> oh
00:23:42FromDiscord<ElegantBeef> Pass the body as `typed` then you can see the lits πŸ˜„
00:23:50FromDiscord<ElegantBeef> actually that's not needed
00:23:52FromDiscord<shadow.> hmm well
00:23:54FromDiscord<ElegantBeef> You can just use the lits if you want
00:23:57FromDiscord<shadow.> i mean
00:24:03FromDiscord<shadow.> i need to figure out what the expression type result will be
00:24:07FromDiscord<shadow.> bc yk someone could do
00:24:20FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpP
00:24:22FromDiscord<shadow.> and assuming an int lit wouldn't work
00:24:36FromDiscord<ElegantBeef> No but you know `$` is the stringification operator πŸ˜›
00:24:50FromDiscord<shadow.> ahh i see
00:25:02FromDiscord<shadow.> you're saying i can deduce the result of anything bc yk static typing
00:25:05FromDiscord<shadow.> so that's all i have to do?
00:25:14FromDiscord<ElegantBeef> If the left is a call you can look at the procdef using `getimpl` on the typed node
00:25:23FromDiscord<shadow.> oh bet lemme try that
00:25:25FromDiscord<ElegantBeef> so make sure your body is typed, and you might be able to
00:26:11FromDiscord<shadow.> well if i make it typed
00:26:15FromDiscord<shadow.> then i get unidentified i lmmao
00:26:28FromDiscord<ElegantBeef> Ok what are you attempting to do in words
00:26:33FromDiscord<shadow.> hmm
00:26:41FromDiscord<ElegantBeef> easily populate a sequence?
00:26:50FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpQ
00:26:52FromDiscord<shadow.> a way to map and filter basically easily yes
00:26:56FromDiscord<shadow.> that currently works
00:27:01FromDiscord<shadow.> buut i have to pass the seq type at the end
00:27:10FromDiscord<ElegantBeef> ok so what does that replace?
00:27:28FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpR
00:27:47FromDiscord<shadow.> and since i have to do a newSeq[]() call
00:27:52FromDiscord<shadow.> i need to know the type of i i
00:28:29FromDiscord<ElegantBeef> Ok so the layout right now is `body | iter, conditions`?
00:28:35FromDiscord<shadow.> yes
00:28:40FromDiscord<ElegantBeef> Weird idea, why not make those each seperate variables for your macro?
00:28:50FromDiscord<shadow.> wym
00:28:58FromDiscord<shadow.> well id like it to be concise i suppose
00:29:04FromDiscord<ElegantBeef> It's not concise though
00:29:25FromDiscord<ElegantBeef> `comp(i i, 1..10, i mod 2 == 0)`
00:29:28FromDiscord<ElegantBeef> It's the same thing
00:29:35FromDiscord<shadow.> hmm
00:29:42FromDiscord<shadow.> how would it know i is the sym
00:29:53FromDiscord<ElegantBeef> well you can just say that it is
00:29:57FromDiscord<ElegantBeef> or `it` rather
00:29:58FromDiscord<shadow.> lol fair enough
00:29:59FromDiscord<shadow.> yeah it
00:30:08FromDiscord<shadow.> but then for pairs and stuff
00:30:13FromDiscord<shadow.> alr ill try that thanks
00:30:39FromDiscord<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:45FromDiscord<shadow.> true alright thanks
00:30:48FromDiscord<shadow.> lemme try that
00:31:07FromDiscord<ElegantBeef> This might be down a path of misfortune as i'm obviously not the smartest with macros, but eh πŸ˜„
00:31:25FromDiscord<shadow.> we'll see how it goes lmao
00:32:24FromDiscord<shadow.> thanks for the help ill give that a shot
00:36:48FromDiscord<shadow.> almost done
00:37:51FromDiscord<shadow.> hmm
00:37:51FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GpU
00:39:38*jaggz left #nim ("Leaving")
00:39:46FromDiscord<shadow.> kk it works
00:39:51FromDiscord<shadow.> when i give it type
00:39:55FromDiscord<shadow.> now i needa make it deduce type
00:40:33FromDiscord<shadow.> @ElegantBeef could you explain that one more time? sorry
00:41:05FromDiscord<shadow.> im guessing i can do something like
00:41:39FromDiscord<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:46FromDiscord<shadow.> so id have to predeclare, and i cant declare it without knowing type
00:56:49FromDiscord<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:39FromDiscord<ElegantBeef> @shadow. ok let's see if i can make a bodge and a half πŸ˜›
01:17:51FromDiscord<shadow.> haha
01:19:01FromDiscord<shadow.> i suppose i could store the string form πŸ’€
01:19:08FromDiscord<shadow.> wait nvm
01:19:19FromDiscord<shadow.> i still couldnt parse that into an ident in the macro since it wouldn't be executed until after compile
01:19:20FromDiscord<shadow.> yeah idrk
01:19:27FromDiscord<shadow.> good luck
01:21:30*lritter joined #nim
01:21:40FromDiscord<shadow.> just ping me if u figure something out lol
01:39:45FromDiscord<shadow.> @ElegantBeef i present to you
01:39:47FromDiscord<shadow.> the ultimate bodge
01:39:57FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gq7
01:40:07FromDiscord<shadow.> behold the most inefficient (iterates entire iterator to get type!) bodge of all time
01:40:09FromDiscord<ElegantBeef> that's not bad
01:40:18FromDiscord<ElegantBeef> πŸ˜›
01:40:20FromDiscord<shadow.> i mean its not verbose but like
01:40:24FromDiscord<shadow.> it has to iterate the whole thing
01:40:33FromDiscord<shadow.> lemme see how the toSeq template works
01:40:37FromDiscord<ElegantBeef> Yea just get the first element
01:40:44FromDiscord<Rika> Uh
01:40:49FromDiscord<Rika> Hello
01:40:51FromDiscord<shadow.> hi
01:41:06FromDiscord<Rika> Are we iterating a closure iterator or any iterator
01:41:06FromDiscord<shadow.> what
01:41:08FromDiscord<shadow.> wait
01:41:09FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gq8
01:41:14FromDiscord<shadow.> oh uh well any iterator i think?
01:41:24FromDiscord<shadow.> usually it would be a seq or hslice
01:41:39FromDiscord<shadow.> idk how to "peek" an iterator tho
01:41:56FromDiscord<Rika> Well for loop then immediately break after?
01:42:02FromDiscord<shadow.> well you see
01:42:12FromDiscord<shadow.> for loops open up a new scope right?
01:42:23FromDiscord<shadow.> and i cant declare a var above the scope bc vars cant hold types
01:42:33FromDiscord<Rika> param.distinctBase?
01:42:42FromDiscord<Rika> Or whatever it is in that type thingy module
01:42:55FromDiscord<shadow.> hm?
01:43:02FromDiscord<shadow.> im not sure ik what u mean
01:43:07FromDiscord<shadow.> typetraits?
01:43:36FromDiscord<Rika> https://nim-lang.org/docs/typetraits.html#genericParams.t%2Ctypedesc
01:43:59FromDiscord<Rika> This
01:44:15FromDiscord<Rika> Well this is for the seqs
01:44:21FromDiscord<Rika> For iterators I do not remember
01:44:26FromDiscord<shadow.> yeah this needs to work for any iterator with an item proc
01:44:33FromDiscord<shadow.> (edit) "proc" => "iterator"
01:44:44FromDiscord<shadow.> is there a way to get the yield type of an iterator using macros?
01:44:44FromDiscord<Rika> Oh hey
01:44:46FromDiscord<Rika> https://nim-lang.org/docs/typetraits.html#elementType.t%2Cuntyped
01:44:48FromDiscord<Rika> Right above it
01:44:57FromDiscord<shadow.> YO
01:45:02FromDiscord<shadow.> thank you
01:45:04FromDiscord<Rika> Lol
01:45:08FromDiscord<shadow.> haha
01:45:13FromDiscord<Rika> LMAO
01:45:27FromDiscord<shadow.> YESSSS
01:45:28FromDiscord<shadow.> IT WORKED
01:45:30FromDiscord<shadow.> OML TYSM
01:45:42FromDiscord<Rika> LMAO
01:45:48FromDiscord<shadow.> PLS WHY WAS IT THAT SIMPLE IM CRYING-
01:45:49FromDiscord<shadow.> ASDJAOSJDOAJSG
01:46:04FromDiscord<shadow.> i was rly aboutta bodge like 50 lines before the toSeq thing πŸƒβ€β™€οΈ
01:46:19FromDiscord<Rika> I love how I was able to help even if I don't know what you're making
01:46:21FromDiscord<shadow.> LOL
01:46:25FromDiscord<shadow.> ill show you once i figure the rest out
01:48:36FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Gq9 @shadow. well here is my attempt πŸ˜„
01:48:46FromDiscord<shadow.> RIP-
01:48:49FromDiscord<ElegantBeef> Ah that's pretty nice aswell rika
01:48:51FromDiscord<shadow.> lowkey what i was gonna do tho
01:49:02FromDiscord<shadow.> like a shit ton of code
01:49:05FromDiscord<shadow.> ok lemme figure this out now
01:50:01FromDiscord<shadow.> hmmm
01:51:21FromDiscord<shadow.> lit it works
01:51:40FromDiscord<ElegantBeef> Yea i fucked what i was doing up πŸ˜„
01:51:50FromDiscord<ElegantBeef> i hardcoded the `it it`
01:51:55FromDiscord<shadow.> oh rip lmao
01:51:56FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqa
01:51:58FromDiscord<shadow.> this is what i wound up doing
01:52:12FromDiscord<ElegantBeef> I dont like that it's all one lined πŸ˜„
01:52:12FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqb
01:52:21FromDiscord<shadow.> @ElegantBeef you ever tried haskell?
01:52:25FromDiscord<ElegantBeef> Clearly not
01:52:27FromDiscord<shadow.> LOL
01:52:48FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/784235720918827018/unknown.png
01:52:52FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/784235740355100743/unknown.png
01:53:06FromDiscord<ElegantBeef> Yea but haskell is just a research language
01:53:16FromDiscord<shadow.> fair idk i like the look of FP im weird
01:53:27FromDiscord<shadow.> prolly bc i overused comprehensions in py
01:53:35FromDiscord<shadow.> @Rika it worked ty
01:53:57FromDiscord<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:28FromDiscord<Rika> I don't get comp
01:54:43FromDiscord<Rika> So it's just filter then a map?
01:54:44FromDiscord<ElegantBeef> Seems like it's just weird map/apply
01:54:49FromDiscord<shadow.> its like
01:54:56FromDiscord<Rika> First filter then map?
01:55:00FromDiscord<shadow.> yeah
01:55:03FromDiscord<shadow.> like here lemme make an example
01:55:10FromDiscord<Rika> Why combine then
01:55:13FromDiscord<shadow.> you want a list of all numbers 1..100 if they're even and you want them squared
01:55:19FromDiscord<shadow.> in python it would be
01:55:36FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqd
01:55:50FromDiscord<shadow.> you can also do it without the if statement
01:56:07FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqe
01:56:31FromDiscord<ElegantBeef> isnt that in nim just `filterit(0..100, it mod 2 == 0`
01:56:36FromDiscord<shadow.> pretty much yeah
01:56:41FromDiscord<shadow.> or like
01:56:42FromDiscord<ElegantBeef> I guess that doesnt work since that's not a sequence
01:56:45FromDiscord<shadow.> yeah
01:56:54FromDiscord<shadow.> toSeq()
01:57:11FromDiscord<shadow.> now i just need a way to call it with []
01:57:16FromDiscord<ElegantBeef> So why not just avoid that entire `comp` thing and just make `iter` map/filter/apply πŸ˜„
01:57:35FromDiscord<shadow.> idk imo comp is easier to read
01:57:44FromDiscord<shadow.> for instance in the square one
01:57:51FromDiscord<ElegantBeef> I mean it's one line it's almost always less readable πŸ˜„
01:58:18FromDiscord<Rika> We need more love for closure iterators but it's understandable why there isn't much
01:58:36FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqg
01:58:43FromDiscord<shadow.> idk in python map and filter are verbose so im use to comprehensions
01:58:55FromDiscord<Rika> Imagine infinitely recursable non-inline iterators aaaa
01:58:57FromDiscord<shadow.> (edit) "https://play.nim-lang.org/#ix=2Gqg" => "https://play.nim-lang.org/#ix=2Gqh"
01:58:59FromDiscord<shadow.> lol
01:59:10FromDiscord<Rika> Not in nim so not comparable
01:59:15FromDiscord<shadow.> fair enough
01:59:20FromDiscord<ElegantBeef> i mean i suggested `filterit(0..100, it mod 2 == 0).map(it it)`
01:59:40FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqi
01:59:49FromDiscord<shadow.> in your opinion yours is more readable?
01:59:52FromDiscord<ElegantBeef> Yes
01:59:53FromDiscord<shadow.> idk to me second makes more sense
01:59:53FromDiscord<Rika> Yes
02:00:01FromDiscord<ElegantBeef> It's clear where each step is occuring
02:00:02FromDiscord<shadow.> i mean there's also
02:00:14FromDiscord<Rika> I think I'd rather read Beef's version than yours as I have no idea what comp means or does
02:00:26FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gql
02:00:27FromDiscord<ElegantBeef> plus your order of declaration is off
02:00:29FromDiscord<shadow.> that's alehandre's version
02:00:42FromDiscord<ElegantBeef> the iterator should be first, as it's what is getting worked on
02:00:42FromDiscord<shadow.> (edit) "alehandre's" => "alehander's"
02:00:49FromDiscord<ElegantBeef> but it still doesnt help much
02:01:01FromDiscord<shadow.> i mean yeah obviously i can flip it around lol
02:01:57FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqn
02:01:59FromDiscord<shadow.> eh i get what you mean i suppose
02:02:17FromDiscord<j-james> What's the best way to initialize a multidimensional array?
02:02:29FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqo
02:02:30FromDiscord<shadow.> zero-d or filled?
02:03:09FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqp
02:03:28FromDiscord<j-james> Whoops, I meant a multidimensional seq
02:03:39FromDiscord<ElegantBeef> `seq[seq[T]]`
02:03:42FromDiscord<j-james> Currently my code looks like `var image: seq[seq[seq[int]]]`
02:04:05FromDiscord<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:05FromDiscord<shadow.> @j-james the way you're doing works
02:05:11FromDiscord<shadow.> you can also do
02:05:26FromDiscord<j-james> The problem is that I get out of bounds errors when assigning items
02:05:35FromDiscord<j-james> So I strongly suspect I need to fill it
02:05:39FromDiscord<j-james> somehow
02:05:40FromDiscord<shadow.> ohh yeah
02:05:43FromDiscord<shadow.> you can use like
02:05:48FromDiscord<shadow.> setLen
02:06:01FromDiscord<shadow.> i think?
02:06:44FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqq
02:06:44FromDiscord<shadow.> ye?
02:07:04*lum quit (Quit: Lum: Bye!)
02:08:04FromDiscord<shadow.> does that work lol
02:08:15FromDiscord<shadow.> and as for in the 3d, i would just use nested loops lol
02:08:26FromDiscord<shadow.> oh wait a minute
02:08:34FromDiscord<shadow.> i might be having a big brain moment
02:08:51FromDiscord<shadow.> BRUH IM SO DUMB ASHDOASJDASD
02:09:15FromDiscord<shadow.> hmm wait am i
02:09:16*lum joined #nim
02:10:24*letto joined #nim
02:10:37FromDiscord<j-james> hmm hmm hmm
02:10:42FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqs
02:10:43FromDiscord<shadow.> LMAO
02:10:58FromDiscord<shadow.> that should technically work
02:11:27FromDiscord<j-james> `setLen()` should work too, i was messing around with my implementation
02:11:28FromDiscord<ElegantBeef> Back to hideous one liners πŸ˜„
02:11:32FromDiscord<shadow.> YES
02:11:36FromDiscord<shadow.> we love those here
02:11:50FromDiscord<shadow.> idk i just think you'd need like 10 lines of nested for loops and variables and shit
02:11:55FromDiscord<shadow.> and why not just repeat 0's 3 times LMAO
02:11:58FromDiscord<j-james> yes pretty much
02:12:16FromDiscord<ElegantBeef> Typically i split code across multiple lines so it's actually easily parsable
02:12:21*apahl_ joined #nim
02:12:43FromDiscord<shadow.> ehhh
02:12:49FromDiscord<shadow.> ehhhhhh
02:13:03FromDiscord<j-james> i am reevaluating my tendency to make fancy data structures
02:13:09FromDiscord<shadow.> lol
02:13:30FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqt
02:13:40FromDiscord<ElegantBeef> Very unreadable 10/10
02:13:43FromDiscord<shadow.> ty ty
02:14:03FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqu
02:14:03FromDiscord<shadow.> that's just so much workkk
02:14:36*apahl quit (Ping timeout: 240 seconds)
02:14:49FromDiscord<ElegantBeef> solving each part independantly?
02:15:16FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/784241378418753567/unknown.png
02:15:17FromDiscord<ElegantBeef> So hard πŸ˜„
02:15:46*omn1present_ joined #nim
02:16:23FromDiscord<shadow.> blech
02:16:26FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=2Gqv
02:16:28FromDiscord<shadow.> BLECH
02:16:38FromDiscord<shadow.> lol
02:17:00FromDiscord<shadow.> jk thats nice
02:17:02FromDiscord<ElegantBeef> Hey it's against my will power to solve each pt one way
02:17:08FromDiscord<shadow.> this was my part one
02:17:12FromDiscord<shadow.> pretty meh
02:17:12FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqw
02:17:29FromDiscord<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:48FromDiscord<shadow.> same
02:18:04FromDiscord<shadow.> the deltas thing was just automating inserting the 's bc im lazy
02:18:45FromDiscord<shadow.> what was your guys' day 1's?
02:18:52FromDiscord<j-james> My part two originally toggled a bool instead of the first modulo
02:18:55FromDiscord<j-james> it was gross
02:19:16FromDiscord<shadow.> blech
02:19:17FromDiscord<shadow.> lol
02:19:19FromDiscord<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:52FromDiscord<ElegantBeef> Wanted more speed πŸ˜„
02:20:54FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gqx
02:20:56FromDiscord<shadow.> that was my part one
02:21:17FromDiscord<shadow.> target being 2020
02:21:53FromDiscord<j-james> Brace yourself
02:21:56FromDiscord<shadow.> uh oh
02:22:00FromDiscord<shadow.> nested for loop?
02:22:03FromDiscord<shadow.> WHAT
02:22:04FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=2Gqy
02:22:10FromDiscord<j-james> you know it
02:22:12FromDiscord<shadow.> lol
02:22:22FromDiscord<ElegantBeef> Hey mine was nested loops just hidden
02:22:23FromDiscord<shadow.> you coulda used a block instead of a done bool iirc
02:22:27FromDiscord<j-james> as a bonus, ugly parseInts littered throughout
02:22:33FromDiscord<shadow.> i believe my solution was O(n) πŸ˜‰
02:23:14FromDiscord<j-james> the done bool over a block is so that the answers output in the correct order
02:23:30FromDiscord<William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2GqA
02:26:02FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqB
02:26:12FromDiscord<shadow.> lol
02:26:26FromDiscord<j-james> (edit) the done bool over a block is so that the answers output in the correct order↡who needs procedures
02:27:25FromDiscord<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:08FromDiscord<shadow.> true but
02:28:12FromDiscord<shadow.> once it's hidden inside a package
02:28:17FromDiscord<shadow.> nobody will see anything πŸ˜‰
02:28:23FromDiscord<ElegantBeef> "hidden"
02:28:28FromDiscord<shadow.> one sec
02:28:29FromDiscord<ElegantBeef> Proprietary Nim packages
02:28:37FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/784244734633574490/unknown.png
02:28:37FromDiscord<shadow.> rip-
02:28:38FromDiscord<shadow.> LOL
02:28:48FromDiscord<shadow.> not hidden 😒
02:28:55FromDiscord<shadow.> ik i was joking
02:29:15FromDiscord<shadow.> guess what else i did on day one
02:29:20FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqD
02:29:50FromDiscord<ElegantBeef> Well i would've done that if i wasnt slurping the text into the binary
02:29:55FromDiscord<shadow.> fair enough
02:30:12FromDiscord<shadow.> is there a way to read files in compile-time
02:30:15FromDiscord<ElegantBeef> Yes
02:30:21FromDiscord<ElegantBeef> Slurp/staticread
02:30:22FromDiscord<shadow.> like making nums a const?
02:30:23FromDiscord<shadow.> oo
02:30:33FromDiscord<ElegantBeef> Look at the top of my day one
02:31:15FromDiscord<ElegantBeef> you can technically do `ints = toSeq(slurp("day1.txt").splitLines).map parseInt`
02:31:21FromDiscord<shadow.> LOL
02:31:34FromDiscord<shadow.> you already knowwww
02:32:27FromDiscord<shadow.> sad
02:32:29FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqF
02:37:13FromDiscord<shadow.> im guessing an issue with toSeq
02:37:13FromDiscord<ElegantBeef> Guess it failed πŸ˜„
02:37:22FromDiscord<shadow.> suits me right for bringing FP into nim
02:37:29FromDiscord<ElegantBeef> Hey nim is very FP
02:37:32FromDiscord<ElegantBeef> It has funcs πŸ˜›
02:37:34FromDiscord<shadow.> LOL
02:37:35FromDiscord<shadow.> true
02:37:46FromDiscord<shadow.> but luckily it doesnt have like
02:37:51FromDiscord<William_CTO> Mind if I repots my issue when chat settles down?
02:38:49FromDiscord<shadow.> sent a long message, see http://ix.io/2GqK
02:39:09FromDiscord<shadow.> go ahead im not saying anything meaningful anyways lmao
02:40:14FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqL
02:40:33FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqM
02:40:36FromDiscord<ElegantBeef> You know it isnt
02:40:42FromDiscord<shadow.> it's so lovely to look at
02:40:45FromDiscord<shadow.> and easy to understand
02:40:57FromDiscord<shadow.> (ima be honest idk wtf this does and this is literally a copy of a program i made in another language)
02:41:09FromDiscord<shadow.> LOL
02:43:40*abm quit (Quit: Leaving)
02:44:55FromDiscord<Rika> Lost me at ::
02:53:05FromDiscord<William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2GqP
02:57:55FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqQ
02:58:01FromDiscord<shadow.> line 55 is the quote
02:59:53FromDiscord<ElegantBeef> Thats a template bud
03:00:11FromDiscord<shadow.> fuck
03:00:20FromDiscord<shadow.> still doesnt work as macro
03:00:29FromDiscord<shadow.> same error
03:00:34FromDiscord<ElegantBeef> supposed to be `quote do`
03:00:47FromDiscord<shadow.> same error
03:01:08FromDiscord<shadow.> lol
03:01:23FromDiscord<j-james> Speaking of templates, is there something special that needs to be done to override system methods?
03:01:33FromDiscord<Rika> I believe quote do and quote are identical now...
03:01:38FromDiscord<shadow.> yeah thats what i thought
03:01:38FromDiscord<ElegantBeef> Ah
03:01:49FromDiscord<shadow.> but i cant get this to work rahh
03:01:54FromDiscord<ElegantBeef> Collect takes a `var seq` and you pass it bare seq
03:02:08FromDiscord<shadow.> ohhh
03:02:09FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqV
03:02:13FromDiscord<shadow.> thats the repr
03:02:28FromDiscord<Rika> That's a template
03:02:34FromDiscord<Rika> Why are you using quote in a templaye
03:02:43FromDiscord<ElegantBeef> Already went over that πŸ˜„
03:02:52FromDiscord<Rika> Okay
03:03:07FromDiscord<shadow.> lol
03:04:28FromDiscord<shadow.> @ElegantBeef collect takes an init call, no?
03:05:08FromDiscord<ElegantBeef> No clue
03:05:27FromDiscord<shadow.> rip
03:05:32FromDiscord<Rika> I believe
03:05:37FromDiscord<Rika> So call new seq
03:06:07FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GqX
03:06:10FromDiscord<shadow.> thats the example given
03:06:31FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2GqY
03:06:50FromDiscord<shadow.> you need backticks in templates too?
03:07:15FromDiscord<ElegantBeef> No, i'm just silly
03:07:48FromDiscord<shadow.> oh ok lol
03:08:04FromDiscord<shadow.> ty that worked
03:09:38FromDiscord<shadow.> welp that was way easier
03:09:38FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gr0
03:09:41FromDiscord<shadow.> than making those entire macros
03:09:54FromDiscord<ElegantBeef> yep, use the most simple tool
03:09:58FromDiscord<shadow.> i should remember that templates exist more often lol
03:10:29FromDiscord<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:30FromDiscord<Rika> You should consider the practicality of your small projects if you're gonna use them often
03:10:38FromDiscord<shadow.> wdym
03:10:38FromDiscord<Rika> :P
03:11:11FromDiscord<Rika> You should check if comp is practical to use and maintain and document before starting to write :P
03:11:15FromDiscord<Rika> Unless it's for fun
03:11:16FromDiscord<shadow.> fair enough
03:11:19FromDiscord<shadow.> it's for fun lol
03:11:20FromDiscord<Rika> Otherwise continue
03:11:35FromDiscord<shadow.> im mostly just doing this to learn metaprogramming
03:11:43FromDiscord<Rika> Idk I don't like wasting time even if I do it a lot
03:11:46FromDiscord<shadow.> rip
03:11:55FromDiscord<shadow.> i wouldn't call it a waste bc i learned about type reflection and other useful stuff
03:12:10FromDiscord<Rika> At least you learned
03:12:42FromDiscord<Rika> Also read typetraits since it's useful for macros and templates when you deal with types
03:13:51FromDiscord<shadow.> yeye ima bookmark it
03:15:05FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gr1
03:15:08FromDiscord<shadow.> lol looks like they basically did what i did
03:15:11FromDiscord<shadow.> iterate the whole thing
03:15:16FromDiscord<shadow.> they just did it smarter
03:15:32FromDiscord<Rika> Huh lol
03:15:43FromDiscord<Rika> 200 IQ plays
03:15:47FromDiscord<shadow.> haha
03:15:51FromDiscord<shadow.> i think its because of the scope thing
03:15:56FromDiscord<shadow.> that you can't just get the first one
03:16:04FromDiscord<shadow.> i mean it's compile-time anyways so it's not really an issue
03:17:02FromDiscord<shadow.> alr well im heading off the pc for tonight, thanks for the help guys
03:17:07FromDiscord<shadow.> im excited for aoc 4 lol
03:19:36*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
03:21:10FromDiscord<Rika> See you
03:21:55*pbb joined #nim
03:27:32FromDiscord<shadow.> back on phone πŸ‘Œ
03:28:59FromDiscord<shadow.> would there ever be a case where the first argument of `newVarStmt` wouldn't be an ident?
03:29:49FromDiscord<shadow.> bc `newCall`'s first arg is a string so i'm wondering why they didn't do the same for declarations
03:30:22FromDiscord<Quibono> Is there a generic way to convert something to a string?
03:32:06*omn1present_ quit (Ping timeout: 260 seconds)
03:33:22FromDiscord<InventorMatt> other than calling $ on it?
03:34:16FromDiscord<Quibono> No I just forgot about $, some of the op symbols seem really random.
03:38:00FromDiscord<shadow.> lmao
03:38:13FromDiscord<shadow.> make a str template for $ then
03:39:58FromDiscord<InventorMatt> one could also make a converter for turning everything into strings
03:52:13FromDiscord<ElegantBeef> I mean `$` is the only operator with a `S` in it πŸ˜›
03:53:10FromDiscord<shadow.> where can i read the rules for operator names
03:53:37FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#lexical-analysis-operators
03:53:43FromDiscord<shadow.> ty
03:56:05FromDiscord<ElegantBeef> Where would you be without me shadow
03:56:12FromDiscord<ElegantBeef> Happy is where πŸ˜„
03:56:17FromDiscord<shadow.> LOL
03:56:38FromDiscord<shadow.> nahh you have increased my happiness dw
03:56:41FromDiscord<shadow.> bc code work
03:56:42FromDiscord<shadow.> i happy
03:56:45FromDiscord<shadow.> simple man
03:56:57FromDiscord<ElegantBeef> I'm happy you went for the more idiomatic versions
03:57:04FromDiscord<shadow.> is there an easier way to alias function?
03:57:07FromDiscord<shadow.> lol ofc
03:57:11FromDiscord<shadow.> functions
03:57:17FromDiscord<ElegantBeef> easier than what?
03:57:21FromDiscord<shadow.> uhh
03:57:30FromDiscord<shadow.> making an alias macro LOL
03:57:56FromDiscord<ElegantBeef> `template newName(): untyped = original`
03:58:07FromDiscord<ElegantBeef> (edit) "original`" => "original()`"
03:58:09FromDiscord<shadow.> and w args u have to type them all out?
03:58:18FromDiscord<shadow.> or would varargs[static] work
03:58:23FromDiscord<ElegantBeef> I guess if you have args you might need a macro
03:58:35FromDiscord<ElegantBeef> I havent used templates for anything complex
03:58:37FromDiscord<shadow.> nvm theres no splat operator in nim
03:58:45FromDiscord<ElegantBeef> splat operator?
03:59:27FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gr6
03:59:33FromDiscord<shadow.> splats a list out into a call
03:59:44FromDiscord<ElegantBeef> Well go make it πŸ˜„
03:59:50FromDiscord<shadow.> SMART
04:00:20FromDiscord<shadow.> lol
04:00:46FromDiscord<ElegantBeef> Dont you love the extensibillity here
04:00:52FromDiscord<ElegantBeef> Want a operator, you can write it πŸ˜›
04:00:57FromDiscord<shadow.> yes metaprogramming is quite sick
04:01:37FromDiscord<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:26FromDiscord<ElegantBeef> Like want a new operator you've got it, implict converters got it
04:04:02FromDiscord<shadow.> yeah true
04:04:21FromDiscord<shadow.> its really cool
04:04:37FromDiscord<shadow.> i also like whatever f(a, b) == a.f(b) is called
04:04:44FromDiscord<ElegantBeef> UFCS
04:04:52FromDiscord<ElegantBeef> Uniform function calling syntax
04:04:57FromDiscord<ElegantBeef> Command syntax is also nice aswell
04:05:13FromDiscord<ElegantBeef> the whole `doThing 10, 11, 12`
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:35*supakeen joined #nim
04:12:07FromDiscord<Quibono> I'm in a hate relationship with websickets right now.
04:12:25FromDiscord<Quibono> Wait, does nim have command syntax?
04:12:52FromDiscord<InventorMatt> yes, you typically see it when you call echo
04:12:59miprihttps://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax
04:13:10FromDiscord<Quibono> Hah, right, I didn't think of that.
04:13:23FromDiscord<ElegantBeef> Fidget also uses it a lot and it makes it look less like code and more like a markup language
04:13:25FromDiscord<ElegantBeef> so it's nice πŸ˜„
04:15:21FromDiscord<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:52FromDiscord<ElegantBeef> I mean i dont do GUI much in general πŸ˜„
04:17:10*spiderstew joined #nim
04:17:44*apahl joined #nim
04:19:18FromDiscord<Quibono> Is there something obviously messed up with my websocket code? https://play.nim-lang.org/#ix=2Grc
04:25:26FromDiscord<Quibono> I keep looking at it, and it keeps looking perfectly fine.
04:27:32FromDiscord<ElegantBeef> What's the issue runtime or compilation?
04:28:38FromDiscord<Quibono> Yeah I just don't get a message back from the server.
04:28:44FromDiscord<Quibono> It compiles fine
04:29:14FromDiscord<ElegantBeef> Well no clue @treeform could possibly help, but idk πŸ˜›
04:31:06FromDiscord<Quibono> It’s going to be some tiny stupid error on my part lol
04:32:14FromDiscord<shadow.> i also love macros in nim bc of jester-type shenanigans
04:32:33FromDiscord<shadow.> its such an elegant setup
04:32:55FromDiscord<ElegantBeef> Metaprogramming, compile time evaluation, and UFCS are like the 3 best features of Nim
04:33:56FromDiscord<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:17FromDiscord<shadow.> true
04:37:51FromDiscord<shadow.> and as for general features id say↡- speed↡- elegance↡- flexibility
04:38:16FromDiscord<shadow.> i mean for a statically typed, compiled language nim really is quite pretty
04:38:35FromDiscord<shadow.> it looks much closer to python than c
04:39:48FromDiscord<Quibono> Yeah the pretty factor is real
04:40:06FromDiscord<shadow.> fr
04:40:17FromDiscord<shadow.> oh also blocks are fucking sick
04:40:29FromDiscord<Rika> Boutta block you then xd
04:40:30FromDiscord<ElegantBeef> Most C-like also have `{}` for blocks
04:40:36FromDiscord<Rika> I kid of course
04:40:42FromDiscord<shadow.> whew
04:40:51FromDiscord<shadow.> who else would send me typetrait links
04:41:01FromDiscord<shadow.> lol
04:41:04FromDiscord<Rika> Dis-- oh.
04:41:18FromDiscord<shadow.> f
04:41:33FromDiscord<Rika> I have to go now
04:42:05FromDiscord<shadow.> rip
04:42:08FromDiscord<shadow.> peace
04:42:23FromDiscord<shadow.> @ElegantBeef named blocks?
04:42:31FromDiscord<ElegantBeef> goto πŸ˜„
04:42:38FromDiscord<shadow.> i meant the ability to break from nested loops is amazingly cool
04:42:42FromDiscord<shadow.> ohhh
04:42:45FromDiscord<shadow.> true
04:43:01FromDiscord<shadow.> the `result` variable is also genius
04:43:18FromDiscord<ElegantBeef> expressions aswell
04:43:41FromDiscord<shadow.> what specifically?
04:44:05FromDiscord<shadow.> abt expressions
04:44:23FromDiscord<ElegantBeef> implict returning
04:46:23FromDiscord<shadow.> ohhh
04:46:26FromDiscord<shadow.> ye
04:46:41FromDiscord<shadow.> statement list expressions are nice
04:46:54FromDiscord<shadow.> oh dont forget ffi lol
04:47:52FromDiscord<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:05audiofileany best practices to know before writing a wrapper for an api in nim?
05:28:20*lmariscal quit (Quit: I'm Out!)
05:30:00FromDiscord<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:38Zevvhm if only I had an easy way to parse this :(
06:06:15mipriit's pretty easy though. string split by {':', ' '}
06:06:45miprithe 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:03Zevvhttp://zevv.nl/div/passport.png :)
06:11:27mipriis this generated by npeg?
06:11:31Zevvyeah
06:11:41miprinice! I'll have to try that out
06:12:07ZevvI'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:43narimiranZevv: you and your cryptic stuff!
06:46:51FromDiscord<treeform> @Quibono did you solve your ws problem?
07:08:04FromDiscord<sealmove> what does `Error: internal error: environment misses: x` mean?
07:13:30FromDiscord<ElegantBeef> I've no clue
07:13:40FromDiscord<ElegantBeef> My aoc day 4 is ugly πŸ˜„
07:14:11FromDiscord<ElegantBeef> For those curious https://play.nim-lang.org/#ix=2GrN
07:17:43FromDiscord<lytedev> maybe mine can inspire a bit =)↡↡https://github.com/lytedev/advent-of-code/blob/master/2020/src/day4.nim
07:21:23FromDiscord<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:54FromDiscord<lqdev> @sealmove you're probably referencing another parameter within a default parameter
07:30:00FromDiscord<lqdev> which nim doesn't like
07:31:41*disruptek joined #nim
07:31:48disruptekwell well well.
07:31:55FromDiscord<ElegantBeef> Welcome back
07:32:03disrupteksup meathead.
07:32:36disruptekhmm, you're making me hungry.
07:33:15narimiranlook who's back!
07:35:40FromDiscord<sealmove> @lqdev not sure what this means
07:37:46disruptekit means you need to convert your symbols to identifiers.
07:42:28FromDiscord<Idefau> the king has returned
07:44:20*PMunch joined #nim
07:46:51miprilytedev: you don't have an off-by-one error. your pid test is wrong.
07:47:30mipri!eval "1234".match re"[0-9]{3}"
07:47:33NimBotCompile failed: /usercode/in.nim(1, 7) Error: attempting to call undeclared routine: 'match'
07:47:40mipri!eval import re; "1234".match re"[0-9]{3}"
07:47:44NimBotCompile 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:47mipri!eval import re; echo "1234".match re"[0-9]{3}"
07:47:52NimBottrue
07:52:01disrupteknarimiran: dude. is it github actions or is it nimble?
07:52:17narimirandisruptek: huh?
07:52:25disruptekeverything is broken.
07:52:42narimiranthat's how we roll
07:52:48disruptekoh, right.
07:53:00FromDiscord<flywind> see https://github.com/nim-lang/Nim/pull/15701#discussion_r535891048
07:53:00disbotβž₯ Try to fix CI failures
07:53:16disruptekyeah, i don't watch the repo anymore.
07:56:46narimiran@lytedev: `y >= 1920 and y <= 2002` can be `y in 1920..2002`, i find it easier to type
07:58:58FromDiscord<Idefau> same
07:59:21FromDiscord<lqdev> yooooo disruptek
07:59:41FromDiscord<lqdev> @sealmove are you doing something like `proc abc(a: int, b = a)`?
08:06:39FromDiscord<sealmove> hum 😢 no idea, not my code. there is a proc where I added 1 parameter, and this error showed up.
08:06:51FromDiscord<sealmove> it's not a default parameter, just regular parameter.
08:10:46*Tanger quit (Remote host closed the connection)
08:11:30FromDiscord<sealmove> actually you are right, there is a default parameter, but I can't see how it's related
08:11:36FromDiscord<sealmove> thanks for the info
08:17:00FromDiscord<sealmove> nah, I still get the error after removing the default param
08:17:00FromDiscord<lqdev> i mean this is one case where i've run into this error
08:17:11FromDiscord<lqdev> but there are probably more
08:18:48FromDiscord<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:11disruptektoo hard for you, huh?
08:20:16disruptekwhat is it, day 4?
08:20:42FromDiscord<Idefau> its day 104 in the idf calendar
08:20:49disruptekholy shit am i in the wrong channel?
08:20:53*disruptek left #nim (#nim)
08:22:03*disruptek joined #nim
08:22:05FromDiscord<lqdev> haha idf
08:22:09FromDiscord<lqdev> you lamed out
08:22:13FromDiscord<lqdev> just like me every year
08:23:22FromDiscord<Recruit_main707> I know I’m late but good to see you disruptek :)
08:23:37disrupteksup buddy.
08:25:12FromDiscord<Idefau> frens laugh at me 😦
08:25:45FromDiscord<Idefau> im not stopping from doing it im just going to put it as a secondary priority
08:26:04disruptekfer sure.
08:26:17FromDiscord<Idefau> :nimDog:
08:26:47disrupteki say the same thing about hygiene.
08:26:59FromDiscord<Idefau> but i wash your teeth
08:27:12disruptekoh, so /you're/ the one.
08:28:30FromDiscord<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:22disrupteki don't believe insert takes an array, does it?
08:30:10miprianother problem si that line 10 should have ()
08:30:10disruptekgive your proc invocation (). procs /love/ them.
08:30:14FromDiscord<mrotaru> probably not but changing the array to a sequence doesn't fix it either
08:30:22miprinullary functions require them, or they're just functions.
08:30:34disruptekdon't be rude.
08:30:43disrupteknullary functions are functions, too. all procs matter.
08:30:54FromDiscord<mrotaru> what's a nullary function ?
08:31:33disruptekit's when you have a function that fails to leave home at 18.
08:31:43miprifixed: https://play.nim-lang.org/#ix=2Gsk
08:32:05PMunch@mrotari, it's just a function without arguments
08:32:21PMunchOr rather a procedure without arguments, a function without arguments is pretty useless
08:32:42disrupteksuch contempt.
08:33:28PMunch!eval echo NimVersion
08:33:31NimBot1.4.0
08:33:36PMunchHmm, I should fix that..
08:33:58disruptekpmunch: i had a dream my father in law was wearing your beard.
08:34:32FromDiscord<mrotaru> thanks for the help !
08:34:56FromDiscord<mrotaru> but if the constructor does not return a ref, does that mean the object will be allocated on the stack ?
08:35:11triblydoesn'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:31mipriFoo[T] is a ref object. the 'new' tells you that dynamic allocation is happening.
08:35:36disruptekwhat do you think splitLines does?
08:36:20FromDiscord<Idefau> split spaces
08:36:21mipriyes, readFile returns a string/taintedstring
08:36:37triblyah, nvm, i had a brainfart
08:36:43miprimrotaru: try giving http://zevv.nl/nim-memory/ a read
08:37:03Zevvwhile you're at it, please write the missing sections at the end
08:37:32disrupteki wrote a section on cuba but i don't see it there.
08:37:42FromDiscord<Idefau> because sphera is more interesting
08:37:53Zevvwait waht whose that
08:38:07FromDiscord<Idefau> its like cuba but round
08:38:07triblyah, vscode had me confused because it marked the parameter of `splitLines`
08:38:26*mbomba quit (Quit: WeeChat 3.0)
08:42:25AraqI'm back
08:42:37FromDiscord<lqdev> hi
08:42:41FromDiscord<Idefau> hi back
08:44:44disruptekmost people don't know this, but araq has a tattoo of church on his back.
08:44:53disruptekharvey church, alonzo's better-looking brother.
08:45:07Araqmy back is nobody's business
08:45:15disruptekfair.
08:45:55FromDiscord<ElegantBeef> Wow everyone's back today
08:47:19FromDiscord<Idefau> nope
08:47:20FromDiscord<Idefau> im around
08:47:29PMunchdisruptek, that is oddly specific :P Who wore it best?
08:47:41disrupteki'd say harvey did.
08:48:03FromDiscord<sealmove> @lqdev in your case, even though different, how did you solve this error?
08:48:06disruptek(sorry, araq)
08:48:19FromDiscord<lqdev> @sealmove i didn't
08:48:36disrupteksealmove: is there macro involvement?
08:48:45*JustASlacker joined #nim
08:48:49FromDiscord<lqdev> just made the param non-default and created another overload that simply calls the proc with my desired param
08:49:09disrupteklqdev: don't let timmy hear you talk this way.
08:49:18FromDiscord<sealmove> yes there are macros
08:49:38FromDiscord<lqdev> disruptek: poor little timmy gonna get his psyche destroyed by default param bugs.
08:49:43FromDiscord<ElegantBeef> Life was odd without disrupteks nonsensical sentences πŸ˜„
08:49:54FromDiscord<sealmove> the macro produces a proc, the error appears when I add an extra parameter to this proc
08:50:03disruptekthen i say unto thee again, thou must repent and desym, post haste.
08:50:19FromDiscord<Idefau> haste
08:51:21FromDiscord<sealmove> why does nim complain about a generated proc parameter?
08:51:56disruptekbecause it's a reuse that needs to be resym'd.
08:52:57FromDiscord<sealmove> how one does this? πŸ˜› sorry I am clueless
08:53:28FromDiscord<sealmove> oh
08:53:33disruptekplanetis 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:58FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2Gsp
08:54:05disruptekthere is similar stuff in cps and half a dozen other projects of mine.
08:54:09FromDiscord<sealmove> because I use `p` 2 times?
08:54:37disruptekp p is something best left to young boys.
08:54:44disruptekthey absolutely love it.
08:54:52FromDiscord<sealmove> >_>
08:55:31disruptekmore important than the proc is the doc, i guess.
08:55:47*disruptek deletes his safety weasel.
08:56:18miprithat 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:27disruptekima take a nap. call me if the situation doesn't improve.
08:57:14Araqit always improves, relax. you won't be called
08:57:40PMunch@sealmove, you can use the same sym multiple times if it points to the same thing
08:58:07supakeenOk I need to up my understanding on `type Foo = object` vs `type Foo = ref object of RootObj` what do I read.
08:58:25mipritry giving http://zevv.nl/nim-memory/ a read
08:58:36supakeenLet me do that :)
08:59:02PMunchThis might also be of use: https://peterme.net/nim-types-originally-a-reddit-reply.html
08:59:08disruptekthe first one is ideal, the second suggests you are about to enjoy inheritance bugs.
08:59:25PMunchHaha, that's good advice :P
08:59:26FromDiscord<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:40PMunchNooooo
08:59:53PMunchI was about to ask you if you had done that, but I trusted you!
09:00:07FromDiscord<sealmove> sorry I failed you
09:00:58PMunchJust out of curiosity, what are you using it for?
09:01:34FromDiscord<sealmove> well I have an ambitious idea to make a generic file editor
09:01:35FromDiscord<j-james> @ElegantBeef your day four ugliness doesn't hold a candle to this: https://play.nim-lang.org/#ix=2Gst
09:01:50FromDiscord<j-james> as far as trash code is concerned
09:01:52FromDiscord<ElegantBeef> oh god
09:01:52FromDiscord<sealmove> other than that parsing windows system files for forensics
09:02:15PMunch@j-james, my eyes!
09:02:34FromDiscord<j-james> to top it off, that doesn't work with the provided input
09:02:39FromDiscord<ElegantBeef> I'm dumb cause i forgot that i seen `hexdigits`
09:02:50PMunchsealmove, ah I see, cool!
09:02:57FromDiscord<j-james> but i was going to speedy speed speed so
09:03:02FromDiscord<j-james> (edit) "to" => "for"
09:04:32miprij-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:08mipriyou don't check that pids are numeric.
09:05:34mipriyou can pull all that == "gry", == "grn" into a `val in ["gry", "brn", ...]` test
09:05:44FromDiscord<ElegantBeef> I was pretty chuffed to see that `parseEnum` can parse values to enums
09:06:06mipriyeah, enums are a great way to handle pid, cid, and such.
09:06:43miprianyway you need to clean this code up so that you can have any chance of finding the errors :)
09:06:45FromDiscord<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:52miprigah, char != 'e', likewise, just look for c in {'0'..'9','a'..'f'}, nicer even than typing the letters out
09:10:13FromDiscord<ElegantBeef> or just `c in HexDigits` if you `import strutils`
09:11:51FromDiscord<sealmove> wow
09:12:01FromDiscord<sealmove> I just duplicated the symbol and the code works
09:17:52PMunch@j-james, your ugly version inspired me to rewrite mine with some pretty patterns: http://ix.io/2GsB/nim
09:18:47FromDiscord<ElegantBeef> Do i rewrite mine?
09:19:05PMunchWhat's yours?
09:19:28FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2GrN
09:19:31FromDiscord<ElegantBeef> Awful in a word
09:19:58PMunchShame! The reason why the 1.4.2 auto-build has been failing on the playground is because of the fusion package!
09:20:03PMunchError: Cannot satisfy the dependency on regex 0.17.1 and regex 0.18.0
09:20:20PMunchOh wait, maybe not
09:21:54Araqfusion doesn't depend on regex
09:21:57miprij-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:21PMunchYeah it was just the log looking like this: http://ix.io/2GsD
09:22:36mipriit still has bugs (pairs is definitely wrong), but you might have more luck debugging it like that
09:23:12narimiranPMunch: do you also include "important packages"?
09:23:20Araqquestion: 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:25FromDiscord<j-james> mipri: thanks, that's funnily similar to where i am at now: https://play.nim-lang.org/#ix=2GsE
09:23:48Araq<insert usual rant about semver here>
09:24:26FromDiscord<j-james> the original ugly code actually worked because of some changes i made to the input file
09:24:45PMunchnarimiran, this is the list of packages installed on the playground: https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble
09:24:50FromDiscord<j-james> (and it would have been done faster too if it wasn't for that meddling Country ID)
09:25:39FromDiscord<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:50FromDiscord<j-james> after it's cleaned up i'm going to look into the fancy/fun nim features you and ElegantBeef mentioned
09:26:18PMunch@j-james, you can turn those parseInt(value) >= 1920 and parseInt(value) <= 2002 into parseInt(value) in 1920..2002
09:26:30FromDiscord<ElegantBeef> I mentioned fancy/fun features?
09:27:22PMunchAnd 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:44narimiranthere is `splitWhitespace`
09:28:02PMunch@ElegantBeef, "oh you should update to mauve, lavender is outdated" :P
09:28:14FromDiscord<ElegantBeef> No
09:28:20FromDiscord<ElegantBeef> You send an image of the colour
09:29:08FromDiscord<sealmove> @PMunch Here is the fix: https://github.com/PMunch/binaryparse/pull/11, sorry for the trouble
09:29:09disbotβž₯ Fixed bug regarding extra parameters in write proc
09:29:15PMunchMuch more fun to generate the colour and have that as the official version but colloquially talk about it with vague names :P
09:29:27narimiran@j-james are you missing a check for height?
09:29:46narimiranalso for colors
09:30:49narimiranbtw, this morning i had a brain-fart and i wrote `if not pid.len == 9`. can you spot the error?
09:31:42FromDiscord<Idefau> it does not pid.len first?
09:31:54narimiran:)
09:32:08FromDiscord<Idefau> B)
09:32:13PMunchOuch
09:32:17narimiranbig ouch
09:32:20narimiranone hour ouch
09:32:26FromDiscord<Idefau> lel
09:32:53FromDiscord<sealmove> @PMunch I meant to ask, why is input parameter `var`?
09:33:06FromDiscord<sealmove> Just style decision?
09:34:11*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:34:12Araqnarimiran, known gotcha
09:34:29narimiranAraq: it is hard to spot it at 6:30 in the morning
09:34:53AraqI am in favor of removing the not/and/or bit operators
09:35:08Araqimport bitops is superior you can use names like 'setBit'
09:35:42Araqbut plenty of code uses the old bit operators
09:35:45Araqfun
09:35:51mipriForth 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:46mipriif 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:25Araq*shrug*, it's Forth
09:37:42PMunchPrestige, you around?
09:37:52*abm joined #nim
09:37:58PMunch@sealmove, hmm don't remember
09:38:06PMunchDid you try turning it into a not var?
09:38:37FromDiscord<sealmove> no, I wanted to ask you first in case there is a good reason I am not seeing
09:39:22PMunchOh 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:56PMunchI vaguely remember having a reason for it, but not sure what it was
09:40:30Araqyou use Forth when you confused Chuck Moore with Chuck Norris
09:40:34FromDiscord<sealmove> yeah I wanted to ask first even before doing rudimental experimentation
09:40:52PMunchRight
09:41:15PMunchI'm a bit surprised you're even able to make changes to this project :P The code is super messy
09:41:26FromDiscord<ElegantBeef> Pmunch have you played with nimscripter yet?
09:41:54PMunchNo I haven't gotten around to that yet
09:42:13PMunchI will though, when I start working on my configuration thingy
09:45:41PMunchGoodness gracious.. https://old.reddit.com/r/adventofcode/comments/k6hasz/2020_day_4_emojicode_ascii_art_can_only_do_so_much/
09:46:07Araqmaybe 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:12mipri0.1 - drunken mosquito, 1.4 - drunken elephant, 3.0 - drunken sperm whale
09:48:31PMunch0.1 - high-on-life mosquito, 1.4 - drunken elephant, 3.0 - cocaine ravaged sperm whale
09:48:41PMunchYou forgot to update your major versions :P
09:49:56Araq4.0 -- horny horse, because we love alliterations
09:50:08FromDiscord<Idefau> 4.2 horny heroine dependant horse
09:50:19FromDiscord<ElegantBeef> 5.0 Macque... Monkey... whatever the fuck it is
09:50:26FromDiscord<Idefau> uh oh stinky
09:50:29FromDiscord<ElegantBeef> (edit) "Macque..." => "Macaque..."
09:50:31Araq5.0 mad monkey
09:50:58FromDiscord<ElegantBeef> Ubuntu is going alphabetically forward we need to go alphabetically backwards
09:51:10FromDiscord<ElegantBeef> So Xylophone Zebra... wait
09:51:33FromDiscord<Idefau> Xtra Zealous
09:51:38Araq7.0 snipping snake
09:51:42PMunchΓ…revΓ₯ken Γ…l
09:55:22FromDiscord<hugogranstrom> Γ„lg Γ„pple πŸ˜›
09:55:38FromDiscord<Idefau> Braping Burrito
10:01:37Zevvif you need to parse, use parser: https://github.com/zevv/aoc2020/blob/master/04/main.nim
10:03:04FromDiscord<Rika> xenophobic xerus idk fucking animal names starting with the letter x
10:07:04PMunchThat's a nice solution Zeww
10:07:07PMunchZevv*
10:09:11Zevvnatural fit, right
10:16:53FromDiscord<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:47Zevvwell it's not overengineered, is it
10:22:21FromDiscord<Vindaar> a bit, the whole enum stuff isn't really necessary haha
10:28:59Araqenums are almost never overengineered
10:29:12Araqenums are the best thing ever :-)
10:29:35*MarderIII joined #nim
10:29:43Araq"oh man, if only I had used fewer enum types" -- never happened in my life
10:30:48ForumUpdaterBotNew thread by Stefan_Salewski: Error: template instantiation too nested, see https://forum.nim-lang.org/t/7201
10:32:08FromDiscord<Vindaar> Araq I totally agree, haha. But for AoC it just makes my code longer πŸ™‚
10:34:10FromDiscord<Cohjellah> Woahh is the Nim forum actually written only with Nim?
10:34:13FromDiscord<Cohjellah> I'm impressed if so
10:34:29Araqyeah it is, both backend and frontend
10:34:38FromDiscord<Cohjellah> What's the frontend written with? Karax?
10:34:52Araqyeah
10:35:03FromDiscord<Cohjellah> Cool
10:35:18FromDiscord<Cohjellah> Really hope this language catches on. Keen to see its growth
10:36:14Araqwe all hope that but it helps to use it already whenever you can
10:36:26FromDiscord<fwsgonzo> I have what seems like a transpiler bug, and I
10:36:41FromDiscord<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:55FromDiscord<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:56disbotβž₯ Strange behavior when calling into Nim ; snippet at 12https://play.nim-lang.org/#ix=2GsW
10:41:48Araqwith -d:useMalloc there is no rawMalloc in your stack trace, no idea what you're doing
10:42:12FromDiscord<fwsgonzo> I removed it for the last output and ran regular nim with GDB
10:42:28FromDiscord<fwsgonzo> then it also happened, so the common thing just seems to be calling into Nim
10:42:36FromDiscord<fwsgonzo> (edit) "then it also happened, so the common thing just seems to be calling into Nim ... " added "without using gc:stack"
10:42:59FromDiscord<fwsgonzo> I originally thought the culprit was useMalloc or os:any, but guess not
10:43:05*Vladar joined #nim
10:43:59FromDiscord<fwsgonzo> `$ nim c --gc:arc --noMain -g test.nim && gdb ./test`
10:45:00AraqI valgrinded it without the test.c stuff and it runs fine under valgrind
10:45:03narimiranZevv: beautiful!!
10:45:07Araqno errors and no leaks
10:45:24Araqnothing "overwrites its own allocations"
10:45:50FromDiscord<fwsgonzo> the test.c stuff seems to be important then
10:47:20FromDiscord<fwsgonzo> i added valgrind output
10:50:03Araqyou need to call NimMainModule() too, I think
10:50:29Araqno wait
10:50:39AraqNimMain does call that already
10:51:21FromDiscord<fwsgonzo> `https://gist.github.com/fwsGonzo/34291ba798d3825c7e799d0d70d0851e` valgrind output is very long, but there's clearly some invalid accesses
10:51:33FromDiscord<fwsgonzo> (edit) "`https://gist.github.com/fwsGonzo/34291ba798d3825c7e799d0d70d0851e`" => "https://gist.github.com/fwsGonzo/34291ba798d3825c7e799d0d70d0851e"
10:51:35FromDiscord<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:47FromDiscord<shad0w> i tried the Rune module but no luck
10:52:12FromDiscord<shad0w> (edit) "Rune" => "~Rune~ unicode"
10:52:22FromDiscord<shad0w> (edit) "~Rune~" => "_Rune_"
10:52:39FromDiscord<lqdev> for r in runes("0123ε­—45")
10:53:00FromDiscord<lqdev> or convert your string toRunes
10:54:29FromDiscord<shad0w> yeap, that worked. Thanks lqdev
10:54:57FromDiscord<shad0w> even `s.len` counts the weird char as 3 chars
10:55:25*Q-Master quit (Ping timeout: 264 seconds)
10:55:31FromDiscord<flywind> !eval import unicode;echo"0123ε­—45".runeLen
10:55:35NimBotCompile failed: /usercode/in.nim(1, 20) Error: expression 'echo["0123ε­—45"]' has no type (or is ambiguous)
10:55:59FromDiscord<flywind> !eval import unicode;echo "0123ε­—45".runeLen
10:56:02narimiran!eval import unicode;echo "0123ε­—45".runeLen
10:56:05NimBot7
10:56:07NimBot7
10:56:20FromDiscord<shad0w> gotcha guys
10:56:24FromDiscord<shad0w> thx
10:56:54FromGitter<alehander92> hey guys
10:58:47FromDiscord<Idefau> sup
10:59:48FromGitter<alehander92> just pinging about the nil thing, if I should work on it this month to fix additional stuff for initial merge
11:00:03FromGitter<alehander92> or if it's not going to make it 2020
11:00:10FromGitter<alehander92> otherwise normal, work, life
11:00:33FromGitter<alehander92> how are you guys
11:02:57*zahary joined #nim
11:06:11FromDiscord<shad0w> so, i can do `2'i8` but not `'a''i8` and have to `int8 'a'`
11:06:47FromDiscord<fwsgonzo> maybe 'a'+0i8
11:07:01FromDiscord<fwsgonzo> (edit) "maybe 'a'+0i8 ... " added "(im new to Nim so ignore me!)"
11:07:29FromDiscord<shad0w> this shouldn't be ambigious to the lexer if the normal `'i8` works
11:11:54*Q-Master joined #nim
11:19:44PMunchThe 'i8 syntax is just to attach types to literals
11:19:46Araqfwsgonzo: --noMain is broken with arc :-)
11:19:56Araqit destroys the global variables too early
11:20:05Araqshouldn't be too hard to fix
11:20:06FromDiscord<fwsgonzo> thanks for looking into it!
11:20:09Araqlook into
11:20:13Araqcompiler/cgen.nim
11:20:35Araq if {optGenStaticLib, optGenDynLib} * m.config.globalOptions == {}:
11:20:37Araq for i in countdown(high(graph.globalDestructors), 0):
11:20:37Araq n.add graph.globalDestructors[i]
11:20:47FromDiscord<Rika> 'i8 syntax only works with number literals
11:21:02Araqso you can try --app:lib
11:21:19FromDiscord<fwsgonzo> it was broken for ORC too, so then I guess that they are very alike
11:21:41Araqorc is a simple extension of arc. build a library for your C code, try --app:lib
11:22:16PMunchHmm, is there a way to get more info on what package is causing this regex version mismatch error?
11:23:52FromDiscord<whisperdev> This is with arc. nim-#devel\lib\windows\registry.nim(58, 54) Error: expression cannot be cast to pointer
11:24:21FromDiscord<whisperdev> is this fixed in some newer versions of Nim? My is 1.5.1
11:24:45PMunchAha, it's apparently this package: https://github.com/citycide/glob
11:24:45*Q-Master quit (Ping timeout: 240 seconds)
11:25:13FromDiscord<flywind> I don't think the issue is fixed, see https://github.com/nim-lang/Nim/issues/14010
11:25:15disbotβž₯ .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:50FromDiscord<shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2Gta
11:27:03FromDiscord<shad0w> There isn't a convention that prevents me from doing
11:27:29FromDiscord<shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2Gtb
11:27:35FromDiscord<shad0w> is there ?
11:27:45*spiderstew quit (Quit: Konversation terminated!)
11:27:58FromDiscord<shad0w> like Capitalize typenames mean something special?
11:28:15FromDiscord<Rika> No
11:28:26FromDiscord<Rika> Other than self enforced convention, no
11:28:29FromDiscord<salvador> when we'll see nim's LLVM backend ? (is it already decided on Nim 2 ) ?
11:28:37FromDiscord<Rika> Well, caps enum will conflict with type
11:28:47FromDiscord<flywind> see nep1, may be useful https://nim-lang.org/docs/nep1.html#introduction-naming-conventions
11:28:48FromDiscord<Recruit_main707> It’s not planned
11:28:55FromDiscord<Rika> Third party made nlvm
11:29:10FromDiscord<Rika> No plan for core dev to work on I believe
11:30:08FromDiscord<salvador> yeah , but i had hope for official one , ↡also it could fix most of problems ,, brings better async/corotine/channel
11:30:41FromDiscord<lqdev> how so?
11:30:55FromDiscord<salvador> LLVM has native support for async stuffs
11:31:15FromDiscord<lqdev> sounds bloated
11:31:18FromDiscord<Rika> It will bring it's own host of problems as well
11:31:22PMunchIt would create a host of other problems tohugh
11:31:35FromDiscord<Rika> I just said that smh PMunch
11:31:36PMunchLike compiling for all the microcontroller stuff and the C interop we enjoy
11:31:49PMunch@Rika, beat me to it by seconds :P
11:31:58FromDiscord<Rika> Yeah I know ahaha
11:32:12FromDiscord<Imperatorn> I also thought there where plans for lvvm?
11:32:25FromDiscord<salvador> much better than supporting and maintaing C stuffs , for the entire lifetime: ))
11:32:32FromDiscord<Rika> Not really.
11:32:54*NimBot joined #nim
11:32:59FromDiscord<Rika> I kid on that remark.
11:33:13FromDiscord<salvador> yeah , i love it: ) much cooler
11:33:24FromDiscord<Rika> Then why even be here
11:33:28FromDiscord<shad0w> refering to the multi minute compile times ?
11:33:33FromDiscord<salvador> also like nim: ))
11:33:39FromDiscord<Rika> Or the massive binary size
11:33:49FromDiscord<Rika> Or that we can smoke rust in many places?
11:34:13FromDiscord<shad0w> we just happen to ? i dont think that was a goal : P
11:34:26FromDiscord<Rika> Yes I didn't say it as a goal
11:34:47dom96Araq, 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:52JustASlackerI like nim better than rust
11:35:06FromDiscord<Rika> I shall go now before I get too heated
11:35:54*Q-Master joined #nim
11:35:56FromDiscord<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:58JustASlackerkarax looks nice
11:35:58FromDiscord<shad0w> what rails did for Ruby : )
11:36:21FromDiscord<shad0w> do irc people see it was a reply msg ?
11:36:25FromDiscord<lqdev> no
11:36:31FromDiscord<flywind> `Karax` is great, but is it easy to be Componential?
11:36:39FromDiscord<Rika> Not a problem for you might be a problem for me
11:36:51FromDiscord<Rika> Just like you don't worry about stuff I do
11:37:03FromDiscord<Rika> I shall go now
11:37:03FromDiscord<lqdev> @salvador yeah, now imagine a 100MB executable just for an OpenGL game
11:37:05FromDiscord<lqdev> welcome to rust
11:37:13FromDiscord<Rika> Please argue with someone more level headed than me right now
11:37:28FromDiscord<Imperatorn> Are Rust executables big?
11:37:32FromDiscord<lqdev> yes.
11:37:39FromDiscord<lqdev> extra thicc, one may say.
11:37:48FromDiscord<Imperatorn> Static linking or why?
11:37:50FromDiscord<shad0w> is llvm the cause ?
11:37:51FromDiscord<Rika> XXL size
11:37:55FromDiscord<Imperatorn> Oh
11:38:12FromDiscord<flywind> see https://users.rust-lang.org/t/rust-to-nim-a-comparison/52096/38
11:38:15FromDiscord<lqdev> no flippin' clue, my friend always says "lack of a stable ABI and monomorphization"
11:38:29FromDiscord<Imperatorn> Naa, shouldn't be lvvm
11:38:30FromDiscord<shad0w> the wut and wut
11:39:04FromDiscord<whisperdev> Karax is used even less than Nim. You cant find anything about Karax basically XD
11:39:32FromDiscord<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:00FromDiscord<Imperatorn> So maybe Rust is just not optimized yet? πŸ€”
11:40:02dom96flywind: yeah, you can have components fairly easily :)
11:40:20FromDiscord<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:56FromDiscord<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:21FromDiscord<lqdev> no.
11:41:30FromDiscord<lqdev> rust's community is bigger because it has corporate backing from mozilla
11:41:38FromDiscord<lqdev> we? we don't have anyone to promote us
11:41:43dom96<Araq> fwsgonzo: --noMain is broken with arc :-)
11:41:50dom96That explains why my device is crashing too :O
11:41:56FromDiscord<lqdev> a bigger community means more packages
11:41:58dom96Do we have an issue for this?
11:42:06FromDiscord<flywind> I tried to make a UI library base on Karax, but failed https://github.com/planety/karax/blob/devel/app.nim.
11:42:09Araqdom96, yeah, and --app:lib might be a workaround
11:42:12FromDiscord<salvador> yea , indeed, but not the only reason ,,
11:42:38dom96Araq, cool, got an issue so I can track it?
11:42:54FromDiscord<lqdev> a lot of people also seem to like rust for its inclusive and politically correct community
11:42:54dom96Also, big thanks to fwsgonzo for reproducing this!
11:43:01FromDiscord<Idefau> i like nim because its epic
11:43:14FromDiscord<salvador> you just mentioned `nlvm` ↡this project developed by few people
11:43:14FromDiscord<lqdev> which is like, ffs. why does a language have to do anything with politics excuse me?
11:43:17FromDiscord<flywind> It is not as easy as `React` to build UI library.
11:43:35dom96lqdev: because politics affect everything and everyone
11:44:18FromDiscord<Idefau> my school politics say i cant install nim on the school's CS lab :(↡I did it anyway πŸ™‚
11:44:19FromDiscord<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:45dom96Nim could do with a hell of a lot more inclusivity in its community
11:45:01FromDiscord<lqdev> no. please let's not enforce politics onto people.
11:45:20dom96What? How does inclusivity equal politics?
11:45:29FromDiscord<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:23JustASlackerdo people really decide on a programming language based on the diversity or blm support?
11:46:38FromDiscord<flywind> The discussion should move to off-topic I think
11:46:38FromDiscord<lqdev> i'm sure that at least some people do
11:46:46FromDiscord<lqdev> @flywind yeah, good idea
11:47:29dom96The 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:15dom96But yes, we should discuss the politics of Rust and other programming languages in off-topic
11:48:18FromDiscord<shad0w> justASlacker: i dont think so. but it's better to have a stratergy for it than pretend it doesn't exist
11:48:26FromDiscord<Idefau> i still dont know what this nim thing is
11:48:38Zoom[m]Do we have any iterator transformers, such as `stepBy`
11:48:51Zoom[m] * Do we have any iterator transformers, such as `stepBy`?
11:49:29FromDiscord<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:00FromDiscord<flywind> See https://github.com/nim-lang/RFCs/issues/295
11:50:02disbotβž₯ next steps for CPS ; snippet at 12https://play.nim-lang.org/#ix=2Gti
11:50:04FromDiscord<flywind> May be useful
11:50:06FromDiscord<lqdev> nim's coro are far from mature though
11:50:16FromDiscord<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:27FromDiscord<lqdev> ah
11:50:28FromDiscord<lqdev> i misread
11:51:18FromDiscord<flywind> `llvm` backend would be better if more people contribute to and use it https://github.com/arnetheduck/nlvm
11:52:12FromDiscord<salvador> yeah , maybe if its could be one of official backends
11:52:20FromDiscord<salvador> (edit) "its" => "it"
11:54:25FromDiscord<InventorMatt> would it really add any significant difference compared to the existing backends?
11:56:50dom96salvador: it's definitely relevant to know what political contributions a company or organisation is making
11:57:00dom96(or any contributions for that matter)
11:57:20JustASlackerdoes nim make any sizable contribution to anything?
11:58:12dom96Not as far as I'm aware.
11:59:34FromDiscord<lqdev> i'd much prefer if nim stayed politically neutral
12:00:28JustASlackerwell, weapons research always needs additional funds
12:00:47FromDiscord<lqdev> america moment
12:03:30FromDiscord<salvador> i just wanted to know about future roadmaps , and sperared discussion about politicals,
12:03:49PMunchJustASlacker, we just make contributions to nice code :)
12:04:09JustASlackeryay for nice code
12:04:17dom96salvador: You didn't :)
12:04:40FromDiscord<salvador> talking about Rust means politicals? xDD wow ,
12:04:47FromDiscord<flywind> You could find some roadmaps in nim forum
12:04:57PMunchWhere do you think the rust belt comes from? /s
12:05:10Zoom[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:56FromDiscord<Rika> I am back
12:07:04FromDiscord<Rika> Suddenly got political
12:07:06FromDiscord<salvador> i couldnt find a clear decision about llvm , so i asked here , i wanna know core team's opinion
12:07:06PMunchHi back, I'm PMunch
12:07:10Zoom[m]And the numbers speak for themselves. They don't mean anything, if the interface is contrived
12:07:12FromDiscord<Rika> Ok dad
12:07:23dom96Zoom[m], what numbers?
12:07:35PMunchI'm seriously starting to think I might have a bastard child somewhere..
12:07:52dom96With that beard of your PMunch I wouldn't be surprised ;)
12:07:55dom96*yours
12:08:01PMunchdom96, a website for Karax would indeed be nice
12:08:17PMunchHaha, how does beard == child? :P
12:08:55PMunch!eval echo NimVersion
12:08:57NimBot1.4.2
12:09:02PMunch^ narimiran
12:09:05FromDiscord<Rika> If you had sex on February of around the 2000s perhaps you did
12:09:20dom96PMunch, well... I won't spell it out lol
12:09:30PMunchHaha :P
12:09:36*Q-Master joined #nim
12:09:38narimiranPMunch: nice! did you find the offending package(s)?
12:09:53PMunchYup, it was the glob package
12:09:58Zoom[m]dom96: some benchmarks in this Issue. i understand that's too unrealistic of an example to take them too seriously
12:10:17PMunchIt had pinned it's regex version to 0.17.x, so it conflicted with the newer 0.18.0
12:11:23Zoom[m]BTW, any rules on repeating questions before being banned here? Just in case...
12:11:41narimiranZoom[m]: what do you mean repeated questions?
12:11:42narimiranZoom[m]: what do you mean repeated questions?
12:11:43narimiranZoom[m]: what do you mean repeated questions?
12:11:56FromDiscord<Rika> Lol
12:12:25FromDiscord<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:09Zoom[m]Righty... Do we have any iterator transformers? I'd like a stepBy. We have countUp/Down with a step
12:13:27PMunchZoom[m], we have a very open and accepting community here, even to repetitionists
12:13:42PMunchZoom[m], hmm, not really
12:14:02PMunchIterators in Nim can be a lot of things, so there isn't an easy way to create a general case stepBy
12:14:18PMunch(apart from just iterating all the values and discarding the unused values)
12:14:57*Q-Master quit (Ping timeout: 256 seconds)
12:15:46Zoom[m]Isn't it inevitable in some cases, such as iterating over string lines?
12:16:00PMunchWhat'd mean?
12:16:18FromDiscord<Rika> Yeah I believe Nim has kinda poor support for iterators
12:16:30FromDiscord<Rika> In std I mean
12:16:50FromDiscord<Rika> There's always that iterator lib I keep on forgetting the name of
12:17:28Zoom[m]PMunch: you can't index a stream, so you'd need to discard the input to skip
12:19:10ForumUpdaterBotNew 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:59PMunchZoom[m], exactly
12:39:25PMunchThink of Nim iterators as a stream, and you realise why there isn't a stepBy
12:40:10PMunchI 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:02FromDiscord<sealmove> @PMunch I found another bug caused for the same reason πŸ˜› although it doesn't cause your tests to fail
12:45:02Zoom[m]alehander92 you here?
12:46:21FromDiscord<sealmove> these bugs are really fun, lol
12:47:33*PMunch joined #nim
12:48:30Zoom[m]clyybber: are you here?
12:55:36*tane joined #nim
12:55:52FromDiscord<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:00FromDiscord<fwsgonzo> is it possible to define a function that returns two strings?
12:58:12PMunch@fwsgonzo, yes
12:58:29PMunchsealmove, ooh how did you do that?
12:59:04PMunchAah, you somehow generate the output that should go to binaryparse?
12:59:08PMunchI'm all for it :)
12:59:37PMunch@fwsgonzo, to elaborate; you can return a tuple containing two strings
13:00:50PMunchLike so: https://play.nim-lang.org/#ix=2Gtw
13:01:54FromDiscord<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:47FromDiscord<sealmove> would you like to have these "plugins" in your repo in a separate directory? or in a different repo?
13:08:26Araqdon't have "plugins" if you can avoid it. plugins imply really solid API design
13:08:37Araqand "really solid design" implies "hard"
13:09:12FromDiscord<sealmove> Araq I think in this case the API is pretty good. Adding more complexity to the DSL is a inferior solution.
13:09:45Araqsimply 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:48FromDiscord<sealmove> or maybe "plugin" is the wrong word of what I am doing
13:10:43FromDiscord<sealmove> what would you call a macro that wraps another macro? πŸ˜›
13:11:00narimiranMarco.
13:11:11AraqPollo!
13:13:23PMunchHmm, just having it in a folder so that you can do `import binaryparse/conditionals` or something like that would be great
13:13:40FromDiscord<sealmove> yeah, I think so too πŸ™‚
13:17:57FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GtA
13:21:03*matthias_ joined #nim
13:24:31Araqmost likely you want some explicit calling convention
13:25:59FromDiscord<fwsgonzo> in this case its nim to nim, so hopefully no problems like that
13:38:43matthias_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:44FromDiscord<flywind> `getImpl`?
13:39:55leorize[m]1getImpl 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:29hmmmwhy every single syntax error that has nothing to do with identation get flagged as "invalid indentation" :|
13:44:13hmmmI mean I would be grateful for something like "you missed a ) you dumbnut"
13:45:22matthias_Thanks! That got it. Some day I'll figure out all these little things with macros. :)
13:45:24matthias_Maybe I need to start building a cheat sheet
13:47:04leorize[m]1hmmm: it's because of the way the compiler currently works
13:48:46leorize[m]1indentation 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:16hmmmleo 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:25FromGitter<alehander92> Zoom i am around sometimes
13:52:29FromGitter<alehander92> Zoom[m] *
13:52:59Zoom[m]alehander92: I think I cought a bug in zero_functional
13:53:35FromGitter<alehander92> possible!
13:53:44Zoom[m]Tried to add a modifier with the DSL and it won't compile. Even the filter example gives me an error
13:53:46FromGitter<alehander92> please, open an issue :)
13:53:59FromGitter<alehander92> hmm, sounds strange
13:54:18FromGitter<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:22leorize[m]1hmmm: I think it will be worked on eventually, those stuff takes time and we currently have higher priority elsewhere
13:54:29FromGitter<alehander92> bb
13:55:09Zoom[m]`zero_functional.nim(959, 24) Error: undeclared identifier: 'newIdentNode'`
13:59:17FromDiscord<shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2GtO
13:59:41leorize[m]1hmmm: it would help if you open an issue requesting better error messages
14:00:54FromDiscord<shad0w> doesn't this kindda waste space if all i care about is 0..10 ?
14:02:01FromDiscord<shad0w> (edit) "0..10" => "`0..10`"
14:06:51leorize[m]1!eval echo sizeof(set[range[0i8..10]])
14:06:52NimBotCompile failed: /usercode/in.nim(1, 26) Error: type mismatch
14:07:44leorize[m]1!eval echo sizeof(set[range[0i8..10i8]])
14:07:46NimBot2
14:08:43leorize[m]1!eval echo sizeof(set[range[0..10]])
14:08:45NimBot2
14:09:41PrestigePMunch: hey
14:10:10leorize[m]1shad0w: how did you make a 8kb set?
14:10:54FromDiscord<shad0w> leorize: var a = {0..10}
14:11:05FromDiscord<shad0w> then echo sizeof a
14:11:09FromDiscord<lqdev> i think that's because 0..10 is interpreted as a slice of uint16
14:11:23FromDiscord<shad0w> why
14:11:49FromDiscord<lqdev> the manual mentions that nim uses the largest possible datatype to represent integers in syntax
14:11:51FromDiscord<lqdev> i think that's why
14:11:52FromDiscord<shad0w> !val echo sizeof({0..10})
14:11:56FromDiscord<shad0w> (edit) "!val" => "!eval"
14:12:10FromDiscord<shad0w> !eval echo sizeof({0..10})
14:12:11FromDiscord<lqdev> !eval echo {0..10}.sizeof
14:12:15NimBot8192
14:12:15NimBot8192
14:12:19FromDiscord<lqdev> yeah
14:12:21FromDiscord<lqdev> told ya
14:12:27Araqfwsgonzo: https://github.com/nim-lang/Nim/pull/16251/files
14:12:29disbotβž₯ fixes #16249 [backport:1.4]
14:12:48FromDiscord<shad0w> .
14:13:09FromDiscord<lqdev> well, it's reasonable to assume that you'll want to use u?int16 by default
14:13:17FromDiscord<shad0w> no ?
14:13:19FromDiscord<lqdev> yes?
14:13:34FromDiscord<lqdev> if it used ranges you wouldn't be able to do `{1..5} + {10..15}`
14:13:58Araqtype R = range[0..10]; {R(0)..R(10)}
14:14:06FromDiscord<lqdev> and you can always restrict the range like araq did
14:14:19Araqsometimes the compiler is a dog and you need to help it
14:14:22leorize[m]1edits doesn't work for irc
14:14:31FromDiscord<Rika> !eval type R = range[0..10]; echo sizeof {R(0)..R(10)}
14:14:34NimBot2
14:14:37FromDiscord<Rika> interested in the size
14:14:38FromDiscord<Rika> ooh nice
14:14:47Zevv"sometimes the compiler is a dog and you need to help it". I'm saving that one
14:14:52leorize[m]1shad0w: because that set can contain more than 0..10
14:15:01FromDiscord<shad0w> i still cant do {-10..10} + {1..5} if it assumes its uint8
14:15:12leorize[m]1!eval echo typeof({0..10})
14:15:14NimBotset[range 0..65535(int)]
14:15:15FromDiscord<lqdev> it doesn't assume uint8
14:15:39FromDiscord<shad0w> why does it assume my set will be positive 16 bits be default ? i'd tell it if i want unsigned ?
14:16:05FromDiscord<lqdev> that's simply the most common use case
14:16:13FromDiscord<shad0w> : /
14:16:35FromDiscord<lqdev> as always, you can do {1.int16..10.int16}
14:16:36FromDiscord<shad0w> i wouldn't even have noticed this if i wasnt looking
14:16:40Araqthe spec says that and the compiler tries to follow it
14:16:43FromDiscord<mratsim> just to type Foo = set[int16], creating a type in Nim is really easy
14:17:06FromDiscord<shad0w> and keep on allocation 8kbs along everywhere : P
14:17:21FromDiscord<shad0w> that's alright. i can see subranges get me out of this
14:17:38FromDiscord<lqdev> if you're really worried about allocating a measly 8KiB you can always specify the type of your set explicitly
14:17:41FromDiscord<shad0w> but if i didn't look. i'd just assume it only allocates 0..10
14:17:50Araqyou can write an RFC that it sucks
14:18:08FromDiscord<lqdev> !eval var x: set[range[1..10]] = {5..7}; echo x.typeof
14:18:09NimBotCompile failed: /usercode/in.nim(1, 28) Error: type mismatch: got <set[range 0..65535(int)]> but expected 'set[range 1..10(int)]'
14:18:10Araqbecause I agree, it's foolish guesswork
14:18:22FromDiscord<lqdev> yeah i guess that's a bit bad
14:18:35Araqform the days before I knew how to design PLs
14:18:38FromDiscord<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:41FromDiscord<mratsim> there is no allocation, it's on the stack. The cost is more in terms of cache line used.
14:18:57FromDiscord<Quibono> Anyone on who can help debug an issue I'm having with websockets? I'm totally lost.
14:19:05FromDiscord<lqdev> !eval var x = set[range[1..10]]({5..7}); echo x.typeof
14:19:06NimBotCompile failed: /usercode/in.nim(1, 26) Error: type mismatch: got <set[range 0..65535(int)]> but expected 'set[range 1..10(int)]'
14:19:44FromDiscord<shad0w> while we're at it. can we have sets of objects : P
14:19:52FromDiscord<lqdev> import sets
14:19:59FromDiscord<lqdev> https://nim-lang.org/docs/sets.html
14:20:15*Vladar quit (Quit: Leaving)
14:25:36FromDiscord<shad0w> uhm, what's a cache line ?
14:25:48Zevvit's hardware
14:26:01FromDiscord<Quibono> Yay, fixed my issue, apparently I needed to use waitfor.
14:26:15FromDiscord<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:34Zevvits 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:37FromDiscord<mratsim> they can load 1 or 2 cache line per cycle
14:26:38FromDiscord<shad0w> like a `word` ?
14:26:44FromDiscord<mratsim> at least for Intel
14:26:45FromDiscord<mratsim> no
14:26:46Zevvas long as you keep working in that local area, it'll be blazingly fast
14:26:55Zevvit's typically tens or hundreds of bytes
14:27:01FromDiscord<mratsim> a word on 64B is 8B only a cache line is 64B
14:27:22FromDiscord<mratsim> well 64B usually because Samsung CPU for phones are 128B for example
14:27:32FromDiscord<mratsim> this matters a lot for high performance computing
14:27:44Zevvit makes all the difference if you know what you're doing
14:27:51FromDiscord<mratsim> but Nim default sets are pretty efficient because they are on the stack.
14:28:30PrestigePMunch: did you need something ?
14:28:40FromDiscord<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:45FromDiscord<shad0w> wut
14:29:05FromDiscord<mratsim> on 64-bit CPU sorry
14:29:27narimiranah, ye old `for x in mySet: y = x; break` popping
14:29:41Araqhardly 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:47Araqwhat the heck is up with our CIs...
14:32:00FromDiscord<mratsim> @Araq even if you had bitops, random poping from a structure that doesn't support random access is complex
14:32:06FromDiscord<shad0w> doesn't 64 bit mean a 64 bit ISA
14:32:37Araqwhat do you mean, "doesn't support random access", incl and excl are O(1) for bitsets
14:32:51ZevvI hope so :)
14:32:59Araqit's packed but still random accessible
14:33:36FromDiscord<mratsim> how do you exclude the randomly chosen 4th item of a set containing {1, 10, 3000, 5000}?
14:34:16FromDiscord<mratsim> if you want to read more: https://github.com/mratsim/weave/issues/5
14:34:17disbotβž₯ Refactor the bitset data structure
14:35:23FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2Gu1
14:35:40FromDiscord<fwsgonzo> nice @Araq
14:35:41FromDiscord<mratsim> This is the way to do from a uint64 bitset
14:35:59AraqI think we are talking about different things
14:36:38Araqto "pop" an item from a bitset, find an element via fsb. then excl it.
14:36:52FromDiscord<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:03FromDiscord<mratsim> at random being key
14:37:49FromDiscord<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:20Araqyou have some constraint here, "random", that I don't
14:38:33FromDiscord<mratsim> This is called "select", pick the n-th set bit from a bitset
14:38:51FromDiscord<mratsim> but I was talking about random for the start
14:38:53AraqI missed the "random" word, sorry
14:39:00FromDiscord<mratsim> np
14:39:00Araq:-)
14:39:17AraqI thought it's about "pop", we have seq.pop and not set.pop
14:39:33FromDiscord<mratsim> set.pop was added in the summer iirc
14:39:39FromDiscord<mratsim> or at least tables.pop
14:39:50AraqI mean bitset.pop
14:39:56FromDiscord<mratsim> ah
14:45:55FromDiscord<Quibono> Sorry for newb question, how do I check if a string is within another string?
14:46:22narimiran"first" in "second"
14:46:26Araqimport strutils
14:46:35Araq"bc" in "abcdefg"
14:46:43Araqnarimiran, CI!
14:46:44FromDiscord<Quibono> Ahh I need strutils, thanks
14:46:58FromDiscord<Quibono> Awesome language btw @Araq
14:47:06Araqclyybber removed some crucial logic from testament, please add it back
14:47:17narimiranAraq: i thought clyybber/timothee were on it. ok, will do it
14:47:27Araqwell ask them
14:47:33Araqbut it's super annoying
14:48:29AraqQuibono, thanks, glad you like it
14:49:13FromDiscord<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:16FromDiscord<Quibono> Love at first sight
14:50:46*hmmm quit ()
14:52:20Araq:-)
14:52:53narimiranAraq: 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:39narimiran"error: RPC failed; curl 18 transfer closed with outstanding read data remaining" :/
14:56:17narimiran"fatal: expected flush after ref listing"
15:00:36leorize[m]1something is wrong with CI?
15:00:43leorize[m]1I can take a quick look if needed
15:03:00PMunchPrestige, hi, sorry. I was off printing something
15:03:04PMunch3D printing*
15:03:13PMunchI just had some issues with nimdom
15:03:17PMunchnimdow*
15:03:28PMunchIt doesn't seem to properly launch my startup programs..
15:03:37Prestigeah, can you open an issue?
15:03:46PMunchSure
15:04:02PrestigeWorking atm but I can check it out in like, 8 hrs
15:05:37narimiranleorize[m]1: yeah, everything fails with the above error
15:06:11FromDiscord<mratsim> Github is broken right now
15:06:19narimiranoh, it is not us?
15:06:19leorize[m]1then it's just github
15:06:19PrestigePMunch: also if you feel like debugging it, you could enable logging and see if any errors are thrown
15:06:26FromDiscord<mratsim> all the Status repo have the same issue on git submodule
15:06:32narimiranyay
15:06:50PMunchIt's super weird
15:06:59PMunchI can see the process in htop
15:07:05PMunchIt just doesn't appear to work
15:07:12Prestigehm, that's odd
15:07:27Prestigewas this after a log out and log back in?
15:07:38PMunchYeah, I just rebooted
15:07:55Prestigeah, should be fine then. Idk
15:07:59PMunchIt's the watch -n1 -p settime.sh command that I use to update the bar
15:08:32FromDiscord<mratsim> it's lovely when doc PR crash on git ls-remote https://media.discordapp.net/attachments/371759389889003532/784435978101850122/unknown.png
15:10:24leorize[m]1https://www.githubstatus.com/ <- Github doesn't seem to be aware yet
15:11:23FromDiscord<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:21narimirannim repo has this error since yesterday
15:16:27FromDiscord<dom96> Gotta love distributed systems becoming centralised
15:19:23ForumUpdaterBotNew 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:39leorize[m]1does anyone knows that Nim has enumerate now? https://nim-lang.org/docs/enumerate.html
15:23:00leorize[m]1we really have to expose these things somewhere...
15:23:17FromDiscord<flywind> known issue
15:23:41FromDiscord<flywind> see https://github.com/nim-lang/Nim/issues/16046
15:23:42disbotβž₯ No link to std/exitprocs in docs (+enumerate,jsonutils etc)
15:25:46FromDiscord<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:11narimiranwell, there is pairs iterator for most of the things
15:26:19narimiran(not for lines)
15:26:46narimiranso you already can do `for i, x in someSeq`, without any imports
15:27:40FromDiscord<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:44FromDiscord<hugogranstrom> Are there any downsides to importing it by default other than cluttering the namespace?
15:29:13Gustavo6046The documents on learning Nim in the Learn page are kind of confusing. I always fail to remember anything I learn from them.
15:29:14FromDiscord<lqdev> bloating system.nim probably
15:29:30Gustavo6046I 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:31FromDiscord<lqdev> araq is quite against adding new stuff to system
15:30:24FromDiscord<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:43narimiranwhat if you want to enumerate something that's not a seq?
15:30:46Gustavo6046I had read them already, now I have to do it again....
15:30:47FromDiscord<hugogranstrom> Yeah, sequtils and strutils
15:31:14narimiranit had to be a separate new module
15:31:22Gustavo6046This 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:26FromDiscord<haxscramper> narimiran: `sequtils` already works for anything that is `items`-iterable,
15:31:40narimiranputting it into an existing one broke important packages because some packages used their own `enumerate`
15:31:41Gustavo6046I mean with regards to learning, of course.
15:31:52FromDiscord<hugogranstrom> Oh
15:32:36FromDiscord<hugogranstrom> That's a more convincing argument.
15:33:34FromDiscord<hugogranstrom> Then we "just" change them to use the correct one πŸ˜›
15:33:56FromDiscord<hugogranstrom> unless their version is more sofisticated that is
15:34:26FromDiscord<lytedev> Hey, thanks! You were totally right! I changed it to "^\d{9}$" πŸ‘
15:34:40FromDiscord<lytedev> (edit) ""^\d{9}$"" => "`re"^\d{9}$"`"
15:43:09*sacredfrog joined #nim
15:50:14FromDiscord<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:03FromDiscord<lytedev> is there a way to get regex match captures without first setting up a `var`?
16:57:30FromDiscord<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:15FromDiscord<Digitalcraftsman> (edit) "65`?↡↡`someNumber" => "65`? My main concern is that this approach is not very performant.↡↡`someNumber"
17:01:04mipriyeah, with a rewriting macro
17:01:36*hnOsmium0001 joined #nim
17:01:50miprihttps://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros
17:02:17FromDiscord<lqdev> @Digitalcraftsman actually the performance is the same
17:02:26FromDiscord<lqdev> `18..65` does not allocate any memory
17:02:37FromDiscord<lqdev> it's the same as storing these two variables on the stack
17:02:44FromDiscord<lqdev> and the C compiler can easily optimize this case
17:02:47federico3Upcoming 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:56FromDiscord<Digitalcraftsman> thanks @lqdev. I've assumed that but not so much familiar with Nim's computer-internals
17:10:56FromDiscord<dom96> federico3: ooh, tempting
17:15:15Zoom[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:17disbotβž₯ Enumeration sticks to the first one in chain, doesn't enumerate actual iterations ; snippet at 12https://play.nim-lang.org/#ix=2Gv4
17:29:13planetis[m]well i m glad nim is not filled with shitty fp ideas like map, unmap, filtered,
17:29:13planetis[m]unfiltered. I just can't read code like that.
17:30:07planetis[m]when im thinking of a useless module, sequtils comes in mind
17:30:32planetis[m]count it? comeone r u serious?
17:30:39planetis[m]come on
17:31:10FromDiscord<lytedev> is that sarcasm? sequtils is great! I had a blast semi-golfing with it in today's AoC
17:31:21FromDiscord<lytedev> I even used countIt specifically =D
17:32:23FromDiscord<dom96> fp is awesome when it's used right
17:33:34Zevvshame on you narimiran, getting away with part1 like that
17:33:56narimiran:)
17:34:03Zevvyou're not even _trrying_
17:34:08narimirantrue
17:34:30FromDiscord<dom96> how's the AoC this year? similar to last year? Any surprises?
17:34:37Zevvnah slow start as always
17:34:46miprinothing exciting so far. Tonight should be good since it's the weekend.
17:34:46narimiranwe'll tell you after this weekend
17:35:37mipriI'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:48Zevvif all you have is a parser, everything looks like a gramma
17:36:11miprialso a lot of people discovered that regexes don't have implicit anchors on both ends.
17:36:30ZevvI'd like to point out that PEG's *do*
17:36:47narimiran@dom96 if you haven't seen Zevv's brilliant solution for today, you're missing out
17:37:06Zevvinkoppertje
17:37:25miprithe 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:50FromDiscord<dom96> narimiran: oooh, would love to see it, link?
17:37:57FromDiscord<dom96> will check later though, brb shop
17:37:58Zevvmipri: share
17:38:05narimiranit's all over the internet ;P
17:38:11Zevvooh, that one!
17:38:17Zevvyeah that's crazy
17:38:39narimiranzevv, wait, did you clean it up? :'(
17:38:50Zevvwell yes, is that not allowed?
17:39:02ZevvI aligned the rules and split one
17:39:19mipriI think seeing rough-cut solutions is fun too.
17:39:39Zevvtrue
17:40:11narimiran@dom96 https://github.com/zevv/aoc2020/tree/master/04
17:40:54Zevvmipri: where's your day 3
17:41:55mipriyou mean day 4?
17:42:05mipriwell, none of them are posted anywhere
17:42:38Zevvaw
17:50:35reversem3is there a way to reset inim variables back to none ?
17:50:53reversem3inim is the nim interpreter for cli
17:53:15mipri'help' shows you its commands, which aren't many. I just quit and restart
17:53:35reversem3yeah thats what I do now , ok thanks
17:59:11narimiranZevv: 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:24FromDiscord<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:30PrestigeIs there an error message?
18:15:33FromDiscord<lytedev> sent a code paste, see https://play.nim-lang.org/#ix=2Gvv
18:17:17miprithat example doesn't work on 1.4.2, 1.4.0, 1.2.0, or 1.0.0
18:18:47FromDiscord<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:27miprino, that wouldn't matter
18:20:44mipriyou see the field there, but you don't see an export marker * next to it
18:20:46*thomasross joined #nim
18:20:48mipriso it's not visible to you
18:23:54miprithis works: https://play.nim-lang.org/#ix=2GvA
18:28:33reversem3can 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:38FromDiscord<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:04FromGitter<deech> Is `getTypeImpl` the best way of statically get the parent of an object type?
18:49:33*rockcavera joined #nim
18:49:41FromDiscord<lytedev> thanks much!
18:49:56FromDiscord<whisperdev> Can anyone explain me this fizzbuzz solution in Nim? https://play.nim-lang.org/#ix=2GvE
18:52:45FromDiscord<lytedev> https://news.ycombinator.com/item?id=1623844
18:54:32FromDiscord<whisperdev> Thanks!
18:57:59FromDiscord<sealmove> πŸ˜„ nice one Zevv
18:59:01disruptekwhisperdev: nope.
18:59:33*hmmm joined #nim
19:01:19mipriwhisperdev: 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:18miprithat's all there is to it.
19:03:14FromDiscord<shadow.> is there a way to scan until the end of the string using a symbol?
19:03:26FromDiscord<shadow.> using scanf
19:05:33*Perkol joined #nim
19:07:05FromDiscord<shadow.> nvm
19:07:15mipridid you find an answer?
19:09:01FromDiscord<Esbeesy> `$` isn't it?
19:09:47FromDiscord<shadow.> i believe that matches until the token after is found
19:09:54mipriwhatever that is gets mangled by the relay, but OK.
19:10:20FromDiscord<shadow.> @Esbeesy that matches until end?
19:10:21FromDiscord<shadow.> lemme test it
19:11:49FromDiscord<Avatarfighter> disruptek: \o/
19:12:38FromDiscord<shadow.> oh shoot disruptek is back nice
19:13:21*disruptek throbs.
19:13:26FromDiscord<shadow.> yes
19:13:28disrupteksomeone must be talking about me.
19:13:31FromDiscord<shadow.> well
19:13:39FromDiscord<shadow.> we missed your sarcasm
19:13:42FromDiscord<Avatarfighter> yeah
19:13:44FromDiscord<shadow.> @Esbeesy that worked thanks
19:13:46FromDiscord<Avatarfighter> we missed you specifically
19:15:05hmmmoh disruptek is back :o
19:17:25FromDiscord<shadow.> :o
19:17:28*MarderIII quit (Quit: Leaving)
19:21:13FromDiscord<Idefau> its time to wash your teeth :nimDog:
19:23:12disruptekit's about the only thing that'd make me login to discord.
19:24:36FromDiscord<Idefau> πŸͺ₯
19:28:12*Perkol quit (Remote host closed the connection)
19:29:00FromDiscord<treeform> @enthus1ast I can add "create websockets beforehand". Why do you need to?
19:32:14FromDiscord<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:12FromDiscord<Quibono> Tree I’ve started using Morepretty and I’m definitely loving it, I really wanted a l’inter.
19:38:33disruptekhow many people do you know who respond to the name, `larry`?
19:39:05disruptekokay, now how many respond to `GargantuanShlongSlinger`?
19:39:15FromDiscord<Avatarfighter> me
19:39:20FromDiscord<Avatarfighter> is that your nickname or something
19:39:24disruptekso, just one?
19:39:36FromDiscord<Avatarfighter> im sure others will react as well
19:39:39FromDiscord<Avatarfighter> right @shadow.
19:39:54ZevvLeisure Suit GargantuanShlongSlinger in the land of the Lounge Lizards
19:39:59FromDiscord<shadow.> of course i react
19:40:14FromDiscord<Avatarfighter> Its settled disruptek, I guess you gotta change your nickname πŸ€·β€β™‚οΈ
19:40:21disrupteki wish we still had age checks in video-games.
19:40:37Zevvi hand-wrote-copied the booklet
19:40:46FromDiscord<shadow.> i mean how difficult is it for a 9 year old to click 1900
19:40:48Zevvreally no clue what all that wa about
19:41:02FromDiscord<shadow.> this part 2 of day 4 is rly tripping me up lmao
19:41:11FromDiscord<shadow.> ive got it working but not well πŸ’€
19:41:16disruptekoh, you mean "what's the third word at the top of page 32 in the manual?"
19:42:02FromDiscord<shadow.> lmao
19:42:15disrupteki only have room for 319 more friends.
19:42:19disruptekget in line, chumps.
19:42:24FromDiscord<shadow.> rip
19:42:26FromDiscord<j-james> so a quick question about templates
19:42:29FromDiscord<shadow.> ye?
19:42:41FromDiscord<j-james> can they be used to make new types and control flow statements?
19:42:49FromDiscord<shadow.> yeah
19:42:53FromDiscord<shadow.> i mean
19:42:54FromDiscord<shadow.> wdym?
19:43:02FromDiscord<shadow.> new control flow statements? or just writing an existing one
19:43:18FromDiscord<j-james> replacing `for` with something else, for example
19:43:23FromDiscord<shadow.> uhh
19:43:29FromDiscord<shadow.> hmm
19:43:54FromDiscord<shadow.> i think in general the answer for metaprogramming is
19:43:54disruptek!repo foreach
19:43:55disbothttps://github.com/disruptek/foreach -- 9foreach: 11A sugary for loop macro with syntax for typechecking loop variables 15 7⭐ 0🍴
19:43:58FromDiscord<shadow.> if it can be parsed, yeah
19:44:17FromDiscord<shadow.> ooo
19:44:23FromDiscord<shadow.> i like the type checking
19:44:35FromDiscord<j-james> interesting
19:44:43FromDiscord<j-james> i'll play around with that, thanks
19:44:45FromDiscord<shadow.> idk how far you can get wiht templates tho
19:44:47FromDiscord<shadow.> might need macros
19:46:32FromDiscord<shadow.> what does `scanf` return as bool?
19:46:35FromDiscord<shadow.> is it just if the scan failed or not?
19:46:58*rockcavera quit (Remote host closed the connection)
19:50:29FromDiscord<lqdev> i think it's whether it parsed the whole string successfully
19:50:45FromDiscord<lqdev> you can always just try on the playground
19:51:06FromDiscord<shadow.> true
19:51:11FromDiscord<shadow.> yeah ur right i tried it
19:51:15miprimanual says that macros have to return NimNodes. only =~, scanf, scanp return bool. scanp blatantly sets result to newTree(...)
19:51:18mipriso, no idea.
19:51:26FromDiscord<shadow.> i mean
19:51:30FromDiscord<shadow.> scanf can return newLit() right
19:51:49FromDiscord<shadow.> could technically just return a bool lit nimnode
19:51:57FromDiscord<lqdev> yeah
19:52:02FromDiscord<lqdev> that's how macros work after all
19:52:04FromDiscord<shadow.> yeah
19:52:07FromDiscord<shadow.> ive done that before
19:52:12FromDiscord<lqdev> you do an AST transformation so you need to return AST
19:52:15FromDiscord<shadow.> ye
19:52:17disruptekit's a convenience for documentation.
19:52:26FromDiscord<shadow.> i needa figure out why my day 4 is wrong for aoc lmao
19:52:36FromDiscord<shadow.> my code is incredibly ugly
19:53:02disruptekthat's what my parents said on my first birthday.
19:53:16FromDiscord<shadow.> lovely
19:53:41disrupteki think my mother's words were, "i didn't order this. did you order this? can we get an exchange?"
19:53:58FromDiscord<Avatarfighter> "why is this thing running at O(n^2)"
19:54:21disruptek"it's leaking and i haven't even alloc'd yet."
19:55:07FromDiscord<shadow.> "so i can't use variables with the same names as arg refs in my function?"
19:55:18hmmmheeey you can't use floats in sets?
19:55:23disrupteksure you can, shadow.
19:55:26hmmmbummer :|
19:55:40disruptekuse a HashSet.
19:55:43FromDiscord<dom96> hmmm: use the sets module
19:55:48hmmmoh
19:55:50hmmmty
19:55:59FromDiscord<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:23disruptekshould we talk about my testes?
19:56:27disruptek!repo testes
19:56:30disbothttps://github.com/disruptek/testes -- 9testes: 11a small unittest framework with decent support πŸ”΄πŸŸ‘πŸŸ’ 15 16⭐ 0🍴 7& 29 more...
19:56:39FromDiscord<Esbeesy> Do they have a lot of coverage?
19:57:02disruptekless than they used to, if i'm being honest.
19:57:13disruptekit's hard out here for a package with three balls.
19:57:24FromDiscord<shadow.> i love being one off on my aoc day 4 answer because i forgot to end my regex with "$"
19:57:33FromDiscord<shadow.> guess i wont make that mistake again
19:57:37FromDiscord<shadow.> lol
19:57:45FromDiscord<Esbeesy> I bailed on using regex, couldn't get it to match the hex code for shit
19:57:58disruptekthere's a special hex code for shit?
19:58:01hmmmdisruptek your utilities are v pretty
19:58:09hmmmI like colors
19:58:21disruptekyou are in the minority.
19:58:23FromDiscord<Esbeesy> Yeah that is super cool
19:58:38FromDiscord<Avatarfighter> what about his testes are cool?
19:58:45FromDiscord<Idefau> yeah i like how colorful your testes are
19:58:55FromDiscord<Esbeesy> There's not much coverage now so very smooth, aerodynamic
19:58:58FromDiscord<shadow.> @Esbeesy #[\da-f]{6}$
19:58:59FromDiscord<shadow.> ?
19:59:04FromDiscord<shadow.> (edit) "#[\da-f]{6}$" => "`#[\da-f]{6}$`"
19:59:18FromDiscord<shadow.> lol
19:59:23FromDiscord<Avatarfighter> You really ironed out all the bumps in your testes and it runs smoothly disruptek
19:59:27FromDiscord<Esbeesy> Mine was far more ghetto, [0-9a-f]{6}$
19:59:34FromDiscord<shadow.> you didnt start it with a hashtag?
19:59:38FromDiscord<Esbeesy> I think it's cause I was using it in a `scanf `
19:59:44disrupteki know; it was pretty hairy at first.
19:59:45FromDiscord<shadow.> ohh lol
20:00:08FromDiscord<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:09FromDiscord<shad0w> hey, welcome back disruptek:
20:00:18FromDiscord<Avatarfighter> At least you were about to clean it disruptek, not all of us have that opportunity
20:00:54disruptekshadows rolling deep up in this bitch.
20:01:31FromDiscord<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:47FromDiscord<shadow.> wdym
20:01:53FromDiscord<shadow.> i mean
20:02:00FromDiscord<shadow.> i split them into string entries on "\n\n"
20:02:02FromDiscord<shadow.> and then i did
20:02:13FromDiscord<Esbeesy> Like I'm iterating through the k:v pairs and using a chungus case statement for every key
20:02:15FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Gzn
20:02:20FromDiscord<shadow.> oh you mean
20:02:24FromDiscord<shadow.> checking if they're valid?
20:02:45FromDiscord<shadow.> all keys were three long haha
20:03:33FromDiscord<shadow.> https://hatebin.com/dpvpuqwrfq not exactly the sexiest solution
20:03:35FromDiscord<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:49FromDiscord<shadow.> check my solution lol
20:03:53FromDiscord<shadow.> i just did a break block
20:03:53FromDiscord<j-james> who needs regex: https://play.nim-lang.org/#ix=2Gz7
20:04:05FromDiscord<shadow.> jesus
20:04:15FromDiscord<shadow.> ohhhh
20:04:23FromDiscord<shadow.> your indexing was pretty smart
20:04:28FromDiscord<shadow.> prolly more efficient than scanf for the height
20:04:49FromDiscord<Avatarfighter> ugh why do colleges make you select alternative programs
20:05:09disruptekprobably because we need more gay folks.
20:05:18FromDiscord<Avatarfighter> thats not what I meant
20:05:19disruptekwait, alternative how?
20:05:29FromDiscord<Avatarfighter> Well I want computer science
20:05:39disruptekselect Gay CS, then.
20:05:43FromDiscord<Avatarfighter> but then they say choose something else in case the first option is full
20:05:52FromDiscord<Avatarfighter> so when I go to pick computer engineering I cant 😦
20:06:27disruptekchoose psych.
20:06:51FromDiscord<Avatarfighter> im tryna make algorithms not have human interactions 😭
20:07:18FromDiscord<Esbeesy> disruptek I'm giving your github a follow, even if all of your CI chains are failing πŸ˜‚
20:07:31FromDiscord<Avatarfighter> @Esbeesy you like his testes?
20:07:54disruptekeh, it's due to github being broken.
20:07:56FromDiscord<Esbeesy> I'm going to put his testes on everything
20:08:02disruptekthat's the spirit.
20:08:33FromDiscord<Esbeesy> When people say to me, "wow! You terminal is so colourful!" I will say "Thank you. It's dusruptek's testes"
20:08:42FromDiscord<Avatarfighter> You're going to inspect it inside out ?
20:08:43FromDiscord<Esbeesy> (edit) "dusruptek's" => "disruptek's"
20:09:06disruptekmy testes are pretty recognizable.
20:09:09FromDiscord<Idefau> are disruptek's testes configurable?
20:09:10disruptekyou'd be surprised...
20:09:18FromDiscord<Avatarfighter> @Idefau they have color
20:09:26FromDiscord<Avatarfighter> they are unlike no other testes
20:09:28disruptekconfiguration is generally code smell.
20:09:41FromDiscord<Idefau> ill just recompile them
20:09:59FromDiscord<Idefau> i might expand something inside his testes at compile-time
20:10:24disruptekit's about the only project i haven't really documented. sorry about that.
20:10:35disruptekit's just a hack i needed while writing cps.
20:13:06FromDiscord<Idefau> i might document your testes dw
20:13:10FromDiscord<Esbeesy> I've lost the last two days at work just trying to configure deployments in dev environments
20:13:14FromGitter<alehander92> disruptek
20:13:15FromGitter<alehander92> good
20:13:25FromGitter<alehander92> it's easier to write you here
20:13:26FromGitter<alehander92> than on irc
20:13:34disruptekwait, i thought rimworld was about rimjobs.
20:13:41FromDiscord<Idefau> it can be
20:13:45disruptekit's running but i don't feel anything.
20:13:47FromDiscord<Esbeesy> You do get a job in rimworld don't you?
20:14:08FromDiscord<shadow.> idf have you done day 4 yet
20:14:17FromDiscord<Avatarfighter> rimworld is so fun
20:14:19disruptekit really says something that programmers feel irc is too difficult to use.
20:14:20FromDiscord<Avatarfighter> highly recommend
20:14:22FromDiscord<shadow.> your last parsing challenge was very clean so im interested to see how your day 4 goes lol
20:14:22FromDiscord<Idefau> i havent
20:14:25FromDiscord<shadow.> oh rip
20:14:37FromDiscord<Idefau> its half finished
20:14:38FromDiscord<shadow.> its basically just parsing and a big ass case statement
20:14:40FromDiscord<shadow.> ohh
20:14:40FromDiscord<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:45FromDiscord<shadow.> you mean part one is finished?
20:14:46FromDiscord<Esbeesy> Or one that's busy anyway
20:14:46FromDiscord<Idefau> i mean my second part is half finished
20:14:46FromDiscord<j-james> searchable history is really very nice
20:14:53FromDiscord<shadow.> explain
20:14:54FromDiscord<shadow.> lol
20:14:57FromDiscord<shadow.> ohhh
20:14:58FromDiscord<shadow.> i see
20:15:00FromDiscord<shadow.> second part
20:15:04FromDiscord<Idefau> its nearly working
20:15:05FromDiscord<Idefau> im just
20:15:06FromDiscord<Idefau> laz
20:15:08FromDiscord<shadow.> fair enough
20:15:12FromDiscord<shadow.> is it just a big case statement
20:15:21FromDiscord<Idefau> ye
20:15:47FromDiscord<Idefau> i wasted time on part 1 because i was reseting the counter every line instead of every empty newline
20:15:50FromDiscord<Idefau> that separates the passport
20:15:53FromDiscord<shadow.> rip
20:15:55FromDiscord<Idefau> i always fuck up the minuscule details
20:16:02FromDiscord<shadow.> same
20:16:14FromDiscord<shadow.> i finished but my part two was one off bc i forgot a $ to terminate my regex
20:16:16FromDiscord<shadow.> :weirdleave:
20:16:27FromGitter<alehander92> disruptek
20:16:45FromGitter<alehander92> i am just lazy
20:16:58FromGitter<alehander92> dont base large analysis of irc on me
20:17:26disruptekum, okay.
20:17:51FromDiscord<Avatarfighter> lmao
20:18:24FromGitter<alehander92> and this is not good
20:18:33FromGitter<alehander92> καλισπΡραα
20:18:34disruptekesbeesy: says a discord user. πŸ™„
20:18:41FromDiscord<Idefau> whats discord
20:18:43disruptekno, that is not good at all.
20:18:51*habamax quit (Quit: leaving)
20:18:51FromDiscord<Avatarfighter> yeah we're just using fancy irc
20:19:08FromDiscord<shadow.> yeah wym this isnt discord
20:19:55FromDiscord<Esbeesy> is the best IRC app for windows still mIRC? πŸ˜‚
20:20:13disruptekit really says something that programmers feel linux is too difficult to use.
20:20:27FromDiscord<Avatarfighter> what is a linux
20:20:42*krux02 joined #nim
20:21:01FromDiscord<Esbeesy> Do they? I love linux (I use Arch btw) but always gaming so Windows is the way for me
20:21:16FromDiscord<Esbeesy> Also doing .NET by day, not a chance I can use Linux 😦
20:21:39FromDiscord<Avatarfighter> mono
20:21:39disrupteki thought mono was a thing.
20:21:54FromDiscord<Avatarfighter> mono should have all .NET apis
20:22:02FromDiscord<dom96> Linux sucks
20:22:04FromDiscord<dom96> _hides_
20:22:07FromDiscord<Esbeesy> Yeah but the Framework 4.6.2 thing I'm developing definitely does not use mono
20:22:14FromDiscord<Avatarfighter> basically what we're saying is sell off all your other devices and adopt a linux monk lifestyle @Esbeesy
20:22:15FromDiscord<Idefau> finds dom
20:22:40FromGitter<alehander92> guys
20:22:45disrupteki think i would use windows if i was developing .net shite.
20:22:45FromDiscord<Idefau> guy
20:22:52FromDiscord<shadow.> i mean yeah
20:22:55FromGitter<alehander92> i feel that i love you more today
20:22:57FromDiscord<Esbeesy> @Avatarfighter Will be doing soon, start a new job in January that's language agnostic/Anything but .NET
20:23:00FromGitter<alehander92> because its time for rest
20:23:03FromGitter<alehander92> friday evening
20:23:05FromDiscord<Idefau> :3
20:23:08FromDiscord<Idefau> comfy friday
20:23:13FromGitter<alehander92> yeah
20:23:15disruptekalehander92: mdma is a powerful thing, ain't it?
20:23:18FromGitter<alehander92> Ρυχαριστοο
20:23:19FromDiscord<shadow.> trying to develop like WPF or winforms on linux would probably not be a thing
20:23:20FromDiscord<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:26FromDiscord<Esbeesy> Less embarrassing
20:23:27FromDiscord<shadow.> lmfao
20:23:29FromDiscord<shadow.> true
20:23:30FromGitter<alehander92> i don't use drugs disruptek
20:23:34disruptekwhy not?
20:23:39FromGitter<alehander92> they are an earthly pleasure.
20:23:44disruptekum, what?
20:23:49FromDiscord<shadow.> or just say you were documenting disruptek's testes
20:23:51FromDiscord<shadow.> it's a worthy cause
20:23:52disruptekwhere are you calling from?
20:23:55FromDiscord<Idefau> im drinking grape juice
20:23:57FromDiscord<Avatarfighter> lovely https://media.discordapp.net/attachments/371759389889003532/784515353656164452/unknown.png
20:24:00FromGitter<alehander92> they are a worldly pleasure
20:24:02FromDiscord<shadow.> of course
20:24:24disrupteki repeat:
20:24:25disruptekwhere are you calling from?
20:24:34FromDiscord<Idefau> from another module
20:24:45FromDiscord<Avatarfighter> lmao
20:24:48FromDiscord<Avatarfighter> idf04
20:24:56FromDiscord<Idefau> who's that
20:24:58FromDiscord<Avatarfighter> https://media.discordapp.net/attachments/371759389889003532/784515611514241034/unknown.png
20:24:59FromGitter<alehander92> we're citizen of another kingdom
20:25:02FromDiscord<Avatarfighter> i love this
20:25:10FromDiscord<shadow.> what kind of discord theme
20:25:12FromDiscord<shadow.> are you using
20:25:15FromDiscord<Idefau> kek
20:25:23FromDiscord<Avatarfighter> its called nocturnal
20:25:30FromDiscord<shadow.> oh nice
20:25:31FromDiscord<Avatarfighter> requires Better Discord
20:25:47FromDiscord<Avatarfighter> I've been working on writing a lib to write discord plugins with nim πŸ˜›
20:25:59FromDiscord<dom96> Mine isn't much different and it's stock Discord https://media.discordapp.net/attachments/371759389889003532/784515868310634516/unknown.png
20:26:03FromDiscord<kaletaa> israeli defence forces is my friend
20:26:13FromDiscord<Idefau> who's that
20:26:18FromDiscord<kaletaa> hello israeli defence force 04
20:26:29FromGitter<alehander92> seriously
20:26:42FromDiscord<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:48FromDiscord<kaletaa> VNC
20:26:50FromGitter<alehander92> drugs are not good, and one can still eat and drink without going into such excesses
20:26:52FromDiscord<kaletaa> or whatever they call it
20:26:54FromGitter<alehander92> oh, i like the iDF
20:26:54FromDiscord<kaletaa> BNC?
20:26:57FromDiscord<kaletaa> i have no clue
20:27:00FromGitter<alehander92> i met a girl that was in IDF
20:27:01FromDiscord<shadow.> welp i dont use compact mode sadly
20:27:12FromDiscord<exelotl> compact mode is just not quite right
20:27:17FromGitter<alehander92> i find israelis very interesting
20:27:18FromDiscord<Idefau> a lot of girls were in me
20:27:25FromGitter<alehander92> and I hope they have their own programming language
20:27:29FromDiscord<j-james> can't wait for matrix to get more stable
20:27:34FromGitter<alehander92> from right to left, it would be interesting to analyze
20:27:42FromDiscord<Idefau> in my mind i mean i think of them haha
20:27:45FromGitter<alehander92> ldefau i didn't mean it in this way.
20:27:48disruptekthere's this thing called a `mirror`.
20:27:50FromDiscord<exelotl> wtf is this discussion
20:28:11FromGitter<alehander92> disruptek but what is the mirror for our souls
20:28:14FromDiscord<dom96> yeah, might be time to pack it up and move it to offtopic
20:28:18FromDiscord<shadow.> true
20:28:37disruptek!repo disruptek/nigel
20:28:37disbotno results 😒
20:29:30FromDiscord<shadow.> disruptek i must say your github repo names are quite nice
20:29:41FromGitter<alehander92> is it the nigel song
20:29:50disruptekalways has been.
20:29:57FromGitter<alehander92> making plans ..
20:30:06FromGitter<alehander92> ah memories
20:30:08FromGitter<alehander92> peanut butter
20:30:16FromDiscord<shadow.> i must say dim looks very promising
20:30:20disruptekmemories, like peanut butter, yes.
20:30:24FromGitter<alehander92> programming in nim and `freaks and geeks` run
20:30:27FromDiscord<shadow.> impossible to create errors in its current state
20:30:28FromDiscord<shadow.> i like it
20:30:31FromGitter<alehander92> i might be wrong
20:31:07disruptekdim is extremely tight right now. nothing remains to be removed from the design.
20:31:46FromDiscord<shadow.> i also like how every function in the language can be ran at compile time
20:32:02FromDiscord<shadow.> every single implemented function has this feature, correct?
20:32:17FromGitter<alehander92> eh, hm, not sure
20:32:24FromGitter<alehander92> there are limitations
20:32:26disruptekright. it's already self-hosted and can reproduce itself without any input at all.
20:32:33FromDiscord<shadow.> yeah that's crazy
20:32:41FromDiscord<shadow.> also it's a really fast install
20:32:43FromDiscord<shadow.> and cross platform
20:32:54disruptekthe entire language is completely documented, in itself, naturally.
20:33:06FromDiscord<shadow.> yeah i especially like that part
20:33:26FromDiscord<mratsim> you cannot use pointers or IO at compile-time
20:33:32FromDiscord<shadow.> we're talking about the superior language, not nim
20:34:01FromDiscord<mratsim> The > language?
20:34:04FromDiscord<shadow.> dim
20:34:08FromDiscord<shadow.> https://github.com/disruptek/dim
20:34:11FromDiscord<shadow.> have a look for yourself
20:34:17disruptekit's inspired by nim.
20:34:20FromDiscord<shadow.> its almost as nice as disruptek's testes
20:34:20FromGitter<alehander92> mratsim
20:34:34FromGitter<alehander92> how is life, and do you know latin
20:34:36FromDiscord<Cloufish> wow
20:34:43FromGitter<alehander92> oh disruptek you're going into
20:34:45FromGitter<alehander92> nim 3.0
20:34:48FromGitter<alehander92> directly
20:34:57disruptekyeah, who needs nim-2?
20:35:12disrupteki mean, really, it's a mess.
20:35:12FromGitter<alehander92> i wanted to write nim 2.0
20:35:18FromDiscord<Cloufish> XD
20:35:21FromDiscord<shadow.> hm
20:35:22FromDiscord<Cloufish> wtf
20:35:22FromGitter<alehander92> but you're building the 4.0
20:35:39disruptekwell, i can't write nim 4 in nim 1 or nim 2, so... yeah.
20:35:48FromDiscord<shadow.> i vote that we replace nim with dim, it's much more reliable
20:35:53FromDiscord<Cloufish> ?!?! YOU SAID HE WAS BUILDING 3.0
20:35:58FromDiscord<shadow.> i don't think i've seen anyone get an error in dim before
20:36:05FromDiscord<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:14FromGitter<alehander92> diruptek drugs are truly bad tho
20:36:15disruptekno, just look at stack overflow. not a single problem or complaint.
20:36:21FromDiscord<shadow.> exactly
20:36:27FromDiscord<shadow.> zero issues or pr's either
20:36:30FromGitter<alehander92> i am interested in looking at lang design tho
20:36:36FromGitter<alehander92> do you plan to have rust
20:36:36disruptekyep. immaculate conception.
20:36:38FromGitter<alehander92> support!
20:36:58FromDiscord<shadow.> zero memory leaks
20:37:03FromDiscord<shadow.> and the parser is incredibly fast
20:37:03FromDiscord<Cloufish> O.O
20:37:27FromGitter<alehander92> not a correct usage
20:37:31disruptekthe memory usage is probably my favorite part.
20:37:37FromDiscord<shadow.> exactly yeah
20:37:44FromDiscord<shadow.> well cpu usage is very nice as well
20:38:01disruptekthat part was easy.
20:40:06FromDiscord<Cloufish> I wanted to believe that I'm not a hipster but it looks like its inevitable
20:41:09FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=2GBt
20:41:19FromDiscord<j-james> Why can't this find its parameters?
20:41:25FromDiscord<Cloufish> (edit) "I wanted to believe that I'm not ... a" added "going to become"
20:41:27FromDiscord<shadow.> wdym
20:41:31FromDiscord<shadow.> how are you calling it
20:41:44FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=2GBw
20:41:50FromDiscord<shadow.> not an operator
20:41:56FromDiscord<shadow.> operators can only be made of some symbols
20:42:05FromDiscord<shadow.> and you didn't even backtick it haha
20:42:33FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GBB
20:43:07FromDiscord<j-james> same issue
20:43:29FromDiscord<j-james> > operators can only be made of some symbols
20:43:45FromDiscord<j-james> that's too bad
20:43:52FromDiscord<shadow.> ye
20:44:01FromDiscord<shadow.> well
20:44:04FromDiscord<shadow.> im guessing it's for parsing reasons
20:44:18FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/784520476658892820/unknown.png
20:44:33FromDiscord<shadow.> here's a fun template
20:44:42FromGitter<deech> Anyone know of benchmarks for the JS backend, especially interested in payload size?
20:44:47FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GBJ
20:44:57*narimiran quit (Ping timeout: 256 seconds)
20:44:58FromDiscord<j-james> i mean it's not really bad i was planning to do some atrocious things otherwise
20:45:07FromDiscord<shadow.> (edit) "https://play.nim-lang.org/#ix=2GBJ" => "https://play.nim-lang.org/#ix=2GBL"
20:45:12FromDiscord<shadow.> haha
20:51:51FromDiscord<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:39FromDiscord<haxscramper> Although it should only be used for things like `echo {'c', 'd'} .Γ— {'a', 'b'}`
20:55:12FromDiscord<For Your Health> This might be a silly question, but does using a c++ library tie me to using the c++ backend?
20:55:16FromDiscord<UNIcodeX> sent a code paste, see https://play.nim-lang.org/#ix=2GCl
20:56:08FromDiscord<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:30FromDiscord<haxscramper> "it does tie you to C++ backend"
20:56:46FromDiscord<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:52FromDiscord<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:38FromDiscord<shadow.> what are the benefits of the js backend?
21:02:04FromDiscord<Esbeesy> It's... JS? You can run it in a browser
21:02:22FromDiscord<Esbeesy> or Node if you're some kind of delinquent
21:02:58FromDiscord<shadow.> fair enough
21:02:59FromDiscord<shadow.> lemme try
21:03:15FromDiscord<shadow.> ive never been able to get it to work lol
21:03:17FromDiscord<shadow.> at least with node
21:03:18FromDiscord<Esbeesy> literally just `nim js <filename>`
21:03:23FromDiscord<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:30FromDiscord<Esbeesy> you have to put -d:nodejs I think if you want it node compatible
21:03:39FromDiscord<shadow.> ohh
21:04:08FromDiscord<shadow.> still didnt work
21:04:09FromDiscord<shadow.> rip
21:04:23FromDiscord<shadow.> i think its bc of my fileread
21:04:31FromDiscord<shadow.> fopen is not defined
21:04:46FromDiscord<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:16FromDiscord<Esbeesy> Maybe it needs a certain version of JS? No idea tbh. Would have thought someone here is Nim JS pro though
21:06:16FromDiscord<For Your Health> @haxscramper If I link to a binary am I still tied to the c++ backend?
21:08:17FromDiscord<treeform> It looks like you need to update typography as well?
21:10:02*abm quit (Quit: Leaving)
21:11:19FromDiscord<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:32disrupteknim doesn't support node.
21:13:01disruptekyou need to build with cpp when you want to use import patterns for c++ symbols.
21:13:25FromDiscord<For Your Health> @haxscramper Alright cool, thanks for the info!
21:14:00FromDiscord<fwsgonzo> how can you take a void()() function pointer as argument in Nim?
21:14:29disruptekproc foo(x: proc(): int) = echo x()
21:14:48disruptekproc foo(x: proc()) = x()
21:14:55FromDiscord<haxscramper> `proc acceptsCallback(callback: proc() {.cdecl.})` if you are asking about C callback specifically
21:15:09FromDiscord<fwsgonzo> aha, that's fairly straight-forward!
21:16:14FromDiscord<haxscramper> !eval proc test(arg: proc(): proc(): proc(): proc(): tuple[a: proc(), b: proc()]) = discard
21:16:16NimBot<no output>
21:16:25FromDiscord<Quibono> How many LoC do you figure for a small web browser?
21:16:51disruptekif the web is only one page, i'd say one.
21:17:31*superbia quit (Quit: WeeChat 2.9)
21:18:17FromDiscord<Quibono> Lol.
21:18:30FromDiscord<Quibono> Was just thinking Nim would be cool for a browser
21:19:17FromDiscord<Esbeesy> Yeah is there any kind of wasm backend going on?
21:20:34disruptek!repo nlvm
21:20:35disbothttps://github.com/arnetheduck/nlvm -- 9nlvm: 11LLVM-based compiler for the Nim language 15 352⭐ 25🍴 7& 1 more...
21:22:28FromDiscord<shadow.> ive noticed this a few times...why do people word out their emails↡> arnetheduck on gmail point com↡?
21:22:34FromDiscord<shadow.> is it to prevent scrapers or something?
21:22:39disruptekyes.
21:22:44FromDiscord<shadow.> ahh that makes sense
21:22:55*rockcavera joined #nim
21:29:33FromDiscord<Avatarfighter> @shadow. its to prevent pesky scraper like myself from spamming emails
21:29:38FromDiscord<Avatarfighter> (edit) "scraper" => "scrapers"
21:30:19FromDiscord<shadow.> smart
21:30:49FromDiscord<Quibono> Can you get paid to scrape emails, or is it just to be an asshole?
21:30:55disruptekyes.
21:31:12FromDiscord<Avatarfighter> yeah you can
21:31:24FromDiscord<Quibono> _builds email scraper_
21:31:32FromDiscord<Avatarfighter> yeah basically
21:31:33disrupteki sign up for most services using arne's email address.
21:31:42FromDiscord<shadow.> lovely
21:31:50mipridon'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:56FromDiscord<shadow.> true
21:32:01FromDiscord<Avatarfighter> what some people do is scrape recruitment emails for companies and bulk apply to them
21:32:13FromDiscord<Quibono> I just recently got a shitton more spam on my main email, so clearly someone scraped me
21:32:25FromDiscord<Avatarfighter> you probably ended up on a public email list
21:39:21FromDiscord<UNIcodeX> no dice.
21:40:10FromDiscord<treeform> i'll look into it this evening then
21:40:24FromDiscord<treeform> the build tests passes?
21:40:35FromDiscord<treeform> maybe pixie needs updating?
21:40:49FromDiscord<treeform> https://github.com/treeform/flippy
21:41:06FromDiscord<treeform> I have updated tons of packages to their new versions: https://github.com/treeform/flippy/blob/master/flippy.nimble
21:41:13FromDiscord<treeform> flippy can't work with old versions of the packages.
21:47:25FromDiscord<fwsgonzo> can you take the address of a function in Nim and cast to uintptr_t similarly to C?
21:47:50disrupteki will permit it.
21:48:31FromDiscord<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:43FromGitter<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:18Zoom[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:44FromDiscord<lqdev> !repo npeg
21:54:45disbothttps://github.com/zevv/npeg -- 9npeg: 11PEGs for Nim, another take 15 129⭐ 7🍴
21:56:06Zoom[m]I'm trying to stick to std until I'm at least confident what's there
21:56:08Zoom[m]But thanks
21:56:28disruptekwell, no one uses std, so...
21:57:11FromDiscord<Esbeesy> Hey, so, Zevv's npeg sample for day4 is super cool however.. It gives me the wrong answer
21:57:19FromDiscord<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:32disruptekweird.
21:58:44FromDiscord<Avatarfighter> ur weirds
21:59:12Zoom[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:42miprizevv's solution throws away the last line of the input
22:00:17Zoom[m]I'd probably be better off with RE. Now, that's a line you don't hear often.
22:00:59hmmmdoodes can I nest a bunch of seqs in a seq
22:01:26disruptekyou're blowin' my mind right now.
22:01:36hmmmor maybe a tuple
22:01:43hmmmso I can untuple it
22:02:10*rockcavera quit (Remote host closed the connection)
22:02:40Zoom[m]Yes you can, and it would be quicker to just try.
22:02:47hmmmhmm
22:02:50hmmmoke
22:02:52miprilame fix: `& "\n"` the readFile
22:04:41mipriyou can also prefix ? to the second Space in valid
22:13:40FromDiscord<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:40disbotβž₯ strscans: skip input until next token is found
22:15:22FromDiscord<Esbeesy> Mipri I used `(field Space[1..2])` instead of the ? prefix, but still works either way I guess
22:15:43mipriwhatever that is doesn't survive the trip to IRC, but ok
22:16:04FromDiscord<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:18FromDiscord<Avatarfighter> http://prntscr.com/vw24w1
22:16:22FromDiscord<Avatarfighter> that is what was said
22:16:31mipriit's not the formatting (that just shows up as backticks). it's the asterisk I guess
22:16:49FromDiscord<Esbeesy> How annoying
22:20:16FromDiscord<shadow.> has anyone used discordnim and dimscord?
22:20:20FromDiscord<shadow.> and can recommend one over the other
22:20:24FromDiscord<shadow.> im unsure of which one to choose
22:31:46FromDiscord<fwsgonzo> how can you cast a ByteAddress to a function type in Nim?
22:32:37*hmmm quit (Ping timeout: 264 seconds)
22:33:03FromDiscord<fwsgonzo> (edit) "Nim?" => "Nim, given the function type?"
22:33:19FromDiscord<ElegantBeef> Shadow i believe yardanico made the discord bot using dimscord and krispurg in here is the author of it
22:33:35FromDiscord<fwsgonzo> I am transporting a function pointer out of Nim and back in again, and I need to cast it back
22:33:50FromDiscord<ElegantBeef> `cast[ptr proc](pointer)`?
22:34:11*hmmm joined #nim
22:34:16FromDiscord<ElegantBeef> Yea ircord uses dimscord
22:37:15FromDiscord<ElegantBeef> @krisppurg cmon update dimscords readme to say "if you want to compress stuff, use https://github.com/guzba/zippy" πŸ˜„
22:41:37FromDiscord<UNIcodeX> no, sir. same error.
22:42:00hmmmis there any difference between strutils replace and re replace :o
22:42:18disrupteknope. they are exactly the same. totally identical.
22:42:25hmmmhmmmm
22:42:34disruptekusename checks out.
22:42:43FromDiscord<Daniel> @disruptek welcome back bro 🍻
22:42:51disruptekhowdy.
22:42:58hmmmI never know when trust your answers disruptek :|
22:42:58miprihmmm: the obvious difference is that one replaces a regex and one only replaces a substring.
22:43:06miprias a rule, if disruptek says something, it's not true.
22:43:21hmmmI suspected that mipri :o
22:43:34disrupteklies.
22:43:39mipriyou have to compel him to enter a magic triangle to get the truth.
22:44:17miprias documented: https://en.wikipedia.org/wiki/Furfur
22:45:31disrupteklooks legit.
22:45:38disruptekespecially the `Be safe` line.
22:46:13miprirandom bit of vandalism.
22:46:43disruptekit used to say, "Be safe, motherfuckers."
22:47:01disrupteksection 230 ftw.
22:48:41FromDiscord<ElegantBeef> Ah yes the freedom of speech removal section πŸ˜„
22:51:05hmmmwhat is the char version of ""
22:51:18hmmmI thought '' but it doesn't work
22:51:28mipria char isn't a sequence, so it can't be empty.
22:51:33hmmmhmmm
22:51:47FromDiscord<ElegantBeef> These are all the possible chars http://www.asciitable.com/
22:51:54hmmmty both
22:51:55mipriif you want to return something that might be a char or might be not a char, use an option[char]
22:52:14FromDiscord<shadow.> you could try a '\0'
22:52:26FromDiscord<ElegantBeef> Well null terminated is a possibllity, but just use an option
22:52:36FromDiscord<ElegantBeef> It's entirely designed for adding another state
22:52:54FromDiscord<shadow.> fair enough
22:53:07mipriI'd do what C does even before '\0', and return an int instead
22:53:21mipriif ret == -1: fail else: dosomething(ret.char)
22:53:39FromDiscord<ElegantBeef> I mean that's just an annoying option πŸ˜›
22:53:53hmmmwell \0 worked just fine, no idea why tho :O
22:53:59mipriit's very annoying. it's optionals without optionals, by widening the type. But as bad as that is, '\0' is worse.
22:54:20mipri'\0' is just ascii 0. whether it "works" depends on what you're doing.
22:54:31FromDiscord<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:48FromDiscord<ElegantBeef> You will pretty much never find a `\0` but if you ever do it'll fuck it up
22:54:51mipriif 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:16FromDiscord<ElegantBeef> Most places `\0` marks the end of a string or file
22:56:02mipriod -c $(which nim)|head -1
22:56:03hmmmnunu 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:19mipri\177ELF\2\1\1\0\0\0\0 <- zero bytes. well before the end of the file.
22:56:21FromDiscord<ElegantBeef> the char version is for a set of characters no?
22:56:33hmmmnu it works for a single char
22:56:51miprihmmm: 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:51FromDiscord<ElegantBeef> Oh i'm thinking contains
22:57:05hmmmoh mipri I wasn't aware of that :o
22:57:24hmmmI'll probably just stick to the string version to be safe
22:57:38FromDiscord<ElegantBeef> I mean the default `replace` parameter will handle that for you
22:57:49hmmmI have some results as seqs and wanted to get rid of the "@"
22:57:50mipriat a shell, run this: echo -e "hi\0there"
22:58:00mipriyou'll see "hithere", but only because the \0 isn't displayed. it's still printed.
22:58:02FromDiscord<ElegantBeef> !eval import strutils; echo "Hello world".replace("o");
22:58:05NimBotHell wrld
22:58:17mipripipe it to |od -c to see it
22:58:29FromDiscord<ElegantBeef> Or just echo the `toHex` of the string
22:58:35FromDiscord<ElegantBeef> It'll have `00` in a spot
22:59:06FromDiscord<ElegantBeef> !eval import strutils; echo "Hello world".replace('o','\0\).toHex;
22:59:08NimBotCompile failed: /usercode/in.nim(1, 52) Error: missing closing ' for character literal
22:59:19FromDiscord<ElegantBeef> !eval import strutils; echo "Hello world".replace('o','\0').toHex;
22:59:22NimBot48656C6C00207700726C64
22:59:50FromDiscord<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:23FromDiscord<ElegantBeef> But i'm just parroting mipri mostly, so i'll shush πŸ˜„
23:01:18hmmmit seems quite dangerous
23:01:55FromDiscord<ElegantBeef> Well yea cause it's purely not what you want πŸ˜„
23:04:53FromDiscord<shadow.> lmao hmm i was not suggesting \0 as an argument for replace
23:05:11FromDiscord<shadow.> i thought you were returning some sort of null char and that would be the closest thing without using an option
23:05:51hmmmshadow if you see my nick always assume I'm abusing something very dangerous that I understand 10% of
23:18:14FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GEG
23:20:54*mbomba quit (Quit: WeeChat 3.0)
23:21:13FromDiscord<shadow.> may i ask why you're casting a function to a pointeR?
23:21:15FromDiscord<shadow.> (edit) "pointeR?" => "pointer?"
23:23:42*luis joined #nim
23:24:10disruptekit turns out that if you understand 10% of thai ladyboys, you basically know all the necessaries.
23:24:47FromDiscord<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:15FromDiscord<shadow.> hmm
23:25:15FromDiscord<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:25FromDiscord<shadow.> how are they communicating?
23:25:29FromDiscord<shadow.> in a way that you can pass a pointer
23:25:32disruptekdoesn't matter.
23:26:31disruptekyou don't have pointers in the vm, regardless of platform.
23:27:01FromDiscord<fwsgonzo> `https://fwsgonzo.medium.com/virtual-machines-for-multi-tenancy-in-varnish-1c619ea3276`
23:27:15FromDiscord<fwsgonzo> maybe that will help explain some details ^
23:28:00disruptekif this is your own vm, then you can send whatever you want.
23:28:33FromDiscord<fwsgonzo> what am I supposed to say to that? yes?
23:28:46FromDiscord<shadow.> i believe it's suppose to make you wonder
23:28:53FromDiscord<shadow.> "why am i using a pointer?"
23:29:06FromDiscord<fwsgonzo> indeed, I am wondering about things now
23:29:16FromDiscord<shadow.> you realize you can pass functions as arguments, correct?
23:29:23FromDiscord<shadow.> just making sure lmao
23:29:37FromDiscord<fwsgonzo> yes πŸ™‚
23:29:42*luis quit (Quit: WeeChat 2.9)
23:30:04FromDiscord<shadow.> then why use a pointer
23:30:40disruptekot
23:30:54disruptekoops. it's a cast of something serialized/deserialized, i guess.
23:31:17disruptekthe answer is, yes, that will deref the pointer. (what else?)
23:31:53FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GEK
23:32:15FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GEL
23:32:32FromDiscord<fwsgonzo> it's not turning farg into a forge_cb properly
23:32:50disruptekremove the space in your cast call; it's invalid syntax.
23:33:24disruptekfunction parens must abut their symbols, else it's "command syntax".
23:33:26disruptek~ufcs
23:33:27disbotufcs: 11a misnomer. See https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d for one set of opinions. -- disruptek
23:33:30ForumUpdaterBotNew thread by Doofenstein: Alternative term for addr, see https://forum.nim-lang.org/t/7203
23:35:30FromDiscord<fwsgonzo> it didn't fix the warning, at least
23:36:27disrupteksweet. i'd hate to see it go.
23:36:58FromDiscord<shadow.> sorry but i don't remember getting an answer lol, why not just pass the function as an argument?
23:37:01FromDiscord<shadow.> instead of messing around with pointers
23:37:14FromDiscord<fwsgonzo> because you can't pass a nim function to outside of a VM
23:37:19FromDiscord<fwsgonzo> and into another
23:37:32disruptekmaybe we should make it work in frosty.
23:37:36disruptek!repo frosty
23:37:37disbothttps://github.com/disruptek/frosty -- 9frosty: 11serialize native Nim types to strings, streams, or sockets β›„ 15 20⭐ 1🍴
23:39:05FromDiscord<shadow.> true
23:39:19FromDiscord<fwsgonzo> so I can freeze a function?
23:39:34disrupteki honestly don't know what it would do.
23:39:51disruptekso basically, yes. we could come up with a solution.
23:40:14disruptekif it doesn't already work, i mean.
23:40:16hmmmcalling procs without ()? that's bold of you mr d.tek
23:40:32disrupteki'm a fuckin' mad man.
23:40:37FromDiscord<ElegantBeef> "bold" πŸ˜„
23:40:56FromDiscord<Avatarfighter> stupid question, can I use karax to generate raw ? I'm considering using it as an xml dsl
23:41:03disruptekwtf is raw?
23:41:17FromDiscord<ElegantBeef> https://github.com/juancarlospaco/nim-html-dsl
23:41:24FromDiscord<Avatarfighter> (edit) "stupid question, can I use karax to generate raw ... ?" added "xml"
23:41:31FromDiscord<Avatarfighter> disruptek: I forgot the word xml
23:41:31FromDiscord<ElegantBeef> HTML is just slightly weirder XML
23:41:33*tane quit (Quit: Leaving)
23:41:50FromDiscord<Cohjellah> So I missed out on the first few days of AoC because I was moving house. Reckon I could catch up?
23:41:54FromDiscord<Cohjellah> Completely new to Nim
23:41:55FromDiscord<Avatarfighter> @ElegantBeef yeah ik but i need to make xml files not html lmao
23:41:56hmmmsquared and halved is genius
23:42:01FromDiscord<Avatarfighter> im just lazy and wanted to use karax
23:42:14FromDiscord<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:25FromDiscord<Avatarfighter> smart
23:42:36*suchasurge joined #nim
23:42:39FromDiscord<Recruit_main707> @Cohjellah I think so
23:42:47FromDiscord<ElegantBeef> Yea day4 is the only one that takes anytime
23:42:51FromDiscord<ElegantBeef> The rest are stupid simple
23:42:55FromDiscord<Cohjellah> Hahah good
23:42:58FromDiscord<Cohjellah> I'll get on it now
23:43:01FromDiscord<Cohjellah> Got free time finally
23:43:08FromDiscord<ElegantBeef> day4 only takes time since they're being a pain πŸ˜„
23:43:10FromDiscord<Cohjellah> Moving blows ass. Can I be rich so I can afford movers ty
23:43:12disruptekeh learn clojure instead.
23:43:36*luis joined #nim
23:43:44FromDiscord<ElegantBeef> Or rust/python
23:43:51FromDiscord<ElegantBeef> Will be swimming in money Soon TM πŸ˜›
23:44:13hmmmufcs was a nice read but too short, do more examples please
23:45:08FromDiscord<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:18FromDiscord<ElegantBeef> and you can omit the `()` if there are no other arguments
23:48:38disruptekfwsgonzo: this is an interesting read, thanks.
23:48:45FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GEP
23:48:58FromDiscord<ElegantBeef> Is Zevv about? Or anyone that knows how to write patterns for Npeg? πŸ˜„
23:49:00FromDiscord<shadow.> did you not just read what disruptek sent
23:49:01FromDiscord<shadow.> LMAO
23:49:18FromDiscord<shadow.> > `unsafeAddr(callback)`
23:49:26FromDiscord<shadow.> rip
23:49:31FromDiscord<Quibono> Anyone with good eyes, I'm getting a data-format error with my JSON and I can't see why...
23:49:41FromDiscord<shadow.> use an unminifier maybe?
23:49:45FromDiscord<shadow.> and see what it says
23:49:51FromDiscord<ElegantBeef> and throw it in something with a linter πŸ˜›
23:51:19FromDiscord<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:43disruptekfwsgonzo: it's a stack address because it's a parameter from the function that is copied to the stack.
23:52:04disruptekyou could, for example, make a lookup table.
23:52:09FromDiscord<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:09FromDiscord<shadow.> you should try jason
23:52:25FromDiscord<shadow.> he's a cool guy
23:52:29FromDiscord<fwsgonzo> and yes, I did suspect that, but I'm not sure how to get the real address
23:52:33FromDiscord<shadow.> disruptek might be able to introduce you
23:52:40FromDiscord<ElegantBeef> I am?
23:52:47FromDiscord<Quibono> Lol why will disruptek's json lib help?
23:52:56FromDiscord<shadow.> idk i just like the name
23:54:22disruptekthe lookup table doesn't need the real address. it just needs a handle, right?
23:54:38FromDiscord<ElegantBeef> I also like the name, but i'm biased πŸ˜„
23:54:47disruptekjason was really a poc for frosty.
23:55:01disruptekthey both suffer from flaws due to missing concept support.
23:55:49disrupteki 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:49disrupteks/until/into/
23:56:52disruptekdamn english.
23:59:32ForumUpdaterBotNew thread by Jaybill: Random float based on unsigned int, see https://forum.nim-lang.org/t/7204