<< 17-05-2020 >>

00:00:01*junland quit (Quit: %ZNC Disconnected%)
00:00:41*junland joined #nim
00:06:05*Hideki joined #nim
00:06:28*Hideki is now known as Guest7405
00:12:25*exelotl quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
00:12:29*zacharycarter joined #nim
00:17:29FromDiscord<Max [codingreaction]> yeeee! i finished my first nim program, a raw, bad formatted implementation for a TODO list manager. I don't know why the environment throws an error on execution, in my local setup works without problem (running on debug mode throught VSCode)
00:17:32*zacharycarter quit (Ping timeout: 272 seconds)
00:17:48FromDiscord<Max [codingreaction]> Anyway, this is the code, feel free to critiquize as my intention is for learning 🙂
00:17:51FromDiscord<Max [codingreaction]> https://play.nim-lang.org/#ix=2mhg
00:20:40*Guest7405 quit (Ping timeout: 256 seconds)
00:30:38*dadada quit (Ping timeout: 256 seconds)
00:38:48*lritter quit (Ping timeout: 265 seconds)
00:39:10*lritter joined #nim
00:45:03FromDiscord<zetashift> If a proc returns nothing then you can omit the `: void`
00:45:58*krux02_ quit (Remote host closed the connection)
00:46:40FromDiscord<zetashift> Also Nim has a the implicit result variable, that is more idiomatic Nim than a return statement, but for a first time your code looks a lot better than mine did lol
00:58:05*zacharycarter joined #nim
01:00:13FromDiscord<Max [codingreaction]> thanks for checking the code @zetashift i'm gonna check the implicit result thing. Oh regarding to the look of the code it's thanks to the community, as my first TODOs was with a SinglyLinkedList and i started to add the classic list methods by hand hahaha, as the slice type is REALLY, REALLY convenient as a dynamic size array
01:03:08*zacharycarter quit (Ping timeout: 272 seconds)
01:03:30*Hideki joined #nim
01:03:54*Hideki is now known as Guest15289
01:04:46FromDiscord<Max [codingreaction]> sent a long message, see http://ix.io/2mhl
01:05:01*konvertex quit (Ping timeout: 264 seconds)
01:20:36PrestigeIs there anything like symmetricDifference for arrays, or should I just convert my arrays to sets to use this?
01:28:08*fredrikhr quit (Read error: Connection reset by peer)
01:33:49*chemist69 quit (Ping timeout: 272 seconds)
01:34:23FromGitter<bung87> found a long article introduce nim http://ssalewski.de/nimprogramming.html#_some_facts_about_nim
01:35:14*chemist69 joined #nim
01:35:40PrestigeNice
01:45:12*Senketsu quit (Ping timeout: 256 seconds)
01:45:20*lritter quit (Quit: Leaving)
01:45:33FromDiscord<Rika> convert
01:58:11FromDiscord<exelotl> wtf I managed to change the value of a static parameter to a macro??
01:58:35FromDiscord<exelotl> how am I running into so many language bugs this weekend
01:58:57FromDiscord<Rika> what do you mean
02:00:35FromDiscord<exelotl> Here's the start of the macro https://media.discordapp.net/attachments/371759389889003532/711397720597725264/unknown.png
02:02:34FromDiscord<exelotl> further down I'm trying to parse up until closeChar, but it's not working. So I added a debug echo: https://media.discordapp.net/attachments/371759389889003532/711398223629254676/unknown.png
02:02:44caffHey folks, I'm pretty new to Nim, so I might be missing something obvious, but I'm trying to break a reference to a proc arg, or copy it somehow. Not sure quite how to approach it.
02:02:46caffhttps://play.nim-lang.org/#ix=2mhr
02:03:10*mono joined #nim
02:03:25caffNamely I'm trying not to mutate the initial toml.
02:04:24FromDiscord<Rika> https://play.nim-lang.org/#ix=2mhs
02:04:29FromDiscord<exelotl> @Rika closeChar somehow gets set to '\0' even though I passed '}'
02:04:31FromDiscord<Rika> is what **i** would do
02:04:48FromDiscord<Rika> @exelotl i wanna try running the code, mind sending it?
02:05:14caffThanks Rika :) I was misusing deepCopy in my experiments apparently.
02:05:16FromDiscord<exelotl> it's a bit unweildy, I'll see if I can make it a bit smaller :x
02:05:54*monok quit (Ping timeout: 256 seconds)
02:07:20FromDiscord<Rika> caff: i dont know if it's a good idea, but it's what i would do
02:07:32FromDiscord<Rika> maybe you can get away with a shallow copy but i dont know...
02:10:17*muffindrake quit (Ping timeout: 260 seconds)
02:12:03caffI can't really think of another way to handle it. It's not a huge deal to mutate the original object, but at the very least, I wanted to at least figure out how to break a reference. :)
02:12:09*muffindrake joined #nim
02:13:33FromDiscord<Rika> deepcopy does all references within the first one, shallow only the first layer is copied, so not recursively or so
02:13:46FromDiscord<Rika> of course, you must know that by now....
02:14:27caffThough I'm thinking since it's a recursive function, it'd probably make more sense to copy when passing in. Definitely still suuuuper green with Nim.
02:16:48FromDiscord<Rika> i actually am unsure if deepcopy is recursive, but i have no idea how else it would be implemented, so i just assumed
02:18:13caffThis post at least gives me a decent starting point to start wrapping my head around it, haha. https://forum.nim-lang.org/t/5539#34522
02:19:27FromDiscord<exelotl> @Rika https://play.nim-lang.org/#ix=2mhu
02:19:31caffshallowCopy should probably be good from what I read. I'll have to play around with it more.
02:20:26FromDiscord<Rika> @exelotl i'm a bit lost, haha, what should i look for?
02:22:26FromDiscord<Rika> it doesnt run either T_T
02:23:51FromDiscord<Rika> ah, i know
02:24:08FromDiscord<Rika> ah, no
02:24:10FromDiscord<Rika> never mind
02:24:28caffAppreciate your help so far @Rika :)
02:24:49FromDiscord<exelotl> oh there's a few errors that will happen even if the bug I'm encountering is fixed, let me clean it up some more
02:28:12FromDiscord<Rika> @exelotl it looks like a bug with static[char]
02:28:54FromDiscord<Rika> huh
02:28:58FromDiscord<Rika> it ist
02:28:59FromDiscord<Rika> isnt
02:30:33FromDiscord<exelotl> @Rika https://play.nim-lang.org/#ix=2mhA
02:31:44FromDiscord<Rika> yeah
02:31:44FromDiscord<exelotl> if you comment out the "scanp approach" and uncomment the "manual approach" it compiles and runs successfully
02:31:54FromDiscord<Rika> scanp fucks with closeChar
02:32:01FromDiscord<Rika> im still reading into it
02:32:16FromDiscord<exelotl> this shouldn't happen lol, it's so wack
02:33:59FromDiscord<Rika> actually
02:34:01FromDiscord<exelotl> scanp hasn't run at all at this point... though it's a macro so it does have a chance to mess with things in its own scope I guess...
02:34:01FromDiscord<Rika> one more test
02:34:05FromDiscord<Rika> im thinking it isnt scanp
02:34:55FromDiscord<Rika> found it
02:35:01FromDiscord<Rika> its the fact that you make a proc and pass i
02:35:04FromDiscord<Rika> pass it*
02:35:12FromDiscord<Rika> prolly closures are broken in vm
02:35:26FromDiscord<exelotl> oof
02:35:35FromDiscord<Rika> make it a not-closure, somehow
02:37:41FromDiscord<exelotl> I didn't really want to make a proc for that at all, but there didn't seem to be any other way to use a variable as part of a scanp pattern
02:37:59FromDiscord<Rika> ***gl, and hf)
02:38:04FromDiscord<Rika> (edit) 'hf)' => 'hf***'
02:38:19FromDiscord<Rika> wonder if that fucked with yars bot
02:38:40FromDiscord<exelotl> thanks for the help, good to narrow down the problem at least. :')
02:39:05FromDiscord<exelotl> guess I'll make a bug report at some point if I can narrow it down more
02:39:30FromDiscord<Rika> i have a feeling that it's related to how the vm cant have ref of ref
02:39:45FromDiscord<Rika> prolly wrong tho 😛
02:40:50FromDiscord<exelotl> copying closeChar into a local variable fixes it too
02:41:03FromDiscord<exelotl> so it's a combination of closures and static macro parameters?
02:41:09FromDiscord<Rika> perhaps
02:50:02skrylar[m]Yardanico: built the first version https://gist.github.com/Skrylar/8b0c95074129cc2de788e20436801be0
02:50:03*caff quit (Read error: Connection reset by peer)
02:53:35*caff joined #nim
02:54:55FromDiscord<Technisha Circuit> Who's the creator of Nimpy?
03:01:16*monok joined #nim
03:01:44skrylar[m]so it seems the earlier question about weak references is, "code them yourself" ._.
03:02:03skrylar[m]cursor isn't a weakref so much as it just ignores counting, but weakrefs specifically get told when the master dies
03:02:39skrylar[m]afaik cursors don't get nilled out
03:03:09skrylar[m]unless they actually do, but i have no idea if they do atm :shrug:
03:03:26disruptekcursor is in the docs now.
03:03:32disrupteksee doc/destructors.
03:03:49*mono quit (Ping timeout: 264 seconds)
03:03:55skrylar[m]lies https://nim-lang.org/docs/destructors.html
03:03:59disruptekthey aren't weak like weak_ptr.
03:04:30skrylar[m]yes i saw the rfc, they just don't interact with ref counting at all
03:04:32disrupteksee commit 06dfd316127fb2ec05ff69942abd1e279156ac5c.
03:04:38skrylar[m]but that also makes them unsafe-ish, so :\
03:04:59disruptekyes, by design.
03:05:04disruptekwhat are you trying to accomplish?
03:05:55skrylar[m]was mostly asking if we had solved that problem yet; i don't use arc
03:06:52disruptekwithout knowing the problem, it's hard to answer.
03:07:08disruptekbut, arc is the solution to most problems.
03:09:30skrylar[m]well its not too hard to make a Weak object that just has a seq of things to notify when it dies
03:10:25FromDiscord<Broadwell> Is there a proc from macros that evaluates a given ast node?
03:11:03FromDiscord<Broadwell> Like `Ident "true"` => the boolean `true`
03:11:04disruptekit's called return.
03:11:23FromDiscord<Broadwell> I want to evaluate it at compile time
03:11:28disruptekreturn
03:11:33skrylar[m]FromDiscord: https://nim-lang.org/docs/macros.html#getAst%2Cuntyped ?
03:11:37FromDiscord<Broadwell> Okay
03:14:37*livcd quit (Ping timeout: 264 seconds)
03:17:40skrylar[m]currently solved the problem of getting the sdl/allegro style union message stacks out of a macro; and then accessor procs to cheat the type system strategically; now there's just the issue of cleaning up subscribers if the mailbox owning object diies
03:34:18*chemist69 quit (Ping timeout: 260 seconds)
03:35:10FromDiscord<Technisha Circuit> Is there something like https://flyx.github.io/emerald/documentation.html but for css?
03:35:25*chemist69 joined #nim
03:37:15FromDiscord<willyboar> Dsl for css?
03:38:20FromDiscord<Technisha Circuit> Mhm
03:38:37FromDiscord<Rika> why?
03:38:47*Guest15289 quit (Remote host closed the connection)
03:39:10FromDiscord<Technisha Circuit> Because i am absolutely trash at css and i prefer the syntax of emerald more
03:39:44FromDiscord<willyboar> Have you look sass?
03:40:23FromDiscord<Technisha Circuit> What's that?
03:40:35FromDiscord<Rika> preprocessor
03:41:22FromDiscord<willyboar> By the way i prefer scf from emerald and i really don't like scf
03:41:27FromDiscord<willyboar> 😋 😋 😋 😋
03:41:43FromDiscord<Technisha Circuit> What's scf?
03:41:48FromDiscord<Technisha Circuit> And thanks :p
03:41:59FromDiscord<willyboar> Source cide filters
03:42:09FromDiscord<willyboar> (edit) 'cide' => 'code'
03:42:13FromDiscord<Technisha Circuit> Thanks!
03:42:44FromDiscord<willyboar> It is one of the 2 std lib ways to create html templates
03:42:53FromDiscord<Technisha Circuit> O
03:42:53FromDiscord<willyboar> The other is obvious htmlgen
03:43:14FromDiscord<willyboar> Who i find it similar to emerald
03:43:39FromDiscord<Technisha Circuit> Wait
03:43:44FromDiscord<Technisha Circuit> I didn't mean emerald
03:43:48FromDiscord<Technisha Circuit> I meant Jade
03:43:53FromDiscord<Technisha Circuit> 😅
03:44:13FromDiscord<Technisha Circuit> Wait
03:44:21FromDiscord<Technisha Circuit> Nope still not the right one ;-;
03:44:42FromDiscord<Technisha Circuit> I can't find the one i was looking for ;-;
03:44:49FromDiscord<Technisha Circuit> Is there any simpler alternative to html then?
03:44:51FromDiscord<willyboar> Mustache?
03:45:25FromDiscord<Technisha Circuit> Is there any alternatives that give me logic?
03:45:33FromDiscord<Technisha Circuit> That are implemented in either Nim or Python?
03:45:55FromDiscord<Technisha Circuit> (edit) 'That are implemented in either Nim or Python? ... ' => 'That are implemented in either Nim or Python?(Because i can use Nimpy)'
03:45:57FromDiscord<willyboar> Well python has a couple of hundreds
03:46:07FromDiscord<willyboar> 😋
03:46:14FromDiscord<Technisha Circuit> Which ones should i look at :P
03:46:30FromDiscord<willyboar> Personally i really like jinja
03:46:45FromDiscord<Technisha Circuit> Oh?
03:48:11*silvernode joined #nim
03:48:29FromDiscord<willyboar> But mustache is cool too and there is a nim library
03:48:29*zacharycarter joined #nim
03:48:40FromDiscord<willyboar> Actually there are two of them
03:49:11FromDiscord<Technisha Circuit> Oh? What Nim libraries are they? And what's the syntax of mustache?
03:50:29FromDiscord<Technisha Circuit> Looks nice
03:50:51FromDiscord<willyboar> https://github.com/search?q=mustache+language%3Anim&type=
03:51:53FromDiscord<Technisha Circuit> Thanks!
03:52:53FromDiscord<Technisha Circuit> Is there an alternative to html which uses json files to generate html code? :P
03:53:00FromDiscord<Technisha Circuit> (edit) 'files' => 'data'
03:53:07FromDiscord<Technisha Circuit> I'm just curious rn
03:53:08FromDiscord<Elegant Beef> Why would you want to convert json to html
03:53:11*zacharycarter quit (Ping timeout: 260 seconds)
03:53:21FromDiscord<Technisha Circuit> A better question is why not
03:53:29FromDiscord<Elegant Beef> They're both human readable and json isnt made for website creation
03:53:35*silvernode quit (Ping timeout: 265 seconds)
03:53:38FromDiscord<Elegant Beef> Json is for serialzing Objects
03:53:41FromDiscord<Elegant Beef> (edit) 'Objects' => 'objects'
03:53:44FromDiscord<Elegant Beef> Shit
03:53:53FromDiscord<Technisha Circuit> Well, I'm known to do stupid things, so
03:53:59FromDiscord<Technisha Circuit> Serialising*
03:54:09FromDiscord<Elegant Beef> serializing*
03:54:11FromDiscord<Technisha Circuit> I'm British :P
03:54:18FromDiscord<Technisha Circuit> It's with an s for me
03:54:19FromDiscord<Elegant Beef> Im Canadian
03:54:22FromDiscord<Elegant Beef> It's an s with me too
03:54:23FromDiscord<Technisha Circuit> Coolio
03:54:28FromDiscord<willyboar> Hahhahah
03:54:33FromDiscord<Technisha Circuit> You put a z tho
03:54:37FromDiscord<Elegant Beef> Cause i dont care
03:54:41FromDiscord<Technisha Circuit> :P
03:54:43FromDiscord<Elegant Beef> It's not colour i dont care
03:54:50FromDiscord<willyboar> Cauze
03:54:55FromDiscord<Technisha Circuit> Okay :0
03:55:23FromDiscord<Elegant Beef> If you dont spell it with a Z why even have 26 letters
03:56:00FromDiscord<Technisha Circuit> Because zebra
03:56:05FromDiscord<Technisha Circuit> And xylophone for x
03:56:10FromDiscord<Elegant Beef> Anyway
03:56:14FromDiscord<Technisha Circuit> Hahaha
03:56:19FromDiscord<Elegant Beef> Json isnt the right tool for websites
03:56:36FromDiscord<Technisha Circuit> So would i have to make something that allows me to turn Json to html then?
03:56:40FromDiscord<Elegant Beef> Yes
03:56:42FromDiscord<Elegant Beef> Probably
03:56:44FromDiscord<Technisha Circuit> If so, I'm going to do it
03:56:53FromDiscord<Technisha Circuit> ~~Cool, an original idea-~~
03:56:56FromDiscord<willyboar> Frontend framework
03:57:02FromDiscord<Technisha Circuit> Welp, I'ma work on this now
03:57:03FromDiscord<willyboar> Vue
03:57:18zedeusemerald is broken
03:57:19FromDiscord<Technisha Circuit> What's vue?
03:57:25FromDiscord<Technisha Circuit> Oh
03:57:36zedeusas soon as you start doing slightly complex stuff it breaks
03:57:44zedeususe karax for server-side rendering instead
03:57:51FromDiscord<Technisha Circuit> Big oof
03:57:53FromDiscord<Technisha Circuit> Okay
03:58:41FromDiscord<Elegant Beef> Creating the structure of html inside of json would be hell
03:59:02FromDiscord<Elegant Beef> For readabillity really imo
03:59:13zedeusworking on nitter I tried htmlgen, source code filters, emerald, mustache, and karax, which is what I stuck with as the most flexible and convenient solution
03:59:59FromDiscord<Technisha Circuit> Hahaha
04:00:08FromDiscord<Technisha Circuit> Oh nice
04:00:44FromDiscord<Technisha Circuit> > Creating the structure of html inside of json would be hell↵@Elegant Beef that's why it will be recommended to use yaml or an alternative and them turn that into json to turn into html
04:00:58FromDiscord<Elegant Beef> https://tenor.com/view/why-huh-but-why-gif-13199396
04:01:09FromDiscord<Technisha Circuit> Hahahaha
04:01:12FromDiscord<Technisha Circuit> Because i can uvu
04:01:27FromDiscord<Rika> Being able to is not a good reason
04:01:38FromDiscord<willyboar> I really want to see that beast
04:01:38FromDiscord<Technisha Circuit> But it'll help me learn
04:01:45FromDiscord<Technisha Circuit> So ¯\\_(ツ)\_/¯
04:01:52FromDiscord<Technisha Circuit> > I really want to see that beast↵Wdym?
04:01:57FromDiscord<Elegant Beef> Doing something practical would also help you learn
04:02:15FromDiscord<willyboar> You can contribute to enim
04:02:22FromDiscord<Rika> What's that
04:02:54FromDiscord<Technisha Circuit> ^^
04:03:04FromDiscord<willyboar> https://github.com/liseki/enim
04:03:12FromDiscord<Technisha Circuit> > Doing something practical would also help you learn↵Doing stupid projects are nice imo
04:03:23FromDiscord<willyboar> We talk about it yesterday
04:03:34FromDiscord<Rika> not everyone was here yesterday
04:03:45leorize[m]enim looks like source code filter
04:03:54leorize[m]any advantage over it?
04:04:08FromDiscord<willyboar> Well it is very similar to erb
04:05:48FromDiscord<willyboar> Obvious the syntax is more beginner friendly
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:39*supakeen joined #nim
04:07:26*silvernode joined #nim
04:07:40*dddddd quit (Ping timeout: 256 seconds)
04:08:57FromDiscord<Technisha Circuit> How would i check if a module is already imported?
04:09:14leorize[m]you can't really be certain
04:09:24leorize[m]but why would you need to check for that?
04:09:25zedeusdeclared?
04:09:44leorize[m]yea but that won't work for `import as`
04:09:57zedeusthat's uncommon anyway
04:10:10FromDiscord<Technisha Circuit> I want to be able to check if the user has imported the yaml module for example, so i could make my code automatically load yaml files if the file given is a yaml file
04:10:23leorize[m]don't do it like that
04:10:41FromDiscord<Elegant Beef> `parseYaml` `parseJson` `genHtml`
04:11:28FromDiscord<Technisha Circuit> But I don't want the yaml to be a dependancy
04:11:33FromDiscord<Elegant Beef> Or a genHtml that takes in a string and figures out it internally
04:11:48FromDiscord<Technisha Circuit> Okay :P
04:12:00FromDiscord<Elegant Beef> You want to parse yaml but dont want to depend on the method of parsing yaml?
04:12:08FromDiscord<Technisha Circuit> Wdym?
04:12:23FromDiscord<Elegant Beef> > But I don't want the yaml to be a dependancy
04:12:47FromDiscord<Technisha Circuit> If they don't use any yaml files, i don't want them to install it if it's not needed
04:12:49leorize[m]note that unless you generate the code with a macro in the user module, you can't depend on a module being loaded
04:13:03FromDiscord<Technisha Circuit> Is there a way to add optional dependancies?
04:13:07FromDiscord<willyboar> You can use parsetoml lib.
04:13:14leorize[m]modules are self-contained by default
04:13:15FromDiscord<Elegant Beef> Yes you split the yaml to another part
04:13:17FromDiscord<Technisha Circuit> For toml :P
04:13:23FromDiscord<Technisha Circuit> Okay then, thanks
04:13:29FromDiscord<Technisha Circuit> :P
04:13:41FromDiscord<Elegant Beef> Then if you want the yaml you import that which relies on the other parser
04:13:42FromDiscord<Technisha Circuit> So it'd me `myLib/yaml`? For example
04:13:51FromDiscord<Elegant Beef> yes
04:13:52FromDiscord<Technisha Circuit> (edit) '`myLib/yaml`? For example' => '`myLib/yaml` for example?'
04:13:53FromDiscord<willyboar> They have already transform to json
04:13:55FromDiscord<Technisha Circuit> Cool
04:14:11FromDiscord<Elegant Beef> What's the benefit of using yaml over html?
04:14:35FromDiscord<Technisha Circuit> Some people just might prefer using YAML for html for some insane reason
04:15:17FromDiscord<willyboar> Then just create a yaml syntax dsl lib
04:15:22FromDiscord<Elegant Beef> Some people prefer using nano over an actualy editor
04:15:27FromDiscord<Elegant Beef> actual*
04:15:31FromDiscord<Elegant Beef> Doesnt mean you should encourage it
04:15:52FromDiscord<Technisha Circuit> I prefer nano over an editor sometimes-
04:16:05FromDiscord<Technisha Circuit> Nano is actually quite nice imo
04:16:07FromDiscord<Technisha Circuit> Hahaha
04:16:08FromDiscord<Elegant Beef> Also what's wrong with the
04:16:15FromDiscord<Elegant Beef> !repo nim-html-dsl
04:16:16disbothttps://github.com/juancarlospaco/nim-html-dsl -- 9nim-html-dsl: 11Nim HTML DSL 15 10⭐ 1🍴 7& 1 more...
04:16:17FromDiscord<Elegant Beef> Ah
04:16:44FromDiscord<Technisha Circuit> Ah, that was what i was mentioning
04:16:50FromDiscord<Technisha Circuit> I couldn't remember it ;-;
04:17:04FromDiscord<Technisha Circuit> But now I'm working on json to html soooooo
04:17:07FromDiscord<Rika> hey, its fine to use nano as an editor
04:17:14FromDiscord<Technisha Circuit> ^^^
04:17:14FromDiscord<Rika> like whatever you like
04:17:17FromDiscord<Technisha Circuit> Mhm
04:17:37FromDiscord<Elegant Beef> > Doesnt mean you should encourage it
04:17:46FromDiscord<willyboar> I really want to see this json to jtml stuff
04:17:52FromDiscord<Technisha Circuit> Hahahaha
04:18:00FromDiscord<Rika> i dont see why you shouldnt encourage nano
04:18:00FromDiscord<Technisha Circuit> I'll start implementing it soon
04:18:06FromDiscord<Rika> its an editor, theres no issue with it
04:18:06zedeusnano sucks
04:18:14FromDiscord<Technisha Circuit> Not really
04:18:19zedeusfor one, it fucks up line endings by default
04:18:29zedeushas insane defaults
04:18:30FromDiscord<Technisha Circuit> > i dont see why you shouldnt encourage nano↵Even has syntax highlighting :P
04:18:31FromDiscord<willyboar> Misstyping create a nice name jtml
04:18:43FromDiscord<Technisha Circuit> > for one, it fucks up line endings by default↵This is true :P
04:18:56FromDiscord<Technisha Circuit> > Misstyping create a nice name jtml↵~~Can i use that name?~~
04:19:00FromDiscord<Rika> jtml (json text markup language)
04:19:03FromDiscord<Rika> xd
04:19:06zedeusand that is enough reason to not encourage anyone to use it, especially if they don't know what they're doing
04:19:12FromDiscord<Technisha Circuit> Hahaha
04:19:12FromDiscord<speckledlemon> "it fucks up line endings by default" how so?
04:19:13FromDiscord<willyboar> Yes you can use it
04:19:24FromDiscord<Technisha Circuit> It adds an extra line by default
04:19:30FromDiscord<Technisha Circuit> > Yes you can use it↵Thanks!
04:20:08FromDiscord<speckledlemon> ah, that's not the same thing as messing with CR/LF/etc., but yes it does that
04:22:51FromDiscord<Technisha Circuit> Idek how to change settings in nano haha
04:23:57FromDiscord<Technisha Circuit> Is it possible to check if a module is installed?
04:24:18FromDiscord<Elegant Beef> Why do you care if it's installed?
04:24:35FromDiscord<Elegant Beef> `nimble install` should handle installation
04:24:39FromDiscord<Elegant Beef> of all dependancies
04:24:39FromDiscord<Technisha Circuit> I just found https://github.com/drewlee/JTML-
04:24:49FromDiscord<Technisha Circuit> Because i want to have some modules optional
04:24:56FromDiscord<Technisha Circuit> So if they don't need it it isn't used
04:25:21zedeusyou could do `when compiles(import module)`
04:25:45FromDiscord<Technisha Circuit> Thanks!
04:26:07FromDiscord<Technisha Circuit> How would i catch the import error?
04:26:14FromDiscord<Technisha Circuit> What's the name of the exception
04:26:24FromDiscord<Technisha Circuit> Ik how to handle errors because it's similar to python :p
04:26:30zedeusthat doesn't throw an error
04:26:41FromDiscord<Technisha Circuit> (edit) 'https://github.com/drewlee/JTML-' => 'https://github.com/drewlee/JTML -'
04:26:43zedeusit's a compile-time statement
04:26:50FromDiscord<Technisha Circuit> If the module isn't found?
04:26:51FromDiscord<Rika> just put an else
04:27:03FromDiscord<Technisha Circuit> Okay :P
04:27:04FromDiscord<Rika> when ...: (module imported) else: (not)
04:27:35FromDiscord<Technisha Circuit> I'll just make it a default dependancy because I'm lazy uvu
04:28:03FromDiscord<Technisha Circuit> Also, is it a bad thing that I'm planning on making this available to multiple languages?
04:28:09FromDiscord<Rika> no, why
04:28:21FromDiscord<Technisha Circuit> Good, just checking :P
04:28:27FromDiscord<Technisha Circuit> I'll probably have to use cffi
04:28:42zedeusactually this doesn't work
04:28:58FromDiscord<Technisha Circuit> How about if you spoof the c header?
04:30:00FromDiscord<Technisha Circuit> If that won't work, what other ways could i use?
04:30:08zedeusthe compiles thing won't work
04:30:37leorize[m]spoof the c header?
04:30:50*Hideki joined #nim
04:31:14*Hideki is now known as Guest49947
04:32:35FromDiscord<Technisha Circuit> Oh okay
04:35:35FromDiscord<Rika> how would i go about returning an "immutable view" of a seq
04:36:04zedeusare you using arc?
04:36:15FromDiscord<Rika> no
04:36:21FromDiscord<Rika> i dont want to enforce it either
04:36:40zedeusunenforced immutability sounds a lot like mutability
04:36:41FromDiscord<Technisha Circuit> Would you guys think I'm crazy if i use regex instead of the json module to parse json data?
04:37:09FromDiscord<Rika> @Technisha Circuit yes
04:37:15FromDiscord<Rika> zedeus: i mean enforce arc
04:37:28zedeusif you have to ask questions like that, the answer is yes
04:37:28FromDiscord<Technisha Circuit> Hahaha
04:37:52zedeusyou can use `lent` without enforcing arc, but it won't do anything without it
04:38:00FromDiscord<Rika> darn...
04:38:26FromDiscord<Rika> would a proc named `something[]` have the same "argument properties" as a proc named `[]`
04:38:30zedeusyou could stick it in a ref object with `[]` but no `[]=`
04:38:40zedeusor make a distinct type
04:39:48FromDiscord<Rika> but then it would be convertable no?
04:39:50FromDiscord<Rika> hmm
04:40:12zedeusnot if the field is private
04:40:41zedeuspublic object type with a private field that holds the seq, then a `[]` proc that accesses it
04:40:59FromDiscord<Technisha Circuit> For data that won't be changed after the user provides it, is it better to use let or var?
04:41:15FromDiscord<Elegant Beef> If you need mutabillity use var if you dont use let
04:41:30FromDiscord<Technisha Circuit> Okay
04:41:42FromDiscord<Rika> zedeus: oh, i see
04:41:50FromDiscord<Rika> i was thinking of the distinct type you said
04:42:45FromDiscord<Rika> man i wish there was some sort of borrow except for distinct types no
04:44:20*Guest49947 quit (Remote host closed the connection)
04:44:25FromDiscord<Technisha Circuit> What does `doAssert` do?
04:44:37zedeusconsider reading the manual
04:44:55FromDiscord<Elegant Beef> Nah it doesnt make you consider read the manual
04:45:03FromDiscord<Technisha Circuit> :p
04:45:05FromDiscord<Technisha Circuit> Okay
04:46:24FromDiscord<Rika> why dont you read docs?
04:46:26FromDiscord<Technisha Circuit> That's actually quite simple
04:46:39FromDiscord<Technisha Circuit> I'm starting to read up on docs more :P
04:46:50FromDiscord<Rika> please do it first before you ask 😛
04:47:02FromDiscord<Technisha Circuit> Ok :P
04:48:45FromDiscord<Technisha Circuit> How would i make it so if i use doAssert, it'll just return false instead if raising an assertion error?
04:48:59FromDiscord<Technisha Circuit> Or is it better to handle the error
04:49:14FromDiscord<Technisha Circuit> (edit) 'Or is it better to handle the error ... ' => 'Or is it better to handle the errorinstead of dealing with a boolean'
04:49:38FromDiscord<Rika> what
04:49:54FromDiscord<Rika> i have no clue what you're trying to do
04:51:50FromDiscord<Technisha Circuit> I want to check if a `jsonNode.kind` is a `JArray`
04:52:09FromDiscord<Technisha Circuit> But idk if it's better to handle an error or deal with a boolean in Nim
04:52:18FromDiscord<Technisha Circuit> In python it's better to deal with a boolean
04:52:57FromDiscord<Elegant Beef> I mean you want to tell users that there is an issue
04:53:00*silvernode quit (Ping timeout: 256 seconds)
04:53:29FromDiscord<Elegant Beef> How you handle it doesnt really matter
04:53:36FromDiscord<Technisha Circuit> Okay then
04:53:41FromDiscord<Technisha Circuit> Thanks
04:53:46leorize[m]just raise an exception :P
04:53:47FromGitter<bung87> boolean in loop ,resursive
04:54:25FromGitter<bung87> raise for io things
04:54:49FromDiscord<Technisha Circuit> Okay
04:54:53FromDiscord<Technisha Circuit> Thanks
04:54:56leorize[m]ValueError is a good exception for things like this
04:55:05leorize[m]though it really depends on what kind of work are you doing
04:55:12leorize[m]not everything should be done via exceptions
04:55:33*narimiran joined #nim
04:56:24FromDiscord<Technisha Circuit> Is raising exceptions similar to python? `raise ValueError('String')` in python
04:56:38leorize[m]read the manual please
04:57:01FromDiscord<Technisha Circuit> Okay :P
04:57:45FromDiscord<Technisha Circuit> Nim's method calling syntax is nice
04:58:16FromDiscord<Technisha Circuit> I can either do `foo.bar()` or `bar(foo)`
04:58:20FromDiscord<Technisha Circuit> Which i like
05:01:20FromDiscord<Elegant Beef> Yes the method call syntax is fantastic
05:01:40leorize[m]wait until you found out about command call syntax :P
05:02:19FromDiscord<Elegant Beef> Eh, that's shitty
05:02:54leorize[m]I'd say it's a pretty cool feature
05:03:17FromDiscord<Elegant Beef> I dislike it so i have to disagree
05:03:46FromDiscord<Elegant Beef> for arguementless functions it's fine but when it has arguements i dislike it
05:04:00leorize[m]it's a way
05:04:15leorize[m]it's not like you have to use it all the time lol :p
05:04:22FromDiscord<Elegant Beef> I know
05:04:35leorize[m]I'd say the benefit of having multiple ways to represent your code is that you have better control over how your code should be read
05:05:02FromDiscord<Elegant Beef> Eh, im a tabs man so i dont think you should control how it's read
05:05:46FromDiscord<Elegant Beef> Write clean code, and let the reader read the damn way they want!
05:05:52leorize[m]not sure if I understand :P
05:06:00leorize[m]ah ok
05:06:50skrylar[m]nim doesn't use copying gcs does it :think:
05:07:10leorize[m]copying gc?
05:07:12FromDiscord<Rika> what do you mean
05:07:40skrylar[m]copying gc means it moves/compacts memory
05:07:55skrylar[m]i've seen references to "if you use a pointer it doesn't trace usage" but i've never seen a mention of pin/unpin
05:08:06leorize[m]nah, our gc does the opposite
05:08:10leorize[m]it almost never free memory :P
05:08:19skrylar[m]pff. the incremental one works okay
05:08:19FromDiscord<Rika> im not intelligent enought to understand lmao
05:08:29FromDiscord<Technisha Circuit> > wait until you found out about command call syntax :P↵Wdym?
05:08:39FromDiscord<Elegant Beef> `echo a` vs `echo(a)`
05:08:45FromDiscord<Technisha Circuit> Oh
05:08:49skrylar[m]Rika: well 'tracing gc' means it understands how objects are built and 'traces' references from roots
05:08:54FromDiscord<Elegant Beef> or `object.procName`
05:09:24FromDiscord<Technisha Circuit> I prefer using `echo a` for somethings over`echo(a)`, but it really depends
05:09:28skrylar[m]Rika: but if you allocate an object and it goes to space 3, space 3 is always in use. a copying gc may notice space 3 is used and 1, 2, 4 aren't, and move it to space 1 and move 5 to space 2
05:09:46skrylar[m]this lets you avoid fragmentation because you can copy/compact memory, but it means pointers have to be updated
05:10:03leorize[m]nim gc never do that, don't worry
05:10:03leorize[m]it's dumb anyway
05:10:04*zacharycarter joined #nim
05:10:31skrylar[m]compacters aren't dumb per se... generational compaction can do pretty well
05:10:35skrylar[m]of course not making garbage is always best
05:10:48leorize[m]well and require you to update all references?
05:11:00leorize[m]that sounds like bugs waiting to happen
05:11:10FromDiscord<Elegant Beef> "of course not making garbage is always best", well if you dont want me to make code, just tell me directly
05:11:17skrylar[m]yes those vm's have pin/unpin apis because of this
05:11:34skrylar[m].net has a pin system so if you handed memory to c you have to tell it not to move the pointer
05:12:03leorize[m]yea that's bugs waiting to happen
05:12:21leorize[m]Nim GC can collect chunks of "freed" memory then reuse it for later objects
05:12:25skrylar[m]no more than dealing with gc_ref calls
05:13:05skrylar[m]anyway was mostly explaining it to rika. was just pondering if i can reliably do some pointer trickery
05:17:28*leorize joined #nim
05:18:21FromDiscord<Rika> hey i understand shit wow
05:18:45leorizegive yourself more credit lol
05:18:49FromDiscord<Elegant Beef> One day i hope to understand shit
05:20:58FromDiscord<Rika> leorize: lolno
05:22:05skrylar[m]well right now i use the type trick so you can get_acceptor(mailboxtype, eventtype) and you get a little proc(pointer, pointer); mostly to dodge bloating stuff with tons of single-purpose generics and all that complexity, but i was thinking of changing that to a struct with a custom destructor and then if the mailbox is destroyed it zeroes out the mailbox pointers and event senders can lazily go "oh that receiver is dead,
05:22:05skrylar[m]just kick them off the seq"
05:24:14*zacharycarter quit (Ping timeout: 240 seconds)
05:27:05FromDiscord<Elegant Beef> Wow leorize doesnt say i need to give myself more credit
05:27:06leorizeI've a weird idea for DIY system security on Linux
05:27:07FromDiscord<Elegant Beef> He's a meanie
05:27:08FromDiscord<Elegant Beef> Report!
05:27:18leorizedunno if I should attempt it
05:27:48FromDiscord<Elegant Beef> I mean cutting the ethernet cord isnt ground breaking
05:28:08FromDiscord<Rika> sometimes its ground breaking
05:28:12FromDiscord<Rika> sometimes its wall breaking
05:28:17leorize@Beef well now you know why I didn't say you should give yourself more credit :P
05:28:31FromDiscord<Elegant Beef> I make funny jokes?
05:28:43FromDiscord<Rika> no you just dont deserve it xd
05:29:30FromDiscord<Elegant Beef> Ah
05:29:38FromDiscord<Elegant Beef> So no one likes my jokes got it
05:30:58FromDiscord<Rika> F
05:31:47*rockcavera quit (Remote host closed the connection)
05:32:09FromDiscord<Elegant Beef> Is that my rating or are you paying respects?
05:32:24leorizeyes
05:32:25skrylar[m]both
05:32:59FromDiscord<Elegant Beef> I dont like this community im going to go to rust now, see what you did
05:33:02FromDiscord<Elegant Beef> You lost a numpty
05:33:19FromDiscord<Rika> numPty
05:33:48leorizeI can see that the progress bars are getting into you :P
05:34:38skrylar[m]i went to rust when newruntime was a thing
05:34:41skrylar[m]i came back because oxidized metal is a poor building resource
05:35:29FromDiscord<Rika> leorize: i've been working on them for 4 days now i think
05:37:21FromDiscord<Elegant Beef> Ok im back from my journey, they have this annoying borrow thing and `let mut` for mutable variables
05:37:45skrylar[m]borrow checker is okay. it annoyed me with thinking it was smarter than me though
05:38:21leorizeone day I'll try rust again
05:38:26skrylar[m]i get why it did some of the things it did, like it was theoretically possible for some references to get messed up by procs a proc itself called, but i happened to know that interpreter could not modify its own bytecode so it was just getting it wrong constantly and i had to do a lot of re-fetching of values to satisfy the borrow checker
05:38:53leorizeI tried it when it was alpha, was put off by the syntax
05:39:02skrylar[m]i used it in 0.8 and 1.something
05:39:06FromDiscord<Technisha Circuit> > One day i hope to understand shit↵~~Shit is disgusting~~
05:39:21FromDiscord<Technisha Circuit> :P
05:39:30skrylar[m]it's very much not for gamedev. they consider float code looking awful a "feature"
05:39:38FromDiscord<Elegant Beef> Yea im actually disgusted by the syntax it's like C++ had a baby but did drugs whilst pregnant
05:39:39skrylar[m]and slow compile time is ok because a sufficiently smart compiler will just optimize that away (someday)
05:39:59leorizealso apply to the high memory usage
05:40:20skrylar[m]i had a couple stupid ideas for incremental compilation but meh
05:40:42leorizewell rust memory management works
05:40:48leorizeit's just too much of a hassle to actually use
05:41:05FromDiscord<Rika> we need someone who uses rust to pitch in
05:41:05leorizeeven the rust people have to agree
05:41:30skrylar[m]one was to do a lisp-seque thing of using a mu vm in nim and then treating compiling like building an image, computing a dependency order for modules and then just caching the entire compiler image for each module, so you only had to load an image back to the changed part and redo the rest, but uh
05:41:40skrylar[m]that's probably not simpler than what disrupek is doing :X
05:42:05FromDiscord<Rika> i think its actually similar to what disruptek is doing
05:42:18skrylar[m]ey's doing something about caching individual mutations to a module
05:42:22skrylar[m]memoizing changes
05:42:56leorizedid matrix broke the irc bridge?
05:43:02FromDiscord<Rika> ?
05:43:03FromDiscord<Technisha Circuit> Is the braces skin for nim still a thing and is it safe to use in my projects now?
05:43:04FromDiscord<Rika> what happened?
05:43:06leorizelooks like your message was cut of
05:43:13FromDiscord<Rika> @Technisha Circuit dont think so
05:43:20FromDiscord<Technisha Circuit> Aw
05:43:27leorizesyntax skins are dead long ago
05:43:35FromDiscord<Technisha Circuit> Oh okay
05:43:46FromDiscord<Rika> it's just too much of a hassle to do i assume
05:43:49FromDiscord<Rika> and infe
05:43:51FromDiscord<Technisha Circuit> So has anyone reimplemented something like this?
05:43:51FromDiscord<Rika> (edit) 'infe' => 'infer'
05:43:56FromDiscord<Yardanico> No
05:44:09FromDiscord<Yardanico> Good morning
05:44:09leorizewe really just removed it do prevent dialects iirc :P
05:44:12FromDiscord<Technisha Circuit> https://forum.nim-lang.org/t/2811 and i agree with this old post
05:44:14leorizethe code was working pretty find
05:44:16FromDiscord<Technisha Circuit> Good morning
05:44:16leorizefine*
05:44:20FromDiscord<Rika> i'm surprised that you asked, given that you always ask stuff about nim and python things
05:44:22FromDiscord<FromIRC> Uptime - 1 day, 13 hours, 6 minutes, 53 seconds, 253 milliseconds, 687 microseconds, and 319 nanoseconds
05:44:22FromDiscord<Yardanico> !status
05:44:25leorizemorning @Yardanico
05:44:34FromDiscord<Technisha Circuit> I prefer braces :P
05:44:54leorizebraces are evil and I don't miss them :P
05:45:16FromDiscord<Technisha Circuit> I just like braces in general ;-;
05:45:27FromDiscord<Technisha Circuit> So is it possible to implement?
05:45:32leorizeI find looking at the indent guide to tell me where my scope end is easier than looking for the opposite brace
05:45:33FromDiscord<Rika> why not
05:45:35FromDiscord<Rika> it was done before
05:45:55FromDiscord<Yardanico> @Technisha Circuit it is possible because it was there already
05:45:59FromDiscord<Technisha Circuit> Hmm, would a Nim beginner be able to implement it?
05:46:03FromDiscord<Technisha Circuit> Oh okay
05:46:07FromDiscord<Rika> no
05:46:13FromDiscord<Technisha Circuit> ~~Could i just reuse some old code?~~
05:46:15skrylar[m]i guess you could use this to get a bracey nim https://nim-lang.org/docs/filters.html
05:46:15FromDiscord<Yardanico> But it requires more maintenance and you need to update one more syntax
05:46:15FromDiscord<Technisha Circuit> Oof okay
05:46:21FromDiscord<Rika> maybe someone as good as disrup can do it
05:46:40leorizeyou can implement it back again, it's just a pita to actually do so
05:46:46leorizeesp after the compiler rework
05:46:58FromDiscord<Technisha Circuit> Big oof
05:47:00FromDiscord<Yardanico> Also you'll have to somehow convince people to merge your PR so that if you write code with braces others can use it
05:47:17skrylar[m]~~go back to c~~
05:47:23FromDiscord<Technisha Circuit> I don't know C
05:47:29leorizethen learn it :p
05:47:42FromDiscord<Technisha Circuit> It's just that after language hopping for a while I've learned to like braces
05:47:43skrylar[m]just being facetious nobody should have to suffer c/c++
05:48:05FromDiscord<Technisha Circuit> But I still love Python's syntax which is why i love Nim
05:48:16FromDiscord<Technisha Circuit> Only thing i wish for is for it to have braces ;-;
05:48:22skrylar[m]i liked it because it was pascal-ish back in the day. and it sucks the least
05:48:37FromDiscord<Technisha Circuit> Also, doesn't Python have a feature to use 'skins'?
05:48:43*m|b_ joined #nim
05:49:00leorizeskrylar[m]: that's mine too
05:49:11leorizeI considered ada at one point but it's too verbose
05:49:11skrylar[m]leorize: hooray for being the least bad \o/
05:49:14FromDiscord<Yardanico> @Technisha Circuit I don't think so
05:49:30FromDiscord<Technisha Circuit> Because there's https://github.com/NeKitDS/braces.py
05:49:37FromDiscord<Yardanico> Well technically there's a way but it's so ugly
05:49:41FromDiscord<Yardanico> And it's runtime
05:49:45FromDiscord<Technisha Circuit> You just do `#coding: braces`
05:49:56FromDiscord<Technisha Circuit> (edit) 'You just do `#coding: braces` ... ' => 'You just do `#coding: braces`at the start of the file'
05:49:58FromDiscord<Technisha Circuit> Oh okay
05:50:02FromDiscord<Elegant Beef> The only thing i want from any other language syntax is tab support
05:50:12FromDiscord<Technisha Circuit> No thanks-
05:50:13leorizeyou can have tab support
05:50:17FromDiscord<Technisha Circuit> I hate tabs now-
05:50:18FromDiscord<Yardanico> @Technisha Circuit yeah they abused source file encoding
05:50:19FromDiscord<Elegant Beef> Im fine with nim syntax but give me seemless tab support!
05:50:25FromDiscord<Technisha Circuit> Okay :P
05:50:32FromDiscord<Yardanico> It's done at runtime
05:50:41leorize@Beef you can with just a small header
05:50:44skrylar[m]~~the only faceplate you should use is hy~~
05:50:45FromDiscord<Technisha Circuit> ~~Just turn all tabs to spaces~~
05:50:53leorizedisruptek actually use tabs fwiw :P
05:50:54FromDiscord<Rika> ah man
05:51:00FromDiscord<Rika> you shouldnt have started this nisha
05:51:06FromDiscord<Technisha Circuit> Hahaha
05:51:14FromDiscord<Elegant Beef> I mean tabs are empirically the better option
05:51:20FromDiscord<Yardanico> @leorize good joke :P
05:51:38FromDiscord<Technisha Circuit> > I mean tabs are empirically the better option↵That's debatable
05:51:39leorizenot a joke, he actually started out writing Nim with tabs
05:51:39FromDiscord<Yardanico> @Elegant Beef your editor already adds spaces when you press Tab
05:51:41FromDiscord<Rika> tell me when all programs have tab sizing support natively
05:51:49skrylar[m]i also wrote nim with tabs '_'
05:51:53FromDiscord<Technisha Circuit> Hahaha
05:52:00skrylar[m]i actually use a lot of the things araq ultimately toasted
05:52:07skrylar[m]which is why i've also ragequit several times
05:52:12FromDiscord<Technisha Circuit> Oof
05:52:17FromDiscord<Rika> what things?
05:52:19FromDiscord<Elegant Beef> @Yardanico oh yes these weird 4 spaces that are stuck at 4 spaces, and i have to change the entire indentation to change how it renderes!
05:52:23FromDiscord<Elegant Beef> renders*
05:52:37FromDiscord<Technisha Circuit> Just do 2 spaces
05:52:45skrylar[m]thread safety on the mailboxes is.. i dunno. after i put in the weakref part it's good enough for me for now. maybe someone else will like it
05:52:52FromDiscord<Elegant Beef> Do 2 spaces
05:52:53FromDiscord<Technisha Circuit> I wonder if it's possible to do 0 width indentation in Nim-
05:52:57FromDiscord<Elegant Beef> Im an 8 tspace tabber
05:53:01skrylar[m]i looked at hazard pointers
05:53:01FromDiscord<Elegant Beef> 8 space *
05:53:02FromDiscord<Technisha Circuit> Oof
05:53:11FromDiscord<Elegant Beef> I like my big ol' tabs
05:53:12FromDiscord<Technisha Circuit> (edit) '0 width' => '0-width'
05:53:12FromDiscord<Yardanico> @Technisha Circuit how that would work?
05:53:28leorizeit's easy to mistake tabs-resizability with actual practical usage
05:53:29FromDiscord<Technisha Circuit> No idea, probably use a character that doesn't render ¯\\_(ツ)\_/¯
05:53:33FromDiscord<Yardanico> Ah well, if you use some unicode character, then maybe
05:53:38FromDiscord<Yardanico> It's already possible
05:53:45FromDiscord<Yardanico> Just use a source code filter
05:53:47FromDiscord<Rika> zero width space
05:53:52FromDiscord<Rika> they deffo exist
05:53:53FromDiscord<Yardanico> To replace some invisible character with space
05:53:53FromDiscord<Technisha Circuit>
05:53:55FromDiscord<Technisha Circuit> This
05:54:00leorizein fact, you're kinda forced to use one tab size for the whole project once you use tab
05:54:07FromDiscord<Technisha Circuit> Oh? How would i do this?
05:54:08leorizeso no better than actually using spaces
05:54:20FromDiscord<Yardanico> https://nim-lang.org/docs/filters.html
05:54:34leorizethe only thing I like about tabs is elastic tabstops
05:54:38FromDiscord<Rika> just regex all zero widths into actual spaces 😛
05:54:38leorizebut that never took off
05:54:39FromDiscord<Yardanico> Specifically https://nim-lang.org/docs/filters.html#available-filters-replace-filter
05:54:39FromDiscord<Elegant Beef> What are you on about leo?
05:54:51FromDiscord<Elegant Beef> You're forced to use one tab size?
05:55:06FromDiscord<Elegant Beef> a tab is a tab
05:55:09leorizeyep, once you change the size everything stops aligning
05:55:14FromDiscord<Elegant Beef> You can change the way it renders to be the way you prefer
05:55:17FromDiscord<Elegant Beef> Who cares about alignment
05:55:18leorizefor a tab-only flow that is
05:55:31FromDiscord<Rika> sometimes i want my damn comments to align tho
05:55:39FromDiscord<Technisha Circuit> Thanks!
05:55:39FromDiscord<Elegant Beef> Well have fun
05:56:03FromDiscord<Rika> leorize: same here regards the elastic tabstops
05:56:13FromDiscord<Rika> those looked interesting
05:56:22FromDiscord<Rika> until i read that they charged for the plugins...
05:57:08leorizeit never got implemented for vim
05:57:31leorizeI actually tested it with sublime once, pretty cool
05:57:47leorizebut eventually none of my tools support it so I have to drop it
06:03:17FromDiscord<Technisha Circuit> sent a code paste, see http://ix.io/2mi4
06:04:12FromDiscord<Technisha Circuit> I'm getting ```/data/data/com.termux/files/home/nim_stuff/zero-width-indent/main.nim(1, 22) Error: missing closing ' for character literal```
06:04:17FromDiscord<Technisha Circuit> And I don't understand ;-;
06:04:36leorizeuse double quotes
06:04:43leorizemost UTF-8 stuff are multibyte
06:04:55leorizeyou can't store them in a char
06:05:32FromDiscord<Technisha Circuit> ```/data/data/com.termux/files/home/nim_stuff/zero-width-indent/main.nim(1, 8) Error: 'stdtmpl(subsChar = "‎", metaChar = " ")' not allowed here```
06:05:52FromDiscord<Rika> what the fuck
06:06:03FromDiscord<Rika> why are there so many people programming on their phones
06:06:15FromDiscord<Technisha Circuit> Because i cannot access my PC rn
06:06:18FromDiscord<Rika> ah
06:06:21FromDiscord<Rika> i guess thats valid
06:06:27FromDiscord<Technisha Circuit> And i didn't have a PC a while aho
06:06:27FromDiscord<Rika> man it must be hell then
06:06:56FromDiscord<Technisha Circuit> Actually i used to be able to use a normal Mobile text editor eith shitty text wrapping quite well
06:07:08FromDiscord<Technisha Circuit> Using a PC with vsc has spoiled me
06:07:14FromDiscord<Rika> still sounds absolutely hellish to me
06:07:16FromDiscord<Technisha Circuit> It's harder now
06:07:36FromDiscord<Rika> also that error gives no context on how it's not allowed there LMAO
06:07:36FromDiscord<Technisha Circuit> There are things like QuickEdit for mobile
06:07:49FromDiscord<Technisha Circuit> But i prefer nano :P
06:07:51FromDiscord<Technisha Circuit> Yeah
06:07:57FromDiscord<Technisha Circuit> I'm stumped ;-;
06:08:25leorizeuse neovim lol
06:08:41FromDiscord<Rika> use replace
06:08:59FromDiscord<Technisha Circuit> Using `sub` and `by`?
06:09:00leorizeyour Nim installation should contain nimsuggest
06:09:11FromDiscord<Technisha Circuit> What's that? :P
06:09:18leorizethat means you can use nim.nvim and get supreme code editing experience on android
06:09:32leorize(yes I already verified that nim.nvim run on android)
06:09:46FromDiscord<Technisha Circuit> Oh nice
06:09:49FromDiscord<Rika> `#? replace(sub = "‎", by = " ")` i think works
06:09:54FromDiscord<Technisha Circuit> Thanks
06:10:04FromDiscord<Technisha Circuit> Also, what's neovim?
06:10:18leorize@Rika that would mean they can never use that string in a string literal
06:10:32FromDiscord<Rika> leorize: what?
06:10:43FromDiscord<Technisha Circuit> I can't use it in a string without it getting replaced
06:10:50FromDiscord<Technisha Circuit> That's what he means
06:10:53FromDiscord<Technisha Circuit> Or she
06:10:55FromDiscord<Technisha Circuit> Or they
06:11:06FromDiscord<Rika> when the fuck are you gonna use a 0-width space tho
06:11:16FromDiscord<Rika> other than your crazy indent idea
06:11:27*solitudesf- joined #nim
06:11:38FromDiscord<Technisha Circuit> Hahaha
06:12:15leorizeI'm sorry, I prefer my solutions to be foolproof :P
06:12:28FromDiscord<Rika> then how else would you do that 😛
06:13:40*nekits quit (Quit: The Lounge - https://thelounge.chat)
06:14:29FromDiscord<Technisha Circuit> Omfg it works hahaha
06:14:38FromDiscord<Technisha Circuit> Maybe regex?
06:14:48FromDiscord<Rika> theres no regex filter
06:14:53FromDiscord<Technisha Circuit> Oh
06:14:55FromDiscord<Technisha Circuit> :/
06:14:57caffHmmm, so I've run into an issue using `removePrefix` on a split string.
06:15:00caffhttps://play.nim-lang.org/#ix=2mi8
06:15:06*nekits joined #nim
06:15:09caff"Error: expression 'removePrefix(test[0], "!")' has no type (or is ambiguous)"
06:15:20caffUnfortunately I'm a bit stumped here :/
06:15:53FromGitter<bung87> discard it
06:15:59FromDiscord<Rika> removePrefix doesnt return anything
06:16:05caffOH
06:16:06FromDiscord<Rika> it's inplace
06:16:17FromDiscord<Rika> so it modifies the given string
06:16:32caffThanks :facepalm: Probably should've looked at the docs a bit closer.
06:16:33leorizeuse `sugar.dup` if you want outplace
06:16:36FromGitter<bung87> mutate action have no returns
06:16:55FromGitter<bung87> and no returns.
06:17:08FromDiscord<Rika> caff, note that what leorize gave you only works in nim 1.2
06:17:16*nekits quit (Client Quit)
06:17:29caffPerfect. Thanks. I'll have to look at that. I am using nim 1.2 :)
06:18:16leorizeeveryone should use nim 1.2 :P
06:20:39*nekits joined #nim
06:23:34FromDiscord<Rika> leorize: i agree but i'm just ensuring that its what they need
06:24:43caffI'm all to familiar with the pain of something that perfectly fits what I need being just a version or five out of reach :P
06:40:44*nsf joined #nim
06:42:53*aeverr joined #nim
06:44:45*aeverr is now known as Rika
06:44:54*Rika is now known as aeverr
06:48:21*Hideki joined #nim
06:48:45*Hideki is now known as Guest23990
06:48:56*Guest23990 quit (Remote host closed the connection)
07:07:40*Hideki joined #nim
07:08:03*Hideki is now known as Guest39498
07:18:19*Guest39498 quit (Remote host closed the connection)
07:29:37*narimiran quit (Ping timeout: 258 seconds)
07:38:22FromDiscord<Technisha Circuit> ~~Json text markup language~~
07:38:57FromDiscord<Rika> ugh
07:39:06FromDiscord<Rika> i think i'm scrapping this callback branch idea thing
07:39:16FromDiscord<Rika> callback -> closure
07:40:09FromDiscord<Technisha Circuit> Oof
07:41:13FromDiscord<Rika> yeah its a lot of work down the drain since i realized it was a really dumb idea
07:42:04leorize@Rika: uhmm, add `{.nimcall.}` on it and it won't be closure?
07:43:08FromDiscord<Rika> leorize: not that
07:43:14FromDiscord<Rika> it's an idea i cant express
07:43:17FromDiscord<Rika> well in words
07:43:29FromDiscord<Rika> basically i was thinking of making the progress bar output closures
07:43:48FromDiscord<Rika> something like how `streams` was implemented
07:43:53leorizehave you read about CPS?
07:44:01leorizecontinuation passing style?
07:44:06FromDiscord<Rika> no
07:45:07leorize[m]http://www.pathsensitive.com/2019/07/the-best-refactoring-youve-never-heard.html
07:45:30leorize[m]https://arxiv.org/pdf/1011.4558.pdf
07:45:37leorize[m]dunno if any of this would apply to what you're doing
07:50:28FromDiscord<Rika> ooh, shiny
07:51:22FromDiscord<Rika> HOLY WOW
07:51:25FromDiscord<Rika> thats big brain
07:52:12leorizeif everything went well, what you're seeing might be the future of Nim async
07:52:22FromDiscord<Rika> this is useful for another project i'm undertaking
07:53:56FromDiscord<Rika> okay the refactoring post is so long that i cant read it in full right now
07:56:11leorizehow can people finish their projects :P
08:01:11FromDiscord<Elegant Beef> They dont they abandon it for project #n+1
08:01:49*letto quit (Quit: Konversation terminated!)
08:02:36*letto joined #nim
08:03:00*Hideki joined #nim
08:03:24*Hideki is now known as Guest24996
08:05:36*Guest24996 quit (Remote host closed the connection)
08:06:41FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> leorize: It's a struggle, that's for sure
08:07:06FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> I think part of it is about forcing focus, at least it has been for me with the AMQP library
08:07:51FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> I want to port my C++ game engine to Nim, but I also want to write some automation stuff around that too, and I like using message queues for that (ala AMQP), so I need this library at MVP at least
08:09:03leorizeI'm struggling to not write yet-another-library atm
08:09:40FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Yeah I know those feels
08:11:13Prestigehow am I even seeing your name rendered like that lol
08:11:37FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> No idea if it will help, but I've been focusing on the fact that this library will add to the Nim ecosystem (something we need) and maybe bring more systems-related traffic to Nim. Maybe looking at whatever library you're trying to finish in the same light would help?
08:13:04leorizePrestige: it's UTF-8
08:13:07YardanicoPrestige: letters in that nickname are from "Mathematical Bold Script"
08:13:16Yardanicowhich is a part of of utf-8 of course :)
08:13:28leorizeBenumbed: I'm working on a new implementation of osproc
08:13:31Yardanico"Mathematical Alphanumeric Symbols, U+1D400 - U+1D7FF"
08:13:32leorizenew API, new everything
08:13:50Yardanicobtw rlwrap for nim secret works just fine
08:13:57leorizeasync support + proper pipes + sane interface that's simple and can be advanced if needed
08:14:34Prestigeinteresting
08:14:51FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> That sounds rather valuable 🙂
08:15:16leorizecurrently for pipes I'd appreciate a library that let me do buffering
08:15:22leorize(ie. just provide the buffering part)
08:15:35leorizepreferably threadsafe
08:15:59leorizeI also need a way to return buffers asynchronously (ie. return a buffer and the reader be notified on new data)
08:16:16leorizechronos asyncbuffers looks interesting but I haven't actually read the code
08:16:28FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Callbacks! *ducks and runs*
08:16:34supakeenleorize: Are you making the poEvalCommand more sane as well?
08:17:11FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> I'm actually interested in osproc and the threading stuff in Nim for AMQP consumers
08:17:16leorizewell I'm not sure how saner can it be other that I'm providing a way to specify arguments and have them escaped automatically
08:17:31FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> The threading interface didn't strike me as very pleasant last time I looked at it though :/
08:17:51leorizethe threading is still a mess atm
08:17:55leorizeARC will clean it up
08:18:10FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> That's one thing I liked about Go (one of the few things)
08:18:48Yardanicodid you see weave btw?
08:18:50supakeenAs in, separate from the args array which is just passed to execve?
08:18:55Yardanicoand yeah, arc/orc has shared heap
08:19:24leorizesupakeen: huh? poEvalCommand is "call using shell"
08:19:50leorizeso basically I'm doing what quoteShellCommand() would do for you
08:20:02supakeenleorize: Correct, but I was wondering where you are going to fit that in the API.
08:20:19leorize(and will also leave the option of not quoting available if you want that)
08:20:34leorizewell new api :p
08:20:45supakeenBecause quoting shell commands is very hard and dependent on what /bin/sh is etc.
08:20:56leorizeI do what posix sh do :)
08:21:03leorizeI don't guess, it's not portable that way
08:21:06supakeenSo as long as it's clear that it's best effort and explicit.
08:21:26*Serenitor joined #nim
08:21:26*Serenitor quit (Remote host closed the connection)
08:22:03leorizeI'm currently designing a DSL for launching stuff
08:22:15leorizemainly because a proc call won't get this done :P
08:22:26leorizethough I might change my mind
08:22:30leorizenow that I've seen Go's API
08:22:31supakeenCan I maybe take a look when you have some stuff? I care a lot about spawning processes for some reason.
08:22:59leorizesure, once I got the API done
08:23:20supakeenNice, thanks. You can keep a pre-exec in mind as well which some APIs offer.
08:23:49leorizeI go deeper, I'll let you in on fork() :)
08:23:58supakeenAh nice.
08:24:14supakeenAlso posix_spawn because I believe that's what's currently used on systems that have it?
08:24:30leorizeI'm also researching ways to safely utilize vfork() where it's actually save resources
08:24:45leorizeposix_spawn is a mess tbh
08:25:06FromDiscord<mratsim> I really think I should look into multithreading for IO tasks
08:25:27FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Why would you multi-thread IO tasks rather than using async?
08:25:32supakeenAnyways it's shower and lunch time for me! We can discuss later if you're up for it.
08:25:32leorizedepends on the os, but usually it's slower than async
08:25:36leorizeI'd prefer combining both
08:26:02FromDiscord<mratsim> and put in bold:↵- Multithreading for IO tasks means efficiently have threads do nothing and wait↵- Multithreading for CPU tasks means efficiently do something and work
08:27:14leorizein a perfect world we can just multithread all of our IO
08:27:22FromDiscord<mratsim> @𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭 I don't know, but I don't mind looking into that
08:27:29FromDiscord<mratsim> apparently it works for Rust
08:27:32leorizetoo bad we are in one where that actually harm your performance
08:27:48leorize(yes I wrote a simple benchmark to verify that)
08:27:58*m|b_ quit (Quit: Connection closed for inactivity)
08:28:24FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> In general, my experience has been, if your 'wait' is iowait, the best 'solution' is async
08:28:32FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> best being most efficient
08:29:27FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Now, that being said, if you have a metric ton of IO, doing what leorize is talking about and having multiple threads running async would be in order
08:29:59FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> although I'm more of a multi-process person myself, shared memory models make me twitchy 😄
08:30:31FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Which is where I grow interested in the work on pipes
08:30:38Yardanicowell sometimes you have to do some cpu-heavy tasks in async so async + threads is really good for that :)
08:30:43Yardanicoor if you want to use async in a GUI app for example
08:30:58Yardanicowithout implementing your own asyncv GUI framework from scratch
08:31:24*konvertex joined #nim
08:31:43FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Wouldn't you want a thread-pool for the CPU-heavy stuff and then just fire jobs off to it from the async loop?
08:31:56FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> or is that what you're talking about?
08:32:06FromDiscord<Technisha Circuit> Is there a websocket server library for Nim?
08:32:08Yardanicoyes
08:32:11Yardanicothere are multiple in fact
08:32:12leorize!repo websockets
08:32:13Yardanico!repo ws
08:32:15disbothttps://github.com/niv/websocket.nim -- 9websocket.nim: 11websockets for nim 15 82⭐ 25🍴 7& 7 more...
08:32:16disbothttps://github.com/treeform/ws -- 9ws: 11Simple WebSocket library for nim. 15 78⭐ 8🍴 7& 4 more...
08:32:29Yardanicoxd
08:32:40FromDiscord<Technisha Circuit> Thanks!
08:42:54FromDiscord<wiremoons> Added a new Nim related post to my blog covering installing Nim on a Raspberry Pi 4B: https://www.wiremoons.com/development/rpi/nim/install/2020/05/16/Nim-on-a-Raspberry-Pi.html
08:43:48Yardanico@wiremoons that's a cool blog post, but if you don't want to compile you can always download a precompiled release :)
08:44:32FromDiscord<wiremoons> For the Raspberry Pi ARM processor?
08:44:40Yardanicoyes
08:44:40leorizeyes, we just don't advertise them
08:44:52Yardanicohttps://github.com/nim-lang/nightlies/releases/tag/2020-05-15-version-1-2-d2d401c
08:44:56leorizeactually debian should have it packaged, courtesy of federico3
08:45:08leorizemake sure you have backports on and you should have the latest nim
08:45:24Yardanico@wiremoons on that link you can find arm64/armv6/armv7/armv7a
08:46:40FromDiscord<wiremoons> Thanks @Yardanico - will add that to the post too
08:47:15Yardanicodon't add that exact link, just https://github.com/nim-lang/nightlies/releases
08:47:19leorizeiirc choosenim can do this too
08:47:40FromDiscord<Technisha Circuit> If i use a library from Python using Nimpy, do i get linited heavily in terms of speed because of Python,m
08:47:46FromDiscord<Technisha Circuit> (edit) 'Python,m' => 'Python?'
08:47:57FromDiscord<Rika> vs pure nim? yes
08:47:59FromDiscord<wiremoons> The Raspbain included version is quite out of date @leorize
08:48:02FromDiscord<Technisha Circuit> Oof
08:48:02FromDiscord<Rika> ffi still costs something
08:48:13Yardanico@Technisha yes, sinec on top of just Python speed you also need to interface with it
08:48:20Yardanicoso the speed will be a bit lower maybe
08:48:27FromDiscord<Technisha Circuit> Big oof
08:48:29leorizewiremoons: ah yea raspbain don't backports from debian
08:48:39FromDiscord<Technisha Circuit> How about if i compile the Python module?
08:48:45FromDiscord<Technisha Circuit> Would that speed it up a bit?
08:48:57leorizeif you can compile python to get speed boost everyone would have done that :P
08:49:05FromDiscord<wiremoons> Yes is a shame @leorize as that would be the quickest option otherwise!
08:49:06FromDiscord<Technisha Circuit> You can
08:49:09FromDiscord<Technisha Circuit> Cython
08:49:21FromDiscord<Technisha Circuit> https://cython.org/
08:49:23Yardanicothat's not python
08:49:25leorizeI said "to get speed bost"
08:49:27leorizeboost*
08:49:38leorizeyou can compile python however you want and it won't get faster
08:49:41FromDiscord<Technisha Circuit> Yeah that turns the code to C or C++
08:49:46Yardanico it's still the same speed
08:49:48leorizethe language semantics doomed itself to being slow
08:49:50Yardanicobecause it'll call python APIs
08:49:52YardanicoCPython*
08:50:06Yardanicowell, it actually works with pypy but cffi is a much better option for C interop there
08:50:17FromDiscord<Technisha Circuit> And you can use cpdef to define variables in C with a type to speed it up
08:50:20FromDiscord<Technisha Circuit> Okay then :P
08:50:25Yardanicoyes but that's not python then @Technisha
08:50:27Yardanicothat's cython
08:50:58leorizeisn't there some actual python -> native compiler announced on HN?
08:51:06FromDiscord<Technisha Circuit> Really?
08:51:29Yardanicoleorize: I don't think there is
08:51:34Yardanicowell there's Nuitka but it's a bit similar to Cython
08:51:48Yardanicoit'll compile your Python code into a binary, but that binary will just have calls to python C API instead of python code
08:51:54FromDiscord<Technisha Circuit> Yeah except for no extra syntax iirc
08:52:19Yardanicowdym?
08:52:21Yardanico"Well milestone 1, feature parity has been reached for Python 2.6, 2.7, and 3.x up to 3.8 was mastered. There is no way, this could be any better, but with every new Python release, there is a lot of new things to add."
08:52:58FromGitter<bung87> with typed python source could be not hard
08:53:04FromDiscord<Technisha Circuit> Wdym?
08:53:27Yardanico@bung87 the problem is that Python by nature is not typed
08:53:40Yardanicoduck typing can't go away with optional type annotations which are not enforced
08:54:07FromGitter<bung87> so in the end it will using python c api?
08:55:43FromGitter<bung87> ok, dynamic script language getting popular then they get typed..
08:56:04leorizeturns out people wanted typed languages :P
09:00:26FromGitter<bung87> something like developing then governance environment
09:02:23leorizeI think it was just that typed language wasn't as developed as they are nowadays
09:02:33leorizenow we have type inferrence, generics, etc.
09:04:05FromGitter<bung87> yeah, that's part of the reasons.
09:04:37FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Re: Cython, Cython is a hybrid language Technisha
09:04:54FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> You need to know how to write in Python, Cython and interface Cython with your target language
09:05:06FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> I use Cython as the glue between my C++ game engine and the Python scripting layer
09:05:29FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> It's very cool, but can have a steep learning curve if you're just looking to get shit done
09:07:02FromDiscord<Technisha Circuit> Nice
09:07:06FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> There are things that will wrap your Python into an executable, but last I knew, there isn't a compiler for Python
09:07:21FromDiscord<Technisha Circuit> I wish there was tbh
09:07:24FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> There are several fundamentally hard problems around 'compiling' Python
09:07:30FromDiscord<Technisha Circuit> Oh?
09:08:05FromDiscord<𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Yeah, and as much as I'd love to get into all that, I really need to go to bed
09:08:20FromDiscord<Technisha Circuit> Okay, goodnight!
09:08:49FromDiscord<Rika> first thing is the dynamic typing i bet
09:08:55leorizenope
09:09:10leorizejulia already did it, dynamic typing but compiled
09:09:40FromDiscord<Technisha Circuit> Mhm
09:10:11leorizethough if you try hard enough, you can compile anything to native
09:11:29Yardanicoyeah, but as always native doesn't neccesarily mean fast :P
09:12:33*Trustable joined #nim
09:28:25leorize[m]@mratsim you might be interested in this CI pipeline I wrote for fusion: https://github.com/nim-lang/fusion/blob/master/.github/workflows/ci.yml
09:30:10leorize[m]the matrix is flexible and github actions features 20 free concurrent tasks, which might help with the CI performance for weave
09:49:59FromDiscord<Recruit_main707> Is strip an expensive function?
09:54:58Yardanicodepends on what you mean
09:55:17Yardanicoyou can check the source - it's relatively simple https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/strutils.nim#L2756
09:57:15*Hideki joined #nim
09:57:39*Hideki is now known as Guest84902
09:59:21FromDiscord<Recruit_main707> Let’s say I send information separated by commas, would msg.strip(“,”) be very time consuming?
09:59:36Yardanicouhh, you mean split not strip?
09:59:52FromDiscord<Recruit_main707> Yes, sorry 😅
10:00:08Yardanicowell split is fine in most cases, but if the number of arguments you need to parse is always the same you can use strscans
10:00:09dom96Why commas?
10:00:32FromDiscord<Recruit_main707> Why not ¯\_(ツ)_/¯
10:00:47dom96because you might as well send JSON instead of writing a custom parser
10:00:55dom96the performance will not be much different
10:01:47FromDiscord<Recruit_main707> i need every single bit of performance I can achieve, I am not expecting it to go way faster, but if I can get a few more tps it will be nice
10:02:03*Guest84902 quit (Remote host closed the connection)
10:02:04Yardanicothen don't do it as text, send it as a binary?
10:02:08Yardanicomsgpack, etc
10:02:46FromGitter<bung87> it's about the string length, and memory copy.
10:02:49FromDiscord<Recruit_main707> I still have to do some research in how to do it
10:03:15FromDiscord<Recruit_main707> I’ll have a look at msgpack
10:04:05Yardanicohttps://github.com/jangko/msgpack4nim
10:12:25dom96What are you working on?
10:13:48FromDiscord<Recruit_main707> On an RLBot <-> python <-> Nim bridge
10:14:55dom96for the chat in rocket league?
10:15:16Yardanicodom96: RLBot is for actual RL bots
10:15:24FromDiscord<Recruit_main707> Ye
10:15:25Yardaniconot chat bots, but bots who play :P
10:15:58dom96yes, I know
10:16:08dom96You shouldn't assume I don't know things :P
10:16:12Yardanico@Recruit why do you need python though?
10:16:22YardanicoRLBot has C++ and Rust versions, so a Nim version should be possible, no?
10:16:25dom96I am wondering whether Recruit wants to bridge debug messages or just chat messages
10:16:46FromDiscord<Recruit_main707> I want to bridge the game information
10:17:02FromDiscord<Recruit_main707> And then the Nim part sends game inputs back
10:17:07FromDiscord<Recruit_main707> That’s why performance is key, hopefully getting a few tps by using msgpack
10:17:21dom96ahh, you want to pass the game info data from Python to Nim and vice versa
10:17:27FromDiscord<Recruit_main707> And hoping the Nim part is always really fast
10:17:32Yardanicowhy not try nimpy btw?
10:17:35dom96I think wrapping the C++ bot framework would work better
10:17:58dom96if you're working around that with msgpack then that's a bad idea
10:17:59FromDiscord<mratsim> > Is strip an expensive function?↵@Recruit_main707 it allocates, it's expensive 😛
10:18:00FromDiscord<Recruit_main707> I thought about it, but the c++ framework is a bit messy
10:18:17FromDiscord<Recruit_main707> And they use flatbuffers
10:18:18FromDiscord<mratsim> > @mratsim you might be interested in this CI pipeline I wrote for fusion: https://github.com/nim-lang/fusion/blob/master/.github/workflows/ci.yml↵@leorize[Matrix]#0000 Interesting, how is your experience with Github Actions?
10:18:30FromDiscord<Recruit_main707> That’s the main reason I am using the bridge
10:19:19*dddddd joined #nim
10:19:22dom96if you're passing data through python then you're already going to get poor performance
10:19:27dom96at that point, why not just use Python?
10:19:39FromDiscord<Recruit_main707> Because Nim :)
10:20:25FromDiscord<mratsim> is multiline IRC<->Discord fixed?
10:20:32FromDiscord<Recruit_main707> Sockets will become part of the framework officially “soon” also, so hopefully my pain will end eventually
10:20:44Yardanico@mratsim yes :P
10:21:34FromDiscord<mratsim> sent a long message, see http://ix.io/2mj8
10:22:12dom96Yardanico, you should advertise your bot
10:22:18FromDiscord<Recruit_main707> And if everything else fails, my flatbuffers implementation is alsmost finished, I would only need to transpile the framework
10:22:23dom96it's really great and it would be awesome to get more users/contributors
10:22:36FromDiscord<mratsim> "transpile" is a banned keyword in there 😉
10:23:15FromDiscord<Recruit_main707> why?
10:23:15FromDiscord<Rika> transpile is a ban, sorry to see you go recruit
10:23:27FromDiscord<Rika> many people call the nim compiler a transpiler
10:23:30FromDiscord<Rika> since it goes from nim to c
10:23:46Yardanicodom96: well I might try but not that many people *only* need IRC<->Discord :p
10:23:47FromDiscord<Recruit_main707> Nim to _optimized_ c
10:24:04FromDiscord<mratsim> not optimized actually
10:24:17FromDiscord<Rika> id just say C
10:24:29FromDiscord<Rika> not really optimized but surely better than some C noob could do i guess
10:27:59FromDiscord<dom96> This chat when someone mentions "transpiler":
10:28:04FromDiscord<dom96> https://tenor.com/view/angry-leonardo-di-caprio-the-wolf-of-wall-street-speech-gif-4280413
10:28:30Yardanicowell nowadays it's not as bad as it was a few years ago :D
10:43:45*Trustable quit (Remote host closed the connection)
10:45:48*letto quit (Quit: Konversation terminated!)
10:46:33*sagax quit (Remote host closed the connection)
10:47:47*letto joined #nim
10:49:49skrylar[m]hmm. so i tested the weak ref system on 0.20 (because thats what choosenim gave me for stable, shrugs) and 1.3 (#devel as of, some days ago). interestingly the 0.20 build calls =sink when a value is first initialized, but 1.3 is not
10:55:47*Hideki joined #nim
10:56:12*Hideki is now known as Guest24907
11:00:16*Guest24907 quit (Ping timeout: 256 seconds)
11:03:37*dadada joined #nim
11:04:00*dadada is now known as Guest33931
11:12:05*Hideki joined #nim
11:12:28*Hideki is now known as Guest50126
11:13:39ZevvThe manual is a bit vague about iterator arguments - it states that you need to provide the arguments to either call, or wrap the thing in a closure which does that. But I want to leverage the fact that I can pass *different* arguments to each call - is that considered safe and well defined behaviour?
11:16:22*Guest50126 quit (Client Quit)
11:17:12*aeverr quit (Quit: Konversation terminated!)
11:21:31skrylar[m]alright 1.2. stable doesn't have the initial assignment call to `=` like 0.20 did .. hm
11:22:51solitudesf-why doesnt this work? https://play.nim-lang.org
11:22:55*solitudesf- is now known as solitudesf
11:23:39Yardanicowhat code? :P
11:25:38solitudesfwhat the heck
11:25:56solitudesfi cant copypaste
11:25:56solitudesfhttps://play.nim-lang.org/#ix=2mkv
11:27:27Yardanico"template/generic instantiation of `==` from here"
11:27:43Yardanicoyou need ==
11:27:50Yardanicohttps://play.nim-lang.org/#ix=2mkw
11:28:43solitudesf+1 iq aquired. thanks
11:31:59*liblq-dev joined #nim
11:35:09skrylar[m]ah looks like it works fine in 1.2 stable; just have to make sure the allocator takes a var input instead of returning
11:35:32skrylar[m](and thats mostly because of preserving the address of the item being sink'ed)
11:37:47federico3wiremoons have you tried https://raspi.debian.net/ ?
11:41:32FromDiscord<wiremoons> @federico3 no. Mainly use Raspbian. Played with Ubuntu 19.10 and tried out 20.04 when it came out. Briefly Manjaro ARM.
11:42:25skrylar[m]weirdly i can't get =sync to get called, but it does copy and then destruct so. shrug.
11:42:30skrylar[m]*=sink
11:42:54FromDiscord<dom96> @Zevv don't think so
11:43:37FromDiscord<Recruit_main707> msgpack looks very promising, do you guys know of nim benchmarks comparing it to json?
11:44:03FromDiscord<wiremoons> @federico3 last time consider Debian (as they had 64bit) they had issues with access all 4Gb of men. Expect is fixed now...
11:47:07FromDiscord<wiremoons> How come in chat some people have more than one Discord id if they are on IRC? For example federico3 has: federico3#3719 and federico3#1394
11:47:16skrylar[m]msgpack is an okay format, but i recommend cbor if you are green fielding something
11:47:39FromDiscord<Recruit_main707> and he doesnt even use discord :P
11:48:12FromDiscord<wiremoons> Never sure which to on a reply....
11:48:16Zevvdom96: aw that's too bad :(
11:48:19FromDiscord<wiremoons> *use
11:48:24ZevvI'll ask ar4q when he is around
11:48:32*caff quit (Quit: WeeChat 2.8)
11:48:45FromDiscord<Recruit_main707> write it without the @, that way it will ping him in irc, which is what he normally uses
11:49:02FromDiscord<Recruit_main707> (if im not mistaken thats how it works)
11:49:38FromDiscord<wiremoons> Ok - thanks @Recruit_main707 - didn't know it worked without the '@' symbol
11:50:10Yardanico@wiremoons IRC clients highlight your username when they see it in any message
11:50:14Yardanicoyou don't need any prefixes like @
11:50:17Yardanicoit's all client-side
11:50:57FromDiscord<wiremoons> OK - thanks yardanico
11:53:01FromDiscord<Clyybber> skrylar: =sink can get optimized away in some cases, such as when its the first write to the variable
11:53:25FromDiscord<Clyybber> Because then the `=destroy(lhs)` in the sink call isn't needed, so a simple bit copy suffices
12:05:11FromDiscord<mratsim> but is it optimized? it wasn't when =destroy was not inline but now?
12:06:01*supakeen quit (Quit: WeeChat 1.9.1)
12:06:41*supakeen joined #nim
12:07:03federico3skrylar[m]: why CBOR? https://en.wikipedia.org/wiki/Comparison_of_data-serialization_formats
12:07:46*sz0 joined #nim
12:08:07FromDiscord<mratsim> meeh, zero-init my tasks slow downs perf by 20% but not doing so prevents supporting destructors/sink types that rely in default nil values ....
12:12:54FromDiscord<Clyybber> @mratsim Its optimized regardless of what =destroy does, only condition is it has to be the first write
12:13:57FromDiscord<Technisha Circuit> if i do `import "a" as l` and then i do `import "b" as l`, what happens?
12:14:07Yardanicobig bang
12:14:19FromDiscord<Technisha Circuit> wut
12:14:35Yardanicodon't worry, you can't do that :)
12:14:36FromDiscord<Clyybber> You'll get a compile error
12:14:40FromDiscord<Technisha Circuit> oof
12:14:51Yardanico? that's fair
12:14:55FromDiscord<Technisha Circuit> is there a way i can remove an import?
12:14:59FromDiscord<Clyybber> ?
12:15:06FromDiscord<Clyybber> Don't write it
12:15:11FromDiscord<Recruit_main707> ^
12:15:17FromDiscord<Technisha Circuit> im tryna make a command per file system with dimscord
12:16:03Yardanicoso?
12:16:15FromDiscord<Technisha Circuit> but i don't really have a good idea how because in js you can do `var l = require("a")` so i can overwrite it
12:16:22Yardanicowhy would you need that?
12:16:37FromDiscord<Technisha Circuit> so i can get the data from the file
12:16:43Yardanicoyou can write a macro
12:16:45Yardanicolike I did before
12:16:53FromDiscord<Clyybber> also, keep in mind that nim is compiled
12:16:53YardanicoI did the same with my social network bot in Nim a long time ago, but it was a bit more complicated
12:17:03Yardanicoyou could declare new modules which contain commands
12:17:05Yardanicoone module per file
12:17:10FromDiscord<Technisha Circuit> okay
12:17:11Yardanicoand it's all compile-time only
12:17:18FromDiscord<Technisha Circuit> oh okay
12:17:32Yardanicohttps://github.com/Yardanico/nickel it's in russian mostly (because it was created for VK), but you can check out modules in src/modules
12:18:17Yardanicothe relevant macro code is in https://github.com/Yardanico/nickel/blob/master/src/dsl.nim
12:18:29FromDiscord<Technisha Circuit> thanks
12:18:50YardanicoI also use "include" so I don't have to write same imports in every file :)
12:19:01FromDiscord<Clyybber> @mratsim You should be able to safely elide the zero init and still have =sink/=/=destroy rely on nil value by making sure the first assignment to the uninit variable is the first write and the last read of the RHS
12:19:01YardanicoI mean I can also use import/export and then "import base", but there's basically not a lot of difference
12:20:19FromDiscord<Technisha Circuit> o
12:21:00FromDiscord<Recruit_main707> Yardanico: include == import + export??
12:21:07Yardanicowell I mean in my case it is
12:21:19Yardanicobecause I only use include to import some common modules each of my modules needs
12:22:07FromDiscord<Rika> include is "put this file inside the current file"
12:22:11FromDiscord<Rika> the contents
12:22:11Yardanicoyes
12:22:23FromDiscord<Recruit_main707> thats cool
12:27:03*zacharycarter joined #nim
12:48:33*NimBot joined #nim
12:54:22*Guest33931 quit (Ping timeout: 272 seconds)
12:55:08skrylar[m]huh. with the normal gc, putting stuff in a seq isn't triggering the copy constructor. under arc, it is. :headscratches
12:55:17skrylar[m]but they are both running =destroy
12:55:38*dadada joined #nim
12:56:01*dadada is now known as Guest71730
13:12:25*Guest71730 quit (Ping timeout: 246 seconds)
13:16:27skrylar[m]well thats.. yea i'm too tired to fix this tonight
13:16:45skrylar[m]it works with --gc:arc, and it works with --newruntime, but it explicitly blows up with the default gc
13:16:56Yardanicothen always use arc ;)
13:18:32*dadada joined #nim
13:18:55*dadada is now known as Guest93953
13:24:08skrylar[m]looks like it was just pretending to work. seems using the lifetime hooks to track pointers is... tricky
13:32:37*scmutalisk joined #nim
13:35:12*scmutalisk quit (Client Quit)
13:38:04skrylar[m]if you make copies to regular variables, taking the address of dest works fine. but whatever happens when you try to call "foo.add <handle>", the lifetime hooks get a destination address that isn't where the handle is ultimately kept, and the lifetime hooks aren't called to notify them when they get shuffled around in memory
13:39:47FromDiscord<Clyybber> @skrylar: Do you have an example?
13:41:45skrylar[m]Clyybber: bottom of this shows it off https://gist.github.com/Skrylar/8b0c95074129cc2de788e20436801be0
13:43:37*filcuc_ joined #nim
13:44:11skrylar[m]gc builds don't even call the copier the correct number of times; arc builds do the correct copy and destruct calls but the dest pointer is not stable when shoving in a struct, and you don't get notified where the thing gets moved to (i tested adding =sink and that doesn't work either)
13:46:27FromDiscord<Clyybber> > but the dest pointer is not stable when shoving in a struct
13:46:31FromDiscord<Clyybber> WDYM?
13:46:41skrylar[m]in a seq
13:46:51FromDiscord<Clyybber> The dest argument of `=destroy` or `=`?
13:46:55skrylar[m]var y = x # dest pointer will be y, so the death notice does work
13:47:01skrylar[m]of `=`
13:47:55FromDiscord<Clyybber> Sorry, I still don't entirely understand what the problem is
13:48:08*filcuc joined #nim
13:48:15FromDiscord<Clyybber> What do you mean its not "stable"?
13:48:23skrylar[m]i just said
13:48:34*filcuc_ quit (Ping timeout: 265 seconds)
13:49:00skrylar[m]var y = x # this is a normal copy, so you can save `addr dest` and change it later to nil so the weak pointer 'dies'
13:49:26skrylar[m]someseq.add x # this has a valid `addr dest` inside `=` but if you save it somewhere, updating it doesn't actually "work"
13:49:45skrylar[m]the seq is moving it to another address without calling any more lifecycle hooks
13:50:07FromDiscord<Clyybber> Yeah, because it is getting sinked into add
13:50:21skrylar[m]it wont call =sink either tho
13:50:27*sagax joined #nim
13:52:12FromDiscord<Clyybber> Hmm, ok I know why; but I'm not sure how or why it causes problems
13:52:28FromDiscord<Clyybber> I have to dig into your example
13:53:28skrylar[m]well in this case the problem is there is a list of pointers to the handles, the list is kept up to date via `=` and `=destroy`, and when the mailbox dies its supposed to go set the handles to nil so sending fails instead of derefing a dead pointer
13:54:45skrylar[m]it would probably work fine with refs, but i didn't want an alloc for every message connection :/
13:55:45FromDiscord<Clyybber> You don't have =sink defined
13:55:58Yardanicolol
13:56:10FromDiscord<Clyybber> If you do, you should get at least one =sink call in the .add line
13:56:14FromDiscord<Clyybber> I *think*
14:02:52skrylar[m]proc `=sink`*(dest: var PostboxDeliverer; src: PostboxDeliverer) = echo "BBBBBBBBBBBBB" # no B's ever show up in the test log
14:04:49FromDiscord<Clyybber> skrylar: Can you try with a custom add proc, that simply does setLen len + 1 and sets the last element?
14:06:41FromDiscord<Recruit_main707> `Error: unhandled exception: int64 [ObjectConversionError]` anyone with msgpack experience, what does this mean??? it seems to not be able to decode even basic types
14:07:17Yardanicoare you sure the type definitions between both ends match?
14:07:27leorize[m]@mratsim pretty solid, performance is comparable to azure pipelines, and lots of free tasks :p
14:07:44Yardanicoleorize[m]: and it's owned by MS anyway :P
14:07:57FromDiscord<Recruit_main707> Yardanico, it did work with json, so i guess they do
14:09:31FromDiscord<Recruit_main707> it doesnt even work for strings
14:09:42FromDiscord<Clyybber> skrylar: I think the source of the issue is this: https://github.com/nim-lang/Nim/blob/devel/lib/system/seqs_v2.nim#L107
14:09:55FromDiscord<Clyybber> Which means we simply bitcopy instead of sinking
14:11:11leorize[m]but if the value is sinkable it will be sinked before it enter the function
14:11:22FromDiscord<Clyybber> No
14:11:30FromDiscord<Clyybber> It will be bit copied
14:11:34*rockcavera joined #nim
14:11:39FromDiscord<Rika> is a 5 nanosecond improvement significant?
14:12:08Yardanicoit's in the level of noise
14:12:24FromDiscord<Clyybber> leorize, skrylar: The issue here is that we deemed these bitcopies safe, since we don't provide any guarantees on the addr of the vars staying the same
14:12:24Yardanicodid you actually run the benchmark like 10_000 times and it still was 5ns?
14:12:32leorize[m]@Clyybber doesn't sink params enforce sinking or copy-then-sink when that's not possible?
14:12:36FromDiscord<Rika> uh i did it around 10000000 times
14:12:46Yardanicoand how did you measure time?
14:12:49FromDiscord<Rika> then repeated the test a few times
14:12:55FromDiscord<Rika> monotimes + runningstat
14:12:59Yardanicohmm ok
14:13:08Yardanicobut if that requires you much more code it's not worth it :P
14:13:15leorize[m]@Rika: use golden
14:13:16Yardanicoand I don't think it's generally worth optimizing too much for a progress bar lib
14:13:26FromDiscord<Clyybber> leorize: Yeah, but we never call sink, we do a `(let tmp = v; reset(v); tmp)`
14:13:43FromDiscord<Clyybber> So we simply copy the argument and reset the original location
14:13:58FromDiscord<Clyybber> This is so that it doesn't get destroyed in the callee scope
14:14:05FromDiscord<Clyybber> (edit) 'callee' => 'caller'
14:14:17FromDiscord<Rika> leorize: okay
14:15:05FromDiscord<Rika> Yardanico: i'm just looking into how the `-` proc for a MonoTime uses the regular generic initDuration which does a lot of converts for literally 0 values
14:15:20FromDiscord<Rika> i'm just looking into it, i got interested
14:15:35FromDiscord<Rika> its not something i'd put in the lib
14:17:44*Guest93953 is now known as dadada
14:18:25dadadais there a call that stops a program/the compiler but doesn't generate an error of statements after it never being reached
14:18:30dadadaI need it for debugging now
14:18:50dadadawait, I could use macros.error hmm
14:20:47skrylar[m]Clyybber: i just solved it with double ref, like everyone else in computer science is doing :/
14:21:32*silvernode joined #nim
14:22:16skrylar[m]a ref object which just holds a ref'd pointer to itself and also a sequence is rustling my allocation jimmies but at least its not fighting the system
14:23:03skrylar[m]on `=destroy` it just clears the self pointer in the tombstone ... which is an untyped pointer, so arc should be happy and not cry about cycles
14:23:26Yardanicoarc won't stop you from compiling your program even if you have cycles everywhere :)
14:23:36Yardanicoalthough compiler might show warnings
14:23:40skrylar[m]no but this won't leak
14:24:53Yardanicowell I understand, I'm just saying that there's no point in "arc won't cry" since it'll compile your program anyway :)
14:25:20leorize[m]@Clyybber: then when will we call sink lol
14:25:38*narimiran joined #nim
14:25:55FromDiscord<Clyybber> never
14:26:45leorize[m]wait what
14:30:02FromDiscord<Clyybber> Its simply copied, no need to call =sink because its add; nothing needs to get destroyed
14:35:26FromDiscord<Clyybber> As far as I understand srkylars problem, its that he is relying on the addresses of the arguments of `=sink` `=` and so on to stay the same, so copies that don't call `=sink` or `=` will throw his system off
14:36:17FromDiscord<Clyybber> In this line: https://gist.github.com/Skrylar/8b0c95074129cc2de788e20436801be0#file-simple-mailbox-generator-nim-L185
14:37:13skrylar[m]i threw out the lifecycle code and replaced it with a tombstone ref object that just holds an untyped pointer so it doesn't count as a cycle but =destroy nils out the tombstone
14:37:27skrylar[m]then just let the gc deal with the tombstone :shrug:
14:39:04FromDiscord<Clyybber> A pointer never counts as a cycle
14:39:10FromDiscord<Clyybber> You can safely make it ptr T
14:39:35skrylar[m]theres some type system evasion going on as well
14:40:04leorize[m]sounds like an use case for shared ptrs
14:40:42skrylar[m]what that module actually does is take a list of structs for events allowed in the event queue and hides making the union and tag enum in the background and theres procs that take the struct and stuff it in the union and add it on the seq
14:40:43leorize[m]we have those in fusion now I think, don't know if Araq merged them yet
14:41:15*filcuc quit (Ping timeout: 265 seconds)
14:41:16Yardanicohttps://github.com/nim-lang/fusion/pull/8
14:41:17disbotadd C++11-like smart pointers to fusion
14:41:19skrylar[m]is that a new branch
14:42:34leorize[m]it's an external package that would be a part of the nim distribution
14:43:09skrylar[m]after sleep need to add the glue to make sending stuff less tedious
14:43:31skrylar[m]but then it should just look roughly like signals and slots, but its actually just the boring old sdl style mailbox
14:44:54*waleee-cl joined #nim
14:50:12*lritter joined #nim
15:04:56FromGitter<zetashift> Dang nimsuggest and macros don't really go together do they
15:06:34leorizetell me about it :P
15:07:04*xet7 quit (Read error: Connection reset by peer)
15:09:19FromGitter<zetashift> I wonder if I know NIm well enough now to just disable it
15:09:31*xet7 joined #nim
15:09:38leorizeyou will never know enough :P
15:09:39FromDiscord<Rika> i barely notice that it broke
15:10:01leorizeuse nim.nvim and you will know how often it crashes
15:10:06FromDiscord<Rika> (cont.) when i program, so its likely you wont notice either
15:10:09leorizethough I just ignore that most of the time
15:14:45FromGitter<zetashift> It's not crashing here but just giving me a lot of false positives
15:15:58leorizeah you're on -d:danger (the default)
15:16:04leorizeI use nimsuggest with -d:release :)
15:16:29leorizeeven so much as pointing it to $lib/system.nim kills it :P
15:17:51FromGitter<zetashift> haha
15:17:59FromGitter<zetashift> How do I try it with `-d:release`?
15:18:25leorizecompile nimsuggest with -d:release :)
15:18:51leorizethat's assuming we still leave assertions on
15:18:59FromGitter<zetashift> I don't even know how to set that using choosenim
15:19:09leorizewell you can't :P
15:19:09FromGitter<zetashift> or do I have to compile from scratch?
15:19:18FromGitter<zetashift> ah makes sense
15:19:18leorizepretty much, yes
15:19:52leorizeAraq: why do we keep assertions on for -d:release?
15:22:59FromDiscord<Clyybber> So that they are on? :p
15:23:12narimiran:D
15:23:20FromDiscord<Clyybber> Its a matter of definitions, disabling them is dangerous so it belongs in -d:danger
15:25:13leorizeI need a way to record nimsuggest failures
15:25:31leorizemaybe I can add this into nim.nvim as a debugging feature :P
15:26:05FromDiscord<waghanza> If someone is interested https://github.com/the-benchmarker/web-frameworks#results
15:26:36FromDiscord<waghanza> I'd compared jester and httpbeast
15:26:47FromGitter<bung87> the proc using last expr as return result, is there a term for it ?
15:26:50leorizewait they didn't test asynchttpserver?
15:27:50leorizenow we also know how much of a bottleneck jester is
15:28:01leorizethough we probably can't mitigate that yet :P
15:28:18*dadada quit (Ping timeout: 256 seconds)
15:28:41FromDiscord<dom96> Anyone know if there is a pragma to get rid of the `result` var being generated?
15:28:48FromDiscord<dom96> (In the C code)
15:29:17leorizenope
15:29:25leorizethere aren't any
15:29:33leorizewhy would you need to get rid of it though?
15:29:42FromDiscord<Clyybber> bung87: Implicit return
15:30:02FromDiscord<Technisha Circuit> Is it a good idea to implement any basic ideas i have in python first (the language i know best) then port it to Nim?
15:30:03FromDiscord<dom96> bah, because it messes with my wasm macro 😛
15:30:11FromGitter<bung87> Clyybber thank you!
15:31:20FromDiscord<Technisha Circuit> :p
15:31:34FromDiscord<Clyybber> @Technisha Circuit Probably not
15:31:40FromDiscord<Technisha Circuit> Oh?
15:32:06FromDiscord<Clyybber> I think its best to implement them in Nim from the start
15:32:16FromDiscord<Clyybber> Since you'll then have a much more fun time with nim
15:32:17FromDiscord<Technisha Circuit> Okay then, thanks
15:32:29FromDiscord<Clyybber> np :)
15:32:33FromDiscord<Technisha Circuit> :)
15:33:23FromDiscord<Technisha Circuit> ~~Wait so how would i make it so i can turn `{"a":"b"}` into `<a>b<\a>`~~
15:33:38FromDiscord<Technisha Circuit> I'm assuming i just need to use the keys to put it in that format
15:34:59FromDiscord<dom96> !eval import htmlgen; echo(a("b"))
15:35:03NimBot<a>b</a>
15:35:22FromDiscord<Technisha Circuit> That's a built-in thing?
15:35:24FromDiscord<dom96> yep
15:35:33FromDiscord<Technisha Circuit> Nice
15:35:43FromDiscord<Technisha Circuit> Is there any other formats that could be put in?
15:35:58FromDiscord<Technisha Circuit> Since I don't think that's doable if i only have a string
15:37:19FromDiscord<Technisha Circuit> `"<"&json["a"]&">"&json["b"]&"</"&json["a"]&">"`
15:37:25FromDiscord<Technisha Circuit> That would work, right?
15:37:32FromDiscord<Technisha Circuit> It's messy but it works :P
15:38:11FromDiscord<dom96> I strongly suggest you use htmlgen
15:38:13FromDiscord<dom96> That's asking for bugs
15:39:00FromDiscord<Technisha Circuit> I don't know how I'd use html gen for constantly changing files
15:39:20*dadada joined #nim
15:39:28FromDiscord<Technisha Circuit> Unless there's a workaround so i could use it with strings
15:39:34*zacharycarter quit (Ping timeout: 256 seconds)
15:39:44*dadada is now known as Guest57155
15:45:30FromDiscord<Technisha Circuit> How would i check all keys in a json string without iterating through the json string multiple types
15:47:01FromGitter<bung87> you meaning multiple times?
15:47:13FromDiscord<Technisha Circuit> Yeah :p
15:47:35FromGitter<bung87> thought could use regex exec ?
15:47:44FromDiscord<Technisha Circuit> It only has one key and value, but I don't the key
15:47:50FromDiscord<Technisha Circuit> How exactly?
15:48:29FromDiscord<Yardanico> You don't need to know the key to get the value, just iterate over all elements in the JSON then?
15:48:34FromGitter<bung87> "([^"]+)":
15:50:07FromDiscord<Technisha Circuit> > You don't need to know the key to get the value, just iterate over all elements in the JSON then?↵I also need to know the key though
15:50:20FromDiscord<Technisha Circuit> Actually
15:50:21FromDiscord<Technisha Circuit> Nevermind
15:50:31FromDiscord<Technisha Circuit> I have a better solution to my issue now
16:03:02*zacharycarter joined #nim
16:05:22*madpata joined #nim
16:06:12madpataShould I use the re or nre module for regex purposes?
16:09:31*silvernode quit (Ping timeout: 246 seconds)
16:12:11liblq-devre
16:12:28liblq-devor better yet, the `regex` package from nimble
16:13:47FromGitter<bung87> use regex
16:14:57shashlickIt's time to move regex into stdlib, or at least fusion
16:24:35madpatayeah why not have 3 regex modules in the stdlib /s
16:26:53*lritter quit (Read error: Connection reset by peer)
16:28:09*opal quit (Quit: No Ping reply in 180 seconds.)
16:28:34*opal joined #nim
16:31:49madpataSo currently using re, but match() doesn't seem to populate the matches array I give it. https://play.nim-lang.org/#ix=2mlL Any theoughts?
16:33:47madpataAh my fault. Shouldn't have used a seq it seems
16:34:43*tyler569 joined #nim
16:35:00FromDiscord<Yardanico> @madpata well re and nre are both pcre, but nim-regex is pure Nim, and yeah, I really think it should be in Fusion
16:35:35FromDiscord<exelotl> I wish Nim regex had common usage examples in the docs
16:36:15FromDiscord<exelotl> it's not obvious how to actually do things with it
16:38:26FromDiscord<Yardanico> ?
16:38:35FromDiscord<Yardanico> It has examples in procs https://nitely.github.io/nim-regex/regex.html
16:41:25FromDiscord<exelotl> https://media.discordapp.net/attachments/371759389889003532/711619394043904080/unknown.png
16:42:14FromDiscord<exelotl> strscans turned out to be a good solution in this case, but it seems like this should be easy to do with regex...
16:53:28*lritter joined #nim
17:05:14*dddddd quit (Ping timeout: 240 seconds)
17:12:08shashlickeven cligen should be in fusion
17:12:09*filcuc joined #nim
17:14:22disruptekthinking about streaming... gaming? game-code? or misc debris? cannot work on compiler today.
17:14:42disruptekcligen is the poster child for fusion, imo.
17:19:06*filcuc quit (Ping timeout: 272 seconds)
17:19:10yumaikasfusion?
17:22:48*tane joined #nim
17:22:48*xet7 quit (Quit: Leaving)
17:23:06shashlickhttps://github.com/nim-lang/fusion
17:24:01yumaikasSo, a nimble package that's sort of a community sourced stdlib++?
17:24:44FromGitter<deech> How do I get nimble to run nim commands like `genDepend` on the project?
17:25:13shashlickWhen do you want that to run
17:26:26FromGitter<deech> I want to use it to generate a `dot` diagram of the project dependencies.
17:28:01shashlickyes but when do you want it to run - when you call a task? `nimble genDot` or during install or when
17:36:08FromGitter<deech> The former is more what I had in mind. I'm happy to roll my own task.
17:38:25*natrys joined #nim
18:01:54*madpata quit (Ping timeout: 260 seconds)
18:06:27FromDiscord<exelotl> to me, cligen is clever, docopt is responsible
18:07:11FromDiscord<exelotl> hot tea
18:24:46FromDiscord<RaycatWhoDat> Honestly, one of these days, I should just stop language hopping and remake all the cool features I like in other languages.
18:25:23FromDiscord<RaycatWhoDat> But I am smoothbrain and will probably botch it
18:29:40yumaikasexelot1: Why is docopt more respnosible than cligen?
18:32:25FromDiscord<zetashift> I think creating a language is harder than it looks like
18:32:31FromDiscord<zetashift> even when you leverage stuff like LLVm
18:35:53FromDiscord<exelotl> with cligen you don't have to document your tool at all
18:36:08FromDiscord<exelotl> right?
18:40:16FromDiscord<Technisha Circuit> I have 2 questions,↵A) Is the json data produced from `jsonParse` in order and↵B) Am i able to turn the json data into an ordered table if it only contains one data type pair (`"string":"string"`)
18:42:10FromDiscord<Elegant Beef> `echo jsonData.parseJson.pretty()`
18:42:22yumaikasIf you want ordered JSON, you'll want to use an array, no?
18:42:44FromDiscord<Technisha Circuit> Thanks
18:42:46FromDiscord<Elegant Beef> I'd imagine that parsin json would be FIFO
18:42:56FromDiscord<Technisha Circuit> Wdym?
18:43:28FromDiscord<Elegant Beef> first object in the file would be the first object in the jsonNode, cause any otherway would be rather silly
18:44:40FromDiscord<Elegant Beef> and if you want an ordered list of the data use the json node and when you want to get the value check the node kind and then get the according value
18:51:05*solitudesf- joined #nim
18:54:02*solitudesf quit (Ping timeout: 265 seconds)
18:55:20*Guest57155 is now known as dadada
18:56:28dadadayumaikas: I like docopt, it worked great everytime I used it, and IMO the code gets very readable, which is one of the most important factors for me
18:57:21YardanicoGuys can you share your thoughts on https://forum.nim-lang.org/t/6350 https://github.com/github/linguist/pull/4866 ?
18:57:32Yardanicoeven a thumbs up/down would be enough :P
18:59:34*xet7 joined #nim
19:00:41Araqany SSE experts around, I cannot understand SIDD_CMP_RANGES
19:03:52*nsf quit (Quit: WeeChat 2.8)
19:04:10*fredrikhr joined #nim
19:06:18FromDiscord<bedwardly-down> Any new secrets here? 🤪
19:07:03Araqno, it's just me learning new tricks
19:07:29leorize[m]ping @mratsim if he's still up
19:07:31FromDiscord<bedwardly-down> Sounds great! ☺️
19:09:06*xet7 quit (Remote host closed the connection)
19:09:19Araqyeah, mratsim please help me
19:09:37*xet7 joined #nim
19:09:50FromDiscord<Elegant Beef> only you can save araq
19:11:26FromDiscord<codic> to get the first line of a string in nim, can I do `string.split("\n")[0]` (assuming i have imported strutils)?
19:12:05FromDiscord<bedwardly-down> @Elegant Beef , I thought you knew everything nim and the nickname was ironic. I’m confused. 😂
19:12:14FromDiscord<Elegant Beef> I know nothing
19:12:26FromDiscord<bedwardly-down> Exactly
19:12:38FromDiscord<Elegant Beef> What?
19:12:49Yardanico@codic that will work fine but it's quite wasteful
19:13:19FromDiscord<zetashift> how to I instantiate an empty Table?
19:13:31FromDiscord<Elegant Beef> `initTable[typeA,typeB]()`
19:13:49Yardanicoyeah, and for TableRef it's newTable[A, B]()
19:13:55FromDiscord<zetashift> `var transitions: Table[(State, Action)] = {}.newTable ` throws ``` Error: cannot instantiate Table↵got: <type tuple of (State, Action)>↵but expected: <A, B> ```
19:14:01FromDiscord<zetashift> ah
19:14:16FromDiscord<Elegant Beef> also your left hand needs to be hashable
19:14:36FromDiscord<Elegant Beef> So if it's an object you need to follow the hash creation instructions
19:14:38FromDiscord<codic> What do you mean it's 'wasteful'?
19:14:43FromDiscord<codic> Is there a better alternative?
19:14:51Yardanicoyes
19:14:56FromDiscord<Elegant Beef> I assume it creates a new string so it increases memory usage
19:15:03FromDiscord<codic> hmm, what's the alternative?
19:15:07Yardanicostrutils.find and then a slice
19:15:26*letto quit (Quit: Konversation terminated!)
19:15:57FromDiscord<Elegant Beef> I could be wrong about the reason
19:15:58FromDiscord<codic> "lorem\nispum".find("lorem").slice(what?)
19:16:35FromDiscord<codic> :p
19:16:45Yardanico!eval let a = "lorem\nispum"; import strutils; let needed = a[0..a.find('\n')]; echo needed
19:16:48NimBotlorem↵
19:17:04Yardanico!eval let a = "lorem\nispum"; import strutils; let needed = a[0..a.find('\n')-1]; echo needed
19:17:07NimBotlorem
19:17:14Yardanicothat one
19:17:19FromDiscord<codic> what did the `-1` do there?
19:17:33Yardanicofind will return the index where it found the \n
19:17:37Yardanicoso it will return "string\n"
19:17:40Yardanicoif you don't want \n you do -1
19:17:41FromDiscord<Elegant Beef> couldnt that be `a[0..<a.find('\n)]`
19:17:44Yardanicoyes
19:17:53FromDiscord<Elegant Beef> Looks nicer to me 😄
19:17:54FromDiscord<codic> ah, i dont care about the newline in any case
19:18:10Yardanicothen just a[0 .. a.find('\n')]
19:18:25*Senketsu joined #nim
19:18:26FromDiscord<codic> ah thank you
19:22:23Araqstrscans module
19:28:25*Senketsu quit (Ping timeout: 240 seconds)
19:30:28FromDiscord<exelotl> is CRLF converted to LF in triple quoted string literals?
19:36:59FromDiscord<exelotl> (seems like it is)
19:53:06*letto joined #nim
19:58:18*pbb_ joined #nim
19:58:21*pbb quit (Ping timeout: 272 seconds)
20:06:13FromDiscord<codic> how can i declare something in the try block to the global scope so that it can be accessed outside the block?
20:06:50FromDiscord<codic> Nvm
20:06:57FromDiscord<codic> was able to do a `var fileContent:string↵` beforehand
20:07:15FromDiscord<codic> works just fine
20:09:44FromDiscord<codic> Yardanico: for your example on getting the first line, how can i modify it to get any line number *n*, eg 42?↵Or would I have to use strutils.split for that?
20:11:19Yardanicowell you can use a simple while loop and iterate over the string there
20:12:24FromDiscord<codic> o. i'll stick with the strutils.split for now, eh
20:16:59*dddddd joined #nim
20:18:23*solitudesf- is now known as solitudesf
20:19:40FromDiscord<zetashift> On Windows, is there any reason to use vcc instead of gcc for compiling NIm?
20:20:28Yardanicowindows compatibility, maybe better speed?
20:22:17FromDiscord<zetashift> Ah alright, I had a crash with Godot and Nim but gcc works and vcc so I was a bit puzzled
20:22:36Yardanicoyou can also use icc on windows btw :P
20:22:55Yardanicobut it's not well tested (I tried it around 3 years ago and it worked for some of simple stuff)
20:23:22*narimiran quit (Quit: leaving)
20:25:35FromDiscord<zetashift> I think it's a Godot thing tbh
20:26:48FromDiscord<mratsim> @Araq, I don't know what SIDD_CMP_RANGES is
20:27:13Yardanicoit's https://doc.rust-lang.org/core/arch/x86_64/constant._SIDD_CMP_RANGES.html
20:28:09FromDiscord<mratsim> seems like a compare operation flag: https://gitlab.indel.ch/thirdparty/gcc/commit/f98d7ce9315a4219dc737d1bc1aa71644b116530#fdd9f2b998a6f2fcbf3ca91555f07f0149a6074d_478_478
20:28:56FromDiscord<mratsim> Here you go: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cmpestri&expand=834
20:29:17Yardanicobtw @mratsim - what do you think about https://github.com/github/linguist/pull/4866? are you fine with that or not, or maybe the colour should be a different one? :P
20:29:33FromDiscord<zetashift> it's such a minor change 😛
20:29:34FromDiscord<mratsim> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/711676802250047510
20:30:35FromDiscord<mratsim> upvoted but really don't care
20:30:49Yardanicoyeah I think so too, but it still would be nice to have it in the same colour :D
20:30:56FromDiscord<mratsim> I'm fighting with concurrent queues/channels and it's hell
20:42:54FromDiscord<zetashift> Yeah no easy topics to tackle
20:43:09rockcaverais there any way to force the standard gc to free unused memory for the operating system? I have a case that getOccupiedMem() returns 10MB and getFreeMem() more than 100MB, and that 100MB does not return to the operating system.
20:44:07FromDiscord<dom96> @Yardanico nice, I like the idea of the #announcements channel
20:44:19Yardanicoyeah it'll be quite useful to keep big news/stuff
20:44:36Yardanicosadly only discord servers with special privileges can create actual announcement channels you can subscribe to
20:44:40Yardanicobut I hope we'll get that status too
20:45:02FromDiscord<dom96> Also, love your PR to change the colour
20:45:05FromDiscord<dom96> Didn't know we could do that
20:45:09FromDiscord<dom96> the green has bothered me for a while
20:45:15FromDiscord<dom96> and that golden yellow is beautiful
20:45:34FromGitter<Willyboar> +1 for the PR
20:46:03FromGitter<Willyboar> ~stream
20:46:57Yardanico~stream
20:47:24FromGitter<bung87> !status
20:47:30FromDiscord<dom96> actually, based on what I'm seeing in the CI for that, the colours it found as being close in proximity still look quite similar to the new #FFDF00
20:47:38Yardanicoyeah I noticed that too
20:47:40Yardanicobut it passes :P
20:47:45Yardanico@bung87 disruptek's bot is down
20:47:49Yardanicohe's on windows playing PoE rn :P
20:47:49FromDiscord<dom96> Any ideas which languages have those colours?
20:48:04Yardanicohttps://github.github.io/linguist/
20:48:10FromGitter<bung87> yeah, that's why it answer nothing
20:48:24*fredrikhr quit (Ping timeout: 256 seconds)
20:48:30YardanicoIsabelle, JavaScript, Parrot, Lex have similar colors
20:48:39FromDiscord<dom96> Hm, being close to JS could be bad
20:48:42Yardanicoalso HiveQL
20:48:58Yardanico@dom96 yeah I know, you can propose an alternative one and I can test it locally via their tests
20:49:04Yardanicoto see if it passes the proximity check
20:49:12FromDiscord<dom96> don't have any better ideas tbh
20:49:15YardanicoJS has #f1e05a
20:49:19FromDiscord<dom96> still better than the green
20:50:01Yardanicoyeah I was surprised when I found it was added by the maintainer of the repo in 2012 :P
20:54:27FromDiscord<Technisha Circuit> I just realized
20:54:29Yardanico@dom96 https://bl.ocks.org/Yardanico/e7deead840ca477d0c59b0078c229906
20:54:38Yardanicogolden yellow vs JS
20:54:40FromDiscord<Technisha Circuit> Because of Nim's amazing metaprogramming capabilities
20:54:59Yardanicobut of course when the color icon is really small they become more similar :P
20:55:01FromDiscord<Technisha Circuit> You can implement the BrainFuck interpreter *in* a .nim file
20:55:12FromDiscord<Technisha Circuit> And then you'll be able to compile it
20:55:51Yardanicothat was already done btw :P
20:56:00Yardanicohttps://github.com/def-/nim-brainfuck
20:56:17Yardanicohttps://github.com/def-/nim-brainfuck/blob/master/src/brainfuck.nim#L104
20:56:31FromDiscord<Technisha Circuit> O
20:56:34FromDiscord<Technisha Circuit> Nice
20:56:38Yardanicoeven if it's just a "naive" implementation it's really fast
20:57:59FromDiscord<dom96> so, strange thing. I implemented fibonacci using WASM, Nim->JS and normal JS. Normal JS is by far fastest, even Nim->JS is fastest then WASM. Very weird.
20:59:11FromDiscord<Technisha Circuit> Wait, by using macros and stuff, is it possible to make a more Python-like 'skin' for Nim?
20:59:18FromDiscord<Technisha Circuit> If so, that'd be cool
20:59:25Yardanicothat was already kinda done :P
20:59:26Yardanicohttps://github.com/Yardanico/nimpylib
20:59:34Yardanicobut I personally don't like that, don't use it in real code
20:59:40Yardanicofor educational purposes only (TM)
20:59:49Yardanicomost of the recent stuff there is by Juan
21:00:08FromDiscord<Technisha Circuit> I was thinking with `__init__` and access to most Python libs
21:00:13Yardanicohuh
21:00:53FromDiscord<Technisha Circuit> And implementing a more python-like inport feature like `from lib import a, b, c`
21:01:01Yardanicowe have that
21:01:03FromDiscord<Technisha Circuit> (edit) 'lib' => 'my.lib'
21:01:07Yardanicooh
21:01:12FromDiscord<Technisha Circuit> With Python modules?
21:01:41FromDiscord<Technisha Circuit> I am probably going to be working on that in the long run
21:02:04FromDiscord<Technisha Circuit> It'll be nice but idiotic if i actually implement that
21:02:50FromDiscord<Technisha Circuit> I'd probably have to make a transpiler which isn't as good or a compiler with macros and procs that add python's functionality
21:04:57Yardanicosee https://github.com/metacraft-labs/py2nim
21:05:02Yardanicohttps://github.com/metacraft-labs/py2nim_deprecated/
21:05:10Yardanicothat was a _real_ py2nim transpiler
21:05:33FromDiscord<exelotl> @Technisha Circuit also if imports are tripping you up, this is a good read: https://narimiran.github.io/2019/07/01/nim-import.html
21:05:40FromDiscord<Technisha Circuit> Thanks
21:16:11*solitudesf quit (Ping timeout: 260 seconds)
21:17:31*zacharycarter quit (Ping timeout: 256 seconds)
21:22:51FromGitter<bung87> I did not run it successfully `py2nim`
21:23:22Yardanicowell you might need to adapt it
21:24:12FromGitter<bung87> I rember he made a python tool , that trace the python variable type
21:24:17Yardanicoyes
21:24:45FromGitter<bung87> that's the first time I know python has such a api
21:25:50FromGitter<bung87> my tool not finish yet :(
21:26:15FromGitter<bung87> next target maybe the java , not python
21:29:02Araqmratsim: more specifically, how come this is incorrect: https://gist.github.com/Araq/ec80ee8be65f52b09bf6eeb11a374081
21:29:23*kraken joined #nim
21:34:25*kraken quit (Remote host closed the connection)
21:35:47FromDiscord<slymilano> Hey guy, I have a question - how do you handle not namespacing your procs in your code? I know you _can_ do it, but even the docs say it's not really recommended or idiomatic. Looking at old code I wrote two months ago, it's hard to understand at a glance if `foobar()` is a proc in the file, or if I'm importing it from some other file. I write Elixir code 99% of the time, so I usually go `SomeModule.foobar()` and I know where a function
21:36:27*krux02 joined #nim
21:39:24FromDiscord<Elegant Beef> If in vscode you can just hover or ctrl + click to see the nim file it's form
21:39:52FromDiscord<slymilano> sent a long message, see http://ix.io/2myw
21:39:55FromDiscord<slymilano> (edit) 'http://ix.io/2myw' => 'http://ix.io/2myx'
21:40:13*gokr quit (Read error: Connection reset by peer)
21:40:15Yardaniconah, it's not deprecated
21:40:43Yardanicobut almost no one uses it :P
21:40:47FromDiscord<Elegant Beef> it's just rather unneeded
21:41:09FromDiscord<Elegant Beef> Unless you have two modules with identical function names and params
21:41:11FromDiscord<slymilano> `from complex import nil` this looks fantastic to me, I immediately know where things come from. Are you saying I can write Nim this way, and my code won't break later on? This is a supported way to do things?
21:41:29FromDiscord<Elegant Beef> I mean import complex would do the same no?
21:41:46FromDiscord<Elegant Beef> It tells you you're using that module and importing all of it's exported signatures
21:42:08FromDiscord<Elegant Beef> Cant you also just import the procs you want directly using the from keyword?
21:42:39Araqslymilano: 'from' is not going anywhere, use it as you see fit
21:43:11FromDiscord<slymilano> Look at this LOC for example, `insertTorrent` i have no idea where it's from lol and this is my code! I'm going to update so it turns into `Database.insertTorrent`, thanks @araq
21:43:14FromDiscord<slymilano> https://github.com/sergiotapia/torrentinim/blob/master/src/crawlers/leetx.nim#L100
21:43:37FromDiscord<Technisha Circuit> It would do the same if you just did `import complex` but it's not forced to do `complex.function()`
21:43:40FromDiscord<Elegant Beef> I wonder if it's from the `import ../torrent`
21:43:59FromDiscord<Elegant Beef> The only issue i see is with functions that have ambigious names
21:44:21FromDiscord<exelotl> `from x import nil` is supported and won't break later on, but the article goes on to show that it leads to rather unpleasant code (especially because operators and method-like procs now need to be fully qualified)
21:44:43FromDiscord<Elegant Beef> Doesnt it make the UFCS completely useless?
21:44:47FromDiscord<exelotl> yep
21:44:54FromDiscord<Elegant Beef> Completely denimifying nim!
21:45:20FromDiscord<exelotl> I'd recommend to get used to doing things the normal way, and only use `from x import nil` in special cases
21:45:59Araq'from' is only dangerous for Nim's collections and DSLs
21:46:07FromDiscord<slymilano> `especially because operators and method-like procs now need to be fully qualified` this is exactly what I'm aiming for. Otherwise how the hell do you know where things come from? It seems the majority of Nim devs don't use import nil though. hmmm
21:46:23FromDiscord<Elegant Beef> You ctrl click on it in vscode to see where it comes from 😄
21:46:31Yardanico@slymilano but then you can't just have a + b if a and b are both of the type Vector for example
21:46:31FromDiscord<Elegant Beef> No clue the nvim way
21:46:39Yardanicoand you import that module as "from module import nil"
21:46:42Yardanicoor hmm, lemme see
21:46:55FromDiscord<Elegant Beef> Does it fuck up operator procs?
21:47:10Araqnah, you can write module.`+`(a, b)
21:47:19FromDiscord<Elegant Beef> so yes it does
21:47:20FromDiscord<Elegant Beef> 😄
21:47:45FromDiscord<exelotl> from the article: https://media.discordapp.net/attachments/371759389889003532/711696484885594233/unknown.png
21:48:23FromDiscord<Elegant Beef> I come from C# so i dont really get the using namespaces infront of functions, the entire point of importing libraries is that you want their functions as first class
21:48:46Araqwhy? it works. it's a bit ugly but then the problem "I cannot navigate through my codebase without tools" is also an ugly problem. Coming soon, keywords in ALLUPPER because we cannot assume working syntax highlighting
21:49:14FromDiscord<UNIcodeX> Oof
21:50:14FromDiscord<slymilano> Thanks guys, lots to think about. In Elixir land, I always qualify, even if I can cmd+click, makes it easier to navigate my codebase without needing tools. In Nim, I may do the same for my own sake. My 2 month old code made me open a few files to find where it was located, I can't imagine a production project. Those who don't use import nil, how do you usually navigate? Just rely on cmd+click?
21:50:43FromDiscord<UNIcodeX> > from the article:↵@exelotl my eyes!!!
21:51:10FromDiscord<Elegant Beef> I mean im a bad example since i generally a noob when it comes to nim
21:51:10Yardanico@slymilano I remember the modules :P
21:51:13FromGitter<bung87> I only using import nil when two lib have same name proc
21:51:22Yardanico@bung87 you don't need to use import nil then
21:51:31Yardanicoyou can fully qualify even if you just use "import a, b"
21:51:46Yardanico!eval import strutils; echo strutils.isAlphaAscii("abcd1234")
21:51:48NimBotCompile failed: /usercode/in.nim(1, 44) Error: type mismatch: got <string>
21:52:02FromGitter<bung87> oh ,yeah that's also right
21:52:03FromDiscord<slymilano> I see that sounds like a nice compromise. Import normally, no nil - and still fully qualify.
21:52:13Yardanico!eval import strutils; echo strutils.isAlphaAscii('a')
21:52:16NimBottrue
21:53:12FromGitter<bung87> there's also `except`
21:53:15Yardanicoyep
21:53:17Araqslymilano: how do you manage any OOP-ish codebase then?
21:53:47AraqPython, C#, ... etc are full of obj.call and obj is *not* the module name
21:53:50FromDiscord<slymilano> My only in-depth experience with OOP was with C# back in 2008, it's.... been a while.
21:53:59FromDiscord<slymilano> but you're right
21:54:27FromDiscord<slymilano> I may be trying to write _functional_ Nim code, and I probably shouldn't.
21:54:37FromGitter<bung87> import nil rarely use, if you do FFF.a(b) you can just b.a()
21:54:42Araqfunctional has nothing to do with it
21:55:53FromDiscord<slymilano> OOP/Procedural: 1.toString() - Functional: String.parseInt(1)
21:55:56FromGitter<bung87> in editor `.` will trigger tip for you
21:56:32FromGitter<bung87> no that's not called functional
21:57:16FromDiscord<slymilano> what's it called
21:57:43FromGitter<bung87> static method
21:57:45FromDiscord<Elegant Beef> I mean in nim it's the same as C# `1.toString()` vs `$1`
21:58:06Araqhow do you *navigate* without cmd+click? "open file", "then search within this file for the right declaration" is not a substitute, it's a waste of time
21:58:23FromDiscord<Elegant Beef> Or search the entire project
21:58:32FromDiscord<Elegant Beef> Which only works if the module is in the project
21:58:34Araqyeah yeah, cause bla bla Java bla bla bloatware
21:58:39FromDiscord<Elegant Beef> So then you have to go find the mdoule
21:58:45FromDiscord<Elegant Beef> module*
21:59:18FromDiscord<Elegant Beef> idk i think if you arent using modern developer tools in your developer environment you might be putting yourself at a detriment 😄
22:00:10FromDiscord<Elegant Beef> Even in C# namespaces are supposed to be like directories, but not everyone follows that so you still dont know where to look
22:00:17FromDiscord<slymilano> In Elixir, I can cmd+click, but also by qualifying my modules, I know `SomeModule.foobar()` is in the `some_module.ex` file, so I can open that file directly
22:00:31FromGitter<bung87> you will get benefit from nim's procedure
22:00:35FromDiscord<slymilano> Trying to replicate that dev UX in Nim
22:00:36*liblq-dev quit (Quit: WeeChat 2.8)
22:00:43FromDiscord<Elegant Beef> But that implies the module is inside the project folder
22:00:51FromDiscord<Elegant Beef> If it's a nimble package you cant just go to it
22:01:05FromDiscord<Elegant Beef> Or a apart of nims stdlib
22:02:02FromDiscord<Elegant Beef> I should say cant just go to it easily
22:02:13FromDiscord<Elegant Beef> you dont do system.int do you?
22:02:51Yardanico!eval let a: system.int = system.`+`(system.int(5), system.int(10)); system.echo(a)
22:02:54NimBot15
22:02:56Yardanico:D
22:03:39FromGitter<bung87> that's make source file larger...
22:03:47Yardanicoyes
22:03:49Yardanicodon't do that :P
22:04:47FromDiscord<Elegant Beef> Wait so i should rewrite all my code?
22:04:50FromGitter<bung87> when company KPI count on this I will go for it..
22:04:58Yardanico@Elegant yes!
22:05:05Yardanicohttps://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
22:05:09Yardanicowe need that in Nim
22:05:37Yardanicohttps://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/tree/master/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl
22:05:52FromDiscord<Elegant Beef> I personally want this in nim↵https://github.com/AceLewis/my_first_calculator.py/blob/master/my_first_calculator.py
22:06:13FromDiscord<Elegant Beef> It'd be a good library to have, we'd finally be able to do math
22:06:13Yardanicothis can be easily converted to nim
22:06:42Yardanicooh it's only 21k lines of code
22:06:44Yardaniconot that much
22:06:59FromDiscord<Technisha Circuit> I thought that was a myth-
22:07:09FromDiscord<Technisha Circuit> Someone actually did that...
22:07:14FromDiscord<Elegant Beef> Well this guy made it after a facebook post
22:07:24FromDiscord<Elegant Beef> That source isnt exactly real
22:08:00FromDiscord<Technisha Circuit> Oh god
22:08:24FromDiscord<zetashift> surely that is generated
22:08:26FromDiscord<Technisha Circuit> How hard would it be to make a script in Nim to do this?
22:08:33FromDiscord<Technisha Circuit> I think it is
22:08:51FromDiscord<zetashift> should be a couple for loops no
22:09:16FromDiscord<Technisha Circuit> https://github.com/AceLewis/my_first_calculator.py/blob/master/generator.py
22:09:37Yardanicoyeah I translated it
22:09:40Yardanicothe original version
22:09:49FromDiscord<Technisha Circuit> Oh?
22:09:56FromDiscord<zetashift> that fast?
22:09:59Yardanicoye ofc?
22:10:03Yardanicoit's basically the same
22:10:07Yardanicoyou just replace print->echo
22:10:11Yardanicoand at the start change the code
22:10:11FromDiscord<zetashift> idk man 😛
22:10:18FromDiscord<Technisha Circuit> Nice hahaha
22:10:27FromDiscord<Technisha Circuit> How about the generator code?
22:10:32Yardanico21k lines, be careful or your browser might crash or something https://gist.github.com/Yardanico/584b90a4aba6a035bffc26901789dbc9
22:10:33FromDiscord<Technisha Circuit> Edit that and you are sound
22:10:49FromDiscord<Technisha Circuit> Chrome crashes so i used puffin
22:10:55Yardanicoi'll try to translate the generator now
22:11:10FromDiscord<Technisha Circuit> Hahaha ok
22:12:32FromDiscord<zetashift> oh I thought you had translated the generator
22:12:42FromDiscord<Technisha Circuit> This is unholy
22:13:21FromDiscord<Technisha Circuit> Python takes a good few seconds to load it-
22:13:40FromDiscord<Elegant Beef> The best part about that is↵> # TODO: Make it work for all floating point numbers too
22:13:47FromDiscord<Technisha Circuit> Hahahahaha
22:13:59FromDiscord<Technisha Circuit> That'll be a huge pain
22:14:15FromDiscord<Technisha Circuit> But seems like it's abandoned so ¯\\_(ツ)\_/¯
22:14:23FromDiscord<Technisha Circuit> ~~I might implement that~~
22:14:33FromDiscord<Elegant Beef> I mean it was based off the facebook post
22:14:34FromDiscord<Elegant Beef> so...
22:14:37FromDiscord<Technisha Circuit> Hahahaha
22:15:07FromDiscord<Technisha Circuit> It'd be funnier if there was a hidden fork bomb in the code
22:15:14FromDiscord<Technisha Circuit> You give ut to yiur friend
22:15:25FromDiscord<Technisha Circuit> Then millions of processes get started
22:15:35FromDiscord<Technisha Circuit> Your PC can't handle it and explodes
22:15:38FromDiscord<Elegant Beef> ...
22:15:45FromDiscord<Elegant Beef> We have vastly different definitions of funny
22:16:25FromDiscord<Technisha Circuit> Well, i am considered the annoying one
22:16:52FromDiscord<Technisha Circuit> ~~I should make a forkbomb in Nim and rename it to Python and then have my class run the code~~
22:17:20FromDiscord<Technisha Circuit> (edit) 'Python' => 'Python.exe'
22:35:51FromGitter<bung87> question about js bridge , can I always using `{.importcpp, varargs.}`
22:39:21*natrys quit (Quit: natrys)
22:41:25*tane quit (Quit: Leaving)
22:57:03*opal quit (Ping timeout: 240 seconds)
23:00:45skrylar[m]leorize: failures as in when it doesn't work right or when it explodes and dies
23:10:00*opal joined #nim
23:13:46*zacharycarter joined #nim
23:17:56*zacharycarter quit (Ping timeout: 240 seconds)
23:26:31skrylar[m] well i dropped one alloc; hid the mailbox in a ref object which is contained by a non-copiable struct, so the struct can set the disposed flag when it dies but the gc/arc holds on to the mailbox itself. since its just a seq and a bit flag, it's okay
23:29:03*opal quit (Ping timeout: 240 seconds)
23:29:41*opal joined #nim
23:57:16Prestige:w
23:57:19Prestigewoops
23:57:55PrestigeCan I cast a var to a generic type? like cast[T](myVar)
23:58:43FromDiscord<Elegant Beef> You can do `T(var)` to convert to another type but if you just want the raw data converted to another type it's `cast[T](var)`
23:58:55FromDiscord<Elegant Beef> The first is proper method 90% of the time
23:59:15*krux02_ joined #nim
23:59:31PrestigeTrying to get the result of XGetWindowProperty back as a seq of T: https://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html