00:07:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JvX |
00:07:22 | FromDiscord | <Elegantbeef> But this is probably contrived |
00:11:36 | FromDiscord | <retkid> what do you guys think of nim packags |
00:12:02 | FromDiscord | <retkid> really excited for package level stuff |
00:13:02 | FromDiscord | <Elegantbeef> Comically nim2.0 is going to remove it IIRC |
00:13:05 | FromDiscord | <Elegantbeef> Since it's not needed |
00:13:36 | FromDiscord | <retkid> i thought it was the opposite |
00:13:45 | FromDiscord | <retkid> hmm |
00:13:46 | FromDiscord | <Rika> The implementation is not needed |
00:13:47 | FromDiscord | <retkid> lemme reread |
00:13:52 | FromDiscord | <Elegantbeef> Well nim2.0 will allow cyclical dependencies so it's not needed |
00:14:22 | FromDiscord | <Rika> I think he was more excited to maybe see package level access level |
00:14:30 | FromDiscord | <retkid> ah so its here right now, nobody uses it, so its getting culled in favor of more rtraditional |
00:14:40 | FromDiscord | <retkid> (edit) "rtraditional" => "trraditional" |
00:14:42 | FromDiscord | <Rika> It’s gonna be here |
00:14:44 | FromDiscord | <Rika> It’s not yet |
00:14:46 | FromDiscord | <Rika> Nim 2.0 |
00:16:11 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3JvY |
00:16:26 | FromDiscord | <Rika> No |
00:16:29 | FromDiscord | <Rika> Never happening |
00:16:38 | FromDiscord | <Rika> Make a macro if you want |
00:17:08 | FromDiscord | <Rika> Seems trivial to implement a rudimentary macro for this |
00:17:32 | FromDiscord | <Elegantbeef> `package` imports/exports all files below this one? |
00:17:34 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3Jw0 |
00:18:21 | * | jjido joined #nim |
00:19:16 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3Jw1 |
00:19:43 | FromDiscord | <Rika> That should be possible in a future version without your package thingy |
00:20:16 | FromDiscord | <retkid> i just think its cool 🥺 |
00:20:43 | FromDiscord | <retkid> instead of interfacing with files you can use package groups |
00:21:08 | FromDiscord | <retkid> In reply to @Rika "Seems trivial to implement": yet to learn macros they seem scary |
00:21:11 | FromDiscord | <Rika> You break a lot of access level concepts |
00:21:51 | FromDiscord | <Elegantbeef> Though i still dont think i like it |
00:21:52 | FromDiscord | <Elegantbeef> Nim 2.0 will support this↵(@retkid) |
00:22:20 | FromDiscord | <retkid> In reply to @Rika "You break a lot": well, no. Because on compile they packages are just one file on compile, you split them up rfor organization |
00:22:45 | FromDiscord | <retkid> (edit) "they" => "the" | "file on compile," => "file," |
00:22:50 | FromDiscord | <retkid> (edit) "rfor" => "for" |
00:23:12 | FromDiscord | <Rika> What happened to private and public then |
00:23:25 | FromDiscord | <Rika> I don’t see why I’d want it |
00:23:56 | FromDiscord | <retkid> In reply to @Elegantbeef "Nim 2.0 will support": I like this, even if it makes reading potentially more difficult. i like to define it like↵↵Its, enums, classes, top level variables, functions |
00:24:12 | FromDiscord | <retkid> (edit) "functions" => "functions↵in that order" |
00:24:28 | FromDiscord | <Rika> The ordering imo doesn’t make reading too much harder |
00:24:49 | FromDiscord | <retkid> In reply to @Rika "The ordering imo doesn’t": well if your procs are at the head you have more context if you read top to bottom |
00:25:00 | FromDiscord | <Rika> Most of us are supportive of the thing, especially since it’s a feature most modern languages have |
00:25:16 | FromDiscord | <Rika> In reply to @retkid "well if your procs": Nothing is truly top to bottom anymore |
00:25:25 | FromDiscord | <retkid> In reply to @Rika "What happened to private": well private and public applies to the package. Things outside the package cant import them |
00:25:42 | FromDiscord | <Rika> If it was we wouldn’t have people complain about cyclic dependencies I guess |
00:25:53 | FromDiscord | <Rika> In reply to @retkid "well private and public": I still fail to see why I would want this |
00:25:56 | FromDiscord | <evoalg> In reply to @Elegantbeef "<@900872397224280125>\: do you have": I used zip on day 01 of aoc ... https://play.nim-lang.org/#ix=3Jw2 |
00:26:22 | FromDiscord | <retkid> In reply to @Rika "I still fail to": because it allows for splitting files for better organization without having extensive import headers |
00:27:00 | FromDiscord | <retkid> this is one of many reasons I should never make a language, this is tupid |
00:27:04 | FromDiscord | <retkid> (edit) "tupid" => "stupid" |
00:27:11 | FromDiscord | <Rika> I mean I guess I can see it |
00:27:15 | FromDiscord | <Rika> Go has this feature |
00:27:20 | FromDiscord | <Rika> I don’t think rust or zig does |
00:27:28 | FromDiscord | <Rika> But I’m pretty sure go does |
00:28:10 | FromDiscord | <retkid> java/kotlin dont, python doesn't, Ocaml doesn't (need to learn more) |
00:28:21 | FromDiscord | <retkid> Bash has it |
00:28:26 | FromDiscord | <retkid> (edit) "it" => "it. Technically" |
00:28:48 | FromDiscord | <retkid> JS would never have this |
00:30:31 | FromDiscord | <Rika> JS barely has the concept of modules |
00:30:53 | FromDiscord | <Rika> ~~I like how Lua does it~~ |
00:31:01 | FromDiscord | <Elegantbeef> That's a good enough reason not to do it↵(@Rika) |
00:31:06 | FromDiscord | <retkid> I should learn more lua |
00:31:08 | FromDiscord | <Rika> Oh god I might start sounding like a Lisp user |
00:31:19 | FromDiscord | <Rika> Lua is fun |
00:31:24 | FromDiscord | <Rika> Head melting too sometimes |
00:31:33 | FromDiscord | <retkid> i was going to learn Lisp but decided not to |
00:31:49 | FromDiscord | <retkid> Common Lisp, that is |
00:32:16 | FromDiscord | <Rika> What about uncommon lisp |
00:33:16 | FromDiscord | <evoalg> sent a long message, see http://ix.io/3Jw8 |
00:33:17 | FromDiscord | <retkid> i dont wanna learn carp-lang |
00:33:45 | FromDiscord | <retkid> https://github.com/carp-lang/Carp |
00:34:12 | FromDiscord | <retkid> babe wakeup, statically typed lisp system lang just dropped |
00:34:13 | FromDiscord | <Elegantbeef> Nim doesnt support unpacking and it requires a compiler change to support, so yea not overly feasible↵(@evoalg) |
00:34:57 | FromDiscord | <retkid> have you ever been doing manual GC, and you sit down and go |
00:35:02 | FromDiscord | <retkid> "i wanna do this in lisp" |
00:35:30 | FromDiscord | <evoalg> if I really needed it, and if I knew what I was doing, I could modify the zip code to look instead a container and just pass a container right? |
00:36:25 | FromDiscord | <Elegantbeef> I mean we can always cheat unpacking and do something like `myColl -> zip` assuming `myColl` is an array |
00:36:49 | FromDiscord | <Elegantbeef> Since nim is dynamic we cant really zip an unknown collection nicely afaict |
00:37:03 | FromDiscord | <Elegantbeef> isnt dynamic\ |
00:37:21 | FromDiscord | <evoalg> gotcha ok |
00:38:41 | FromDiscord | <Elegantbeef> My `zip` is slower than the `sequtils` due to the fact they only work on openarrays and can reason the size needed, but more flexible so in some cases it's faster |
00:38:54 | FromDiscord | <Elegantbeef> Just thought i'd mention that |
00:39:12 | FromDiscord | <Elegantbeef> `all`/`map` should in theory be faster, but i need to bench them in my contrived example |
00:44:43 | FromDiscord | <evoalg> you don't need "fold" as it doesn't copy to a temporary seq? |
00:51:06 | nrds | <sorcerer99> merry christmas nim coders! from the IRC-nERDs irc network! =) |
00:52:50 | FromDiscord | <Elegantbeef> I mean this is working on iterators so doesnt make sense really |
00:52:52 | FromDiscord | <Elegantbeef> Write a reversed iterator if you can for your type |
00:52:52 | FromDiscord | <Elegantbeef> Actually i'm dumb |
00:52:53 | FromDiscord | <Elegantbeef> You dont have step by step |
00:52:53 | FromDiscord | <Elegantbeef> But eitherway doesnt make sense for iterators imo |
00:52:56 | FromDiscord | <Elegantbeef> Substantially faster due to just applying logic as we go instead of allocating a seq |
00:53:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Jwd |
00:53:02 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/MoW |
00:54:01 | * | drewr joined #nim |
00:56:08 | FromDiscord | <Elegantbeef> Now if only you were a nim coder so you'd be weirdly saying it to yourself |
00:58:44 | FromDiscord | <evoalg> oh that's a huge difference in time |
00:59:19 | FromDiscord | <evoalg> like 500 x faster ... am I testing that right? |
00:59:42 | FromDiscord | <Elegantbeef> Yea it's quite a bit faster |
01:00:05 | FromDiscord | <Elegantbeef> Bad example since we're just doing `filterIt` then getting the size of that |
01:00:18 | FromDiscord | <Elegantbeef> But the point is to test the equivlent loop logic's performance |
01:00:30 | FromDiscord | <evoalg> yep makes sense |
01:02:01 | FromDiscord | <evoalg> The `x == 'd'` bit in `all(a, x == 'd')` ... it supports any `true` statement right? ... so I could use a complicated func in that bit right? |
01:02:29 | FromDiscord | <Elegantbeef> Yep |
01:03:02 | * | drewr quit (Quit: ERC (IRC client for Emacs 27.2)) |
01:03:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Jwj |
01:04:21 | * | drewr joined #nim |
01:04:22 | FromDiscord | <Elegantbeef> It's heavily leaning into "Nim is imperative and doesnt support iterator chaning" so i'm embracing it using for statement macros |
01:05:14 | FromDiscord | <evoalg> that was my next question 😉 ... so `all` is just a nice way of writing it right? ... and that's important as was is Araq that said if code is simpler then one can reason about it better? |
01:07:53 | FromDiscord | <evoalg> if sequtils had a closure iterator for all, then that would also be fast right? |
01:08:25 | FromDiscord | <Elegantbeef> The closure is actually slower |
01:08:38 | FromDiscord | <Elegantbeef> It copies the collection and does funky logic |
01:08:51 | FromDiscord | <evoalg> wow ok |
01:09:38 | FromDiscord | <Elegantbeef> `zipIter` will always be slower than `sequtils.zip` since `sequtils.zip` only iterates once |
01:09:53 | FromDiscord | <Elegantbeef> The way that `zipIter` is faster is in the cases you need to do `toSeq` on values |
01:10:37 | FromDiscord | <Elegantbeef> It's really just a case of enabling iterating over N number of iterators stepping at the same time |
01:11:06 | FromDiscord | <evoalg> gotcha ... and also you've made it nice to accept >= 2 containers |
01:11:30 | FromDiscord | <Elegantbeef> > = 2 iterators\ 😛 |
01:11:55 | FromDiscord | <evoalg> >= iterators true 😉 |
01:12:04 | FromDiscord | <evoalg> can't type |
01:12:20 | FromDiscord | <evoalg> >= 2 iterators |
01:12:28 | FromDiscord | <Elegantbeef> There we go one of us could do it |
01:13:55 | FromDiscord | <evoalg> so I've had a little play with `zip` and `all` ... I have to go out so I can't play with `map` until later |
01:14:03 | FromDiscord | <Elegantbeef> lol |
01:14:18 | FromDiscord | <Elegantbeef> They're not that special, just a semi funky for loop |
01:14:25 | FromDiscord | <Elegantbeef> But i'll leave them until i decide i dont like them |
01:14:57 | * | drewr quit (Ping timeout: 240 seconds) |
01:15:07 | FromDiscord | <Elegantbeef> Though i think since they're a tinge safer that just manually writing them I might not dislike them that much |
01:17:52 | * | drewr` joined #nim |
01:18:17 | * | drewr` quit (Client Quit) |
01:21:06 | FromDiscord | <evoalg> I can't use `a.all(x == 'd')` right? |
01:22:20 | * | drewr` joined #nim |
01:24:32 | FromDiscord | <Elegantbeef> I dont think so |
01:26:10 | FromDiscord | <Elegantbeef> Just how the for loop macros work |
01:26:48 | * | drewr` quit (Client Quit) |
01:28:13 | * | drewr joined #nim |
01:28:47 | FromDiscord | <Elegantbeef> Really i could make `a.forAll(x, x == 'd')` though it's less consistent |
01:34:32 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
01:58:17 | * | drewr quit (Ping timeout: 240 seconds) |
02:15:55 | * | drewr joined #nim |
02:20:39 | * | neceve quit (Ping timeout: 256 seconds) |
02:30:17 | * | drewr quit (Ping timeout: 240 seconds) |
02:32:08 | * | drewr joined #nim |
02:34:37 | * | neurocyte0132889 quit (Ping timeout: 240 seconds) |
02:40:20 | * | drewr quit (Quit: ERC (IRC client for Emacs 27.2)) |
02:41:11 | * | drewr joined #nim |
03:31:48 | * | kayabaNerve_ joined #nim |
03:33:45 | * | kayabaNerve quit (Ping timeout: 256 seconds) |
03:45:17 | FromDiscord | <Roundlay> Pretty new to Nim and find myself frequently searching here for good examples of the language in use. Anybody floated the idea of a Highlights channel? A place where nice/cool/interesting contributions could be automatically collated by a bot (written in Nim, of course) based on reactions? |
03:46:12 | FromDiscord | <Elegantbeef> There is "This month with Nim" which is kinda like that, but a showcase channel could be nicer for less delayed waiting 😀 |
03:46:13 | * | kayabaNerve_ quit (Ping timeout: 256 seconds) |
03:48:06 | * | kayabaNerve joined #nim |
03:49:51 | * | kayabaNerve quit (Remote host closed the connection) |
03:58:37 | * | drewr quit (Ping timeout: 240 seconds) |
04:02:46 | * | Colt_ joined #nim |
04:04:39 | * | Colt quit (Ping timeout: 268 seconds) |
04:05:04 | * | kayabaNerve joined #nim |
04:20:40 | * | drewr joined #nim |
04:22:10 | FromDiscord | <Yardanico> In reply to @Roundlay "Pretty new to Nim": yeah I was thinking about making something like this, but user-submitted instead of being managed by a bot |
04:22:17 | FromDiscord | <Yardanico> (edit) "making something" => "adding a channel" |
04:27:15 | * | kayabaNerve quit (Quit: Leaving) |
04:28:23 | FromDiscord | <Roundlay> Nice. Yeah, I guess I figured basing it on some reasonable threshold of reactions might help surface quality contributions without adding extra busywork for mods here, but both approaches work 👍🏻 |
04:28:47 | FromDiscord | <Elegantbeef> Well there are also Matrix/IRC users |
04:29:18 | FromDiscord | <Elegantbeef> I'm not a sophisticated bot afterall |
04:29:54 | FromDiscord | <Rika> You aren’t? |
04:30:18 | FromDiscord | <Elegantbeef> I'm an unsophisticated schmuck |
04:30:27 | FromDiscord | <Bung> @haxscramper where is hmisc/helpers moved to ? |
04:30:49 | FromDiscord | <Elegantbeef> Oh it's bung 😀 |
04:31:22 | FromDiscord | <Roundlay> In reply to @Elegantbeef "Well there are also": Ahh, fair point |
04:32:28 | FromDiscord | <Elegantbeef> Though the matrix protocol supports reactions i find it hard to believe all clients implement it 😛 |
05:09:22 | * | arkurious quit (Quit: Leaving) |
05:23:11 | * | kayabaNerve joined #nim |
05:24:45 | FromDiscord | <Roundlay> I guess if platform parity is important to the community then things get tricky yeah. Although I’m not sure what the user numbers per platform is like |
05:24:45 | FromDiscord | <haxscramper> In reply to @Bung "<@!608382355454951435> where is hmisc/helpers": Depending on which proc you need, but it is a hmisc/core/all mostly |
05:25:00 | FromDiscord | <haxscramper> But it has been half a year since then |
05:25:53 | FromDiscord | <Bung> In reply to @haxscramper "But it has been": yeah, I just updated my slim package. |
05:41:11 | FromDiscord | <AulonSal> are `nim doc` and `nim doc2` the same command? |
05:43:37 | FromDiscord | <Elegantbeef> It appears so |
05:43:42 | FromDiscord | <Elegantbeef> Though i didnt even know doc2 was a thing |
05:44:48 | FromDiscord | <AulonSal> thank you, I encountered it in a repo from 2018 |
05:45:07 | FromDiscord | <Elegantbeef> Perhaps it used to do something different but that got moved to `doc` |
05:45:14 | FromDiscord | <Rika> The assumption is that they weren’t the same before |
05:45:31 | FromDiscord | <Rika> Then doc probably got deprecated |
05:45:38 | FromDiscord | <Rika> And then was made the same as 2 |
06:44:37 | * | drewr quit (Ping timeout: 240 seconds) |
06:44:41 | * | Colt_ is now known as Colt |
06:46:09 | * | drewr joined #nim |
06:50:39 | FromDiscord | <evoalg> @ElegantBeef why is slicerator.all called "all" and not "filter" or something? |
06:51:32 | FromDiscord | <Elegantbeef> Possibly cause i'm an idiot |
06:52:43 | FromDiscord | <evoalg> you certainly aren't ... I thought I was an idiot for not knowing 😉 |
06:53:06 | FromDiscord | <Elegantbeef> Eh i read it as `for all(x == 'a') in a.items` 😀 |
06:53:24 | FromDiscord | <Elegantbeef> But filter matches the convention and probably more accurate |
06:53:43 | FromDiscord | <Elegantbeef> Naming it the same as the functions is probablly illadvised since it's kinda hidden |
06:54:15 | FromDiscord | <Elegantbeef> should be like `allWhere()` or `syncIter(a, b, c)` instead of `zipIter` |
06:54:16 | FromDiscord | <evoalg> ahh yea I see what you mean ... but "all" is also in sequtils but means something different |
06:55:06 | FromDiscord | <evoalg> ... where all of the elements have to match |
06:55:25 | FromDiscord | <Elegantbeef> Yea i know i noticed the bad naming today but didnt change it cause i forgot |
06:55:46 | FromDiscord | <Elegantbeef> I did update it to be `filter` now, if `all` bothers you that much |
06:55:54 | FromDiscord | <Elegantbeef> But yea might rename them again to be more readable |
06:57:25 | FromDiscord | <evoalg> hehe I'm not used to someone listening to my advice 😉 ... but yea hmmm ... filter is nice, but if it shouldn't be named the same then what about "filterFor" ... since slicerator is all about for loops? |
06:58:18 | FromDiscord | <evoalg> ... and map can be mapFor ?? |
06:58:56 | FromDiscord | <Elegantbeef> Being named the same isnt that big of a deal |
07:00:15 | FromDiscord | <Elegantbeef> The issue with the name was that it didnt make much sense, i'm probably going to end with something more descriptive like `onlyWhere` |
07:00:46 | FromDiscord | <evoalg> ok ... and if I import both sequtils and slicerator (because that's the crazy fool I am), how do I do one over the other? ... do I do: slicerator.map? |
07:01:42 | FromDiscord | <evoalg> oh I do do that 😉 |
07:01:52 | FromDiscord | <Elegantbeef> I mean you dont need to |
07:02:31 | FromDiscord | <evoalg> oh because the compiler is intelligent enough to choose? |
07:03:16 | FromDiscord | <Elegantbeef> Well all the stuff is forloop macros so it'll only be chosen in the case of `for x in map(y, x +10)` |
07:03:31 | FromDiscord | <Elegantbeef> Which is why we cannot do `a.items.map` |
07:04:42 | FromDiscord | <Elegantbeef> In the case you want to use the `sequtils` map yes you will need to do `for x in sequtils.map(y, myProc)` |
07:04:57 | FromDiscord | <Elegantbeef> Though if you're testing both you'll probably use `sequtils.mapit` so it's less of an issue |
07:05:32 | FromDiscord | <evoalg> gotcha ok ... and as cool as function programming is, for loops are easier for me to read, and I can do them efficiently and I can even break out of them early etc |
07:06:10 | FromDiscord | <Elegantbeef> You also made me find a bug so win 😀 |
07:06:25 | FromDiscord | <evoalg> oh?! |
07:07:00 | FromDiscord | <Elegantbeef> i didnt produce an intelligent error for `for x in map(a)` |
07:07:14 | FromDiscord | <Elegantbeef> It should say "No expression to map provided." |
07:07:22 | FromDiscord | <Elegantbeef> But i instead just had a dumb macro error |
07:07:31 | FromDiscord | <evoalg> ahh |
07:08:11 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/924559200787501106/image.png |
07:08:15 | FromDiscord | <Elegantbeef> Now it's a lovely error 😛 |
07:08:53 | FromDiscord | <evoalg> that's a handsome error yes |
07:09:21 | FromDiscord | <Elegantbeef> I should have a nice error for all the cases one ruins the syntax for these new macros, so if you get a confusing error let me know |
07:11:42 | FromDiscord | <evoalg> oh sure ... I'd be good for that as I'm easily confused ... I'm not joking either. It's like someone new to nim comes in and they are either the type that reads the docs & source code and understands complicated error messages, and then there are people like me where it needs to be explained in a dumbed-down way |
07:16:36 | FromDiscord | <evoalg> `for x in filter(x):` -> "slicerator.nim(247, 23) Error: index 2 not in 0 .. 1" ... that confuses me |
07:17:55 | FromDiscord | <Elegantbeef> Yea that was the error i mentioned i fixed |
07:18:14 | FromDiscord | <evoalg> oh I thought you fixed map |
07:18:50 | FromDiscord | <Elegantbeef> Both they have replicated logic |
07:19:08 | FromDiscord | <dizzyliam> @ElegantBeef What are you using to see an error in your text editor? |
07:19:16 | FromDiscord | <Elegantbeef> Codelens |
07:19:22 | FromDiscord | <evoalg> I uninstalled slicerator and installed it again but still saw that error |
07:20:11 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/924562217062531162/image.png |
07:20:14 | FromDiscord | <Elegantbeef> Uhh |
07:20:48 | FromDiscord | <evoalg> I see it now! |
07:21:05 | FromDiscord | <dizzyliam> In reply to @Elegantbeef "Codelens": damn, premium feature |
07:21:54 | FromDiscord | <Elegantbeef> Indeed |
07:22:14 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/924562733616218112/image.png |
07:22:17 | FromDiscord | <Elegantbeef> I'm really happy with these errors |
07:22:50 | FromDiscord | <dizzyliam> that's not a normal thing to say about errors |
07:25:10 | FromDiscord | <Elegantbeef> Codelens + the `error` for macros makes me sleep easier at night |
07:25:37 | FromDiscord | <Elegantbeef> `error` is so nice for macros, giving helpful custom error messages on the input code |
07:25:41 | FromDiscord | <Elegantbeef> You cant beat it if you ask me |
07:29:07 | FromDiscord | <Elegantbeef> This reminds me that i havent got an inline linter setup for nvim |
07:29:56 | FromDiscord | <Elegantbeef> Anyway evo i pushed changes for `zipIter` aswell which make it smarter for errors, but yea i really want to hear when you break it all |
07:30:10 | FromDiscord | <Rika> In reply to @Elegantbeef "You cant beat it": It can be better |
07:30:40 | FromDiscord | <Elegantbeef> For macros? |
07:30:47 | FromDiscord | <Rika> Yeah |
07:31:11 | FromDiscord | <Rika> Being able to show where in the untransformed code is the error |
07:31:27 | FromDiscord | <Elegantbeef> `error` does that |
07:31:42 | FromDiscord | <Elegantbeef> You pass the input node and it links back to it's line infor |
07:31:45 | FromDiscord | <Rika> Does it now |
07:31:52 | FromDiscord | <Rika> I don’t remember it being able to |
07:31:58 | FromDiscord | <Rika> Nonetheless then that is good |
07:31:59 | FromDiscord | <Elegantbeef> The `error` from `macros` does |
07:32:10 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/macros.html#error%2Cstring%2CNimNode |
07:32:40 | FromDiscord | <Elegantbeef> It also has a sibling `warning` |
07:32:53 | FromDiscord | <Elegantbeef> Oh and also hint, didnt know that |
07:33:43 | FromDiscord | <Elegantbeef> Though comically since it takes the lineinfo of whatever you give it you can give arbitrary errors on unrelated lines |
07:34:52 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3Jx2 |
07:34:59 | FromDiscord | <Elegantbeef> If you run that it errors on line 6 😀 |
07:35:10 | FromDiscord | <evoalg> can you determine the length of the nim source file and then import random and and point to someone innocent? |
07:35:28 | FromDiscord | <Elegantbeef> Nah you need a node to point to |
07:35:40 | nrds | <Prestige99> weird beef |
07:36:14 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3Jx3 you can get really funky |
07:36:31 | FromDiscord | <Elegantbeef> I can create an error on a 100% unrelated file that I have imported |
07:36:34 | FromDiscord | <Elegantbeef> What's weird? |
07:37:09 | nrds | <Prestige99> That error on line 6 thing |
07:37:22 | FromDiscord | <Elegantbeef> I mean it has it's uses I wager |
07:37:35 | nrds | <Prestige99> shouldn't it have been on the next line though? |
07:37:47 | FromDiscord | <Elegantbeef> No i gave it the line info of the last line |
07:39:01 | nrds | <Prestige99> 🤔 |
07:39:35 | FromDiscord | <Elegantbeef> i do `getImpl` which gets the declaration of `a` which is `var a = 300` then do `[0]` which gets the `a` ident |
07:40:03 | nrds | <Prestige99> oh, I see |
08:04:02 | FromDiscord | <evoalg> https://play.nim-lang.org/#ix=3Jxa not sure what I broke beef |
08:06:37 | * | drewr quit (Ping timeout: 240 seconds) |
08:07:45 | FromDiscord | <Elegantbeef> You didnt break anything |
08:08:10 | FromDiscord | <Elegantbeef> `parseInt(x)` in the second example is trying to do `parseInt(char)` not string do `parseInt($x)` |
08:08:54 | FromDiscord | <Elegantbeef> `Error: type mismatch: got <char> but expected one of: func parseInt(s: string): int` is right |
08:11:21 | FromDiscord | <Elegantbeef> Due to how quasi quoting works here means we get an odd error message, though accurate info |
08:11:38 | FromDiscord | <evoalg> is a the same as b here? |
08:12:03 | FromDiscord | <Elegantbeef> b is a string so iterating over it yields `char` |
08:12:20 | FromDiscord | <Elegantbeef> iterating over `a` yields `string` since it's a `seq[string]` |
08:13:37 | FromDiscord | <evoalg> ohhhhhh right! |
08:19:20 | FromDiscord | <evoalg> oooo I can even do `for i, x in map(a, parseInt(x) div (i + 1)):` ... I didn't expect that I can use `i` (not just `x`) |
08:19:42 | FromDiscord | <Elegantbeef> Yep implemented for both filter and map 🙂 |
08:19:50 | FromDiscord | <evoalg> nice! |
08:20:03 | FromDiscord | <Elegantbeef> and if you do `for i, x, y` it'll give a cryptic error methinks |
08:20:30 | FromDiscord | <Elegantbeef> Ah nvm |
08:20:43 | FromDiscord | <Elegantbeef> "Invalid number of for loop variables for 'map" is not cryptic |
08:20:54 | FromDiscord | <evoalg> even I can understand that one 😉 |
08:24:22 | FromDiscord | <Elegantbeef> also a side note is you can do `typeof(expr)` instead of `typedesc(expr)` |
08:24:27 | FromDiscord | <Elegantbeef> It reads better and is the convention |
08:24:47 | FromDiscord | <evoalg> ahhh my syntax highlighting highlights typedesc but not typeof |
08:25:00 | FromDiscord | <evoalg> but I'll use it |
08:25:21 | FromDiscord | <evoalg> my syntax highlighting doesn't highlight slicerator stuff either 😉 |
08:25:44 | FromDiscord | <evoalg> I love how I can do `for i, x in filter([5, 6, 7, 8], i > 0):` do skip the first element btw |
08:25:57 | FromDiscord | <Elegantbeef> That's a happy accident 😀 |
08:26:10 | FromDiscord | <JamesH> I've got a silly generic programming question. I've never worked in languages that need manual memory management, but I vaguely know about malloc() etc. in C. If one were to make something like a game in Nim, do you think most occasions people use malloc() etc. to get dynamic allocations, they could get away with just using a `seq` of a custom struct, or is that naive? |
08:26:45 | FromDiscord | <Elegantbeef> You only use malloc and similar to interop with C, you dont ever really need to do it otherise |
08:27:08 | FromDiscord | <JamesH> I only ask because I was reading some code that relied a lot on malloc() to dynamically allocate new structs in a game written in C++, and thought i might have implemented it as a seq, but i know C++ has vectors, which is the same? |
08:27:26 | FromDiscord | <Elegantbeef> I've got a framework that I only use 1 non GC'd allocated heap memory for iirc |
08:27:37 | FromDiscord | <Elegantbeef> Yea i mean you can use a seq, there isnt much reason not to |
08:27:55 | FromDiscord | <JamesH> What was the situation you didn't use the GC for, out of interest? |
08:28:07 | FromDiscord | <Elegantbeef> Loading shaders since it required a cstringarray |
08:29:07 | FromDiscord | <Elegantbeef> You dont really need to use manual memory management in most siutations |
08:29:14 | FromDiscord | <Elegantbeef> A vast majority you can do with built in collections |
08:29:29 | FromDiscord | <Rika> Even interop sometimes |
08:29:46 | FromDiscord | <Elegantbeef> Yep Nim strings are null terminated |
08:30:13 | FromDiscord | <Elegantbeef> So a cstring that doesnt outlive creation is 100% safe |
08:30:29 | FromDiscord | <Rika> If the C API is also safe lol |
08:30:30 | FromDiscord | <Elegantbeef> a cstring from a nim string\ |
08:30:41 | FromDiscord | <Elegantbeef> That's what i meant by outlive creation |
08:31:09 | FromDiscord | <Elegantbeef> If the C Api holds onto the pointer and you add to your nimstring causing it to grow it'll have a bad pointer to old memory |
08:31:34 | FromDiscord | <Elegantbeef> But anyway the point is Nim's collections work, if they dont work well enough you'll want to rewrite them in your own container which uses destructors anyway |
08:33:37 | FromDiscord | <Elegantbeef> It's odd to hear that they didnt use vector, maybe they just didnt like the name 😛 |
08:34:28 | FromDiscord | <evoalg> I can also do: `for i, x in map(1..9, x ^ i):` ... so nice |
08:37:14 | FromDiscord | <Elegantbeef> The fun part with those variants is it was just me going "I really hate testing these with manually declaring a counter and incrementing it" |
08:38:04 | FromDiscord | <Elegantbeef> I was getting tired of doing that |
08:38:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/R7j |
08:40:18 | * | Guest2440 joined #nim |
08:40:33 | Guest2440 | hi |
08:41:19 | FromDiscord | <Elegantbeef> hello |
08:43:35 | Guest2440 | I'm at a lost, im trying to upload a png to an ftp using asyncftpclient and it keeps corrupting it. when i try to open it again i get "PNG file curropted by ASCII conversion". |
08:44:07 | Guest2440 | there is no excpetion or anything, and i can figure out how to make the ftp use binary for the upload |
08:45:26 | Guest2440 | *cant |
08:57:47 | FromDiscord | <Elegantbeef> It doesnt look like it can change between the two, that might've been a detail missed in writting it |
08:58:18 | FromDiscord | <Elegantbeef> Though i dont get why a binary/ascii file behaves differently |
08:58:48 | FromDiscord | <Elegantbeef> You're sure you got the order right? |
09:02:30 | Guest2440 | i don't understand the question. the file works on the original computer, then copied to ftp and stops working. |
09:03:14 | FromDiscord | <Elegantbeef> I mean do you have the parameter order correct? |
09:03:51 | FromDiscord | <Elegantbeef> I guess you'd know cause it'd throw an exception otherwise |
09:04:55 | Guest2440 | it has two parameters, local file and remote, and its copies the file, just corrupted |
09:05:13 | FromDiscord | <Elegantbeef> What's the file size? |
09:05:35 | Guest2440 | 1. 40kb. 2. 110kb. |
09:06:03 | FromDiscord | <Elegantbeef> 40 is on recieve? |
09:09:39 | Guest2440 | i checked files, the first 40kb and the second 110kb. |
09:10:03 | FromDiscord | <Elegantbeef> So they're properly transferred? |
09:10:13 | Guest2440 | yes. |
09:12:39 | FromDiscord | <Elegantbeef> Wish i could help, dont have anything setup to help debug this |
09:15:37 | FromDiscord | <Elegantbeef> Oddly there is https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncftpclient.nim#L433-L448 in the module |
09:20:13 | FromDiscord | <Elegantbeef> Seems no one tested if the files worked properly, so it seems the binary stuff needs to be added |
09:23:44 | FromDiscord | <Elegantbeef> Atleast the spec is published and easily understandable |
09:25:18 | * | jjido joined #nim |
09:30:34 | FromDiscord | <Elegantbeef> If i can be arsed to setup a ftp server I might consider implementing it properly, but big if, do make an issue on the github though |
10:24:41 | * | Goodbye_Vincent joined #nim |
10:53:30 | FromDiscord | <glyh (Lyhokia)> I'm trying to create a treesitter grammar for Nim, and I found this\: |
10:56:24 | FromDiscord | <glyh (Lyhokia)> I'm trying to create a treesitter grammar for Nim, and I found this [Grammar](https://nim-lang.org/docs/manual.html#syntax-grammar), on Nim's website, which is not standard CFG, I guess. So could you explain how these operator works? e.g. "/","\\", "IND{\}"?↵There seems to be more magic, e.g. OP0, it claims to be operator ending in either "-\>", "\~\>" or "=\>", does this mean "abc=\>" is a OP0? |
10:57:27 | FromDiscord | <glyh (Lyhokia)> Or, if I have to read the source, except the parser.nim file, could you point out what else should I scan through? |
10:58:35 | FromDiscord | <glyh (Lyhokia)> I'm trying to create a treesitter grammar for Nim, and I found this [Grammar](https://nim-lang.org/docs/manual.html#syntax-grammar), on Nim's website, which is not standard CFG. So could you explain how these operator works? e.g. "/","\\", "IND{\}"?↵There seems to be more magic, e.g. OP0, it claims to be operator ending in either "-\>", "\~\>" or "=\>", does this mean "abc=\>" is a OP0? |
10:59:59 | FromDiscord | <glyh (Lyhokia)> Or, if I have to read the sources, could you point out what else should I scan through, except "compiler/{parser.nim,lexer.nim}" ? |
11:07:58 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:09:42 | FromDiscord | <demotomohiro> It seems these operators are explained in http://nim-lang.github.io/Nim/manual.html#about-this-document |
11:14:50 | FromDiscord | <demotomohiro> 'IND{=}" and "IND{>}" are explained in http://nim-lang.github.io/Nim/manual.html#lexical-analysis-indentation↵I think you need to read the manual from the top. |
11:15:38 | FromDiscord | <glyh (Lyhokia)> I'll go and see, thank you |
11:24:20 | FromDiscord | <demotomohiro> There is also grammer related file in https://github.com/nim-lang/Nim/blob/devel/doc/grammar.txt |
11:27:29 | FromDiscord | <glyh (Lyhokia)> Thanks! |
11:42:59 | * | pro joined #nim |
11:48:57 | * | neceve joined #nim |
12:36:23 | FromDiscord | <kaddkaka> Hi, why did `nim` go for named `shl`/`shr` instead of operators `<<`/`>>`? |
12:39:20 | pro | iirc shl and shr are common assembly names in popular risc's so why not use them |
12:39:45 | FromDiscord | <Marisol> And because of pascal roots i guess |
12:39:56 | FromDiscord | <kaddkaka> add is assembly for `+` 😛 |
12:40:03 | FromDiscord | <kaddkaka> I see |
12:40:06 | FromDiscord | <kaddkaka> thanks |
12:52:14 | FromDiscord | <Solitude> In reply to @kaddkaka "Hi, why did `nim`": and to leave `<<`, `>>` free for some wacky sugar, i guess |
12:52:27 | FromDiscord | <kaddkaka> Make sense |
13:05:28 | FromDiscord | <haxscramper> You can also copy some parts from https://github.com/haxscramper/tree-sitter-nim/blob/master/grammar.js if you find this useful |
13:05:29 | FromDiscord | <glyh (Lyhokia)> I'm trying to create a treesitter grammar for Nim, and I found this [Grammar](https://nim-lang.org/docs/manual.html#syntax-grammar), on Nim's website, which is not standard CFG. So could you explain how these operator works? e.g. "/","\\", "IND{\}"?↵There seems to be more magic, e.g. OP0, it claims to be operator ending in either "-\>", "\~\>" or "=\>", does this mean "abc=\>" is a OP0? |
13:22:45 | FromDiscord | <MD> sent a long message, see http://ix.io/3JyF |
13:23:51 | FromDiscord | <MD> (edit) "http://ix.io/3JyF" => "http://ix.io/3JyG" |
13:23:59 | FromDiscord | <MD> (edit) "http://ix.io/3JyG" => "http://ix.io/3JyH" |
13:24:09 | FromDiscord | <MD> (edit) "http://ix.io/3JyH" => "http://ix.io/3JyI" |
13:24:23 | FromDiscord | <MD> (edit) "http://ix.io/3JyI" => "http://ix.io/3JyJ" |
13:24:35 | FromDiscord | <MD> (edit) "http://ix.io/3JyJ" => "http://ix.io/3JyK" |
13:36:07 | FromDiscord | <Shiba> HI |
13:36:25 | FromDiscord | <Shiba> iam new to nim |
13:36:43 | FromDiscord | <Shiba> and i have some questions😀 |
13:37:38 | pro | welcome |
13:39:05 | FromDiscord | <Shiba> so is nim faster than LuaJit |
13:40:44 | * | pro quit (Read error: Connection reset by peer) |
13:50:12 | FromDiscord | <TryAngle> In reply to @Shiba "so is nim faster": nim is one of the faster languages available, especially when arc/orc becomes default↵in most situations ur implementation is what matters and not the language though. |
13:51:05 | FromDiscord | <TryAngle> https://github.com/kostya/benchmarks↵here are some benchmarks |
13:51:06 | FromDiscord | <enthus1ast> also fast EXECUTION is not everything, also fast code writing, CORRECT code, joy of use... |
13:51:51 | FromDiscord | <Shiba> okay 😀 but i think that luaJit is fast and has acces to hardaware level with c in "fii" |
13:52:18 | FromDiscord | <Ricky Spanish> Agreed with all of this, it's fast but the code also is nice to work with and it has a lot of options if you want to deep dive to improve the performance also, nim can also call c and cpp easily |
13:53:16 | FromDiscord | <TryAngle> C / C++ interop feels a bit too easy in nim tbh, almost illegal XD |
13:53:29 | FromDiscord | <TryAngle> (edit) "XD" => "how easy it isXD" |
13:53:52 | FromDiscord | <Shiba> iam confused beacause i already know lua and i want to switch to a languagesthat has acces to low level stuff and maybe a similair syntanx |
13:53:59 | FromDiscord | <Shiba> (edit) "languagesthat" => "language that" |
13:54:24 | FromDiscord | <Shiba> so if i compile my code to i need to get a c compiler too |
13:54:31 | FromDiscord | <Shiba> (edit) "so if i compile my code to ... i" added "c" |
13:54:38 | FromDiscord | <Shiba> (edit) "c" => "c, do" |
13:54:42 | FromDiscord | <Shiba> (edit) "too" => "too?" |
13:56:01 | FromDiscord | <Rika> Yes |
13:56:04 | * | neurocyte0132889 joined #nim |
13:56:04 | * | neurocyte0132889 quit (Changing host) |
13:56:04 | * | neurocyte0132889 joined #nim |
13:56:13 | FromDiscord | <Rika> But nim on Windows gets it for you |
13:56:17 | FromDiscord | <TryAngle> In reply to @Shiba "so if i compile": you only need a c compiler installed but u don't need to use it |
13:56:23 | FromDiscord | <TryAngle> nim does that for u |
13:56:39 | FromDiscord | <Shiba> i have minGW installed with gcc |
13:56:58 | FromDiscord | <TryAngle> that should be perfect |
13:57:02 | FromDiscord | <Rika> You won't need to manually use it |
13:57:53 | FromDiscord | <Shiba> so how do i start make a fille with .nim at the end |
13:57:58 | FromDiscord | <Shiba> (edit) "fille" => "file" |
13:57:59 | FromDiscord | <Rika> Startup time is not easily measurable I’d say↵Image manipulation is pretty easy I’d say↵Probably on the GUI but I don’t know too much on that |
13:58:11 | FromDiscord | <Rika> In reply to @Shiba "so how do i": Call the Nim compiler |
13:58:32 | FromDiscord | <Rika> “nim c file” generates a binary |
13:58:33 | FromDiscord | <Shiba> iam interested in game dev and i found the nico framework |
14:01:49 | FromDiscord | <Shiba> and since most luaJit frameworks are made for games and not software even that they have "ffi" , i decided to work with another language with another framework that allows to make games and software at the same time , i will need some time to learn the language , can anyone give some youtube videos i can watch to start learning😀 |
14:03:20 | FromDiscord | <TryAngle> that is the main issue with nim in my opinion... the lack of documentation, media etc. :c |
14:05:16 | FromDiscord | <TryAngle> https://nim-lang.org/docs/tut1.html↵https://nim-lang.org/docs/manual.html↵https://nim-lang.org/docs/lib.html |
14:10:23 | FromDiscord | <Solitude> In reply to @Shiba "and since most luaJit": https://narimiran.github.io/nim-basics/ |
14:12:55 | NimEventer | New thread by Gcao: Nim 1.6.2 does not compile on MacOS BigSur 11.6.1, see https://forum.nim-lang.org/t/8743 |
14:14:12 | FromDiscord | <Shiba> nim syntax higlighting package for sublime? |
14:14:17 | FromDiscord | <Shiba> (edit) "higlighting" => "highlighting" |
14:19:34 | FromDiscord | <Zajt> How can I define a function that doesn't return anything? Can I put void after `proc main(): ` this? |
14:20:00 | FromDiscord | <enthus1ast> proc main() = |
14:20:27 | FromDiscord | <Zajt> thanks! |
14:22:17 | FromDiscord | <Zajt> sent a code paste, see https://play.nim-lang.org/#ix=3Jz9 |
14:24:01 | FromDiscord | <enthus1ast> no this means they must be declared at the most left tab intentation level |
14:24:48 | FromDiscord | <enthus1ast> idn why this complains here, maybe change the NimMain name |
14:24:51 | FromDiscord | <enthus1ast> idk |
14:26:12 | FromDiscord | <Zajt> https://media.discordapp.net/attachments/371759389889003532/924669433333559346/unknown.png |
14:26:21 | FromDiscord | <Zajt> i think it complains about line 134 here |
14:26:40 | FromDiscord | <enthus1ast> yes |
14:26:44 | FromDiscord | <enthus1ast> toByteSeq\ |
14:26:46 | FromDiscord | <enthus1ast> is not allowed |
14:26:52 | FromDiscord | <enthus1ast> must be toByteSeq |
14:26:56 | FromDiscord | <enthus1ast> withouth export marker |
14:27:24 | FromDiscord | <Zajt> but it worked with this code when I had `when isMainModule:` instead of `proc main() =` on line 132 there |
14:27:33 | * | arkurious joined #nim |
14:27:38 | FromDiscord | <Solitude> when doesnt introduce new scope |
14:28:04 | FromDiscord | <Zajt> ah I see, now it compiled! thanks |
14:31:05 | FromDiscord | <MD> In reply to @Rika "Startup time is not": What did you mean by "Probably on the GUI but I don’t know too much on that"? |
14:31:24 | FromDiscord | <MD> (edit) "What" => "Thanks! And what" |
14:36:35 | * | pro joined #nim |
14:39:02 | * | pro quit (Client Quit) |
14:39:30 | * | pro joined #nim |
14:42:22 | pro | what is lua lol |
14:44:53 | madprops | i use lua to program my window manager |
14:45:30 | madprops | but i'd rather use something else tbh |
14:46:28 | FromDiscord | <Rika> In reply to @MD "Thanks! And what did": Probably exists fitting your criteria but I am not familiar |
14:46:36 | FromDiscord | <Rika> In reply to @madprops "i use lua to": Why? |
14:46:51 | madprops | because that's what awesomewm uses for configuration/extension |
14:47:11 | FromDiscord | <Rika> I think I replied to the wrong one |
14:47:17 | FromDiscord | <Rika> Why on the you would rather another |
14:47:32 | madprops | the language is very barebones |
14:47:52 | madprops | lots of basic things have to be implemented |
14:54:23 | FromDiscord | <enthus1ast> lua has some interesting constructs, but i would rather use a typed language even for configuration |
14:55:22 | FromDiscord | <enthus1ast> would be interesting to have a dynamic nim configuration (nimscript) that could also be compiled, for default configuration and super fast startup times |
14:55:39 | FromDiscord | <enthus1ast> for a wm i mean |
14:56:33 | FromDiscord | <enthus1ast> the nimscript startup times unfortunately are not THAT great currently |
14:56:56 | FromDiscord | <enthus1ast> think lua can startup much quicker than the nim compiler |
15:11:11 | * | rp2 quit (Ping timeout: 250 seconds) |
15:13:06 | * | rp2 joined #nim |
15:16:28 | * | Colt quit (Remote host closed the connection) |
15:16:54 | * | Colt joined #nim |
15:19:54 | * | Colt quit (Remote host closed the connection) |
15:20:19 | * | Colt joined #nim |
15:26:04 | * | Colt quit (Remote host closed the connection) |
15:26:30 | * | Colt joined #nim |
15:28:14 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3Jzz |
15:31:59 | FromDiscord | <Rika> How would that work |
15:32:57 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3JzB |
15:33:07 | * | Colt quit (Remote host closed the connection) |
15:33:17 | * | rp2 quit (Ping timeout: 240 seconds) |
15:35:06 | * | Colt joined #nim |
15:35:11 | FromDiscord | <el__maco> it doesn't matter if the buffer is in heap. But avoiding constant malloc matters. I don't know for a fact that Nim allocates, I should probably see the C source and see if it does, but I suspect it would |
15:35:17 | * | rp2 joined #nim |
15:35:57 | * | Colt quit (Read error: Connection reset by peer) |
15:45:37 | FromDiscord | <Shiba> ok so compiler said that i dont have a compatible mingw installation and it's started a download |
15:57:28 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3JzF |
15:57:44 | FromDiscord | <el__maco> rawNewString almost certainly allocates. But I don't see where it gets freed |
15:58:09 | FromDiscord | <el__maco> there's popFrame() but that only updates a frame pointer of some kind |
16:13:57 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/Dvd |
16:14:02 | FromDiscord | <Yardanico> (edit) "https://play.nim-lang.org/#ix=3JzI" => "https://play.nim-lang.org/#ix=3JzJ" |
16:14:10 | FromDiscord | <Yardanico> well it still uses strings |
16:14:52 | FromDiscord | <Yardanico> also for a cleaner C code you can compile with `-d:danger --gc:arc` |
16:14:59 | FromDiscord | <Yardanico> and also, nim uses its own allocator by default |
16:15:10 | FromDiscord | <Yardanico> so even if it's doing rawNewString it might actually not allocate _new memory_, but I'm not sure |
16:16:09 | FromDiscord | <Solitude> In reply to @Yardanico "maybe take a look": what the hell is that |
16:16:15 | FromDiscord | <Yardanico> In reply to @Solitude "what the hell is": dont ask me |
16:16:42 | FromDiscord | <Solitude> waiting for seqbasics |
16:16:46 | FromDiscord | <Solitude> jsonbasics |
16:16:55 | FromDiscord | <Yardanico> return to basics |
16:17:56 | FromDiscord | <Yardanico> In reply to @Solitude "what the hell is": have you forgot about https://nim-lang.org/docs/strmisc.html |
16:19:12 | FromDiscord | <Yardanico> also https://nim-lang.org/docs/cstrutils.html |
16:20:03 | FromDiscord | <Solitude> In reply to @Yardanico "have you forgot about": forsenInsane |
16:20:20 | FromDiscord | <Yardanico> In reply to @Solitude "forsenInsane": https://media.discordapp.net/attachments/371759389889003532/924698152601264128/unknown.png |
16:20:27 | FromDiscord | <Yardanico> :forsenNOIDONTTHINKSO: |
16:27:26 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3JzN |
16:27:33 | FromDiscord | <Yardanico> yes |
16:27:35 | FromDiscord | <Yardanico> use setLen |
16:27:41 | FromDiscord | <el__maco> also its not pretty, I wonder if I got this right |
16:27:42 | FromDiscord | <Yardanico> or create a string with `newStringOfCap` |
16:27:53 | FromDiscord | <Yardanico> and then you can just use normal `add` really |
16:28:13 | FromDiscord | <el__maco> that sounds kinda better tbh |
16:28:29 | FromDiscord | <Yardanico> also @elmaco you can avoid temp allocations when adding ints to the string |
16:28:59 | FromDiscord | <Yardanico> https://nim-lang.org/docs/digitsutils.html#addInt%2Cstring%2Cint64 it's exported by system so always available |
16:29:22 | FromDiscord | <Yardanico> just don't forget `echo` itself allocates too |
16:29:22 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3JzO |
16:29:37 | FromDiscord | <el__maco> well, echo is just debug |
16:29:56 | FromDiscord | <el__maco> that can allocate if it feels like it |
16:30:14 | FromDiscord | <Yardanico> and I think it's a bit better to use char instead of string if the string is len 1 |
16:30:24 | FromDiscord | <Yardanico> if you want to add it to another string |
16:31:11 | FromDiscord | <krisppurg> sent a long message, see http://ix.io/3JzP |
16:31:38 | FromDiscord | <Yardanico> of 19 bytes |
16:31:39 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3JzQ |
16:31:42 | FromDiscord | <Solitude> In reply to @krisppurg "<@!107140179025735680> heya uh whenever": jsony treats tuples as arrays |
16:32:33 | FromDiscord | <krisppurg> how come? |
16:33:50 | FromDiscord | <krisppurg> it expects an array, but it gets an object instead.↵↵jsony should treat objects as objects but also treat tuples as objects as well |
16:34:28 | FromDiscord | <Solitude> open issue, treeform thought otherwise. |
16:34:41 | FromDiscord | <Yardanico> In reply to @Solitude "open issue, treeform thought": :forsenDespair: |
16:35:08 | FromDiscord | <Solitude> i would go for compromise where named tuples are treated as objects, and unnamed - as arrays. |
16:35:49 | FromDiscord | <Yardanico> can you actually distinguish between named and unnamed in code? i guess if you check that the field is named "field1" xD? |
16:36:27 | FromDiscord | <Solitude> https://nim-lang.org/docs/typetraits.html#isNamedTuple%2Ctypedesc |
16:36:32 | FromDiscord | <Solitude> amazing |
16:36:43 | FromDiscord | <Yardanico> wow |
16:36:48 | FromDiscord | <Yardanico> nim is usable?! |
16:37:55 | * | Colt joined #nim |
16:39:58 | FromDiscord | <krisppurg> In reply to @Solitude "i would go for": yeah basically |
16:40:33 | FromDiscord | <Shiba> how do i make objects that has an update functions and variables |
16:40:46 | FromDiscord | <krisppurg> In reply to @Solitude "https://nim-lang.org/docs/typetraits.html#isNamedTu": didnt know that was there. Deffo would come in handy |
16:40:55 | FromDiscord | <Yardanico> In reply to @Shiba "how do i make": not sure what you mean. If you want objects to "have variables", then you add fields to your object |
16:40:59 | FromDiscord | <Yardanico> nim doesn't really have a notion of classes |
16:41:11 | FromDiscord | <Yardanico> but you can easily replicate what you would do with classes in other languages in Nim without them |
16:41:26 | FromDiscord | <Shiba> In reply to @Yardanico "nim doesn't really have": so like i need to update seprately |
16:41:42 | FromDiscord | <Shiba> (edit) "In reply to @Yardanico "nim doesn't really have": so like i need to update ... seprately" added "them" |
16:42:13 | FromDiscord | <Yardanico> In reply to @Shiba "so like i need": can you show what you want with code maybe? |
16:42:34 | FromDiscord | <Yardanico> if you want to have functions that update your object, you can just write them normally |
16:45:08 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3JzU |
16:56:18 | FromDiscord | <krisppurg> In reply to @krisppurg "<@!107140179025735680> heya uh whenever": also minimal example to reproduce this error message↵↵https://play.nim-lang.org/#ix=3JzX |
16:59:33 | * | neceve quit (Ping timeout: 256 seconds) |
17:10:28 | FromDiscord | <treeform> In reply to @krisppurg "also minimal example to": I treat tuples as arrays, but maybe if tuple has named fields I should read it as an object. To get around this limitation, you can create a hook. |
17:11:26 | FromDiscord | <krisppurg> well I dont want to create a hook for every single possible tuple |
17:12:51 | FromDiscord | <Solitude> In reply to @treeform "I treat tuples as": how do you override default hook? |
17:13:19 | * | neceve joined #nim |
17:26:17 | * | xet7 quit (Ping timeout: 252 seconds) |
17:29:09 | * | pro quit (Quit: WeeChat 3.3) |
17:31:35 | FromDiscord | <treeform> In reply to @krisppurg "well I dont want": I don't support named tuples at the moment, it's probably not that hard to add support. |
17:31:54 | FromDiscord | <krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=3JAc |
17:32:23 | FromDiscord | <treeform> If that works great. |
17:38:38 | * | xet7 joined #nim |
18:02:31 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JAl |
18:02:47 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3JAl" => "https://play.nim-lang.org/#ix=3JAm" |
18:04:04 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3JAm" => "https://play.nim-lang.org/#ix=3JAo" |
18:04:08 | FromDiscord | <Solitude> In reply to @TryAngle ". anybody knows now?": yes, just `template impl(p: untyped): untyped =` and use p in place of required proc |
18:04:29 | FromDiscord | <treeform> In reply to @krisppurg "Seems like I sort": I don't think its correct to parse every named tuple with fields, my code for instance relies on pacing named tuple as array. It probably should check and parse it as array if it sees [ and { if it sees as object. |
18:04:43 | FromDiscord | <treeform> (edit) "pacing" => "parsing" |
18:06:09 | FromDiscord | <Solitude> In reply to @treeform "I don't think its": since its very debatable what behaviour should be default, i think that hook needs to be moved to other module and imported as needed |
18:06:43 | FromDiscord | <krisppurg> ^^ |
18:06:57 | FromDiscord | <krisppurg> (edit) "^^ ... " added "i agree" |
18:10:55 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JAv |
18:11:09 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3JAv" => "https://play.nim-lang.org/#ix=3JAw" |
18:12:48 | FromDiscord | <Solitude> you cant use SomeFloat like that |
18:12:58 | FromDiscord | <Solitude> in newSeq |
18:13:05 | FromDiscord | <Solitude> SomeFloat is typeclass, not a concrete type |
18:13:31 | FromDiscord | <Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3JAz |
18:13:33 | FromDiscord | <TryAngle> do I do p[T: SomeFloat](..)↵newSeq[T]()? |
18:13:44 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JAA |
18:13:49 | FromDiscord | <TryAngle> what is the difference now? |
18:14:03 | FromDiscord | <TryAngle> does the T in the second be treated as a concrete type ? |
18:14:14 | FromDiscord | <TryAngle> (edit) "?" => "instead of a typeclass?" |
18:14:25 | FromDiscord | <Solitude> when you instantiate a generic proc T will be resolved to a concrete type |
18:15:07 | FromDiscord | <TryAngle> but why does it work "normal" when I don't put it in a template when using SomeFoat without a T ? |
18:15:27 | FromDiscord | <Solitude> it doesnt |
18:15:38 | FromDiscord | <treeform> In reply to @Solitude "since its very debatable": Not sure what you mean with extra imports, but I think jsony should work out of the "box" for most people. I don't want to make people think. |
18:15:51 | FromDiscord | <treeform> I just want to give them a 1 line solution that should work in most cases |
18:15:53 | FromDiscord | <TryAngle> In reply to @Solitude "it doesnt": it does lol, so its a bug that it wokrs? |
18:16:03 | FromDiscord | <Solitude> give a snippet wehre it works |
18:16:34 | FromDiscord | <Solitude> In reply to @treeform "I just want to": but make solution painful in rare cases? |
18:17:18 | FromDiscord | <Solitude> In reply to @treeform "I just want to": you can still make it as easy to use if you split it up into modules, and reexport all of them in `jsony.nim`. whoever needs extra customization will mix and match component modules |
18:18:10 | FromDiscord | <Solitude> !eval echo newSeq[SomeFloat](1) |
18:18:12 | NimBot | Compile failed: /playground/nim/lib/system.nim(643, 14) Error: cannot instantiate: 'T' |
18:21:50 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JAH |
18:21:59 | FromDiscord | <Solitude> what |
18:22:10 | FromDiscord | <Solitude> dont bother explaining |
18:23:09 | FromDiscord | <TryAngle> sent a code paste, see https://paste.rs/wwe |
18:29:30 | FromDiscord | <Solitude> In reply to @TryAngle "I mean that is": thats broken |
18:30:42 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JAJ |
18:31:25 | FromDiscord | <Solitude> compiles for me |
18:34:47 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JAM |
18:35:08 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3JAM" => "https://play.nim-lang.org/#ix=3JAN" |
18:38:37 | FromDiscord | <Solitude> what is your nim version\ |
18:38:44 | FromDiscord | <TryAngle> 1.6.2 |
18:40:18 | FromDiscord | <Solitude> works on playground https://play.nim-lang.org/#ix=3JAS |
18:42:46 | FromDiscord | <Yardanico> In reply to @Solitude "works on playground https://play.nim-lang.org/#ix=3": playground runs fake nim |
18:42:53 | FromDiscord | <Yardanico> /s |
19:19:52 | FromDiscord | <planetis> is there a way to do the same as .bycopy pragma directly in the function definition? |
19:20:24 | FromDiscord | <planetis> I want to bypass nim's way of parameter passing but only for some functions |
19:24:43 | FromDiscord | <enthus1ast> how can i tell nimble to always install the newest version? ↵When useing this syntax\:↵↵requires "https://github.com/enthus1ast/nimFsm.git" |
19:25:04 | FromDiscord | <enthus1ast> i want to basically ignore the artificial versioning and just install the newest |
19:25:19 | FromDiscord | <Solitude> `#HEAD` |
19:25:52 | FromDiscord | <Yardanico> :forsenHead: |
19:26:26 | FromDiscord | <enthus1ast> mhh lets try |
19:26:38 | FromDiscord | <enthus1ast> i thought i have done this already |
19:28:16 | FromDiscord | <Solitude> i hope its for your personal use, because its a pain in the ass for other users to have #HEAD'ed dependency |
19:28:26 | FromDiscord | <enthus1ast> yes |
19:28:33 | FromDiscord | <enthus1ast> personal use |
19:28:54 | FromDiscord | <enthus1ast> i always fight with this nimble syntax |
19:29:01 | FromDiscord | <enthus1ast> every time |
19:29:09 | FromDiscord | <enthus1ast> it does not what i want |
19:47:15 | FromDiscord | <planetis> requires "x@#head" |
19:48:27 | FromDiscord | <Yardanico> In reply to @planetis "requires "x@#head"": AFAIK @# when using nimble on CLI, no? |
19:48:29 | FromDiscord | <Yardanico> and # is for requires |
19:48:32 | FromDiscord | <Yardanico> or is it the other way? |
19:55:40 | FromDiscord | <frankzig> Is there a bucket queue impl for Nim? |
20:14:00 | FromDiscord | <enthus1ast> on the cli afaik |
20:14:14 | FromDiscord | <enthus1ast> und just #head when in nimble file |
20:20:34 | FromDiscord | <sOkam!> How does nim code interact with the original code a binding exactly? |
20:21:52 | FromDiscord | <sOkam!> @ElegantBeef Started the gdextension-nim thing. Having trouble understanding the architecture of the binding generator, and why the mentioned macros. I get that macros create a desired AST, I don't get why (in my total noob understanding) "a bunch of procedures" will need custom restructuring of the AST |
20:22:18 | FromDiscord | <sOkam!> (edit) "How does nim code interact with the original code ... a" added "of" |
20:23:02 | FromDiscord | <sOkam!> (edit) "@ElegantBeef Started the gdextension-nim thing. Having trouble understanding the architecture of the binding generator, and why the mentioned macros. I get that macros create a desired AST, ... I" added "but" |
20:24:15 | FromDiscord | <sOkam!> Why is the generated code not gonna be compliant to the default AST? 🤔 |
20:42:07 | FromDiscord | <yledu> hi↵I don't know if it's the right channel to ask : |
20:42:42 | FromDiscord | <yledu> I've downloaded nim using choosenim on my mac, everything compiled fine and all, but trying some examples `import random fails` |
20:43:37 | FromDiscord | <yledu> It tells me "cannot open random" |
20:45:27 | FromDiscord | <yledu> Some random is in math I found out, but not rand() for example which is used in the nim by example |
20:46:36 | FromDiscord | <Yardanico> In reply to @yledu "Some random is in": can you show all of your code ? |
20:47:09 | FromDiscord | <yledu> sent a code paste, see https://play.nim-lang.org/#ix=3JBr |
20:47:34 | FromDiscord | <yledu> taken from https://nim-by-example.github.io/if_else_while/ |
20:49:41 | FromDiscord | <yledu> I must have a path problem, but I did follow all instructions there:↵https://nim-lang.org/install_unix.html↵with choosenim |
20:56:30 | * | ozzz quit (Remote host closed the connection) |
20:59:10 | FromDiscord | <yledu> any idea ? |
21:26:27 | * | Gustavo6046 joined #nim |
21:33:21 | * | ozzz joined #nim |
21:34:27 | FromDiscord | <Elegantbeef> `nim -v`? |
21:34:27 | FromDiscord | <Elegantbeef> Can you elaborate i dont quite follow?↵(@sOkam!) |
21:37:08 | FromDiscord | <Elegantbeef> Are you asking why use macros to generate the code from the json? |
21:37:34 | FromDiscord | <evoalg> In reply to @yledu "any idea ?": one thing you could try and remove choosenim (`rm -fr ~/.config/nim/`) and install nim via brew? |
21:37:46 | FromDiscord | <evoalg> (edit) "and" => "is" |
21:38:48 | FromDiscord | <evoalg> brew for mac has the latest nim version (1.6.2) |
21:38:49 | FromDiscord | <Elegantbeef> Or just check your nim version and make sure it's modern |
21:39:29 | FromDiscord | <Elegantbeef> Given that i jump around versions i'm a bit biased against system installed packages |
21:39:46 | FromDiscord | <evoalg> oh yea do `nim -v` first like beef said @yledu |
21:39:46 | FromDiscord | <TryAngle> In reply to @Solitude "works on playground https://play.nim-lang.org/#ix=3": hmmm... sus 😳 |
21:39:48 | FromDiscord | <Elegantbeef> So after playing with the iterator macros, evo likey? |
21:40:37 | FromDiscord | <Elegantbeef> try running with a broken compiler |
21:40:41 | FromDiscord | <Elegantbeef> shame on try |
21:48:15 | FromDiscord | <evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3JBH |
21:49:05 | FromDiscord | <Elegantbeef> You dont really need to of course |
21:49:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JBI |
21:49:50 | FromDiscord | <Elegantbeef> So yea it's probably 100% useless |
21:50:21 | FromDiscord | <Elegantbeef> I have ideas that make me go "Hey this would solve X" then realize "hey that's dumb" |
21:50:53 | FromDiscord | <Elegantbeef> What i actually want to do but cannot reason how is chaining iterators |
21:51:14 | FromDiscord | <evoalg> hehe ... I am learning the right way to do things by test all this stuff, which is awesome |
21:51:35 | FromDiscord | <Elegantbeef> so like `for x in filter(map(a, x 10), x >= 100)` |
21:51:55 | FromDiscord | <evoalg> yea chaining iterators would be so awesome, and that's what attracts people to functional programing I think? |
21:52:17 | FromDiscord | <Elegantbeef> which i guess could be achieved by doing `for x in chain(a.map(x 10).filter(x >= 10))` |
21:52:48 | FromDiscord | <TryAngle> In reply to @Elegantbeef "shame on try": literally reinstalled nim XD https://media.discordapp.net/attachments/371759389889003532/924781821965766697/unknown.png |
21:53:33 | FromDiscord | <Elegantbeef> Really though i just need to reason how to poop out the iterators in such a way that iterators are inlined at `yield` points |
21:53:41 | FromDiscord | <sOkam!> In reply to @Elegantbeef "Can you elaborate i": I get that macros create a desired AST, but I don't get why "a bunch of procedures" will need custom restructuring of the AST↵In my current understanding, the godot api is just a bunch of procedures/types that need some "mapping", so that they exist in nim syntax↵What I don't know is how is the AST related to that, if the ast is used for creating new custom structures (like the walrus o |
21:53:47 | FromDiscord | <Elegantbeef> Which isnt that difficult just gets complicate |
21:54:15 | FromDiscord | <Elegantbeef> Ok so the reason is say you want to do `SomeNode` which inherits `Node` |
21:54:29 | FromDiscord | <Elegantbeef> You need to know in Nim the methods and fields `Node` has and have them map to the GD native code |
21:54:35 | FromDiscord | <Elegantbeef> This way you can properly write code for godot |
21:55:05 | FromDiscord | <Elegantbeef> What's' the entire module Try? |
21:55:18 | FromDiscord | <TryAngle> @Solitude @ElegantBeef I think I found the issue now maybe? |
21:56:01 | FromDiscord | <TryAngle> Calling it in NNFS project works↵calling it from the library I'm developing and testing in another does not |
21:56:03 | FromDiscord | <Elegantbeef> You had T somewhereelse in the module? |
21:57:27 | FromDiscord | <Elegantbeef> Also AST isnt for custom structures |
21:57:34 | FromDiscord | <Elegantbeef> AST is legitimately everything you write |
21:57:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JBL |
21:58:15 | FromDiscord | <Elegantbeef> It's a VarSection with an identDef of `"a", emptyNode(), 100` |
22:00:29 | FromDiscord | <TryAngle> hmmm maybe its an issue with nimble devlop and generics withhin templates? |
22:00:53 | FromDiscord | <Elegantbeef> That doesnt make any sense really |
22:01:31 | FromDiscord | <TryAngle> test it make a project add this template & proc there, nimble develop it and call it from another project |
22:01:44 | FromDiscord | <TryAngle> when I create it in the same project it works |
22:02:13 | FromDiscord | <sOkam!> @ElegantBeef About the architecture. How does nim code actually interact with the original code?↵Is it some type of translation on compile timer or smth? or how does it work, roughly? |
22:02:28 | FromDiscord | <sOkam!> (edit) "timer" => "time" |
22:02:50 | FromDiscord | <Elegantbeef> You use the C code in the header and do everything required to let Godot know about your "classes" |
22:03:23 | FromDiscord | <Elegantbeef> Do you have the link for the godot extension repo |
22:03:31 | FromDiscord | <sOkam!> ye, its godot-headers |
22:03:32 | FromDiscord | <Elegantbeef> I dont have it on hand atm |
22:03:42 | FromDiscord | <Elegantbeef> Thanks |
22:03:49 | FromDiscord | <sOkam!> https://github.com/godotengine/godot-headers |
22:04:02 | FromDiscord | <sOkam!> Master is the gdextension branch |
22:04:12 | FromDiscord | <Elegantbeef> https://github.com/godotengine/godot-headers/blob/master/godot/gdnative_interface.h#L447-L454 |
22:04:20 | FromDiscord | <Elegantbeef> these are percisely how you let it know |
22:04:50 | * | xet7 quit (Quit: Leaving) |
22:06:29 | FromDiscord | <sOkam!> Ok. So you interact with those functions to let C know about nim procs↵But how does the interaction work? |
22:06:59 | FromDiscord | <sOkam!> I understand that that interaction is what I'm going to be designing... so that's what my Q is about mainly |
22:07:31 | FromDiscord | <sOkam!> Trying to design the model for what the generator is going to actually be doing... but kinda lost |
22:07:41 | FromDiscord | <sOkam!> (edit) "model" => "model/architecture" |
22:07:57 | FromDiscord | <Elegantbeef> If you want an example compile a `godot-nim` project with `--expandMacro:gdobj` to see what it does |
22:08:32 | FromDiscord | <sOkam!> you mean a godot game project? |
22:08:57 | FromDiscord | <Elegantbeef> Works fine here @TryAngle |
22:08:58 | FromDiscord | <Elegantbeef> It wont be the same for Godot extensions of course but it's atleast the basic idea |
22:09:14 | FromDiscord | <sOkam!> or just compiling the godot-nim bindings themselves? |
22:09:20 | FromDiscord | <Elegantbeef> Yea |
22:09:42 | FromDiscord | <Elegantbeef> You emit a bunch of top level instructions that subscribe the code to the godot environment |
22:09:58 | FromDiscord | <Elegantbeef> Yea using a godot game project that uses the `gdobj` example |
22:10:06 | FromDiscord | <Elegantbeef> `gdobj` macro\ |
22:10:21 | FromDiscord | <Shiba> so my hello world program compiles in 3s with d:release |
22:10:32 | FromDiscord | <Shiba> can i optimiz it further |
22:10:38 | FromDiscord | <Shiba> (edit) "optimiz" => "optimize" |
22:10:46 | FromDiscord | <Yardanico> use clang, also consequent compilations are faster |
22:10:47 | FromDiscord | <frankzig> Are you guys aware of bucket queue implementations for Nim?↵Heapqueue is perfect for most intents, I need approximate priority handling in order to reduce that LogN complexity |
22:13:53 | FromDiscord | <frankzig> In reply to @Shiba "so my hello world": Joking: Yes, enable LTO, it will compile slower but run faster ;) |
22:13:57 | FromDiscord | <Shiba> In reply to @Yardanico "use clang, also consequent": ?? sorry can you explain "consequent compilations" and how i can use it😅 |
22:14:24 | FromDiscord | <Yardanico> if you compile again and only change some code nim won't recompile all C files |
22:14:58 | FromDiscord | <Elegantbeef> yardanico mean subsequent compilations |
22:15:09 | FromDiscord | <Shiba> but i only have one fille with "echo "hello world"" andit's still 3s |
22:15:16 | FromDiscord | <Shiba> (edit) "andit's" => "and it's" |
22:15:21 | FromDiscord | <Shiba> wow |
22:15:24 | FromDiscord | <Yardanico> well you gotta deal with that |
22:15:28 | FromDiscord | <Yardanico> get a faster CPU :)) |
22:15:35 | FromDiscord | <Yardanico> things should improve with IC |
22:15:50 | FromDiscord | <Elegantbeef> You could also use TCC if it's the c compiler but it's not as optimized code |
22:16:13 | FromDiscord | <frankzig> It cannot be avoided, on the other hand, it does scaly as badly as other languages, so longer scripts still compile in reasonable time |
22:16:24 | FromDiscord | <frankzig> (edit) "does" => "doesnt" |
22:16:25 | FromDiscord | <Shiba> In reply to @Elegantbeef "You could also use": i have it ,but idk how |
22:16:33 | FromDiscord | <Elegantbeef> `--cc:tcc` |
22:16:38 | FromDiscord | <Elegantbeef> On \nix atleast |
22:16:45 | FromDiscord | <Elegantbeef> On windows i think there is more of a setup |
22:17:03 | FromDiscord | <Yardanico> also @Shiba this only speeds up the C compilation part |
22:17:09 | FromDiscord | <Yardanico> it doesn't change the speed of the nim compilation part |
22:17:18 | FromDiscord | <Yardanico> so if you run your compile command more than 1 time and it's still 3s - that's nim time |
22:17:20 | FromDiscord | <Yardanico> not C compiler time |
22:17:36 | FromDiscord | <yledu> @evoalg @ElegantBeef Thanks ! it allowed me to see that I had the wrong nim version, a very old one from 2014! I then used `choosenim show path` and that gave me the right path to add to my .bash_profile |
22:18:01 | FromDiscord | <evoalg> nice! |
22:18:42 | FromDiscord | <sOkam!> @ElegantBeef Is this not exactly what I would be coding?↵https://github.com/pragmagic/godot-nim/blob/master/godot/godotapigen.nim |
22:18:54 | FromDiscord | <Shiba> In reply to @Yardanico "not C compiler time": i wonder why embeded languages like lua run super fast , maube because they don't compile |
22:19:04 | FromDiscord | <Yardanico> In reply to @Shiba "i wonder why embeded": not "maybe", that's exactly the reason :D |
22:19:06 | FromDiscord | <Shiba> (edit) "maube" => "maybe" |
22:19:13 | FromDiscord | <Yardanico> and the term you're looking for is "interpreted" |
22:19:18 | FromDiscord | <sOkam!> Ofc, adapting to gdextension... but seems like most of the work should be done there? possibly? or am I missing something big |
22:19:50 | FromDiscord | <Elegantbeef> Nope you're mostly right |
22:20:24 | FromDiscord | <Elegantbeef> They didnt document the code much though so it's a slog to try to understand |
22:28:00 | FromDiscord | <sOkam!> Good news is they were already binding with a json file, so at least that's similar 🤷♂️ |
22:28:17 | FromDiscord | <sOkam!> I really thought it was done with an autowrapper |
22:30:37 | FromDiscord | <evoalg> sent a long message, see http://ix.io/3JBU |
22:31:07 | FromDiscord | <Elegantbeef> Most interpreted languages are not statically typed so a good type system 😛 |
22:31:25 | FromDiscord | <evoalg> what beef said! |
22:32:22 | FromDiscord | <Shiba> In reply to @evoalg "a short program that": do all imported scripts compile |
22:32:30 | FromDiscord | <Shiba> (edit) "In reply to @evoalg "a short program that": do all imported scripts compile ... " added "in one time" |
22:32:49 | FromDiscord | <Shiba> (edit) "In reply to @evoalg "a short program that": do all imported scripts compile in ... one" added "all running scripts in" |
22:33:42 | * | FromDiscord quit (Remote host closed the connection) |
22:33:55 | * | FromDiscord joined #nim |
22:34:12 | FromDiscord | <Shiba> idk if that makes sense |
22:34:14 | FromDiscord | <evoalg> you mean when you do something like "import random" in your nim source file? ... it will import the random source (but only the part you actually use!) and will compile that along with your nim code (I belive) |
22:34:23 | FromDiscord | <Elegantbeef> It presently imports the entire file and semantically checks it all |
22:34:36 | FromDiscord | <Elegantbeef> Lazysem is a think that is being looked at, which will only look at what you actively use |
22:34:43 | FromDiscord | <Elegantbeef> "is a thing" |
22:35:14 | FromDiscord | <Shiba> not a problem since all of my programs are written in one file |
22:35:29 | FromDiscord | <Shiba> (edit) "file" => "file😜" |
22:35:33 | FromDiscord | <KatrinaKitten> Is there a way to call a proc which is stored as a property on an object? Trying to just do `object.property(params)` gives an error `identifier expected, but found 'object.property'`. |
22:36:13 | FromDiscord | <Elegantbeef> That's how you d oit |
22:36:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JBW |
22:37:54 | FromDiscord | <KatrinaKitten> Hmm... is it possibly an issue with the fact that the property is declared `var`? If so, is there a way to work around that? |
22:38:09 | FromDiscord | <Elegantbeef> What? |
22:39:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JBX |
22:39:29 | FromDiscord | <KatrinaKitten> sent a code paste, see https://play.nim-lang.org/#ix=3JBY |
22:39:44 | FromDiscord | <KatrinaKitten> (edit) "https://play.nim-lang.org/#ix=3JBY" => "https://play.nim-lang.org/#ix=3JC0" |
22:40:11 | FromDiscord | <Solitude> var shouldnt be there |
22:40:43 | FromDiscord | <KatrinaKitten> It needs to be there, the proc can be `nil` and needs to be changeable. I'm doing a manual `nil` check directly before the call in my actual code. |
22:40:47 | FromDiscord | <Elegantbeef> indeed |
22:40:57 | FromDiscord | <Solitude> . |
22:40:57 | FromDiscord | <Elegantbeef> `var proc` isnt a type deef |
22:41:04 | FromDiscord | <Elegantbeef> remove `var` from your object definition |
22:41:23 | FromDiscord | <Elegantbeef> field mutability depends on object mutabillity |
22:41:57 | FromDiscord | <KatrinaKitten> So why was the error nothing related to "hey idiot, don't use `var` there"? |
22:42:02 | FromDiscord | <KatrinaKitten> Just removing it results in `'parser1.body' cannot be assigned to` |
22:42:06 | FromDiscord | <KatrinaKitten> (edit) "Just removing it results in `'parser1.body' cannot be assigned to` ... " added "from elsewhere." |
22:42:21 | FromDiscord | <Solitude> declare your p with var |
22:42:42 | FromDiscord | <Solitude> https://nim-lang.github.io/Nim/tut1.html#the-var-statement |
22:42:55 | FromDiscord | <Elegantbeef> methinks the views has escaped the flags |
22:43:10 | FromDiscord | <Elegantbeef> Cause `var T` should error without `--experimental:views` |
22:43:27 | FromDiscord | <KatrinaKitten> In reply to @Solitude "declare your p with": That isn't really an option, this is an API thing. It's intended to be essentially an invisible replacement, it shouldn't rely on the user declaring with `var`. |
22:44:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JC1 |
22:44:36 | FromDiscord | <Solitude> In reply to @KatrinaKitten "That isn't really an": make your type a ref. your code doesnt do what you think ti does |
22:45:02 | FromDiscord | <Solitude> or make a better api |
22:45:09 | FromDiscord | <Elegantbeef> Indeed `var T` in a type definition is for views, and apparently a fix has leaked into views disabled |
22:45:31 | FromDiscord | <Elegantbeef> Weirder even that `var T` compiles in 1.0 |
22:45:32 | FromDiscord | <Shiba> can you acces memory? |
22:45:35 | FromDiscord | <Elegantbeef> So the hell is going on |
22:45:40 | FromDiscord | <Solitude> no, you should use rust for that |
22:46:09 | FromDiscord | <Elegantbeef> Depends what you mean by access memory |
22:47:48 | FromDiscord | <Shiba> accessing by modifiying variables adresses and vallues in hex ... |
22:48:07 | FromDiscord | <Elegantbeef> It's a system language so yes you have that control |
23:41:06 | FromDiscord | <evoalg> @ElegantBeef when you did `b = "\10\20\30\40"` ... what is that sort of string? |
23:41:33 | FromDiscord | <Elegantbeef> It's a normal string |
23:41:58 | FromDiscord | <Elegantbeef> `\number` is a char escape that equates to `char(theByte)` |
23:42:22 | FromDiscord | <Elegantbeef> So the 10th ascii character is written, then the 20th, 30th ... |
23:44:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JCc |
23:44:23 | FromDiscord | <Elegantbeef> This is just getting silly |
23:45:20 | FromDiscord | <evoalg> I'll have a play 😉 |
23:45:36 | FromDiscord | <Elegantbeef> Lol it's not pushed yet |
23:45:41 | FromDiscord | <Elegantbeef> I'm still questioning if it makes any sense |
23:45:49 | FromDiscord | <evoalg> ahh true |
23:46:10 | FromDiscord | <evoalg> zip and zipIter are the same thing except I use zipIter in a for loop right? |
23:46:39 | FromDiscord | <Elegantbeef> Well "same" |
23:46:46 | FromDiscord | <Elegantbeef> They're vastly different implementations |
23:46:59 | FromDiscord | <evoalg> I can pass the same args? |
23:47:13 | FromDiscord | <Elegantbeef> Yea |
23:47:51 | FromDiscord | <evoalg> I guess I can use slicerator zip in the for loop but zipIter is more efficient |
23:53:08 | FromDiscord | <Elegantbeef> Neither are overly performant if you have a fixed size collection |
23:53:11 | FromDiscord | <Spook> nigga |
23:53:21 | FromDiscord | <Spook> semen |
23:53:21 | FromDiscord | <Spook> semen |
23:53:22 | FromDiscord | <Spook> semen |
23:53:22 | FromDiscord | <Spook> semen |
23:53:23 | FromDiscord | <Spook> semen |
23:53:25 | FromDiscord | <moggo> fucking niggers |
23:53:31 | FromDiscord | <moggo> niger ngien |
23:53:32 | FromDiscord | <moggo> gengeingeigeg |
23:53:33 | FromDiscord | <moggo> egegemg |
23:53:33 | FromDiscord | <moggo> enege |
23:53:34 | FromDiscord | <moggo> nge |
23:53:34 | FromDiscord | <moggo> ng |
23:53:34 | FromDiscord | <moggo> eng |
23:53:51 | FromDiscord | <Spook> https://tenor.com/view/redo-of-healer-redo-of-a-healer-redo-of-the-healer-anime-anime-girl-gif-20602961 |
23:53:53 | FromDiscord | <ElegantBeef> <@&371760044473319454> |
23:54:10 | FromDiscord | <moggo> https://media.discordapp.net/attachments/371759389889003532/924812361859207168/2Q.png |
23:54:10 | FromDiscord | <Yardanico> thanks |
23:54:12 | FromDiscord | <moggo> https://media.discordapp.net/attachments/371759389889003532/924812370419777596/2Q.png |
23:54:12 | FromDiscord | <moggo> https://media.discordapp.net/attachments/371759389889003532/924812371904577536/2Q.png |
23:54:45 | FromDiscord | <Elegantbeef> Probably should also delete it from matrix since apparently image uploads deletion dont propagate |
23:56:07 | FromDiscord | <evoalg> beef are you on discord as well as matrix? |
23:56:14 | FromDiscord | <Elegantbeef> I am |
23:56:22 | FromDiscord | <Elegantbeef> Cant ping moderators from here 😛 |
23:57:08 | FromDiscord | <Elegantbeef> Useless speed increase code |
23:57:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JCg |
23:57:11 | FromDiscord | <Yardanico> i'm not an admin in here |
23:59:41 | FromDiscord | <retkid> so im running something i barely have enough memory for |
23:59:54 | FromDiscord | <retkid> i have it on a while true loop |