<< 24-12-2021 >>

00:00:14FromDiscord<Rika> No linker needed technically
00:00:25FromDiscord<Leonardo da Vinci> In reply to @Rika "No linker needed technically": Why?
00:00:40FromDiscord<Rika> Nim calls the linker on compile
00:00:46FromDiscord<Rika> It doesn’t have a separate linker step
00:01:21FromDiscord<retkid> ik im weird but i like to edit in my terminal and compile and test in a separate terminal with htop open to monitor ram
00:01:37FromDiscord<Elegantbeef> I mean people use nvim as an editor so not that weird
00:01:45FromDiscord<retkid> (edit) "terminal" => "ide"
00:01:55FromDiscord<retkid> no i dont know vim
00:01:58FromDiscord<Rika> What the fuck
00:01:58FromDiscord<Elegantbeef> I've always just used the terminal interface aswell
00:02:07FromDiscord<Rika> Rude
00:03:08FromDiscord<Leonardo da Vinci> @Rika rika thanks for the help
00:03:35FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jie
00:03:49FromDiscord<TryAngle> does that work?
00:03:54FromDiscord<Elegantbeef> No
00:04:05FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/923727693063807056/Screenshot_2021-12-23_19_03_10.png
00:04:08FromDiscord<Elegantbeef> `xSeq` is a runtime value, nim doesnt know it "comes from static"
00:04:24FromDiscord<retkid> In reply to @retkid "": my elite setup
00:04:26FromDiscord<TryAngle> In reply to @Elegantbeef "`xSeq` is a runtime": that's what I thought, what have been cursed otherwise lol
00:04:36FromDiscord<TryAngle> (edit) "what" => "would"
00:04:40FromDiscord<demotomohiro> Generic parameters must be determined at compile time
00:05:56FromDiscord<retkid> personally I really like kali rn
00:05:57FromDiscord<retkid> idk
00:16:42FromDiscord<Leonardo da Vinci> In reply to @Elegantbeef "I mean is `nim": it gives me error somehow
00:17:07FromDiscord<Leonardo da Vinci> Never mind
00:19:12FromDiscord<Leonardo da Vinci> In reply to @Elegantbeef "It's a shitty editor": Why?
00:19:23FromDiscord<TryAngle> when nim compiles a project that depends on libraries↵how are the libraries compiled?↵Only the used code, only the imported code or all?
00:22:06FromDiscord<auxym> Nim always run dead code elimination, ie, code that is not used is not included in the binary
00:22:29FromDiscord<TryAngle> ok ty
00:22:55FromDiscord<Elegantbeef> Presently it checks all the code but only uses what's used
00:23:52FromDiscord<Elegantbeef> There are two PRs for different implementations of "lazysem" which decrease compile times by only semantically checking what's used
00:24:21FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jih
00:24:35FromDiscord<TryAngle> or does the value get cloned
00:25:03FromDiscord<Elegantbeef> It's coped but NVRO can take place
00:25:11FromDiscord<TryAngle> what is NVRO ?
00:25:28FromDiscord<Elegantbeef> The result variable is rewritten as the variable you're assigning to
00:25:59FromDiscord<TryAngle> I mean, isnt' taht what the result variable is used for 😅 ?
00:26:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Jii
00:26:53FromDiscord<Elegantbeef> Remember you can do `echo 1 + 2`
00:26:57FromDiscord<Elegantbeef> There is no NVRO there
00:27:31FromDiscord<Elegantbeef> It's NRVO and i'm an idiot
00:28:32FromDiscord<Elegantbeef> It depends on the call site if it's NRVO'd but yes procs can be 0 copy
00:29:02FromDiscord<TryAngle> ok thanks
00:29:49FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jik
00:30:13FromDiscord<TryAngle> ah wait, does that not make sense? should I just use seq in this case?
00:30:24FromDiscord<Elegantbeef> Indeed
00:30:38FromDiscord<Elegantbeef> openarrays can only be returned from openarrays
00:30:54FromDiscord<TryAngle> hmmm when I use the zip function with Vector then
00:31:05FromDiscord<TryAngle> does it know to use use the toSeq converter?
00:31:26FromDiscord<TryAngle> no 😢
00:31:34FromDiscord<Leonardo da Vinci> It works!!!! https://media.discordapp.net/attachments/371759389889003532/923734608443494440/unknown.png
00:31:44FromDiscord<Elegantbeef> `toSeq` can use an iterator
00:31:48FromDiscord<Elegantbeef> Well they all can use an iterator
00:32:09FromDiscord<Elegantbeef> Nah it doesnt your editor isnt in english 😛
00:32:46FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jim
00:33:09FromDiscord<Elegantbeef> Oh right `seqUtils` uses `openArray`
00:33:25FromDiscord<Elegantbeef> It's best to make your own iterator based stuff methinks
00:33:40FromDiscord<TryAngle> yes so I should just implement my own zip?
00:34:05FromDiscord<Elegantbeef> Probably
00:34:07FromDiscord<Leonardo da Vinci> In reply to @Elegantbeef "Nah it doesnt your": idk how to change it, i recently installed mint
00:34:22FromDiscord<Elegantbeef> Eh i was joking
00:36:38FromDiscord<Leonardo da Vinci> In reply to @Elegantbeef "Eh i was joking": Yeah, but i like having everything on one language, english
00:37:38FromDiscord<Elegantbeef> No idea
00:37:46FromDiscord<Elegantbeef> Language settings are probably in settings
00:38:52*vicfred quit (Quit: Leaving)
00:42:15FromDiscord<Leonardo da Vinci> what is the command to make nim compile to C source code?
00:42:15FromDiscord<Rika> In reply to @TryAngle "I already have ": Pairs iterator is wrong
00:42:23FromDiscord<Rika> In reply to @Leonardo da Vinci "what is the command": nim cc
00:42:37FromDiscord<Rika> Source code only? Technically doesn’t exist
00:42:44FromDiscord<Leonardo da Vinci> In reply to @Rika "Source code only? Technically": why?
00:42:57FromDiscord<Rika> Because Nim is not designed like that
00:43:15*redj quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:43:19FromDiscord<Elegantbeef> You can make it output C code
00:43:23FromDiscord<Leonardo da Vinci> i see
00:43:32FromDiscord<Rika> That’s the technically part
00:43:42FromDiscord<Elegantbeef> `nim c -c --nimcache:someDir/"` but it's only needed for a small variety of situations
00:43:56FromDiscord<Elegantbeef> Nim is not a C generator is Araq's view
00:44:00FromDiscord<Elegantbeef> Nim uses C as an IR
00:44:12*redj joined #nim
00:44:14FromDiscord<Rika> It’s a lot of our views as well I’d say
00:44:47FromDiscord<Elegantbeef> There was(is) an header generated but it's not support
00:44:51FromDiscord<Elegantbeef> generator\
00:46:01FromDiscord<Leonardo da Vinci> In reply to @Elegantbeef "Nim uses C as": What is IR?
00:46:18FromDiscord<Rika> Intermediate representation
00:46:34FromDiscord<Leonardo da Vinci> In reply to @Elegantbeef "You can make it": how?
00:46:54FromDiscord<Rika> In reply to @Elegantbeef "`nim c -c --nimcache:someDir/"`": This
00:47:27FromDiscord<Elegantbeef> Intermediate representation
00:48:05FromDiscord<Elegantbeef> I already showed how
00:48:06FromDiscord<Rika> Late
00:48:10FromDiscord<Rika> Late x2
00:48:27FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/923738859559321620/image.png
00:48:30FromDiscord<Elegantbeef> Matrix bridge shat the bed
00:48:46FromDiscord<Rika> Lol
00:49:03FromDiscord<Elegantbeef> Comically your late messages didnt even shoot through
00:49:39FromDiscord<Rika> Damnit
00:49:47FromDiscord<Leonardo da Vinci> In reply to @Elegantbeef "`nim c -c --nimcache:someDir/"`": it doesn't work
00:49:51FromDiscord<Elegantbeef> There we go it's catching up
00:50:00FromDiscord<ElegantBeef> It does work you still need to supply the nim file
00:50:00FromDiscord<Rika> How does it not work?
00:50:09FromDiscord<Rika> Who are you
00:50:21FromDiscord<Leonardo da Vinci> In reply to @ElegantBeef "It does work you": aaaaa
00:50:24FromDiscord<Leonardo da Vinci> i am so dumb
00:50:28FromDiscord<Rika> Lol
00:50:30FromDiscord<Leonardo da Vinci> In reply to @Rika "Who are you": Me
00:50:40FromDiscord<ElegantBeef> Someone annoyed by the bridge being slow
00:51:18FromDiscord<ElegantBeef> The funny part is that the "X user is typing" is even delayed
00:51:23FromDiscord<Rika> Lol
00:51:29FromDiscord<Rika> So your internet is slow
00:51:35FromDiscord<ElegantBeef> Nah my internet is fast
00:51:40FromDiscord<ElegantBeef> The bridge shits the bed occasionally
00:52:42FromDiscord<ElegantBeef> Well my internet is relatively fast, 500MBps down
00:53:17FromDiscord<Rika> If it ain’t gigabit it’s slow
00:53:45FromDiscord<ElegantBeef> Indeed
00:53:52FromDiscord<ElegantBeef> Half gigabit is half fast so it's slow
00:54:19FromDiscord<Elegantbeef> Oh i think we've caught up
00:54:57FromDiscord<Leonardo da Vinci> i have half a megabyte :_(
00:55:02FromDiscord<Leonardo da Vinci> (edit) ":_(" => "😦"
00:58:54FromDiscord<TryAngle> In reply to @Rika "Pairs iterator is wrong": true it shouldn't be var Vector rioght?
00:59:18FromDiscord<Rika> The for loop part I mean
00:59:27FromDiscord<Rika> The mutability is one issue
00:59:28FromDiscord<Elegantbeef> `for x in 0..<vec.len`
01:08:51FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3Jir
01:08:57FromDiscord<retkid> https://tenor.com/view/chefs-kiss-french-chef-perfect-dish-excellent-food-perfection-gif-20341505
01:09:02FromDiscord<TryAngle> In reply to @Rika "The for loop part": what is worng in the loop?
01:09:14FromDiscord<Elegantbeef> The iterator is wrong
01:09:19FromDiscord<TryAngle> ah 0..len - 1
01:09:23FromDiscord<TryAngle> or 0..<len
01:09:26FromDiscord<Elegantbeef> You do `for x in vec.len()` that's not valid unless `len` is a `range`
01:09:42FromDiscord<retkid> i do 0 .. len()-1
01:09:44FromDiscord<retkid> dunno why
01:09:46FromDiscord<retkid> looks better
01:11:19FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3Jis
01:11:22FromDiscord<retkid> as if they ever were
01:13:08*stosby joined #nim
01:13:22*stosby left #nim (#nim)
01:15:42FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3Jiu
01:15:49FromDiscord<retkid> (edit)
01:17:06FromDiscord<retkid> its probably temporary code thats why i dont care at all
01:17:46FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jiv
01:18:24FromDiscord<TryAngle> (edit) "https://play.nim-lang.org/#ix=3Jiv" => "https://play.nim-lang.org/#ix=3Jiw"
01:18:30FromDiscord<Elegantbeef> Mine is non copying
01:18:41FromDiscord<Elegantbeef> It doesnt create a new collection to iterate
01:18:59FromDiscord<TryAngle> ah I see, but why is that not in std 🤔
01:19:14FromDiscord<Elegantbeef> Cause it was broken until 1.6 and makes things a bit more awkward
01:19:34FromDiscord<TryAngle> lol↵so it got "just fixed" ?
01:19:40FromDiscord<TryAngle> like 2 weeks ago
01:19:45FromDiscord<TryAngle> (edit) "2" => "some"
01:20:12FromDiscord<Elegantbeef> Yes i fixed it a few months ago and it was released with 1.6
01:20:23FromDiscord<Elegantbeef> Previously `[]` could not be used for a iterator
01:21:12FromDiscord<TryAngle> oh ok
01:21:32FromDiscord<TryAngle> so will that get be added into std potentially in the future?
01:21:39FromDiscord<TryAngle> (edit) removed "get"
01:21:42FromDiscord<Elegantbeef> No clue
01:21:50FromDiscord<Elegantbeef> It makes things more annoying like i mentioned
01:21:56FromDiscord<TryAngle> just curious, because cloning an entire collection just for iterations sounds weird
01:22:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Jix
01:22:21FromDiscord<TryAngle> ah true xd
01:22:55FromDiscord<Elegantbeef> I had the idea of doing `for i, x in a[&1..2]` for pairs
01:23:09FromDiscord<Elegantbeef> Or any other unary operator
01:23:10FromDiscord<Elegantbeef> Everything is overly cryptic
01:23:33FromDiscord<Elegantbeef> presently i decided on `for i, x in a.pairs(1..2)`
01:24:43FromDiscord<Elegantbeef> I suppose i could also do `for i, x in a[1, 2]`
01:25:17FromDiscord<Elegantbeef> The issue is it's all rather cryptic
01:26:39FromDiscord<Elegantbeef> I'm open to suggestions
01:31:33*neceve quit (Ping timeout: 256 seconds)
01:32:53FromDiscord<evoalg> In reply to @TryAngle "I already have ": I want to play around with these, but how should I define the Vector type?
01:34:32FromDiscord<evoalg> In reply to @Elegantbeef "presently i decided on": I like `a.pairs(1..2)` for it's readability
01:36:04FromDiscord<IsaacPaul> Is there anyway to access unexposed fields? I'm looking to add mutable unsafeGet to Option[T]
01:36:55FromDiscord<Elegantbeef> `std/importutils`
01:37:12FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jiz
01:41:13FromDiscord<evoalg> In reply to @TryAngle "uhm what do you": When you make your zip iterator, I'd be interested in seeing it ... and are you going to make it accept more than 2 Vectors or is that not possible?
01:41:35FromDiscord<IsaacPaul> Awesome! works like a charm
01:41:59FromDiscord<IsaacPaul> ... just realized how weird that expression is
01:42:48FromDiscord<Elegantbeef> You technically dont need to use `privateAccess` but it's a tad bit easier 😀
01:43:26FromDiscord<evoalg> it's all magic to me, as long as I import the correct spells
01:45:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JiF
01:45:33FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JiG
01:45:36FromDiscord<Elegantbeef> it practically does the same thing as private access but doesnt rely on the compiler magic that is privateaccess
01:45:39FromDiscord<TryAngle> @evoalg
01:46:00FromDiscord<TryAngle> nothing spectectular
01:46:21FromDiscord<evoalg> Thank you!
01:46:40FromDiscord<TryAngle> I haven't tested the [T, U] ones though
01:52:08FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3JiJ
01:52:26FromDiscord<Elegantbeef> Had to think about how to do this for a minute, but general purpose zip that works on any iterable
01:53:55FromDiscord<Elegantbeef> You can always replace `iterable` with \`untyped
01:54:08FromDiscord<Elegantbeef> Then you dont need `items` but `elementType` wont work properly with all types
01:54:57FromDiscord<Elegantbeef> The real nice thing is you can just use any iterable `let f = zip(d.pairs, c.items)` works for instance
01:55:56FromDiscord<IsaacPaul> https://github.com/izackp/questionable/commit/a7343fc8d3ee9ba3507b2b89d075270959ae16c5↵↵If anyone is interested I added support for void procs and procs that take mutable arguments for `questionable` . Honestly, kinda sad how much effort like 15 lines of code was 😂
01:56:19FromDiscord<IsaacPaul> but i understand templates and macros better so I guess that's a win
01:56:36FromDiscord<Elegantbeef> You may want to go with the macro method instead of private access since `importutils` is only 1.6+
01:56:57FromDiscord<Elegantbeef> Especially since `status-im` aims at `1.2.x`
01:57:06FromDiscord<IsaacPaul> ah alright
01:57:21FromDiscord<Elegantbeef> Assuming you are going to PR that is
01:58:13FromDiscord<IsaacPaul> I'm not sure if the author is a fan of these changes. There's already a closed ticket dismissing it
01:58:17*vicfred joined #nim
01:58:19FromDiscord<Elegantbeef> Ah
01:58:23FromDiscord<Elegantbeef> Then carry on
01:58:58FromDiscord<Elegantbeef> Though it's a nice example of `sym`s if you want to look into how what i sent you works 🙂
01:59:36FromDiscord<IsaacPaul> gotcha, I'll probably put it in just in case someone finds it useful
02:01:03FromDiscord<Elegantbeef> \is presently trying to reason how to make a iterator compliant `zip`
02:02:26FromDiscord<Rika> You would need to make one for every number of seqs
02:02:48FromDiscord<Elegantbeef> Nah forloop macro
02:02:58FromDiscord<evoalg> In reply to @Elegantbeef "Had to think about": amazing thank you ... python's zip can take any number of lists and it will zip them in one go ... we can't do that in nim right?
02:03:02FromDiscord<Elegantbeef> The only issue is that you cannot do it without iterating like i did above
02:03:15FromDiscord<Elegantbeef> Oh you can do that evo
02:03:22FromDiscord<Rika> Macro
02:03:37FromDiscord<Elegantbeef> It's the same logic as above but you just keep applying step 2
02:03:47FromDiscord<Elegantbeef> I might aswell make a macro for it
02:03:50FromDiscord<Elegantbeef> Throw it in slicerator
02:05:03FromDiscord<evoalg> but does it need to know how many iterables are passed? ... what if one day I wanted to zip 15 of them in one go?
02:05:22FromDiscord<Elegantbeef> I'll have it done in a minute, be patient my boy
02:05:46FromDiscord<evoalg> I will try, father
02:08:49nrds<Prestige99> Running into a compiler error, trying to figure out where to even start looking to debug this. https://play.nim-lang.org/#ix=3JiP
02:08:54nrds<Prestige99> Beef any thoughts?
02:11:43FromDiscord<Rika> Mismatched glibc version?
02:12:11nrds<Prestige99> hm passing in --threads:on seems to have worked but I'm not explicitly using threads in my code
02:12:32nrds<Prestige99> glibc 2.33-5
02:12:32FromDiscord<Rika> What’s the code
02:12:59nrds<Prestige99> It's a game engine I'm writing, I deleted some code and now I'm getting that when attempting to compile
02:13:40FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JiQ
02:13:55FromDiscord<TryAngle> (edit) "https://play.nim-lang.org/#ix=3JiQ" => "https://play.nim-lang.org/#ix=3JiR"
02:15:21nrds<Prestige99> I'll try it on CI and see what happens, since that environment hasn't changed
02:17:42nrds<Prestige99> https://app.circleci.com/pipelines/github/avahe-kellenberger/shade/38/workflows/6b5303bb-93eb-415e-97d0-beae6904d683/jobs/36?invite=true#step-111-47 on CI, would should correspond to https://github.com/avahe-kellenberger/shade/blob/custom-physics/src/shadepkg/game/node.nim#L152 ?
02:18:15nrds<Prestige99> It's the same code on another branch which compiles though, so. Not sure what's up
02:18:34FromDiscord<Elegantbeef> Ugh iterable issues strike again
02:19:55nrds<Prestige99> Can you see https://app.circleci.com/pipelines/github/avahe-kellenberger/shade/38/workflows/6b5303bb-93eb-415e-97d0-beae6904d683/jobs/36 ?
02:21:22nrds<Prestige99> oh hell I think I do need --threads:on to use locks
02:21:35FromDiscord<Elegantbeef> Yes
02:21:58nrds<Prestige99> Why does it compile on another branch without --threads:on 🤔
02:22:22FromDiscord<Elegantbeef> I could be wrong
02:25:24FromDiscord<retkid> i know i only have a vague idea of what a thread scheduler is, but im gonna make one tomorro
02:25:26FromDiscord<retkid> (edit) "tomorro" => "tomorrow"
02:26:11FromDiscord<retkid> i feel like it would be more efficient to instead of threading the process, run 4 of them independently
02:26:27FromDiscord<retkid> (edit) "independently" => "independently, and communicate"
02:26:30FromDiscord<retkid> (edit) "i feel like it would be more efficient to instead of threading the process, run 4 of them independently, and communicate ... " added "via a manager"
02:26:54FromDiscord<Elegantbeef> @evoalg\: here you go https://play.nim-lang.org/#ix=3JiT
02:27:17FromDiscord<Elegantbeef> Sadly doesnt use `iterable` as a limiter so has less than useful errors if you do something dumb
02:27:35FromDiscord<retkid> also collect() is so cool i wish i knew about it
02:27:58FromDiscord<retkid> i like that you can make it return a tuple and just add data to it without changing its type manuall
02:28:14FromDiscord<retkid> (edit) "manuall" => "manually"
02:28:18FromDiscord<Elegantbeef> Using a int literal instead of an iterator does `https://hatebin.com/gdhcdacerq`
02:28:30FromDiscord<Elegantbeef> So it's a mess but it does the goal
02:30:22FromDiscord<evoalg> That's very impressive @ElegantBeef thank you!
02:30:56FromDiscord<Elegantbeef> Well zip is rather programmatic compliant
02:31:18FromDiscord<evoalg> "programmatic compliant" means what?
02:31:29FromDiscord<Elegantbeef> My logic i wrote for the template is all i'm doing here, just generating the tail end with code
02:32:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JiU
02:32:46FromDiscord<Elegantbeef> More iterators just means more of those and setting `i = 0` after resizing
02:33:16FromDiscord<Elegantbeef> The macro afterall is just that template but written by code instead of by me 😛
02:34:58FromDiscord<evoalg> hehe that makes sense (even if I don't know macro's, and I don't understand the code). It's amazing how you can do this stuff so fast
02:35:01FromDiscord<Elegantbeef> I feel like a quip of "The key of writing macros is identifying patterns and saying to your computer 'i'm to lazy to write this, you've got it ok'" 😛
02:35:01FromDiscord<retkid> i can use threads to represent specific cores right?
02:35:07FromDiscord<retkid> or well, threads
02:35:18FromDiscord<Elegantbeef> Threads you interact with are software threads
02:35:32FromDiscord<Elegantbeef> You can pin threads to a specific hardware thread but it's pointless
02:35:41FromDiscord<retkid> why is it pointless?
02:36:04FromDiscord<Elegantbeef> Cause you might have a lot of operations on that hardware thread and by pining to that thread you're now waiting for that to clear up
02:36:12FromDiscord<Elegantbeef> Instead of just waiting for the next available thread
02:36:16FromDiscord<retkid> what if thats the point
02:36:33FromDiscord<Elegantbeef> You want high latency?
02:37:03FromDiscord<retkid> if you know the operation will use up 100% of the resources on the thread, you run each process on each thread and reassign them as they complete
02:37:26FromDiscord<Elegantbeef> You do realize the OS still schedules other stuff right?
02:37:54FromDiscord<retkid> well if they didn't then it wouldn't work because the thread the controller sits on wouldn't operate
02:38:14FromDiscord<retkid> (edit) "well if they didn't then it wouldn't work because the thread the controller sits on wouldn't operate ... " added "besides that one task"
02:38:30FromDiscord<retkid> I dont see how thats relevant you're never going to get 100% control of a cpu
02:39:04FromDiscord<Elegantbeef> Eitherway there is `pinToCpu` so feel free to use it
02:39:11FromDiscord<retkid> just avoid running the same function on the same core because otherwise it'll be less efficient
02:39:27FromDiscord<retkid> (edit) "just avoid running the same function on the same core because otherwise it'll be less efficient ... " added "(maybe)"
02:39:42FromDiscord<retkid> (edit) "(maybe)" => "(maybe, need to test)"
02:40:14FromDiscord<ajusa> Is there any way to tell Nim not to link against a library? I want to remove the `-lm` that Nim adds to link against libm
02:44:58*vicfred quit (Quit: Leaving)
03:12:38*arkurious quit (Quit: Leaving)
03:26:56FromDiscord<impbox [ftsf]> are you sure it is?
03:27:04FromDiscord<impbox [ftsf]> where do you see that happening?
03:37:48FromDiscord<ajusa> In reply to @impbox "where do you see": is this intended for me or retkid? If it's for me, I see that happening when the linking command fails, Nim prints out the command. I've been working on using cosmopolitan libc, and as it is an alternative implementation I need to avoid linking against libm and link against cosmopolitan instead.
03:38:42FromDiscord<impbox [ftsf]> In reply to @ajusa "is this intended for": for you, when i compile a simple nim script it doesn't link against libm
03:40:18FromDiscord<impbox [ftsf]> are you importing math?
03:40:23FromDiscord<ajusa> In reply to @impbox "for you, when i": Hm, it does this on a more complex project (using zippy, parsetoml, and other libraries). I'd wager that it is something in the stdlib that is causing that
03:40:34FromDiscord<ajusa> In reply to @impbox "are you importing math?": probably somewhere a dependency is yes
03:40:44FromDiscord<impbox [ftsf]> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/math.nim#L126
03:41:13FromDiscord<TennisBowling> is there any way to know what gcc command nim is invoking?
03:41:24FromDiscord<ajusa> In reply to @impbox "https://github.com/nim-lang/Nim/blob/version-1-6/li": Thanks, I know where to patch that out now! I should have checked there to begin with lol, common sense.
03:41:47FromDiscord<Rika> In reply to @TennisBowling "is there any way": Doesn’t it use whatever matches GCC on the path
03:42:04FromDiscord<impbox [ftsf]> --listCmd
03:42:05FromDiscord<Elegantbeef> I think they mean "what does it call gcc with"
03:42:07FromDiscord<Elegantbeef> The answer is yes
03:42:09FromDiscord<TennisBowling> yeah what args
03:42:39FromDiscord<Rika> Doesn’t it get printed by default?
03:42:43FromDiscord<Rika> At least on 1.6
03:42:50FromDiscord<impbox [ftsf]> `--listCmd` will print it out
03:42:53FromDiscord<TennisBowling> thank you
03:50:53*redj quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
03:51:50*redj joined #nim
03:53:16*redj quit (Client Quit)
03:54:25*redj joined #nim
04:09:14FromDiscord<_Ash> Hey people I am new here
04:09:25FromDiscord<Elegantbeef> Hello
04:17:38*vicfred joined #nim
04:23:30FromDiscord<Rika> Hello new here
04:32:33*audiophile_ quit (Quit: Default Quit Message)
04:53:14FromDiscord<Elegantbeef> No you're not dont lie
05:03:22*rockcavera quit (Remote host closed the connection)
05:03:57*noeontheend joined #nim
05:36:17*noeontheend quit (Ping timeout: 240 seconds)
06:14:53NimEventerNew thread by Gtriangle: High memory usage with large number of HashSets. 3X more memory than Python, see https://forum.nim-lang.org/t/8732
06:51:07*sagax quit (Quit: Konversation terminated!)
06:52:38*sagax joined #nim
07:56:16*jkl quit (Quit: Gone.)
07:57:36*jkl joined #nim
08:28:54FromDiscord<_Ash> Beginner guide to Nim please
08:29:26FromDiscord<Elegantbeef> https://nim-lang.org/documentation.html
08:30:22FromDiscord<Elegantbeef> https://nim-by-example.github.io/getting_started/ http://ssalewski.de/nimprogramming.html
08:30:38FromDiscord<Elegantbeef> That should have you covered for all knowledge/skill levels
08:31:37NimEventerNew thread by Cnerd: Nim smtp library, see https://forum.nim-lang.org/t/8733
08:34:27FromDiscord<Solitude> In reply to @_Ash "Beginner guide to Nim": damn, now people type their google searches here...
08:34:46FromDiscord<Elegantbeef> And some assholes indulge it
09:57:52NimEventerNew thread by Niminem: Require Nim devel branch as dependency (nimble), see https://forum.nim-lang.org/t/8734
10:02:58FromDiscord<qb> How do I concat two `cstring`s?
10:04:07FromDiscord<qb> well nvm. Gonna concat normal strings and use .cstring after
10:19:46FromDiscord<hmmm> In reply to @Solitude "damn, now people type": they also added a "please" to appease the human algorithm, this is top level google-fu
10:21:43FromDiscord<qb> Results are even the same https://media.discordapp.net/attachments/371759389889003532/923883129184342087/Bildschirmfoto_von_2021-12-24_11-20-51.png
11:05:10*flynn quit (Remote host closed the connection)
11:06:20*flynn joined #nim
11:08:47*neceve joined #nim
11:13:48*flynn quit (Read error: Connection reset by peer)
11:14:58*flynn joined #nim
11:19:23*flynn quit (Read error: Connection reset by peer)
11:20:33*flynn joined #nim
11:44:11FromDiscord<planetis> so in C free(NULL) is ok, but dealloc(nil) crashes in Nim
11:46:25*audiophile_ joined #nim
12:10:52Zevvuse -d:usemalloc :)
12:12:14NimEventerNew thread by Mantielero: Issue with operator `·`, see https://forum.nim-lang.org/t/8735
12:22:16NimEventerNew thread by Kcvinu: Original source of Mingw64, see https://forum.nim-lang.org/t/8736
12:46:18*audiophile_ quit (Quit: Default Quit Message)
12:50:52*Vladar joined #nim
13:36:26*flynn quit (Remote host closed the connection)
13:37:36*flynn joined #nim
13:57:39FromDiscord<Zoom> Can I somehow variably `include` something? Surprisingly, it wants a literal, const doesn't cut it.
14:07:16*Vladar quit (Quit: Leaving)
14:07:34FromDiscord<Rika> include is "before <whats traditionally called> compile time" afaik
14:07:52FromDiscord<Solitude> In reply to @Zoom "Can I somehow variably": bunch of `when`'s dont cut it?
14:10:42FromDiscord<Zoom> Not sure they help at all. I'd like to generate a part of the program in a static block and include it later.↵(@Solitude)
14:11:08FromDiscord<Zoom> I was hoping I could save the results in a temp file and pass the path to include
14:11:51FromDiscord<Solitude> and why file path cant stay static?
14:12:09FromDiscord<Rika> why do you need to save it in a file if you can just emit the code from a macro
14:12:36FromDiscord<Rika> or `macrocache` which holds nimnodes afaik
14:22:21FromDiscord<Zoom> Because I want to modify a file in memory, so source filters won't work (they are required to be inserted into a file)
14:23:24FromDiscord<Solitude> i dont get it
14:23:26FromDiscord<Solitude> use a macro
14:26:07FromDiscord<Zoom> Thanks. Just "no" would suffice though.↵(@Solitude)
14:27:10FromDiscord<Zoom> For now I use `transformFile` from `pegs` and save to a hardcoded path, and later include. I don't like hardcoding paths and would like to use `tempfiles` for this.
14:28:27FromDiscord<Rika> Then no
14:30:55NimEventerNew question by ChrisoLosoph: Reversing Bytes and cross compatible binary serialization in Nim, see https://stackoverflow.com/questions/70473879/reversing-bytes-and-cross-compatible-binary-serialization-in-nim
14:36:42FromDiscord<Solitude> In reply to @Zoom "Thanks. Just "no" would": you could just use a macro for you hack tho↵`macro includeStr(m: static[string]): untyped = newStmtList nnkIncludeStmt.newTree newLit m↵`
14:40:36FromDiscord<Zoom> Thanks!
14:40:47FromDiscord<pmunch> You can, that's basically what Futhark does
14:59:38FromDiscord<planetis> how do I run a task from a .nimble file without nimble? its nim e x.nimble but what about the task?
15:25:38*flynn quit (Read error: Connection reset by peer)
15:26:48*flynn joined #nim
15:45:18*flynn quit (Remote host closed the connection)
15:46:28*flynn joined #nim
15:51:37FromDiscord<Fish-Face> is there no `pairs` iterator for `iterable[T]`? or am I just missing an import
15:51:42*yann-kaelig joined #nim
15:52:02yann-kaeligHello
15:52:14yann-kaeligDo you know an XMPP library for Nim ?
15:59:39*flynn quit (Read error: Connection reset by peer)
16:00:50*flynn joined #nim
16:10:11FromDiscord<Solitude> In reply to @Fish-Face "is there no `pairs`": pairs is iterable[T]
16:13:03FromDiscord<Fish-Face> sent a code paste, see https://play.nim-lang.org/#ix=3Jme
16:13:15FromDiscord<Solitude> what
16:13:21FromDiscord<Solitude> what are you trying to do
16:13:40FromDiscord<Fish-Face> `for i, line in something.splitLines:`
16:13:56FromDiscord<Solitude> https://nim-lang.org/docs/enumerate.html#enumerate.m%2CForLoopStmt
16:16:19FromDiscord<Fish-Face> huh. thanks. i find the inconsistency odd though
16:16:39FromDiscord<Solitude> which one
16:19:48FromDiscord<Fish-Face> that you can do this with `.pairs` on `OpenArray` and many other types, but not on `iterable`.
16:21:47FromDiscord<Solitude> iterable can only be used as template argument
16:36:27FromDiscord<IsaacPaul> Yea i found it odd too the first time it was mentioned here
16:41:25FromDiscord<IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3Jms
16:42:26FromDiscord<IsaacPaul> (edit) "https://play.nim-lang.org/#ix=3Jms" => "https://play.nim-lang.org/#ix=3Jmt"
16:50:04FromDiscord<IsaacPaul> Not that it's an answer to your question, but just more _odd_ behavior imo
16:50:36FromDiscord<Solitude> there is no zip iterator?..
16:57:03FromDiscord<IsaacPaul> ah I'm dumb I forgot I was using one I wrote. My point was that it's odd for seq and iterator behave differently https://play.nim-lang.org/#ix=3Jmw
17:27:06NimEventerNew thread by Gcao: Question about debugging issue related to GC, see https://forum.nim-lang.org/t/8738
18:57:56FromDiscord<TryAngle> Merry Christmas everyone thanks for helping me out a lot recently 😊
19:00:07yann-kaeligmerry chrostmas
19:00:20yann-kaeligmerry christmas
19:00:28yann-kaeliglol, to much drink :D
19:00:46*yann-kaelig left #nim (#nim)
19:29:14FromDiscord<IsaacPaul> bahaha
19:57:56FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jn2
19:58:17FromDiscord<TryAngle> (edit) "https://play.nim-lang.org/#ix=3Jn2" => "https://play.nim-lang.org/#ix=3Jn3"
19:59:19FromDiscord<Solitude> they both must be known at compile time
20:01:14FromDiscord<Yardanico> yeah, as Solitude said, `typedesc` is really just an alternative syntax for making procedures generic :)
20:01:31FromDiscord<Yardanico> for each different type passed to `test` Nim will instantiate a proc with that type
20:03:01FromDiscord<retkid> how do i do return types in nim
20:03:11FromDiscord<retkid> rpoggojh
20:03:11FromDiscord<retkid> wait
20:03:15FromDiscord<retkid> ignore that
20:03:28FromDiscord<Solitude> irc remembers
20:03:31FromDiscord<Yardanico> @retkid why do you delete messages? that doesn't make any sense
20:03:33FromDiscord<retkid> shhh
20:03:36FromDiscord<Yardanico> your messages will still be there in IRC
20:03:43FromDiscord<Yardanico> and it just makes the conversation harder to follow if a part of it is deleted
20:03:46FromDiscord<retkid> In reply to @Yardanico "<@!217459674700578816> why do you": i dont exist in the irc void
20:03:47FromDiscord<Yardanico> in a public place like here
20:03:54FromDiscord<retkid> how am i suppose to know that though
20:03:57FromDiscord<Yardanico> hm, can I disallow normal members from deleting messages here? 🤔
20:04:09FromDiscord<retkid> you cannot
20:04:15FromDiscord<retkid> anyway
20:04:21FromDiscord<Rosen> Yes you can
20:04:23FromDiscord<Rosen> I think?
20:04:31FromDiscord<retkid> i never seen it
20:04:40FromDiscord<retkid> (edit) "i" => "ive"
20:04:41FromDiscord<Yardanico> yeah you can't apparently
20:04:50FromDiscord<Yardanico> but anyway it's there in IRC, so by deleting messages you only make the conversation harder to follow here
20:04:59FromDiscord<retkid> anyway
20:05:10FromDiscord<retkid> how do i return types with Threads again?
20:05:15FromDiscord<Yardanico> what?
20:05:41FromDiscord<retkid> uhhhhh how do i create a thread in nim and use the proc called's return
20:05:49FromDiscord<retkid> ie
20:05:57FromDiscord<Yardanico> https://nim-lang.org/docs/threads.html#examples
20:06:12FromDiscord<retkid> yea i saw
20:06:16FromDiscord<retkid> that proc has no return
20:06:43FromDiscord<retkid> i dont know why you linked that...
20:06:50FromDiscord<Yardanico> In reply to @retkid "that proc has no": you can't do that directly
20:07:01FromDiscord<Yardanico> threadpool provides a way of doing it, but it's kind of abandoned and outdated
20:07:16FromDiscord<Yardanico> you should store the results in some global variable or pass a pointer or something for the thread to store the result in
20:07:21FromDiscord<retkid> I usually use threadpool but i need to maniuplate affinity
20:08:09FromDiscord<retkid> so basically, channels?
20:08:32FromDiscord<retkid> alrighty, time for some nifty fine channels
20:08:39FromDiscord<Yardanico> I didn't just say channels, there are other ways too
20:20:36FromDiscord<TryAngle> thanks for explanation @Yardanico @Solitude
20:23:44FromDiscord<TryAngle> when I have a type that has `len` as a field↵is there a way to add a proc with the same name?
20:26:19FromDiscord<Solitude> yes, just add it
20:38:05FromDiscord<evoalg> In reply to @IsaacPaul "ah I'm dumb I": Just curious ... what's the advantage of writing your own zip iterator instead of using the std zip?
20:38:37FromDiscord<retkid> pintocpu segfaults due to an old cpu, however its fine because linux is smart enough to kinda do it automatically
20:39:21*arkurious joined #nim
20:39:40FromDiscord<Yardanico> In reply to @evoalg "Just curious ... what's": stdlib doesn't have an iterator version of zip actually
20:39:56FromDiscord<evoalg> ahhh
20:40:03FromDiscord<retkid> zip iterator?
20:40:08FromDiscord<IsaacPaul> In reply to @evoalg "Just curious ... what's": I only had that to test some random things with nim.↵The current zip and most things from sequtils create a ton of seqs while iterators are lazy and pass values individually.
20:40:25FromDiscord<IsaacPaul> (edit) removed "a ton of"
20:41:05FromDiscord<evoalg> ahhh ok ... so the stdlib may be rewritten one day?
20:41:28FromDiscord<Yardanico> i don't think there will ever be a full "rewrite"
20:41:33FromDiscord<retkid> holy shit i didnt know what zip iterators work
20:41:37FromDiscord<retkid> (edit) "work" => "where"
20:41:43FromDiscord<Yardanico> but afaik nim 2.0 will allow for more significant changes to the stdlib
20:41:45FromDiscord<retkid> those seem useful
20:41:50FromDiscord<IsaacPaul> zip iterators aren't a thing
20:41:50FromDiscord<Yardanico> In reply to @retkid "holy shit i didnt": it's not "zip iterators"
20:41:52FromDiscord<Yardanico> zip is just a name
20:41:57FromDiscord<retkid> :|
20:42:20FromDiscord<retkid> ah so its just called zip
20:42:33FromDiscord<retkid> well ive been scooled
20:42:37FromDiscord<retkid> (edit) "scooled" => "scgooled"
20:42:45FromDiscord<retkid> (edit) "scgooled" => "schooled"
20:42:58FromDiscord<retkid> i think this chromebook has the worst keyboard ive ever used
20:42:59FromDiscord<evoalg> In reply to @retkid "ah so its just": zip in python is an iterator / generator by default, and in nim it's a proc or something
20:43:41FromDiscord<evoalg> iterators are nice as it wont copy large sequences and so it saves on memory and speed
20:44:00FromDiscord<retkid> lol i know what an tierator is
20:44:07FromDiscord<retkid> (edit) "tierator" => "iterator"
20:44:10FromDiscord<evoalg> sorry!
20:44:11FromDiscord<retkid> ive learned what Collect is tho
20:44:20FromDiscord<retkid> and collect is beautiful
20:44:32FromDiscord<evoalg> I do love collect (mostly)
20:44:41FromDiscord<retkid> (mostly)
20:44:51FromDiscord<evoalg> it breaks sometimes
20:45:13FromDiscord<retkid> hm
20:46:34FromDiscord<retkid> never broke for me unless i used break
20:48:17FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jn8
21:10:52FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Jnc
21:11:11FromDiscord<TryAngle> (edit) "https://play.nim-lang.org/#ix=3Jnc" => "https://play.nim-lang.org/#ix=3Jnd"
21:12:23FromDiscord<Yardanico> because you can't have an openArray of openArray
21:14:23FromDiscord<TryAngle> 🥺
21:22:10FromDiscord<kaddkaka> Noob here, 2nd day of Nim. Why is `var tiles = seq[array[5, int]]` an Error? `Error: invalid type: 'typedesc[seq[array[0..4, int]]]' for var`
21:22:22FromDiscord<Yardanico> In reply to @kaddkaka "Noob here, 2nd day": because you're trying to assign a type to a variable
21:22:29FromDiscord<kaddkaka> oops
21:22:30FromDiscord<Yardanico> if you want to declare a variable of that type you should use `:` instead
21:22:32FromDiscord<kaddkaka> right
21:22:33FromDiscord<Yardanico> `var tiles: seq[array[5, int]]`
21:22:37FromDiscord<kaddkaka> yup
21:22:38FromDiscord<kaddkaka> thanks
21:24:38FromDiscord<evoalg> In reply to @retkid "never broke for me": This breaks for me: https://play.nim-lang.org/#ix=3Jnf
21:25:07FromDiscord<Yardanico> did you report it?
21:25:46FromDiscord<Yardanico> fixing variables leaking out of scope should actually be an easy fix
21:26:08FromDiscord<evoalg> How do I report it?
21:26:13FromDiscord<Yardanico> open an issue on github
21:26:27FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/new/choose there's a template for a bug report
21:26:37FromDiscord<evoalg> are you saying I'll have to create a github account?
21:26:40FromDiscord<Yardanico> yes?
21:27:23FromDiscord<sOkam!> Is there a way to call a variable of an object from inside its constructor? https://media.discordapp.net/attachments/371759389889003532/924050652416606279/unknown.png
21:27:42*anadahz quit (Ping timeout: 276 seconds)
21:27:43FromDiscord<Yardanico> In reply to @sOkam! "Is there a way": nope
21:27:53FromDiscord<Yardanico> you should probably make a constructor proc instead if you want that
21:28:05*anadahz joined #nim
21:29:25FromDiscord<evoalg> In reply to @Yardanico "fixing variables leaking out": There's another bug in that snippet ... with the if/else's in the last collect ... should that also be reported?
21:29:37FromDiscord<sOkam!> In reply to @Yardanico "you should probably make": what should I look for in the manual to find how they are created?
21:29:48FromDiscord<Yardanico> In reply to @sOkam! "what should I look": nim doesn't have any special syntax for init procedures
21:29:53FromDiscord<Yardanico> there's only a convention for naming them
21:29:59FromDiscord<Yardanico> initType for stack-allocated (like your Canvas)
21:30:03FromDiscord<Yardanico> and newType for heap-allocated
21:30:27FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Jnj
21:30:31FromDiscord<Yardanico> and then use it
21:30:35FromDiscord<Yardanico> (edit) "https://play.nim-lang.org/#ix=3Jnj" => "https://play.nim-lang.org/#ix=3Jnk"
21:30:39FromDiscord<sOkam!> thx!
21:33:27FromDiscord<sOkam!> In reply to @Yardanico "and then use it": for using it for constructing, should I just replace `Canvas( ... )` with `initCanvas( ... )`?
21:33:33FromDiscord<Yardanico> yes
21:33:41FromDiscord<Yardanico> then nim will just call your proc at compile time
21:33:46FromDiscord<Yardanico> to initialize your `const`
21:33:53FromDiscord<sOkam!> kk, easy enough
21:34:38FromDiscord<sOkam!> how do I assign the values, though? is there a self or this keyword?
21:35:15FromDiscord<sOkam!> (edit) "values," => "values inside the init proc,"
21:36:02FromDiscord<sOkam!> or should I just use `result.w` etc
21:37:15FromDiscord<Solitude> In reply to @Yardanico "initType for stack-allocated (like": i believe in init(typedesc) supremacy 🙏
21:37:15FromDiscord<Yardanico> yes, just that
21:37:21FromDiscord<Yardanico> @sOkam!
21:37:44FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Jnl
21:37:58FromDiscord<Yardanico> so you can set r and w directly like in your example before, and then set `h` separely
21:38:02FromDiscord<Yardanico> (edit) "separely" => "separately"
21:38:24FromDiscord<sOkam!> In reply to @Solitude "i believe in init(typedesc)": how would that syntax look like?
21:38:49FromDiscord<Yardanico> In reply to @sOkam! "how would that syntax": init(Canvas)
21:38:51FromDiscord<Yardanico> or Canvas.init()
21:39:02FromDiscord<Yardanico> or `init Canvas`
21:39:06FromDiscord<Solitude> hot
21:39:07FromDiscord<Yardanico> or `Canvas.init`
21:39:24FromDiscord<Yardanico> or `C_A_N_V_A_S.i_N_I_T()`
21:39:30FromDiscord<sOkam!> LUL
21:39:31FromDiscord<sOkam!> 😄
21:39:43FromDiscord<sOkam!> can you give a simple example of that init(Canvas) in context?
21:39:59FromDiscord<Solitude> example of what
21:40:04FromDiscord<sOkam!> Total first-timer, so all of this is really new
21:40:35FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Jnn
21:40:39FromDiscord<Yardanico> (edit) "https://play.nim-lang.org/#ix=3Jnn" => "https://play.nim-lang.org/#ix=3Jno"
21:40:55FromDiscord<Yardanico> basically you create a proc with `Canvas` type as its single argument
21:41:02FromDiscord<Yardanico> there's no runtime overhead for that as all types are resolved at compile time
21:41:17FromDiscord<Solitude> not necessarily single argument, jsut first
21:41:24FromDiscord<sOkam!> thats handy, love it
21:41:27FromDiscord<Yardanico> In reply to @Solitude "not necessarily single argument,": yeah right
21:42:17FromDiscord<sOkam!> how does it know that Canvas has a .init procedure? 🤔
21:42:51FromDiscord<Solitude> mhmmmmmmmmmmmmmmmmmmmmm
21:42:56FromDiscord<Yardanico> In reply to @sOkam! "how does it know": ?
21:42:56FromDiscord<Yardanico> it doesn'
21:43:02FromDiscord<Yardanico> (edit) "doesn'" => "doesn't know that Canvas "has" an init procedure"
21:43:08FromDiscord<Yardanico> you try to call `init` on a `Canvas` type
21:43:13FromDiscord<Yardanico> so it finds a proc that has `Canvas` as its argument
21:43:16FromDiscord<Yardanico> and that matches
21:43:22FromDiscord<Yardanico> Canvas as the type itself, not as a value
21:43:25FromDiscord<sOkam!> ahhhh got it
21:43:43FromDiscord<sOkam!> small detail that I didn't know. thats super handy
21:47:15FromDiscord<sOkam!> So, if I want to use that Canvas.init() syntax, but keep my `r, w, h` as arguments at construction... do I need a separate constructor for that?
21:47:18FromDiscord<Yardanico> no
21:47:27FromDiscord<Yardanico> you just add other arguments to your `init` proc as Solitude said
21:47:40FromDiscord<Yardanico> and then you can do Canvas.init(1, 2, 3) etc
21:47:56FromDiscord<Yardanico> of course you can also use `initCanvas` syntax, in fact that's the more "conventional" way
21:48:07FromDiscord<Yardanico> but Nim is all about freedom so you can use `init` style too if you find it nicer
21:48:07FromDiscord<Solitude> challenge conventions
21:48:27FromDiscord<sOkam!> In reply to @Solitude "challenge conventions": I will, just not as a noob 🙈
21:48:50FromDiscord<Yardanico> In reply to @sOkam! "I will, just not": we have a similar document to PEP-8 with some conventions https://nim-lang.org/docs/nep1.html
21:53:50FromDiscord<sOkam!> Still can't get it to work. I think I'm missing something 😔 https://media.discordapp.net/attachments/371759389889003532/924057306252054648/unknown.png
21:54:23FromDiscord<Yardanico> did you see my code example?
21:54:37FromDiscord<Yardanico> ah nvm, you have a different problem here
21:54:45FromDiscord<Yardanico> @sOkam! the `:` syntax is only for constructors
21:54:49FromDiscord<Yardanico> for procedures just pass arguments normally
21:55:39FromDiscord<sOkam!> In reply to @Yardanico "for procedures just pass": tried it, but it didnt know what `w` and `r` were, so added them
21:57:33FromDiscord<Elegantbeef> you just do `initCanvas(16/9, 640, int(round(640/(16/9))))`
21:57:47FromDiscord<sOkam!> In reply to @Elegantbeef "you just do `initCanvas(16/9,": thats precisely what im trying to avoid
21:57:59FromDiscord<Yardanico> In reply to @sOkam! "thats precisely what im": then you should calculate that in the proc itself
21:58:34FromDiscord<sOkam!> i just want a way to make new canvas presets without having to type the math
21:58:37FromDiscord<Yardanico> yes
21:59:04FromDiscord<Elegantbeef> Exactly what yardanico said
21:59:11FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Jnu
21:59:13FromDiscord<Yardanico> one possible example
21:59:41FromDiscord<sOkam!> In reply to @Yardanico "then you should calculate": i guess there is proc overload, and there could be another constructor that takes an int for height... that doesnt do the ratio calc 🤷‍♂️
21:59:46FromDiscord<Yardanico> yes
21:59:54FromDiscord<Yardanico> or you can have a default value that calculates the height by itself
21:59:59FromDiscord<Yardanico> although a bit chunky
21:59:59NimEventerNew post on r/nim by Ether-naut: Using a distinct type as a table key, see https://reddit.com/r/nim/comments/rnvt83/using_a_distinct_type_as_a_table_key/
22:00:50FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Jnw
22:00:55FromDiscord<Yardanico> maybe you prefer the overload instead though as it's simpler
22:02:04FromDiscord<Yardanico> (edit) "https://play.nim-lang.org/#ix=3Jnw" => "https://play.nim-lang.org/#ix=3Jnx"
22:02:07FromDiscord<sOkam!> also, is there a way to write the full type syntax in one line, including all its components?
22:02:10FromDiscord<Yardanico> yes
22:02:19FromDiscord<Yardanico> I just prefer writing it in multiple lines
22:02:37FromDiscord<Yardanico> ` result = Canvas(r: ratio, w: width, h: height)` works as well
22:02:50FromDiscord<Yardanico> ah, if you mean the `object` type definition, then no
22:02:58FromDiscord<sOkam!> 😔
22:03:04FromDiscord<sOkam!> kk
22:03:30FromDiscord<Elegantbeef> I mean there is but it's dumb
22:03:42FromDiscord<Yardanico> with tuples?
22:03:50FromDiscord<Elegantbeef> `type Canvas = distinct tuple[r: float, w,h: int]` dont ever do it
22:03:54FromDiscord<Yardanico> knew it
22:04:03FromDiscord<Elegantbeef> I will find where you live and hurt you if you do it
22:04:05FromDiscord<Yardanico> yeah, @sOkam! better to just stick to `object` :)
22:04:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Jny
22:05:51FromDiscord<Elegantbeef> Also sokam i see you took my comments and added them to your github issue on godot-nim, they were based 100% in my feelings and i dont see why you included them 😀
22:07:07*xet7 quit (Remote host closed the connection)
22:07:38FromDiscord<sOkam!> In reply to @Elegantbeef "Also sokam i see": I know know who said them, I just remembered someone talking about it
22:07:53FromDiscord<sOkam!> (edit) "know" => "dont"
22:08:12*xet7 joined #nim
22:08:13FromDiscord<sOkam!> I was just worried about it, so I asked if they are alive or not
22:08:23FromDiscord<Elegantbeef> Well they are very much alive
22:08:45FromDiscord<Elegantbeef> Your 5th point was not them afaik, it was stuffe or whoever in the job posting iirc
22:09:32FromDiscord<Elegantbeef> It's very much tooling made for the authors by the authors and they opened them up for others to use, so dont expect too much
22:12:23FromDiscord<sOkam!> I expected pure silence if I had just asked "hey, is this gonna be ported to gdextension"... so tried to give it some more weight. Plus I was genuinely worried about the comments I saw and the issues open unanswered, etc
22:12:39FromDiscord<Elegantbeef> I mean i dont get why you're so worried
22:12:52FromDiscord<sOkam!> Bc if they don't port to gdextension, who will?
22:12:55FromDiscord<Elegantbeef> When godot 4 is here someone(possibly me) will handle it
22:13:06FromDiscord<sOkam!> I wish I knew how. But its waaay over my league
22:13:58FromDiscord<Elegantbeef> Well that's why you start on it then get a numpty to solve issues
22:14:09FromDiscord<sOkam!> In reply to @Elegantbeef "When godot 4 is": #waitingforgodot4, I guess 😔
22:14:17*vicfred quit (Quit: Leaving)
22:14:54FromDiscord<Elegantbeef> Hey you can get started on it
22:15:02FromDiscord<sOkam!> The physics changes are just too good for what I'm making, so I guess that skews my impatience a lot
22:15:27FromDiscord<sOkam!> In reply to @Elegantbeef "Hey you can get": good jk. tried to give it a serious try... not even start I could
22:15:29FromDiscord<Elegantbeef> The first step of "knowing how" is "not knowing"
22:16:02FromDiscord<sOkam!> Writing a parser, when you don't really get the language... its not very endearing
22:17:08FromDiscord<Elegantbeef> You dont need to write a parser
22:17:18FromDiscord<Elegantbeef> There is a json parser in the stdlib
22:17:51FromDiscord<sOkam!> how do you tell the app what to do with the json then?
22:18:08FromDiscord<sOkam!> it just goes over my head, completely
22:18:22FromDiscord<Elegantbeef> You use a macro
22:18:58FromDiscord<evoalg> In reply to @sOkam! "Writing a parser, when": it's actually a compliment to you, as they can you are an intelligent noob with lots of experience ... they never tell me to create anything 😉
22:20:04FromDiscord<evoalg> (edit) "In reply to @sOkam! "Writing a parser, when": it's actually a compliment to you, as they can ... you" added "tell"
22:20:45FromDiscord<sOkam!> In reply to @evoalg "it's actually a compliment": Well, if you feel skilled enough to do it, I'm eagerly waiting for gdextension-nim 😔↵I honestly have absolutely no clue how to even get started
22:21:35FromDiscord<sOkam!> I couldn't even understand how to start... so if you know how, you are already ahead
22:21:44FromDiscord<Solitude> In reply to @evoalg "it's actually a compliment": fix nim bugs
22:21:55FromDiscord<Solitude> you're smart, i believe in you
22:22:09FromDiscord<evoalg> oooo finally something has faith in me!
22:22:19FromDiscord<Elegantbeef> @evoalg\: make something
22:22:47FromDiscord<Elegantbeef> It's more just people here are willing to help when you run into issues, you need to take a macro over that json file and emit nim files
22:23:22FromDiscord<Elegantbeef> Everything in that json file and the headerfile is all you need to get gd4.0 bindings, might seem very complicated but if you start writing macros you'll quickly understand how/what to do
22:27:09FromDiscord<evoalg> In reply to @sOkam! "Well, if you feel": ... I find these folk in here are really helpful (much more so than other places I've been in)
22:27:32FromDiscord<Elegantbeef> Evo just says that cause he really wants me to continue helping him 😛
22:28:00FromDiscord<evoalg> saw right through me
22:28:49FromDiscord<Elegantbeef> You have reminded me i didnt throw `zip` into slicerator
22:28:59FromDiscord<Elegantbeef> I suppose there are other variants that make sense aswell there
22:29:57FromDiscord<evoalg> ooooo that would be awesome
22:34:06FromDiscord<Yardanico> @evoalg made the PR to fix scope leakage and also replied in the issue about the last example
22:35:21FromDiscord<sOkam!> In reply to @Elegantbeef "Everything in that json": If this would be the start point for that, this tut is a great example of why it goes over my head↵https://nim-lang.org/docs/tut3.html
22:35:46FromDiscord<sOkam!> Step by step, I still understand 0.0000001% of it 😔
22:36:09FromDiscord<sOkam!> (edit) "Step by step, ... I" added "and"
22:37:31FromDiscord<evoalg> In reply to @Yardanico "<@!900872397224280125> made the PR": Thank you!
22:37:33FromDiscord<Elegantbeef> https://dev.to/beef331/demystification-of-macros-in-nim-13n8 is better for a intro
22:38:16FromDiscord<sOkam!> In reply to @Elegantbeef "https://dev.to/beef331/demystification-of-macros-in": Ah I read that one, yeah. How is that used for handling the json?
22:38:40FromDiscord<Elegantbeef> I mean you need to get comfortable with macros before you can run with them
22:39:07FromDiscord<Elegantbeef> Understanding the AST and how it needs to be is the first step to making the bindings
22:39:18FromDiscord<Elegantbeef> You can jump straight into the json but it'll confuse your rapidly
22:40:30FromDiscord<sOkam!> Which is why I said its waay over my league
22:41:02FromDiscord<Elegantbeef> I mean you just need to play with macros run into troubles then get yourself out
22:41:10FromDiscord<Elegantbeef> You'll quickly learn how to handle this stuff
22:41:30FromDiscord<Elegantbeef> "yourself out" does also mean ask in here
22:41:49FromDiscord<sOkam!> I could learn how to make macros and still not understand what to do with the json
22:42:52FromDiscord<Elegantbeef> I feel like you're missing the point where a person is offering assistance when you get stuck
22:44:10FromDiscord<sOkam!> That's where I'm currently stuck, that understanding may seem obvious... but its not so much for me, personally 😔
22:44:47FromDiscord<Elegantbeef> Want a challenge?
22:45:07FromDiscord<Elegantbeef> Using a macro take a newline seperate file and emit a enum from it
22:45:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JnG
22:47:01FromDiscord<sOkam!> I think the answer to that challenge is the answer to "what to do with the json"... when I don't really know what to do with it
22:47:31FromDiscord<Yardanico> @ElegantBeef do you know if nnkBlockExpr is actually used anywhere?
22:47:34FromDiscord<Elegantbeef> You need to emit Nim objects and procedure calls that interact with godot
22:47:43FromDiscord<Yardanico> I don't understand if I should just use nnkBlockStmt or nnkBlockExpr for https://github.com/nim-lang/Nim/pull/19288
22:47:51FromDiscord<Elegantbeef> I was just about to answer in the github issue
22:47:54FromDiscord<Yardanico> oh okay
22:48:00FromDiscord<Elegantbeef> The compiler replaces it from a stmt
22:48:00FromDiscord<Elegantbeef> So you're fine
22:48:08FromDiscord<TryAngle> sent a code paste, see https://paste.rs/QRI
22:48:37FromDiscord<Elegantbeef> `Slice[T]` -\> `HSlice[T, T]`
22:49:14FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3JnI
22:49:23FromDiscord<Yardanico> ah nvm, I see your error already I think
22:49:27FromDiscord<Elegantbeef> That works for instance yard
22:49:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JnJ
22:49:36FromDiscord<sOkam!> In reply to @Elegantbeef "You need to emit": that's exactly the part that i dont understand, dude. I see your point, that if I solve that challenge I answer the question... but not knowing how to solve that is exactly the issue... so a challenge related to that helps very little because the answer to both is the same 😔
22:49:37FromDiscord<Yardanico> @TryAngle you have your matrixes as `let`
22:49:46FromDiscord<Yardanico> but since you're modifying them you need to declare them as `var`
22:49:52FromDiscord<TryAngle> In reply to @Yardanico "can you show the": its just further implementations that were found and is "[]="
22:49:55FromDiscord<Yardanico> your proc accepts `m: var Matrix[T]`
22:50:04FromDiscord<Yardanico> so you should have a matrix declared as `var mat1 = ...`
22:50:40FromDiscord<Yardanico> In reply to @Elegantbeef "That works for instance": yeah, I noticed that it always gets parsed to BlockStmt, so yeah, I'll keep it that way
22:53:44FromDiscord<TryAngle> @Yardanico thanks, lol those mistakes....
22:54:20FromDiscord<Elegantbeef> Sokam here is the answer to the enum https://play.nim-lang.org/#ix=3JnL
22:55:47*perro quit (Ping timeout: 268 seconds)
23:02:35FromDiscord<Elegantbeef> Oh also yard https://github.com/nim-lang/Nim/pull/19262 should have a different name
23:02:47FromDiscord<Elegantbeef> The PR title should explain what the PR does
23:03:00FromDiscord<Solitude> it fixes issue 19261
23:04:04FromDiscord<Yardanico> @ElegantBeef ok
23:04:34FromDiscord<Elegantbeef> That doesnt explain what it does without looking at the issue on github, PR names are now supposed to say in plain english what they do
23:06:14FromDiscord<TryAngle> sent a code paste, see https://paste.rs/oNI
23:06:19FromDiscord<TryAngle> because I'm not a fan of quadratic loops
23:06:47FromDiscord<Yardanico> @ElegantBeef can you also review the PR then? :D
23:07:03FromDiscord<Yardanico> i don't know if my changes are really safe or not, and also don't know if and how I should test them
23:07:13FromDiscord<Yardanico> that http header code wasn't touched since it was first written 8 years ago
23:08:28FromDiscord<Yardanico> also funny thing about parseUntil from parseutils - docs says it returns 0 in case of an error but it actually never does that afaik
23:08:29FromDiscord<Elegantbeef> `memCopy` does exist
23:08:39FromDiscord<Elegantbeef> Nope i dont no web stuff
23:08:43FromDiscord<Elegantbeef> know
23:10:53FromDiscord<Elegantbeef> I dont know what it considers an error
23:16:07FromDiscord<sOkam!> In reply to @Elegantbeef "Sokam here is the": thank you ✍️
23:30:04FromDiscord<sOkam!> @ElegantBeef Does this line mean that each line in the txt file will be interpreted as a type NimNode when added to the sequence? https://media.discordapp.net/attachments/371759389889003532/924081522544353280/unknown.png
23:30:43FromDiscord<Elegantbeef> Yes `ident(x)` in the for loop converts makes a new `nnkIdent(strVal: x)`
23:30:52FromDiscord<Elegantbeef> So now it's full of `nnkIdent`s
23:33:35FromDiscord<sOkam!> In reply to @Elegantbeef "Yes `ident(x)` in the": how did you know that you need to call ident? is it documented in the manual, or did you make it for this example?
23:33:43FromDiscord<sOkam!> (edit) "ident?" => "ident()?"
23:34:36FromDiscord<Elegantbeef> `ident`s are non semantically checked symbols
23:34:43FromDiscord<Elegantbeef> Anywhere you see a written word it's an idient
23:35:19FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JnT
23:35:22FromDiscord<Elegantbeef> You can see that using `dumpTree`
23:35:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JnU
23:36:11FromDiscord<Elegantbeef> https://nim-lang.org/docs/macros.html#newEnum%2CNimNode%2CopenArray%5BNimNode%5D%2Cbool%2Cbool in this case it states what it needs
23:48:44FromDiscord<Elegantbeef> @evoalg\: here's you're weekly slicerator update\: now have `all` `zip` and `map`
23:49:10FromDiscord<Elegantbeef> All are `for` loop based for minimal amount of overhead
23:49:16FromDiscord<sOkam!> @ElegantBeef is this a typo, or is having no () after add an alternative syntax? https://media.discordapp.net/attachments/371759389889003532/924086353233322014/unknown.png
23:49:43FromDiscord<Elegantbeef> Nim has `command syntax` which means you can drop `()` in many situations
23:49:50FromDiscord<Elegantbeef> I find it easier to read when adding and things of that nature
23:50:04FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax
23:50:16FromDiscord<sOkam!> it is, yeah. true, didn't remember reading about it
23:57:17FromDiscord<sOkam!> I don't think I understand that for loop 😔 ↵How is x taking the value of it's corresponding line? 🤔
23:57:37FromDiscord<Elegantbeef> It's just a string
23:57:56FromDiscord<sOkam!> Common sense from other languages tells me that X would be just a number, increasing in each iteration
23:58:00FromDiscord<Elegantbeef> `file` in that case is the entire file loaded into memory `for x in file.splitLines` is each line without `\n`
23:58:24FromDiscord<Elegantbeef> `splitLines` is an iterator that yields `string`
23:58:49FromDiscord<sOkam!> and its output is assigned to x on each iteration?
23:59:02FromDiscord<Elegantbeef> Yes
23:59:07FromDiscord<sOkam!> I mean, it must... but... is that not different to other languages?
23:59:53FromDiscord<sOkam!> I'd assume that x would be just the int counter of the for loop, so the sentry value for the loop in int form... instead of being assigned the output of anything
23:59:59FromDiscord<Elegantbeef> No