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