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:29 | FromDiscord | <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:48 | FromDiscord | <Max [codingreaction]> Anyway, this is the code, feel free to critiquize as my intention is for learning 🙂 |
00:17:51 | FromDiscord | <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:03 | FromDiscord | <zetashift> If a proc returns nothing then you can omit the `: void` |
00:45:58 | * | krux02_ quit (Remote host closed the connection) |
00:46:40 | FromDiscord | <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:13 | FromDiscord | <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:46 | FromDiscord | <Max [codingreaction]> sent a long message, see http://ix.io/2mhl |
01:05:01 | * | konvertex quit (Ping timeout: 264 seconds) |
01:20:36 | Prestige | Is 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:23 | FromGitter | <bung87> found a long article introduce nim http://ssalewski.de/nimprogramming.html#_some_facts_about_nim |
01:35:14 | * | chemist69 joined #nim |
01:35:40 | Prestige | Nice |
01:45:12 | * | Senketsu quit (Ping timeout: 256 seconds) |
01:45:20 | * | lritter quit (Quit: Leaving) |
01:45:33 | FromDiscord | <Rika> convert |
01:58:11 | FromDiscord | <exelotl> wtf I managed to change the value of a static parameter to a macro?? |
01:58:35 | FromDiscord | <exelotl> how am I running into so many language bugs this weekend |
01:58:57 | FromDiscord | <Rika> what do you mean |
02:00:35 | FromDiscord | <exelotl> Here's the start of the macro https://media.discordapp.net/attachments/371759389889003532/711397720597725264/unknown.png |
02:02:34 | FromDiscord | <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:44 | caff | Hey 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:46 | caff | https://play.nim-lang.org/#ix=2mhr |
02:03:10 | * | mono joined #nim |
02:03:25 | caff | Namely I'm trying not to mutate the initial toml. |
02:04:24 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2mhs |
02:04:29 | FromDiscord | <exelotl> @Rika closeChar somehow gets set to '\0' even though I passed '}' |
02:04:31 | FromDiscord | <Rika> is what **i** would do |
02:04:48 | FromDiscord | <Rika> @exelotl i wanna try running the code, mind sending it? |
02:05:14 | caff | Thanks Rika :) I was misusing deepCopy in my experiments apparently. |
02:05:16 | FromDiscord | <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:20 | FromDiscord | <Rika> caff: i dont know if it's a good idea, but it's what i would do |
02:07:32 | FromDiscord | <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:03 | caff | I 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:33 | FromDiscord | <Rika> deepcopy does all references within the first one, shallow only the first layer is copied, so not recursively or so |
02:13:46 | FromDiscord | <Rika> of course, you must know that by now.... |
02:14:27 | caff | Though 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:48 | FromDiscord | <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:13 | caff | This 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:27 | FromDiscord | <exelotl> @Rika https://play.nim-lang.org/#ix=2mhu |
02:19:31 | caff | shallowCopy should probably be good from what I read. I'll have to play around with it more. |
02:20:26 | FromDiscord | <Rika> @exelotl i'm a bit lost, haha, what should i look for? |
02:22:26 | FromDiscord | <Rika> it doesnt run either T_T |
02:23:51 | FromDiscord | <Rika> ah, i know |
02:24:08 | FromDiscord | <Rika> ah, no |
02:24:10 | FromDiscord | <Rika> never mind |
02:24:28 | caff | Appreciate your help so far @Rika :) |
02:24:49 | FromDiscord | <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:12 | FromDiscord | <Rika> @exelotl it looks like a bug with static[char] |
02:28:54 | FromDiscord | <Rika> huh |
02:28:58 | FromDiscord | <Rika> it ist |
02:28:59 | FromDiscord | <Rika> isnt |
02:30:33 | FromDiscord | <exelotl> @Rika https://play.nim-lang.org/#ix=2mhA |
02:31:44 | FromDiscord | <Rika> yeah |
02:31:44 | FromDiscord | <exelotl> if you comment out the "scanp approach" and uncomment the "manual approach" it compiles and runs successfully |
02:31:54 | FromDiscord | <Rika> scanp fucks with closeChar |
02:32:01 | FromDiscord | <Rika> im still reading into it |
02:32:16 | FromDiscord | <exelotl> this shouldn't happen lol, it's so wack |
02:33:59 | FromDiscord | <Rika> actually |
02:34:01 | FromDiscord | <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:01 | FromDiscord | <Rika> one more test |
02:34:05 | FromDiscord | <Rika> im thinking it isnt scanp |
02:34:55 | FromDiscord | <Rika> found it |
02:35:01 | FromDiscord | <Rika> its the fact that you make a proc and pass i |
02:35:04 | FromDiscord | <Rika> pass it* |
02:35:12 | FromDiscord | <Rika> prolly closures are broken in vm |
02:35:26 | FromDiscord | <exelotl> oof |
02:35:35 | FromDiscord | <Rika> make it a not-closure, somehow |
02:37:41 | FromDiscord | <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:59 | FromDiscord | <Rika> ***gl, and hf) |
02:38:04 | FromDiscord | <Rika> (edit) 'hf)' => 'hf***' |
02:38:19 | FromDiscord | <Rika> wonder if that fucked with yars bot |
02:38:40 | FromDiscord | <exelotl> thanks for the help, good to narrow down the problem at least. :') |
02:39:05 | FromDiscord | <exelotl> guess I'll make a bug report at some point if I can narrow it down more |
02:39:30 | FromDiscord | <Rika> i have a feeling that it's related to how the vm cant have ref of ref |
02:39:45 | FromDiscord | <Rika> prolly wrong tho 😛 |
02:40:50 | FromDiscord | <exelotl> copying closeChar into a local variable fixes it too |
02:41:03 | FromDiscord | <exelotl> so it's a combination of closures and static macro parameters? |
02:41:09 | FromDiscord | <Rika> perhaps |
02:50:02 | skrylar[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:55 | FromDiscord | <Technisha Circuit> Who's the creator of Nimpy? |
03:01:16 | * | monok joined #nim |
03:01:44 | skrylar[m] | so it seems the earlier question about weak references is, "code them yourself" ._. |
03:02:03 | skrylar[m] | cursor isn't a weakref so much as it just ignores counting, but weakrefs specifically get told when the master dies |
03:02:39 | skrylar[m] | afaik cursors don't get nilled out |
03:03:09 | skrylar[m] | unless they actually do, but i have no idea if they do atm :shrug: |
03:03:26 | disruptek | cursor is in the docs now. |
03:03:32 | disruptek | see doc/destructors. |
03:03:49 | * | mono quit (Ping timeout: 264 seconds) |
03:03:55 | skrylar[m] | lies https://nim-lang.org/docs/destructors.html |
03:03:59 | disruptek | they aren't weak like weak_ptr. |
03:04:30 | skrylar[m] | yes i saw the rfc, they just don't interact with ref counting at all |
03:04:32 | disruptek | see commit 06dfd316127fb2ec05ff69942abd1e279156ac5c. |
03:04:38 | skrylar[m] | but that also makes them unsafe-ish, so :\ |
03:04:59 | disruptek | yes, by design. |
03:05:04 | disruptek | what are you trying to accomplish? |
03:05:55 | skrylar[m] | was mostly asking if we had solved that problem yet; i don't use arc |
03:06:52 | disruptek | without knowing the problem, it's hard to answer. |
03:07:08 | disruptek | but, arc is the solution to most problems. |
03:09:30 | skrylar[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:25 | FromDiscord | <Broadwell> Is there a proc from macros that evaluates a given ast node? |
03:11:03 | FromDiscord | <Broadwell> Like `Ident "true"` => the boolean `true` |
03:11:04 | disruptek | it's called return. |
03:11:23 | FromDiscord | <Broadwell> I want to evaluate it at compile time |
03:11:28 | disruptek | return |
03:11:33 | skrylar[m] | FromDiscord: https://nim-lang.org/docs/macros.html#getAst%2Cuntyped ? |
03:11:37 | FromDiscord | <Broadwell> Okay |
03:14:37 | * | livcd quit (Ping timeout: 264 seconds) |
03:17:40 | skrylar[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:10 | FromDiscord | <Technisha Circuit> Is there something like https://flyx.github.io/emerald/documentation.html but for css? |
03:35:25 | * | chemist69 joined #nim |
03:37:15 | FromDiscord | <willyboar> Dsl for css? |
03:38:20 | FromDiscord | <Technisha Circuit> Mhm |
03:38:37 | FromDiscord | <Rika> why? |
03:38:47 | * | Guest15289 quit (Remote host closed the connection) |
03:39:10 | FromDiscord | <Technisha Circuit> Because i am absolutely trash at css and i prefer the syntax of emerald more |
03:39:44 | FromDiscord | <willyboar> Have you look sass? |
03:40:23 | FromDiscord | <Technisha Circuit> What's that? |
03:40:35 | FromDiscord | <Rika> preprocessor |
03:41:22 | FromDiscord | <willyboar> By the way i prefer scf from emerald and i really don't like scf |
03:41:27 | FromDiscord | <willyboar> 😋 😋 😋 😋 |
03:41:43 | FromDiscord | <Technisha Circuit> What's scf? |
03:41:48 | FromDiscord | <Technisha Circuit> And thanks :p |
03:41:59 | FromDiscord | <willyboar> Source cide filters |
03:42:09 | FromDiscord | <willyboar> (edit) 'cide' => 'code' |
03:42:13 | FromDiscord | <Technisha Circuit> Thanks! |
03:42:44 | FromDiscord | <willyboar> It is one of the 2 std lib ways to create html templates |
03:42:53 | FromDiscord | <Technisha Circuit> O |
03:42:53 | FromDiscord | <willyboar> The other is obvious htmlgen |
03:43:14 | FromDiscord | <willyboar> Who i find it similar to emerald |
03:43:39 | FromDiscord | <Technisha Circuit> Wait |
03:43:44 | FromDiscord | <Technisha Circuit> I didn't mean emerald |
03:43:48 | FromDiscord | <Technisha Circuit> I meant Jade |
03:43:53 | FromDiscord | <Technisha Circuit> 😅 |
03:44:13 | FromDiscord | <Technisha Circuit> Wait |
03:44:21 | FromDiscord | <Technisha Circuit> Nope still not the right one ;-; |
03:44:42 | FromDiscord | <Technisha Circuit> I can't find the one i was looking for ;-; |
03:44:49 | FromDiscord | <Technisha Circuit> Is there any simpler alternative to html then? |
03:44:51 | FromDiscord | <willyboar> Mustache? |
03:45:25 | FromDiscord | <Technisha Circuit> Is there any alternatives that give me logic? |
03:45:33 | FromDiscord | <Technisha Circuit> That are implemented in either Nim or Python? |
03:45:55 | FromDiscord | <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:57 | FromDiscord | <willyboar> Well python has a couple of hundreds |
03:46:07 | FromDiscord | <willyboar> 😋 |
03:46:14 | FromDiscord | <Technisha Circuit> Which ones should i look at :P |
03:46:30 | FromDiscord | <willyboar> Personally i really like jinja |
03:46:45 | FromDiscord | <Technisha Circuit> Oh? |
03:48:11 | * | silvernode joined #nim |
03:48:29 | FromDiscord | <willyboar> But mustache is cool too and there is a nim library |
03:48:29 | * | zacharycarter joined #nim |
03:48:40 | FromDiscord | <willyboar> Actually there are two of them |
03:49:11 | FromDiscord | <Technisha Circuit> Oh? What Nim libraries are they? And what's the syntax of mustache? |
03:50:29 | FromDiscord | <Technisha Circuit> Looks nice |
03:50:51 | FromDiscord | <willyboar> https://github.com/search?q=mustache+language%3Anim&type= |
03:51:53 | FromDiscord | <Technisha Circuit> Thanks! |
03:52:53 | FromDiscord | <Technisha Circuit> Is there an alternative to html which uses json files to generate html code? :P |
03:53:00 | FromDiscord | <Technisha Circuit> (edit) 'files' => 'data' |
03:53:07 | FromDiscord | <Technisha Circuit> I'm just curious rn |
03:53:08 | FromDiscord | <Elegant Beef> Why would you want to convert json to html |
03:53:11 | * | zacharycarter quit (Ping timeout: 260 seconds) |
03:53:21 | FromDiscord | <Technisha Circuit> A better question is why not |
03:53:29 | FromDiscord | <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:38 | FromDiscord | <Elegant Beef> Json is for serialzing Objects |
03:53:41 | FromDiscord | <Elegant Beef> (edit) 'Objects' => 'objects' |
03:53:44 | FromDiscord | <Elegant Beef> Shit |
03:53:53 | FromDiscord | <Technisha Circuit> Well, I'm known to do stupid things, so |
03:53:59 | FromDiscord | <Technisha Circuit> Serialising* |
03:54:09 | FromDiscord | <Elegant Beef> serializing* |
03:54:11 | FromDiscord | <Technisha Circuit> I'm British :P |
03:54:18 | FromDiscord | <Technisha Circuit> It's with an s for me |
03:54:19 | FromDiscord | <Elegant Beef> Im Canadian |
03:54:22 | FromDiscord | <Elegant Beef> It's an s with me too |
03:54:23 | FromDiscord | <Technisha Circuit> Coolio |
03:54:28 | FromDiscord | <willyboar> Hahhahah |
03:54:33 | FromDiscord | <Technisha Circuit> You put a z tho |
03:54:37 | FromDiscord | <Elegant Beef> Cause i dont care |
03:54:41 | FromDiscord | <Technisha Circuit> :P |
03:54:43 | FromDiscord | <Elegant Beef> It's not colour i dont care |
03:54:50 | FromDiscord | <willyboar> Cauze |
03:54:55 | FromDiscord | <Technisha Circuit> Okay :0 |
03:55:23 | FromDiscord | <Elegant Beef> If you dont spell it with a Z why even have 26 letters |
03:56:00 | FromDiscord | <Technisha Circuit> Because zebra |
03:56:05 | FromDiscord | <Technisha Circuit> And xylophone for x |
03:56:10 | FromDiscord | <Elegant Beef> Anyway |
03:56:14 | FromDiscord | <Technisha Circuit> Hahaha |
03:56:19 | FromDiscord | <Elegant Beef> Json isnt the right tool for websites |
03:56:36 | FromDiscord | <Technisha Circuit> So would i have to make something that allows me to turn Json to html then? |
03:56:40 | FromDiscord | <Elegant Beef> Yes |
03:56:42 | FromDiscord | <Elegant Beef> Probably |
03:56:44 | FromDiscord | <Technisha Circuit> If so, I'm going to do it |
03:56:53 | FromDiscord | <Technisha Circuit> ~~Cool, an original idea-~~ |
03:56:56 | FromDiscord | <willyboar> Frontend framework |
03:57:02 | FromDiscord | <Technisha Circuit> Welp, I'ma work on this now |
03:57:03 | FromDiscord | <willyboar> Vue |
03:57:18 | zedeus | emerald is broken |
03:57:19 | FromDiscord | <Technisha Circuit> What's vue? |
03:57:25 | FromDiscord | <Technisha Circuit> Oh |
03:57:36 | zedeus | as soon as you start doing slightly complex stuff it breaks |
03:57:44 | zedeus | use karax for server-side rendering instead |
03:57:51 | FromDiscord | <Technisha Circuit> Big oof |
03:57:53 | FromDiscord | <Technisha Circuit> Okay |
03:58:41 | FromDiscord | <Elegant Beef> Creating the structure of html inside of json would be hell |
03:59:02 | FromDiscord | <Elegant Beef> For readabillity really imo |
03:59:13 | zedeus | working 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:59 | FromDiscord | <Technisha Circuit> Hahaha |
04:00:08 | FromDiscord | <Technisha Circuit> Oh nice |
04:00:44 | FromDiscord | <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:58 | FromDiscord | <Elegant Beef> https://tenor.com/view/why-huh-but-why-gif-13199396 |
04:01:09 | FromDiscord | <Technisha Circuit> Hahahaha |
04:01:12 | FromDiscord | <Technisha Circuit> Because i can uvu |
04:01:27 | FromDiscord | <Rika> Being able to is not a good reason |
04:01:38 | FromDiscord | <willyboar> I really want to see that beast |
04:01:38 | FromDiscord | <Technisha Circuit> But it'll help me learn |
04:01:45 | FromDiscord | <Technisha Circuit> So ¯\\_(ツ)\_/¯ |
04:01:52 | FromDiscord | <Technisha Circuit> > I really want to see that beast↵Wdym? |
04:01:57 | FromDiscord | <Elegant Beef> Doing something practical would also help you learn |
04:02:15 | FromDiscord | <willyboar> You can contribute to enim |
04:02:22 | FromDiscord | <Rika> What's that |
04:02:54 | FromDiscord | <Technisha Circuit> ^^ |
04:03:04 | FromDiscord | <willyboar> https://github.com/liseki/enim |
04:03:12 | FromDiscord | <Technisha Circuit> > Doing something practical would also help you learn↵Doing stupid projects are nice imo |
04:03:23 | FromDiscord | <willyboar> We talk about it yesterday |
04:03:34 | FromDiscord | <Rika> not everyone was here yesterday |
04:03:45 | leorize[m] | enim looks like source code filter |
04:03:54 | leorize[m] | any advantage over it? |
04:04:08 | FromDiscord | <willyboar> Well it is very similar to erb |
04:05:48 | FromDiscord | <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:57 | FromDiscord | <Technisha Circuit> How would i check if a module is already imported? |
04:09:14 | leorize[m] | you can't really be certain |
04:09:24 | leorize[m] | but why would you need to check for that? |
04:09:25 | zedeus | declared? |
04:09:44 | leorize[m] | yea but that won't work for `import as` |
04:09:57 | zedeus | that's uncommon anyway |
04:10:10 | FromDiscord | <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:23 | leorize[m] | don't do it like that |
04:10:41 | FromDiscord | <Elegant Beef> `parseYaml` `parseJson` `genHtml` |
04:11:28 | FromDiscord | <Technisha Circuit> But I don't want the yaml to be a dependancy |
04:11:33 | FromDiscord | <Elegant Beef> Or a genHtml that takes in a string and figures out it internally |
04:11:48 | FromDiscord | <Technisha Circuit> Okay :P |
04:12:00 | FromDiscord | <Elegant Beef> You want to parse yaml but dont want to depend on the method of parsing yaml? |
04:12:08 | FromDiscord | <Technisha Circuit> Wdym? |
04:12:23 | FromDiscord | <Elegant Beef> > But I don't want the yaml to be a dependancy |
04:12:47 | FromDiscord | <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:49 | leorize[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:03 | FromDiscord | <Technisha Circuit> Is there a way to add optional dependancies? |
04:13:07 | FromDiscord | <willyboar> You can use parsetoml lib. |
04:13:14 | leorize[m] | modules are self-contained by default |
04:13:15 | FromDiscord | <Elegant Beef> Yes you split the yaml to another part |
04:13:17 | FromDiscord | <Technisha Circuit> For toml :P |
04:13:23 | FromDiscord | <Technisha Circuit> Okay then, thanks |
04:13:29 | FromDiscord | <Technisha Circuit> :P |
04:13:41 | FromDiscord | <Elegant Beef> Then if you want the yaml you import that which relies on the other parser |
04:13:42 | FromDiscord | <Technisha Circuit> So it'd me `myLib/yaml`? For example |
04:13:51 | FromDiscord | <Elegant Beef> yes |
04:13:52 | FromDiscord | <Technisha Circuit> (edit) '`myLib/yaml`? For example' => '`myLib/yaml` for example?' |
04:13:53 | FromDiscord | <willyboar> They have already transform to json |
04:13:55 | FromDiscord | <Technisha Circuit> Cool |
04:14:11 | FromDiscord | <Elegant Beef> What's the benefit of using yaml over html? |
04:14:35 | FromDiscord | <Technisha Circuit> Some people just might prefer using YAML for html for some insane reason |
04:15:17 | FromDiscord | <willyboar> Then just create a yaml syntax dsl lib |
04:15:22 | FromDiscord | <Elegant Beef> Some people prefer using nano over an actualy editor |
04:15:27 | FromDiscord | <Elegant Beef> actual* |
04:15:31 | FromDiscord | <Elegant Beef> Doesnt mean you should encourage it |
04:15:52 | FromDiscord | <Technisha Circuit> I prefer nano over an editor sometimes- |
04:16:05 | FromDiscord | <Technisha Circuit> Nano is actually quite nice imo |
04:16:07 | FromDiscord | <Technisha Circuit> Hahaha |
04:16:08 | FromDiscord | <Elegant Beef> Also what's wrong with the |
04:16:15 | FromDiscord | <Elegant Beef> !repo nim-html-dsl |
04:16:16 | disbot | https://github.com/juancarlospaco/nim-html-dsl -- 9nim-html-dsl: 11Nim HTML DSL 15 10⭐ 1🍴 7& 1 more... |
04:16:17 | FromDiscord | <Elegant Beef> Ah |
04:16:44 | FromDiscord | <Technisha Circuit> Ah, that was what i was mentioning |
04:16:50 | FromDiscord | <Technisha Circuit> I couldn't remember it ;-; |
04:17:04 | FromDiscord | <Technisha Circuit> But now I'm working on json to html soooooo |
04:17:07 | FromDiscord | <Rika> hey, its fine to use nano as an editor |
04:17:14 | FromDiscord | <Technisha Circuit> ^^^ |
04:17:14 | FromDiscord | <Rika> like whatever you like |
04:17:17 | FromDiscord | <Technisha Circuit> Mhm |
04:17:37 | FromDiscord | <Elegant Beef> > Doesnt mean you should encourage it |
04:17:46 | FromDiscord | <willyboar> I really want to see this json to jtml stuff |
04:17:52 | FromDiscord | <Technisha Circuit> Hahahaha |
04:18:00 | FromDiscord | <Rika> i dont see why you shouldnt encourage nano |
04:18:00 | FromDiscord | <Technisha Circuit> I'll start implementing it soon |
04:18:06 | FromDiscord | <Rika> its an editor, theres no issue with it |
04:18:06 | zedeus | nano sucks |
04:18:14 | FromDiscord | <Technisha Circuit> Not really |
04:18:19 | zedeus | for one, it fucks up line endings by default |
04:18:29 | zedeus | has insane defaults |
04:18:30 | FromDiscord | <Technisha Circuit> > i dont see why you shouldnt encourage nano↵Even has syntax highlighting :P |
04:18:31 | FromDiscord | <willyboar> Misstyping create a nice name jtml |
04:18:43 | FromDiscord | <Technisha Circuit> > for one, it fucks up line endings by default↵This is true :P |
04:18:56 | FromDiscord | <Technisha Circuit> > Misstyping create a nice name jtml↵~~Can i use that name?~~ |
04:19:00 | FromDiscord | <Rika> jtml (json text markup language) |
04:19:03 | FromDiscord | <Rika> xd |
04:19:06 | zedeus | and that is enough reason to not encourage anyone to use it, especially if they don't know what they're doing |
04:19:12 | FromDiscord | <Technisha Circuit> Hahaha |
04:19:12 | FromDiscord | <speckledlemon> "it fucks up line endings by default" how so? |
04:19:13 | FromDiscord | <willyboar> Yes you can use it |
04:19:24 | FromDiscord | <Technisha Circuit> It adds an extra line by default |
04:19:30 | FromDiscord | <Technisha Circuit> > Yes you can use it↵Thanks! |
04:20:08 | FromDiscord | <speckledlemon> ah, that's not the same thing as messing with CR/LF/etc., but yes it does that |
04:22:51 | FromDiscord | <Technisha Circuit> Idek how to change settings in nano haha |
04:23:57 | FromDiscord | <Technisha Circuit> Is it possible to check if a module is installed? |
04:24:18 | FromDiscord | <Elegant Beef> Why do you care if it's installed? |
04:24:35 | FromDiscord | <Elegant Beef> `nimble install` should handle installation |
04:24:39 | FromDiscord | <Elegant Beef> of all dependancies |
04:24:39 | FromDiscord | <Technisha Circuit> I just found https://github.com/drewlee/JTML- |
04:24:49 | FromDiscord | <Technisha Circuit> Because i want to have some modules optional |
04:24:56 | FromDiscord | <Technisha Circuit> So if they don't need it it isn't used |
04:25:21 | zedeus | you could do `when compiles(import module)` |
04:25:45 | FromDiscord | <Technisha Circuit> Thanks! |
04:26:07 | FromDiscord | <Technisha Circuit> How would i catch the import error? |
04:26:14 | FromDiscord | <Technisha Circuit> What's the name of the exception |
04:26:24 | FromDiscord | <Technisha Circuit> Ik how to handle errors because it's similar to python :p |
04:26:30 | zedeus | that doesn't throw an error |
04:26:41 | FromDiscord | <Technisha Circuit> (edit) 'https://github.com/drewlee/JTML-' => 'https://github.com/drewlee/JTML -' |
04:26:43 | zedeus | it's a compile-time statement |
04:26:50 | FromDiscord | <Technisha Circuit> If the module isn't found? |
04:26:51 | FromDiscord | <Rika> just put an else |
04:27:03 | FromDiscord | <Technisha Circuit> Okay :P |
04:27:04 | FromDiscord | <Rika> when ...: (module imported) else: (not) |
04:27:35 | FromDiscord | <Technisha Circuit> I'll just make it a default dependancy because I'm lazy uvu |
04:28:03 | FromDiscord | <Technisha Circuit> Also, is it a bad thing that I'm planning on making this available to multiple languages? |
04:28:09 | FromDiscord | <Rika> no, why |
04:28:21 | FromDiscord | <Technisha Circuit> Good, just checking :P |
04:28:27 | FromDiscord | <Technisha Circuit> I'll probably have to use cffi |
04:28:42 | zedeus | actually this doesn't work |
04:28:58 | FromDiscord | <Technisha Circuit> How about if you spoof the c header? |
04:30:00 | FromDiscord | <Technisha Circuit> If that won't work, what other ways could i use? |
04:30:08 | zedeus | the compiles thing won't work |
04:30:37 | leorize[m] | spoof the c header? |
04:30:50 | * | Hideki joined #nim |
04:31:14 | * | Hideki is now known as Guest49947 |
04:32:35 | FromDiscord | <Technisha Circuit> Oh okay |
04:35:35 | FromDiscord | <Rika> how would i go about returning an "immutable view" of a seq |
04:36:04 | zedeus | are you using arc? |
04:36:15 | FromDiscord | <Rika> no |
04:36:21 | FromDiscord | <Rika> i dont want to enforce it either |
04:36:40 | zedeus | unenforced immutability sounds a lot like mutability |
04:36:41 | FromDiscord | <Technisha Circuit> Would you guys think I'm crazy if i use regex instead of the json module to parse json data? |
04:37:09 | FromDiscord | <Rika> @Technisha Circuit yes |
04:37:15 | FromDiscord | <Rika> zedeus: i mean enforce arc |
04:37:28 | zedeus | if you have to ask questions like that, the answer is yes |
04:37:28 | FromDiscord | <Technisha Circuit> Hahaha |
04:37:52 | zedeus | you can use `lent` without enforcing arc, but it won't do anything without it |
04:38:00 | FromDiscord | <Rika> darn... |
04:38:26 | FromDiscord | <Rika> would a proc named `something[]` have the same "argument properties" as a proc named `[]` |
04:38:30 | zedeus | you could stick it in a ref object with `[]` but no `[]=` |
04:38:40 | zedeus | or make a distinct type |
04:39:48 | FromDiscord | <Rika> but then it would be convertable no? |
04:39:50 | FromDiscord | <Rika> hmm |
04:40:12 | zedeus | not if the field is private |
04:40:41 | zedeus | public object type with a private field that holds the seq, then a `[]` proc that accesses it |
04:40:59 | FromDiscord | <Technisha Circuit> For data that won't be changed after the user provides it, is it better to use let or var? |
04:41:15 | FromDiscord | <Elegant Beef> If you need mutabillity use var if you dont use let |
04:41:30 | FromDiscord | <Technisha Circuit> Okay |
04:41:42 | FromDiscord | <Rika> zedeus: oh, i see |
04:41:50 | FromDiscord | <Rika> i was thinking of the distinct type you said |
04:42:45 | FromDiscord | <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:25 | FromDiscord | <Technisha Circuit> What does `doAssert` do? |
04:44:37 | zedeus | consider reading the manual |
04:44:55 | FromDiscord | <Elegant Beef> Nah it doesnt make you consider read the manual |
04:45:03 | FromDiscord | <Technisha Circuit> :p |
04:45:05 | FromDiscord | <Technisha Circuit> Okay |
04:46:24 | FromDiscord | <Rika> why dont you read docs? |
04:46:26 | FromDiscord | <Technisha Circuit> That's actually quite simple |
04:46:39 | FromDiscord | <Technisha Circuit> I'm starting to read up on docs more :P |
04:46:50 | FromDiscord | <Rika> please do it first before you ask 😛 |
04:47:02 | FromDiscord | <Technisha Circuit> Ok :P |
04:48:45 | FromDiscord | <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:59 | FromDiscord | <Technisha Circuit> Or is it better to handle the error |
04:49:14 | FromDiscord | <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:38 | FromDiscord | <Rika> what |
04:49:54 | FromDiscord | <Rika> i have no clue what you're trying to do |
04:51:50 | FromDiscord | <Technisha Circuit> I want to check if a `jsonNode.kind` is a `JArray` |
04:52:09 | FromDiscord | <Technisha Circuit> But idk if it's better to handle an error or deal with a boolean in Nim |
04:52:18 | FromDiscord | <Technisha Circuit> In python it's better to deal with a boolean |
04:52:57 | FromDiscord | <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:29 | FromDiscord | <Elegant Beef> How you handle it doesnt really matter |
04:53:36 | FromDiscord | <Technisha Circuit> Okay then |
04:53:41 | FromDiscord | <Technisha Circuit> Thanks |
04:53:46 | leorize[m] | just raise an exception :P |
04:53:47 | FromGitter | <bung87> boolean in loop ,resursive |
04:54:25 | FromGitter | <bung87> raise for io things |
04:54:49 | FromDiscord | <Technisha Circuit> Okay |
04:54:53 | FromDiscord | <Technisha Circuit> Thanks |
04:54:56 | leorize[m] | ValueError is a good exception for things like this |
04:55:05 | leorize[m] | though it really depends on what kind of work are you doing |
04:55:12 | leorize[m] | not everything should be done via exceptions |
04:55:33 | * | narimiran joined #nim |
04:56:24 | FromDiscord | <Technisha Circuit> Is raising exceptions similar to python? `raise ValueError('String')` in python |
04:56:38 | leorize[m] | read the manual please |
04:57:01 | FromDiscord | <Technisha Circuit> Okay :P |
04:57:45 | FromDiscord | <Technisha Circuit> Nim's method calling syntax is nice |
04:58:16 | FromDiscord | <Technisha Circuit> I can either do `foo.bar()` or `bar(foo)` |
04:58:20 | FromDiscord | <Technisha Circuit> Which i like |
05:01:20 | FromDiscord | <Elegant Beef> Yes the method call syntax is fantastic |
05:01:40 | leorize[m] | wait until you found out about command call syntax :P |
05:02:19 | FromDiscord | <Elegant Beef> Eh, that's shitty |
05:02:54 | leorize[m] | I'd say it's a pretty cool feature |
05:03:17 | FromDiscord | <Elegant Beef> I dislike it so i have to disagree |
05:03:46 | FromDiscord | <Elegant Beef> for arguementless functions it's fine but when it has arguements i dislike it |
05:04:00 | leorize[m] | it's a way |
05:04:15 | leorize[m] | it's not like you have to use it all the time lol :p |
05:04:22 | FromDiscord | <Elegant Beef> I know |
05:04:35 | leorize[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:02 | FromDiscord | <Elegant Beef> Eh, im a tabs man so i dont think you should control how it's read |
05:05:46 | FromDiscord | <Elegant Beef> Write clean code, and let the reader read the damn way they want! |
05:05:52 | leorize[m] | not sure if I understand :P |
05:06:00 | leorize[m] | ah ok |
05:06:50 | skrylar[m] | nim doesn't use copying gcs does it :think: |
05:07:10 | leorize[m] | copying gc? |
05:07:12 | FromDiscord | <Rika> what do you mean |
05:07:40 | skrylar[m] | copying gc means it moves/compacts memory |
05:07:55 | skrylar[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:06 | leorize[m] | nah, our gc does the opposite |
05:08:10 | leorize[m] | it almost never free memory :P |
05:08:19 | skrylar[m] | pff. the incremental one works okay |
05:08:19 | FromDiscord | <Rika> im not intelligent enought to understand lmao |
05:08:29 | FromDiscord | <Technisha Circuit> > wait until you found out about command call syntax :P↵Wdym? |
05:08:39 | FromDiscord | <Elegant Beef> `echo a` vs `echo(a)` |
05:08:45 | FromDiscord | <Technisha Circuit> Oh |
05:08:49 | skrylar[m] | Rika: well 'tracing gc' means it understands how objects are built and 'traces' references from roots |
05:08:54 | FromDiscord | <Elegant Beef> or `object.procName` |
05:09:24 | FromDiscord | <Technisha Circuit> I prefer using `echo a` for somethings over`echo(a)`, but it really depends |
05:09:28 | skrylar[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:46 | skrylar[m] | this lets you avoid fragmentation because you can copy/compact memory, but it means pointers have to be updated |
05:10:03 | leorize[m] | nim gc never do that, don't worry |
05:10:03 | leorize[m] | it's dumb anyway |
05:10:04 | * | zacharycarter joined #nim |
05:10:31 | skrylar[m] | compacters aren't dumb per se... generational compaction can do pretty well |
05:10:35 | skrylar[m] | of course not making garbage is always best |
05:10:48 | leorize[m] | well and require you to update all references? |
05:11:00 | leorize[m] | that sounds like bugs waiting to happen |
05:11:10 | FromDiscord | <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:17 | skrylar[m] | yes those vm's have pin/unpin apis because of this |
05:11:34 | skrylar[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:03 | leorize[m] | yea that's bugs waiting to happen |
05:12:21 | leorize[m] | Nim GC can collect chunks of "freed" memory then reuse it for later objects |
05:12:25 | skrylar[m] | no more than dealing with gc_ref calls |
05:13:05 | skrylar[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:21 | FromDiscord | <Rika> hey i understand shit wow |
05:18:45 | leorize | give yourself more credit lol |
05:18:49 | FromDiscord | <Elegant Beef> One day i hope to understand shit |
05:20:58 | FromDiscord | <Rika> leorize: lolno |
05:22:05 | skrylar[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:05 | skrylar[m] | just kick them off the seq" |
05:24:14 | * | zacharycarter quit (Ping timeout: 240 seconds) |
05:27:05 | FromDiscord | <Elegant Beef> Wow leorize doesnt say i need to give myself more credit |
05:27:06 | leorize | I've a weird idea for DIY system security on Linux |
05:27:07 | FromDiscord | <Elegant Beef> He's a meanie |
05:27:08 | FromDiscord | <Elegant Beef> Report! |
05:27:18 | leorize | dunno if I should attempt it |
05:27:48 | FromDiscord | <Elegant Beef> I mean cutting the ethernet cord isnt ground breaking |
05:28:08 | FromDiscord | <Rika> sometimes its ground breaking |
05:28:12 | FromDiscord | <Rika> sometimes its wall breaking |
05:28:17 | leorize | @Beef well now you know why I didn't say you should give yourself more credit :P |
05:28:31 | FromDiscord | <Elegant Beef> I make funny jokes? |
05:28:43 | FromDiscord | <Rika> no you just dont deserve it xd |
05:29:30 | FromDiscord | <Elegant Beef> Ah |
05:29:38 | FromDiscord | <Elegant Beef> So no one likes my jokes got it |
05:30:58 | FromDiscord | <Rika> F |
05:31:47 | * | rockcavera quit (Remote host closed the connection) |
05:32:09 | FromDiscord | <Elegant Beef> Is that my rating or are you paying respects? |
05:32:24 | leorize | yes |
05:32:25 | skrylar[m] | both |
05:32:59 | FromDiscord | <Elegant Beef> I dont like this community im going to go to rust now, see what you did |
05:33:02 | FromDiscord | <Elegant Beef> You lost a numpty |
05:33:19 | FromDiscord | <Rika> numPty |
05:33:48 | leorize | I can see that the progress bars are getting into you :P |
05:34:38 | skrylar[m] | i went to rust when newruntime was a thing |
05:34:41 | skrylar[m] | i came back because oxidized metal is a poor building resource |
05:35:29 | FromDiscord | <Rika> leorize: i've been working on them for 4 days now i think |
05:37:21 | FromDiscord | <Elegant Beef> Ok im back from my journey, they have this annoying borrow thing and `let mut` for mutable variables |
05:37:45 | skrylar[m] | borrow checker is okay. it annoyed me with thinking it was smarter than me though |
05:38:21 | leorize | one day I'll try rust again |
05:38:26 | skrylar[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:53 | leorize | I tried it when it was alpha, was put off by the syntax |
05:39:02 | skrylar[m] | i used it in 0.8 and 1.something |
05:39:06 | FromDiscord | <Technisha Circuit> > One day i hope to understand shit↵~~Shit is disgusting~~ |
05:39:21 | FromDiscord | <Technisha Circuit> :P |
05:39:30 | skrylar[m] | it's very much not for gamedev. they consider float code looking awful a "feature" |
05:39:38 | FromDiscord | <Elegant Beef> Yea im actually disgusted by the syntax it's like C++ had a baby but did drugs whilst pregnant |
05:39:39 | skrylar[m] | and slow compile time is ok because a sufficiently smart compiler will just optimize that away (someday) |
05:39:59 | leorize | also apply to the high memory usage |
05:40:20 | skrylar[m] | i had a couple stupid ideas for incremental compilation but meh |
05:40:42 | leorize | well rust memory management works |
05:40:48 | leorize | it's just too much of a hassle to actually use |
05:41:05 | FromDiscord | <Rika> we need someone who uses rust to pitch in |
05:41:05 | leorize | even the rust people have to agree |
05:41:30 | skrylar[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:40 | skrylar[m] | that's probably not simpler than what disrupek is doing :X |
05:42:05 | FromDiscord | <Rika> i think its actually similar to what disruptek is doing |
05:42:18 | skrylar[m] | ey's doing something about caching individual mutations to a module |
05:42:22 | skrylar[m] | memoizing changes |
05:42:56 | leorize | did matrix broke the irc bridge? |
05:43:02 | FromDiscord | <Rika> ? |
05:43:03 | FromDiscord | <Technisha Circuit> Is the braces skin for nim still a thing and is it safe to use in my projects now? |
05:43:04 | FromDiscord | <Rika> what happened? |
05:43:06 | leorize | looks like your message was cut of |
05:43:13 | FromDiscord | <Rika> @Technisha Circuit dont think so |
05:43:20 | FromDiscord | <Technisha Circuit> Aw |
05:43:27 | leorize | syntax skins are dead long ago |
05:43:35 | FromDiscord | <Technisha Circuit> Oh okay |
05:43:46 | FromDiscord | <Rika> it's just too much of a hassle to do i assume |
05:43:49 | FromDiscord | <Rika> and infe |
05:43:51 | FromDiscord | <Technisha Circuit> So has anyone reimplemented something like this? |
05:43:51 | FromDiscord | <Rika> (edit) 'infe' => 'infer' |
05:43:56 | FromDiscord | <Yardanico> No |
05:44:09 | FromDiscord | <Yardanico> Good morning |
05:44:09 | leorize | we really just removed it do prevent dialects iirc :P |
05:44:12 | FromDiscord | <Technisha Circuit> https://forum.nim-lang.org/t/2811 and i agree with this old post |
05:44:14 | leorize | the code was working pretty find |
05:44:16 | FromDiscord | <Technisha Circuit> Good morning |
05:44:16 | leorize | fine* |
05:44:20 | FromDiscord | <Rika> i'm surprised that you asked, given that you always ask stuff about nim and python things |
05:44:22 | FromDiscord | <FromIRC> Uptime - 1 day, 13 hours, 6 minutes, 53 seconds, 253 milliseconds, 687 microseconds, and 319 nanoseconds |
05:44:22 | FromDiscord | <Yardanico> !status |
05:44:25 | leorize | morning @Yardanico |
05:44:34 | FromDiscord | <Technisha Circuit> I prefer braces :P |
05:44:54 | leorize | braces are evil and I don't miss them :P |
05:45:16 | FromDiscord | <Technisha Circuit> I just like braces in general ;-; |
05:45:27 | FromDiscord | <Technisha Circuit> So is it possible to implement? |
05:45:32 | leorize | I find looking at the indent guide to tell me where my scope end is easier than looking for the opposite brace |
05:45:33 | FromDiscord | <Rika> why not |
05:45:35 | FromDiscord | <Rika> it was done before |
05:45:55 | FromDiscord | <Yardanico> @Technisha Circuit it is possible because it was there already |
05:45:59 | FromDiscord | <Technisha Circuit> Hmm, would a Nim beginner be able to implement it? |
05:46:03 | FromDiscord | <Technisha Circuit> Oh okay |
05:46:07 | FromDiscord | <Rika> no |
05:46:13 | FromDiscord | <Technisha Circuit> ~~Could i just reuse some old code?~~ |
05:46:15 | skrylar[m] | i guess you could use this to get a bracey nim https://nim-lang.org/docs/filters.html |
05:46:15 | FromDiscord | <Yardanico> But it requires more maintenance and you need to update one more syntax |
05:46:15 | FromDiscord | <Technisha Circuit> Oof okay |
05:46:21 | FromDiscord | <Rika> maybe someone as good as disrup can do it |
05:46:40 | leorize | you can implement it back again, it's just a pita to actually do so |
05:46:46 | leorize | esp after the compiler rework |
05:46:58 | FromDiscord | <Technisha Circuit> Big oof |
05:47:00 | FromDiscord | <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:17 | skrylar[m] | ~~go back to c~~ |
05:47:23 | FromDiscord | <Technisha Circuit> I don't know C |
05:47:29 | leorize | then learn it :p |
05:47:42 | FromDiscord | <Technisha Circuit> It's just that after language hopping for a while I've learned to like braces |
05:47:43 | skrylar[m] | just being facetious nobody should have to suffer c/c++ |
05:48:05 | FromDiscord | <Technisha Circuit> But I still love Python's syntax which is why i love Nim |
05:48:16 | FromDiscord | <Technisha Circuit> Only thing i wish for is for it to have braces ;-; |
05:48:22 | skrylar[m] | i liked it because it was pascal-ish back in the day. and it sucks the least |
05:48:37 | FromDiscord | <Technisha Circuit> Also, doesn't Python have a feature to use 'skins'? |
05:48:43 | * | m|b_ joined #nim |
05:49:00 | leorize | skrylar[m]: that's mine too |
05:49:11 | leorize | I considered ada at one point but it's too verbose |
05:49:11 | skrylar[m] | leorize: hooray for being the least bad \o/ |
05:49:14 | FromDiscord | <Yardanico> @Technisha Circuit I don't think so |
05:49:30 | FromDiscord | <Technisha Circuit> Because there's https://github.com/NeKitDS/braces.py |
05:49:37 | FromDiscord | <Yardanico> Well technically there's a way but it's so ugly |
05:49:41 | FromDiscord | <Yardanico> And it's runtime |
05:49:45 | FromDiscord | <Technisha Circuit> You just do `#coding: braces` |
05:49:56 | FromDiscord | <Technisha Circuit> (edit) 'You just do `#coding: braces` ... ' => 'You just do `#coding: braces`at the start of the file' |
05:49:58 | FromDiscord | <Technisha Circuit> Oh okay |
05:50:02 | FromDiscord | <Elegant Beef> The only thing i want from any other language syntax is tab support |
05:50:12 | FromDiscord | <Technisha Circuit> No thanks- |
05:50:13 | leorize | you can have tab support |
05:50:17 | FromDiscord | <Technisha Circuit> I hate tabs now- |
05:50:18 | FromDiscord | <Yardanico> @Technisha Circuit yeah they abused source file encoding |
05:50:19 | FromDiscord | <Elegant Beef> Im fine with nim syntax but give me seemless tab support! |
05:50:25 | FromDiscord | <Technisha Circuit> Okay :P |
05:50:32 | FromDiscord | <Yardanico> It's done at runtime |
05:50:41 | leorize | @Beef you can with just a small header |
05:50:44 | skrylar[m] | ~~the only faceplate you should use is hy~~ |
05:50:45 | FromDiscord | <Technisha Circuit> ~~Just turn all tabs to spaces~~ |
05:50:53 | leorize | disruptek actually use tabs fwiw :P |
05:50:54 | FromDiscord | <Rika> ah man |
05:51:00 | FromDiscord | <Rika> you shouldnt have started this nisha |
05:51:06 | FromDiscord | <Technisha Circuit> Hahaha |
05:51:14 | FromDiscord | <Elegant Beef> I mean tabs are empirically the better option |
05:51:20 | FromDiscord | <Yardanico> @leorize good joke :P |
05:51:38 | FromDiscord | <Technisha Circuit> > I mean tabs are empirically the better option↵That's debatable |
05:51:39 | leorize | not a joke, he actually started out writing Nim with tabs |
05:51:39 | FromDiscord | <Yardanico> @Elegant Beef your editor already adds spaces when you press Tab |
05:51:41 | FromDiscord | <Rika> tell me when all programs have tab sizing support natively |
05:51:49 | skrylar[m] | i also wrote nim with tabs '_' |
05:51:53 | FromDiscord | <Technisha Circuit> Hahaha |
05:52:00 | skrylar[m] | i actually use a lot of the things araq ultimately toasted |
05:52:07 | skrylar[m] | which is why i've also ragequit several times |
05:52:12 | FromDiscord | <Technisha Circuit> Oof |
05:52:17 | FromDiscord | <Rika> what things? |
05:52:19 | FromDiscord | <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:23 | FromDiscord | <Elegant Beef> renders* |
05:52:37 | FromDiscord | <Technisha Circuit> Just do 2 spaces |
05:52:45 | skrylar[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:52 | FromDiscord | <Elegant Beef> Do 2 spaces |
05:52:53 | FromDiscord | <Technisha Circuit> I wonder if it's possible to do 0 width indentation in Nim- |
05:52:57 | FromDiscord | <Elegant Beef> Im an 8 tspace tabber |
05:53:01 | skrylar[m] | i looked at hazard pointers |
05:53:01 | FromDiscord | <Elegant Beef> 8 space * |
05:53:02 | FromDiscord | <Technisha Circuit> Oof |
05:53:11 | FromDiscord | <Elegant Beef> I like my big ol' tabs |
05:53:12 | FromDiscord | <Technisha Circuit> (edit) '0 width' => '0-width' |
05:53:12 | FromDiscord | <Yardanico> @Technisha Circuit how that would work? |
05:53:28 | leorize | it's easy to mistake tabs-resizability with actual practical usage |
05:53:29 | FromDiscord | <Technisha Circuit> No idea, probably use a character that doesn't render ¯\\_(ツ)\_/¯ |
05:53:33 | FromDiscord | <Yardanico> Ah well, if you use some unicode character, then maybe |
05:53:38 | FromDiscord | <Yardanico> It's already possible |
05:53:45 | FromDiscord | <Yardanico> Just use a source code filter |
05:53:47 | FromDiscord | <Rika> zero width space |
05:53:52 | FromDiscord | <Rika> they deffo exist |
05:53:53 | FromDiscord | <Yardanico> To replace some invisible character with space |
05:53:53 | FromDiscord | <Technisha Circuit> |
05:53:55 | FromDiscord | <Technisha Circuit> This |
05:54:00 | leorize | in fact, you're kinda forced to use one tab size for the whole project once you use tab |
05:54:07 | FromDiscord | <Technisha Circuit> Oh? How would i do this? |
05:54:08 | leorize | so no better than actually using spaces |
05:54:20 | FromDiscord | <Yardanico> https://nim-lang.org/docs/filters.html |
05:54:34 | leorize | the only thing I like about tabs is elastic tabstops |
05:54:38 | FromDiscord | <Rika> just regex all zero widths into actual spaces 😛 |
05:54:38 | leorize | but that never took off |
05:54:39 | FromDiscord | <Yardanico> Specifically https://nim-lang.org/docs/filters.html#available-filters-replace-filter |
05:54:39 | FromDiscord | <Elegant Beef> What are you on about leo? |
05:54:51 | FromDiscord | <Elegant Beef> You're forced to use one tab size? |
05:55:06 | FromDiscord | <Elegant Beef> a tab is a tab |
05:55:09 | leorize | yep, once you change the size everything stops aligning |
05:55:14 | FromDiscord | <Elegant Beef> You can change the way it renders to be the way you prefer |
05:55:17 | FromDiscord | <Elegant Beef> Who cares about alignment |
05:55:18 | leorize | for a tab-only flow that is |
05:55:31 | FromDiscord | <Rika> sometimes i want my damn comments to align tho |
05:55:39 | FromDiscord | <Technisha Circuit> Thanks! |
05:55:39 | FromDiscord | <Elegant Beef> Well have fun |
05:56:03 | FromDiscord | <Rika> leorize: same here regards the elastic tabstops |
05:56:13 | FromDiscord | <Rika> those looked interesting |
05:56:22 | FromDiscord | <Rika> until i read that they charged for the plugins... |
05:57:08 | leorize | it never got implemented for vim |
05:57:31 | leorize | I actually tested it with sublime once, pretty cool |
05:57:47 | leorize | but eventually none of my tools support it so I have to drop it |
06:03:17 | FromDiscord | <Technisha Circuit> sent a code paste, see http://ix.io/2mi4 |
06:04:12 | FromDiscord | <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:17 | FromDiscord | <Technisha Circuit> And I don't understand ;-; |
06:04:36 | leorize | use double quotes |
06:04:43 | leorize | most UTF-8 stuff are multibyte |
06:04:55 | leorize | you can't store them in a char |
06:05:32 | FromDiscord | <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:52 | FromDiscord | <Rika> what the fuck |
06:06:03 | FromDiscord | <Rika> why are there so many people programming on their phones |
06:06:15 | FromDiscord | <Technisha Circuit> Because i cannot access my PC rn |
06:06:18 | FromDiscord | <Rika> ah |
06:06:21 | FromDiscord | <Rika> i guess thats valid |
06:06:27 | FromDiscord | <Technisha Circuit> And i didn't have a PC a while aho |
06:06:27 | FromDiscord | <Rika> man it must be hell then |
06:06:56 | FromDiscord | <Technisha Circuit> Actually i used to be able to use a normal Mobile text editor eith shitty text wrapping quite well |
06:07:08 | FromDiscord | <Technisha Circuit> Using a PC with vsc has spoiled me |
06:07:14 | FromDiscord | <Rika> still sounds absolutely hellish to me |
06:07:16 | FromDiscord | <Technisha Circuit> It's harder now |
06:07:36 | FromDiscord | <Rika> also that error gives no context on how it's not allowed there LMAO |
06:07:36 | FromDiscord | <Technisha Circuit> There are things like QuickEdit for mobile |
06:07:49 | FromDiscord | <Technisha Circuit> But i prefer nano :P |
06:07:51 | FromDiscord | <Technisha Circuit> Yeah |
06:07:57 | FromDiscord | <Technisha Circuit> I'm stumped ;-; |
06:08:25 | leorize | use neovim lol |
06:08:41 | FromDiscord | <Rika> use replace |
06:08:59 | FromDiscord | <Technisha Circuit> Using `sub` and `by`? |
06:09:00 | leorize | your Nim installation should contain nimsuggest |
06:09:11 | FromDiscord | <Technisha Circuit> What's that? :P |
06:09:18 | leorize | that means you can use nim.nvim and get supreme code editing experience on android |
06:09:32 | leorize | (yes I already verified that nim.nvim run on android) |
06:09:46 | FromDiscord | <Technisha Circuit> Oh nice |
06:09:49 | FromDiscord | <Rika> `#? replace(sub = "", by = " ")` i think works |
06:09:54 | FromDiscord | <Technisha Circuit> Thanks |
06:10:04 | FromDiscord | <Technisha Circuit> Also, what's neovim? |
06:10:18 | leorize | @Rika that would mean they can never use that string in a string literal |
06:10:32 | FromDiscord | <Rika> leorize: what? |
06:10:43 | FromDiscord | <Technisha Circuit> I can't use it in a string without it getting replaced |
06:10:50 | FromDiscord | <Technisha Circuit> That's what he means |
06:10:53 | FromDiscord | <Technisha Circuit> Or she |
06:10:55 | FromDiscord | <Technisha Circuit> Or they |
06:11:06 | FromDiscord | <Rika> when the fuck are you gonna use a 0-width space tho |
06:11:16 | FromDiscord | <Rika> other than your crazy indent idea |
06:11:27 | * | solitudesf- joined #nim |
06:11:38 | FromDiscord | <Technisha Circuit> Hahaha |
06:12:15 | leorize | I'm sorry, I prefer my solutions to be foolproof :P |
06:12:28 | FromDiscord | <Rika> then how else would you do that 😛 |
06:13:40 | * | nekits quit (Quit: The Lounge - https://thelounge.chat) |
06:14:29 | FromDiscord | <Technisha Circuit> Omfg it works hahaha |
06:14:38 | FromDiscord | <Technisha Circuit> Maybe regex? |
06:14:48 | FromDiscord | <Rika> theres no regex filter |
06:14:53 | FromDiscord | <Technisha Circuit> Oh |
06:14:55 | FromDiscord | <Technisha Circuit> :/ |
06:14:57 | caff | Hmmm, so I've run into an issue using `removePrefix` on a split string. |
06:15:00 | caff | https://play.nim-lang.org/#ix=2mi8 |
06:15:06 | * | nekits joined #nim |
06:15:09 | caff | "Error: expression 'removePrefix(test[0], "!")' has no type (or is ambiguous)" |
06:15:20 | caff | Unfortunately I'm a bit stumped here :/ |
06:15:53 | FromGitter | <bung87> discard it |
06:15:59 | FromDiscord | <Rika> removePrefix doesnt return anything |
06:16:05 | caff | OH |
06:16:06 | FromDiscord | <Rika> it's inplace |
06:16:17 | FromDiscord | <Rika> so it modifies the given string |
06:16:32 | caff | Thanks :facepalm: Probably should've looked at the docs a bit closer. |
06:16:33 | leorize | use `sugar.dup` if you want outplace |
06:16:36 | FromGitter | <bung87> mutate action have no returns |
06:16:55 | FromGitter | <bung87> and no returns. |
06:17:08 | FromDiscord | <Rika> caff, note that what leorize gave you only works in nim 1.2 |
06:17:16 | * | nekits quit (Client Quit) |
06:17:29 | caff | Perfect. Thanks. I'll have to look at that. I am using nim 1.2 :) |
06:18:16 | leorize | everyone should use nim 1.2 :P |
06:20:39 | * | nekits joined #nim |
06:23:34 | FromDiscord | <Rika> leorize: i agree but i'm just ensuring that its what they need |
06:24:43 | caff | I'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:22 | FromDiscord | <Technisha Circuit> ~~Json text markup language~~ |
07:38:57 | FromDiscord | <Rika> ugh |
07:39:06 | FromDiscord | <Rika> i think i'm scrapping this callback branch idea thing |
07:39:16 | FromDiscord | <Rika> callback -> closure |
07:40:09 | FromDiscord | <Technisha Circuit> Oof |
07:41:13 | FromDiscord | <Rika> yeah its a lot of work down the drain since i realized it was a really dumb idea |
07:42:04 | leorize | @Rika: uhmm, add `{.nimcall.}` on it and it won't be closure? |
07:43:08 | FromDiscord | <Rika> leorize: not that |
07:43:14 | FromDiscord | <Rika> it's an idea i cant express |
07:43:17 | FromDiscord | <Rika> well in words |
07:43:29 | FromDiscord | <Rika> basically i was thinking of making the progress bar output closures |
07:43:48 | FromDiscord | <Rika> something like how `streams` was implemented |
07:43:53 | leorize | have you read about CPS? |
07:44:01 | leorize | continuation passing style? |
07:44:06 | FromDiscord | <Rika> no |
07:45:07 | leorize[m] | http://www.pathsensitive.com/2019/07/the-best-refactoring-youve-never-heard.html |
07:45:30 | leorize[m] | https://arxiv.org/pdf/1011.4558.pdf |
07:45:37 | leorize[m] | dunno if any of this would apply to what you're doing |
07:50:28 | FromDiscord | <Rika> ooh, shiny |
07:51:22 | FromDiscord | <Rika> HOLY WOW |
07:51:25 | FromDiscord | <Rika> thats big brain |
07:52:12 | leorize | if everything went well, what you're seeing might be the future of Nim async |
07:52:22 | FromDiscord | <Rika> this is useful for another project i'm undertaking |
07:53:56 | FromDiscord | <Rika> okay the refactoring post is so long that i cant read it in full right now |
07:56:11 | leorize | how can people finish their projects :P |
08:01:11 | FromDiscord | <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:41 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> leorize: It's a struggle, that's for sure |
08:07:06 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> I think part of it is about forcing focus, at least it has been for me with the AMQP library |
08:07:51 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> 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:03 | leorize | I'm struggling to not write yet-another-library atm |
08:09:40 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Yeah I know those feels |
08:11:13 | Prestige | how am I even seeing your name rendered like that lol |
08:11:37 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> 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:04 | leorize | Prestige: it's UTF-8 |
08:13:07 | Yardanico | Prestige: letters in that nickname are from "Mathematical Bold Script" |
08:13:16 | Yardanico | which is a part of of utf-8 of course :) |
08:13:28 | leorize | Benumbed: I'm working on a new implementation of osproc |
08:13:31 | Yardanico | "Mathematical Alphanumeric Symbols, U+1D400 - U+1D7FF" |
08:13:32 | leorize | new API, new everything |
08:13:50 | Yardanico | btw rlwrap for nim secret works just fine |
08:13:57 | leorize | async support + proper pipes + sane interface that's simple and can be advanced if needed |
08:14:34 | Prestige | interesting |
08:14:51 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> That sounds rather valuable 🙂 |
08:15:16 | leorize | currently for pipes I'd appreciate a library that let me do buffering |
08:15:22 | leorize | (ie. just provide the buffering part) |
08:15:35 | leorize | preferably threadsafe |
08:15:59 | leorize | I also need a way to return buffers asynchronously (ie. return a buffer and the reader be notified on new data) |
08:16:16 | leorize | chronos asyncbuffers looks interesting but I haven't actually read the code |
08:16:28 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Callbacks! *ducks and runs* |
08:16:34 | supakeen | leorize: Are you making the poEvalCommand more sane as well? |
08:17:11 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> I'm actually interested in osproc and the threading stuff in Nim for AMQP consumers |
08:17:16 | leorize | well 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:31 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> The threading interface didn't strike me as very pleasant last time I looked at it though :/ |
08:17:51 | leorize | the threading is still a mess atm |
08:17:55 | leorize | ARC will clean it up |
08:18:10 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> That's one thing I liked about Go (one of the few things) |
08:18:48 | Yardanico | did you see weave btw? |
08:18:50 | supakeen | As in, separate from the args array which is just passed to execve? |
08:18:55 | Yardanico | and yeah, arc/orc has shared heap |
08:19:24 | leorize | supakeen: huh? poEvalCommand is "call using shell" |
08:19:50 | leorize | so basically I'm doing what quoteShellCommand() would do for you |
08:20:02 | supakeen | leorize: Correct, but I was wondering where you are going to fit that in the API. |
08:20:19 | leorize | (and will also leave the option of not quoting available if you want that) |
08:20:34 | leorize | well new api :p |
08:20:45 | supakeen | Because quoting shell commands is very hard and dependent on what /bin/sh is etc. |
08:20:56 | leorize | I do what posix sh do :) |
08:21:03 | leorize | I don't guess, it's not portable that way |
08:21:06 | supakeen | So 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:03 | leorize | I'm currently designing a DSL for launching stuff |
08:22:15 | leorize | mainly because a proc call won't get this done :P |
08:22:26 | leorize | though I might change my mind |
08:22:30 | leorize | now that I've seen Go's API |
08:22:31 | supakeen | Can I maybe take a look when you have some stuff? I care a lot about spawning processes for some reason. |
08:22:59 | leorize | sure, once I got the API done |
08:23:20 | supakeen | Nice, thanks. You can keep a pre-exec in mind as well which some APIs offer. |
08:23:49 | leorize | I go deeper, I'll let you in on fork() :) |
08:23:58 | supakeen | Ah nice. |
08:24:14 | supakeen | Also posix_spawn because I believe that's what's currently used on systems that have it? |
08:24:30 | leorize | I'm also researching ways to safely utilize vfork() where it's actually save resources |
08:24:45 | leorize | posix_spawn is a mess tbh |
08:25:06 | FromDiscord | <mratsim> I really think I should look into multithreading for IO tasks |
08:25:27 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Why would you multi-thread IO tasks rather than using async? |
08:25:32 | supakeen | Anyways it's shower and lunch time for me! We can discuss later if you're up for it. |
08:25:32 | leorize | depends on the os, but usually it's slower than async |
08:25:36 | leorize | I'd prefer combining both |
08:26:02 | FromDiscord | <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:14 | leorize | in a perfect world we can just multithread all of our IO |
08:27:22 | FromDiscord | <mratsim> @𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭 I don't know, but I don't mind looking into that |
08:27:29 | FromDiscord | <mratsim> apparently it works for Rust |
08:27:32 | leorize | too bad we are in one where that actually harm your performance |
08:27:48 | leorize | (yes I wrote a simple benchmark to verify that) |
08:27:58 | * | m|b_ quit (Quit: Connection closed for inactivity) |
08:28:24 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> In general, my experience has been, if your 'wait' is iowait, the best 'solution' is async |
08:28:32 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> best being most efficient |
08:29:27 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> 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:59 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> although I'm more of a multi-process person myself, shared memory models make me twitchy 😄 |
08:30:31 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Which is where I grow interested in the work on pipes |
08:30:38 | Yardanico | well sometimes you have to do some cpu-heavy tasks in async so async + threads is really good for that :) |
08:30:43 | Yardanico | or if you want to use async in a GUI app for example |
08:30:58 | Yardanico | without implementing your own asyncv GUI framework from scratch |
08:31:24 | * | konvertex joined #nim |
08:31:43 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> 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:56 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> or is that what you're talking about? |
08:32:06 | FromDiscord | <Technisha Circuit> Is there a websocket server library for Nim? |
08:32:08 | Yardanico | yes |
08:32:11 | Yardanico | there are multiple in fact |
08:32:12 | leorize | !repo websockets |
08:32:13 | Yardanico | !repo ws |
08:32:15 | disbot | https://github.com/niv/websocket.nim -- 9websocket.nim: 11websockets for nim 15 82⭐ 25🍴 7& 7 more... |
08:32:16 | disbot | https://github.com/treeform/ws -- 9ws: 11Simple WebSocket library for nim. 15 78⭐ 8🍴 7& 4 more... |
08:32:29 | Yardanico | xd |
08:32:40 | FromDiscord | <Technisha Circuit> Thanks! |
08:42:54 | FromDiscord | <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:48 | Yardanico | @wiremoons that's a cool blog post, but if you don't want to compile you can always download a precompiled release :) |
08:44:32 | FromDiscord | <wiremoons> For the Raspberry Pi ARM processor? |
08:44:40 | Yardanico | yes |
08:44:40 | leorize | yes, we just don't advertise them |
08:44:52 | Yardanico | https://github.com/nim-lang/nightlies/releases/tag/2020-05-15-version-1-2-d2d401c |
08:44:56 | leorize | actually debian should have it packaged, courtesy of federico3 |
08:45:08 | leorize | make sure you have backports on and you should have the latest nim |
08:45:24 | Yardanico | @wiremoons on that link you can find arm64/armv6/armv7/armv7a |
08:46:40 | FromDiscord | <wiremoons> Thanks @Yardanico - will add that to the post too |
08:47:15 | Yardanico | don't add that exact link, just https://github.com/nim-lang/nightlies/releases |
08:47:19 | leorize | iirc choosenim can do this too |
08:47:40 | FromDiscord | <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:46 | FromDiscord | <Technisha Circuit> (edit) 'Python,m' => 'Python?' |
08:47:57 | FromDiscord | <Rika> vs pure nim? yes |
08:47:59 | FromDiscord | <wiremoons> The Raspbain included version is quite out of date @leorize |
08:48:02 | FromDiscord | <Technisha Circuit> Oof |
08:48:02 | FromDiscord | <Rika> ffi still costs something |
08:48:13 | Yardanico | @Technisha yes, sinec on top of just Python speed you also need to interface with it |
08:48:20 | Yardanico | so the speed will be a bit lower maybe |
08:48:27 | FromDiscord | <Technisha Circuit> Big oof |
08:48:29 | leorize | wiremoons: ah yea raspbain don't backports from debian |
08:48:39 | FromDiscord | <Technisha Circuit> How about if i compile the Python module? |
08:48:45 | FromDiscord | <Technisha Circuit> Would that speed it up a bit? |
08:48:57 | leorize | if you can compile python to get speed boost everyone would have done that :P |
08:49:05 | FromDiscord | <wiremoons> Yes is a shame @leorize as that would be the quickest option otherwise! |
08:49:06 | FromDiscord | <Technisha Circuit> You can |
08:49:09 | FromDiscord | <Technisha Circuit> Cython |
08:49:21 | FromDiscord | <Technisha Circuit> https://cython.org/ |
08:49:23 | Yardanico | that's not python |
08:49:25 | leorize | I said "to get speed bost" |
08:49:27 | leorize | boost* |
08:49:38 | leorize | you can compile python however you want and it won't get faster |
08:49:41 | FromDiscord | <Technisha Circuit> Yeah that turns the code to C or C++ |
08:49:46 | Yardanico | it's still the same speed |
08:49:48 | leorize | the language semantics doomed itself to being slow |
08:49:50 | Yardanico | because it'll call python APIs |
08:49:52 | Yardanico | CPython* |
08:50:06 | Yardanico | well, it actually works with pypy but cffi is a much better option for C interop there |
08:50:17 | FromDiscord | <Technisha Circuit> And you can use cpdef to define variables in C with a type to speed it up |
08:50:20 | FromDiscord | <Technisha Circuit> Okay then :P |
08:50:25 | Yardanico | yes but that's not python then @Technisha |
08:50:27 | Yardanico | that's cython |
08:50:58 | leorize | isn't there some actual python -> native compiler announced on HN? |
08:51:06 | FromDiscord | <Technisha Circuit> Really? |
08:51:29 | Yardanico | leorize: I don't think there is |
08:51:34 | Yardanico | well there's Nuitka but it's a bit similar to Cython |
08:51:48 | Yardanico | it'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:54 | FromDiscord | <Technisha Circuit> Yeah except for no extra syntax iirc |
08:52:19 | Yardanico | wdym? |
08:52:21 | Yardanico | "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:58 | FromGitter | <bung87> with typed python source could be not hard |
08:53:04 | FromDiscord | <Technisha Circuit> Wdym? |
08:53:27 | Yardanico | @bung87 the problem is that Python by nature is not typed |
08:53:40 | Yardanico | duck typing can't go away with optional type annotations which are not enforced |
08:54:07 | FromGitter | <bung87> so in the end it will using python c api? |
08:55:43 | FromGitter | <bung87> ok, dynamic script language getting popular then they get typed.. |
08:56:04 | leorize | turns out people wanted typed languages :P |
09:00:26 | FromGitter | <bung87> something like developing then governance environment |
09:02:23 | leorize | I think it was just that typed language wasn't as developed as they are nowadays |
09:02:33 | leorize | now we have type inferrence, generics, etc. |
09:04:05 | FromGitter | <bung87> yeah, that's part of the reasons. |
09:04:37 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Re: Cython, Cython is a hybrid language Technisha |
09:04:54 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> You need to know how to write in Python, Cython and interface Cython with your target language |
09:05:06 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> I use Cython as the glue between my C++ game engine and the Python scripting layer |
09:05:29 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> It's very cool, but can have a steep learning curve if you're just looking to get shit done |
09:07:02 | FromDiscord | <Technisha Circuit> Nice |
09:07:06 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> There are things that will wrap your Python into an executable, but last I knew, there isn't a compiler for Python |
09:07:21 | FromDiscord | <Technisha Circuit> I wish there was tbh |
09:07:24 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> There are several fundamentally hard problems around 'compiling' Python |
09:07:30 | FromDiscord | <Technisha Circuit> Oh? |
09:08:05 | FromDiscord | <𝓑𝓮𝓷𝓾𝓶𝓫𝓮𝓭> Yeah, and as much as I'd love to get into all that, I really need to go to bed |
09:08:20 | FromDiscord | <Technisha Circuit> Okay, goodnight! |
09:08:49 | FromDiscord | <Rika> first thing is the dynamic typing i bet |
09:08:55 | leorize | nope |
09:09:10 | leorize | julia already did it, dynamic typing but compiled |
09:09:40 | FromDiscord | <Technisha Circuit> Mhm |
09:10:11 | leorize | though if you try hard enough, you can compile anything to native |
09:11:29 | Yardanico | yeah, but as always native doesn't neccesarily mean fast :P |
09:12:33 | * | Trustable joined #nim |
09:28:25 | leorize[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:10 | leorize[m] | the matrix is flexible and github actions features 20 free concurrent tasks, which might help with the CI performance for weave |
09:49:59 | FromDiscord | <Recruit_main707> Is strip an expensive function? |
09:54:58 | Yardanico | depends on what you mean |
09:55:17 | Yardanico | you 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:21 | FromDiscord | <Recruit_main707> Let’s say I send information separated by commas, would msg.strip(“,”) be very time consuming? |
09:59:36 | Yardanico | uhh, you mean split not strip? |
09:59:52 | FromDiscord | <Recruit_main707> Yes, sorry 😅 |
10:00:08 | Yardanico | well 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:09 | dom96 | Why commas? |
10:00:32 | FromDiscord | <Recruit_main707> Why not ¯\_(ツ)_/¯ |
10:00:47 | dom96 | because you might as well send JSON instead of writing a custom parser |
10:00:55 | dom96 | the performance will not be much different |
10:01:47 | FromDiscord | <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:04 | Yardanico | then don't do it as text, send it as a binary? |
10:02:08 | Yardanico | msgpack, etc |
10:02:46 | FromGitter | <bung87> it's about the string length, and memory copy. |
10:02:49 | FromDiscord | <Recruit_main707> I still have to do some research in how to do it |
10:03:15 | FromDiscord | <Recruit_main707> I’ll have a look at msgpack |
10:04:05 | Yardanico | https://github.com/jangko/msgpack4nim |
10:12:25 | dom96 | What are you working on? |
10:13:48 | FromDiscord | <Recruit_main707> On an RLBot <-> python <-> Nim bridge |
10:14:55 | dom96 | for the chat in rocket league? |
10:15:16 | Yardanico | dom96: RLBot is for actual RL bots |
10:15:24 | FromDiscord | <Recruit_main707> Ye |
10:15:25 | Yardanico | not chat bots, but bots who play :P |
10:15:58 | dom96 | yes, I know |
10:16:08 | dom96 | You shouldn't assume I don't know things :P |
10:16:12 | Yardanico | @Recruit why do you need python though? |
10:16:22 | Yardanico | RLBot has C++ and Rust versions, so a Nim version should be possible, no? |
10:16:25 | dom96 | I am wondering whether Recruit wants to bridge debug messages or just chat messages |
10:16:46 | FromDiscord | <Recruit_main707> I want to bridge the game information |
10:17:02 | FromDiscord | <Recruit_main707> And then the Nim part sends game inputs back |
10:17:07 | FromDiscord | <Recruit_main707> That’s why performance is key, hopefully getting a few tps by using msgpack |
10:17:21 | dom96 | ahh, you want to pass the game info data from Python to Nim and vice versa |
10:17:27 | FromDiscord | <Recruit_main707> And hoping the Nim part is always really fast |
10:17:32 | Yardanico | why not try nimpy btw? |
10:17:35 | dom96 | I think wrapping the C++ bot framework would work better |
10:17:58 | dom96 | if you're working around that with msgpack then that's a bad idea |
10:17:59 | FromDiscord | <mratsim> > Is strip an expensive function?↵@Recruit_main707 it allocates, it's expensive 😛 |
10:18:00 | FromDiscord | <Recruit_main707> I thought about it, but the c++ framework is a bit messy |
10:18:17 | FromDiscord | <Recruit_main707> And they use flatbuffers |
10:18:18 | FromDiscord | <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:30 | FromDiscord | <Recruit_main707> That’s the main reason I am using the bridge |
10:19:19 | * | dddddd joined #nim |
10:19:22 | dom96 | if you're passing data through python then you're already going to get poor performance |
10:19:27 | dom96 | at that point, why not just use Python? |
10:19:39 | FromDiscord | <Recruit_main707> Because Nim :) |
10:20:25 | FromDiscord | <mratsim> is multiline IRC<->Discord fixed? |
10:20:32 | FromDiscord | <Recruit_main707> Sockets will become part of the framework officially “soon” also, so hopefully my pain will end eventually |
10:20:44 | Yardanico | @mratsim yes :P |
10:21:34 | FromDiscord | <mratsim> sent a long message, see http://ix.io/2mj8 |
10:22:12 | dom96 | Yardanico, you should advertise your bot |
10:22:18 | FromDiscord | <Recruit_main707> And if everything else fails, my flatbuffers implementation is alsmost finished, I would only need to transpile the framework |
10:22:23 | dom96 | it's really great and it would be awesome to get more users/contributors |
10:22:36 | FromDiscord | <mratsim> "transpile" is a banned keyword in there 😉 |
10:23:15 | FromDiscord | <Recruit_main707> why? |
10:23:15 | FromDiscord | <Rika> transpile is a ban, sorry to see you go recruit |
10:23:27 | FromDiscord | <Rika> many people call the nim compiler a transpiler |
10:23:30 | FromDiscord | <Rika> since it goes from nim to c |
10:23:46 | Yardanico | dom96: well I might try but not that many people *only* need IRC<->Discord :p |
10:23:47 | FromDiscord | <Recruit_main707> Nim to _optimized_ c |
10:24:04 | FromDiscord | <mratsim> not optimized actually |
10:24:17 | FromDiscord | <Rika> id just say C |
10:24:29 | FromDiscord | <Rika> not really optimized but surely better than some C noob could do i guess |
10:27:59 | FromDiscord | <dom96> This chat when someone mentions "transpiler": |
10:28:04 | FromDiscord | <dom96> https://tenor.com/view/angry-leonardo-di-caprio-the-wolf-of-wall-street-speech-gif-4280413 |
10:28:30 | Yardanico | well 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:49 | skrylar[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:39 | Zevv | The 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:31 | skrylar[m] | alright 1.2. stable doesn't have the initial assignment call to `=` like 0.20 did .. hm |
11:22:51 | solitudesf- | why doesnt this work? https://play.nim-lang.org |
11:22:55 | * | solitudesf- is now known as solitudesf |
11:23:39 | Yardanico | what code? :P |
11:25:38 | solitudesf | what the heck |
11:25:56 | solitudesf | i cant copypaste |
11:25:56 | solitudesf | https://play.nim-lang.org/#ix=2mkv |
11:27:27 | Yardanico | "template/generic instantiation of `==` from here" |
11:27:43 | Yardanico | you need == |
11:27:50 | Yardanico | https://play.nim-lang.org/#ix=2mkw |
11:28:43 | solitudesf | +1 iq aquired. thanks |
11:31:59 | * | liblq-dev joined #nim |
11:35:09 | skrylar[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:32 | skrylar[m] | (and thats mostly because of preserving the address of the item being sink'ed) |
11:37:47 | federico3 | wiremoons have you tried https://raspi.debian.net/ ? |
11:41:32 | FromDiscord | <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:25 | skrylar[m] | weirdly i can't get =sync to get called, but it does copy and then destruct so. shrug. |
11:42:30 | skrylar[m] | *=sink |
11:42:54 | FromDiscord | <dom96> @Zevv don't think so |
11:43:37 | FromDiscord | <Recruit_main707> msgpack looks very promising, do you guys know of nim benchmarks comparing it to json? |
11:44:03 | FromDiscord | <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:07 | FromDiscord | <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:16 | skrylar[m] | msgpack is an okay format, but i recommend cbor if you are green fielding something |
11:47:39 | FromDiscord | <Recruit_main707> and he doesnt even use discord :P |
11:48:12 | FromDiscord | <wiremoons> Never sure which to on a reply.... |
11:48:16 | Zevv | dom96: aw that's too bad :( |
11:48:19 | FromDiscord | <wiremoons> *use |
11:48:24 | Zevv | I'll ask ar4q when he is around |
11:48:32 | * | caff quit (Quit: WeeChat 2.8) |
11:48:45 | FromDiscord | <Recruit_main707> write it without the @, that way it will ping him in irc, which is what he normally uses |
11:49:02 | FromDiscord | <Recruit_main707> (if im not mistaken thats how it works) |
11:49:38 | FromDiscord | <wiremoons> Ok - thanks @Recruit_main707 - didn't know it worked without the '@' symbol |
11:50:10 | Yardanico | @wiremoons IRC clients highlight your username when they see it in any message |
11:50:14 | Yardanico | you don't need any prefixes like @ |
11:50:17 | Yardanico | it's all client-side |
11:50:57 | FromDiscord | <wiremoons> OK - thanks yardanico |
11:53:01 | FromDiscord | <Clyybber> skrylar: =sink can get optimized away in some cases, such as when its the first write to the variable |
11:53:25 | FromDiscord | <Clyybber> Because then the `=destroy(lhs)` in the sink call isn't needed, so a simple bit copy suffices |
12:05:11 | FromDiscord | <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:03 | federico3 | skrylar[m]: why CBOR? https://en.wikipedia.org/wiki/Comparison_of_data-serialization_formats |
12:07:46 | * | sz0 joined #nim |
12:08:07 | FromDiscord | <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:54 | FromDiscord | <Clyybber> @mratsim Its optimized regardless of what =destroy does, only condition is it has to be the first write |
12:13:57 | FromDiscord | <Technisha Circuit> if i do `import "a" as l` and then i do `import "b" as l`, what happens? |
12:14:07 | Yardanico | big bang |
12:14:19 | FromDiscord | <Technisha Circuit> wut |
12:14:35 | Yardanico | don't worry, you can't do that :) |
12:14:36 | FromDiscord | <Clyybber> You'll get a compile error |
12:14:40 | FromDiscord | <Technisha Circuit> oof |
12:14:51 | Yardanico | ? that's fair |
12:14:55 | FromDiscord | <Technisha Circuit> is there a way i can remove an import? |
12:14:59 | FromDiscord | <Clyybber> ? |
12:15:06 | FromDiscord | <Clyybber> Don't write it |
12:15:11 | FromDiscord | <Recruit_main707> ^ |
12:15:17 | FromDiscord | <Technisha Circuit> im tryna make a command per file system with dimscord |
12:16:03 | Yardanico | so? |
12:16:15 | FromDiscord | <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:22 | Yardanico | why would you need that? |
12:16:37 | FromDiscord | <Technisha Circuit> so i can get the data from the file |
12:16:43 | Yardanico | you can write a macro |
12:16:45 | Yardanico | like I did before |
12:16:53 | FromDiscord | <Clyybber> also, keep in mind that nim is compiled |
12:16:53 | Yardanico | I did the same with my social network bot in Nim a long time ago, but it was a bit more complicated |
12:17:03 | Yardanico | you could declare new modules which contain commands |
12:17:05 | Yardanico | one module per file |
12:17:10 | FromDiscord | <Technisha Circuit> okay |
12:17:11 | Yardanico | and it's all compile-time only |
12:17:18 | FromDiscord | <Technisha Circuit> oh okay |
12:17:32 | Yardanico | https://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:17 | Yardanico | the relevant macro code is in https://github.com/Yardanico/nickel/blob/master/src/dsl.nim |
12:18:29 | FromDiscord | <Technisha Circuit> thanks |
12:18:50 | Yardanico | I also use "include" so I don't have to write same imports in every file :) |
12:19:01 | FromDiscord | <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:01 | Yardanico | I mean I can also use import/export and then "import base", but there's basically not a lot of difference |
12:20:19 | FromDiscord | <Technisha Circuit> o |
12:21:00 | FromDiscord | <Recruit_main707> Yardanico: include == import + export?? |
12:21:07 | Yardanico | well I mean in my case it is |
12:21:19 | Yardanico | because I only use include to import some common modules each of my modules needs |
12:22:07 | FromDiscord | <Rika> include is "put this file inside the current file" |
12:22:11 | FromDiscord | <Rika> the contents |
12:22:11 | Yardanico | yes |
12:22:23 | FromDiscord | <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:08 | skrylar[m] | huh. with the normal gc, putting stuff in a seq isn't triggering the copy constructor. under arc, it is. :headscratches |
12:55:17 | skrylar[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:27 | skrylar[m] | well thats.. yea i'm too tired to fix this tonight |
13:16:45 | skrylar[m] | it works with --gc:arc, and it works with --newruntime, but it explicitly blows up with the default gc |
13:16:56 | Yardanico | then always use arc ;) |
13:18:32 | * | dadada joined #nim |
13:18:55 | * | dadada is now known as Guest93953 |
13:24:08 | skrylar[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:04 | skrylar[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:47 | FromDiscord | <Clyybber> @skrylar: Do you have an example? |
13:41:45 | skrylar[m] | Clyybber: bottom of this shows it off https://gist.github.com/Skrylar/8b0c95074129cc2de788e20436801be0 |
13:43:37 | * | filcuc_ joined #nim |
13:44:11 | skrylar[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:27 | FromDiscord | <Clyybber> > but the dest pointer is not stable when shoving in a struct |
13:46:31 | FromDiscord | <Clyybber> WDYM? |
13:46:41 | skrylar[m] | in a seq |
13:46:51 | FromDiscord | <Clyybber> The dest argument of `=destroy` or `=`? |
13:46:55 | skrylar[m] | var y = x # dest pointer will be y, so the death notice does work |
13:47:01 | skrylar[m] | of `=` |
13:47:55 | FromDiscord | <Clyybber> Sorry, I still don't entirely understand what the problem is |
13:48:08 | * | filcuc joined #nim |
13:48:15 | FromDiscord | <Clyybber> What do you mean its not "stable"? |
13:48:23 | skrylar[m] | i just said |
13:48:34 | * | filcuc_ quit (Ping timeout: 265 seconds) |
13:49:00 | skrylar[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:26 | skrylar[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:45 | skrylar[m] | the seq is moving it to another address without calling any more lifecycle hooks |
13:50:07 | FromDiscord | <Clyybber> Yeah, because it is getting sinked into add |
13:50:21 | skrylar[m] | it wont call =sink either tho |
13:50:27 | * | sagax joined #nim |
13:52:12 | FromDiscord | <Clyybber> Hmm, ok I know why; but I'm not sure how or why it causes problems |
13:52:28 | FromDiscord | <Clyybber> I have to dig into your example |
13:53:28 | skrylar[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:45 | skrylar[m] | it would probably work fine with refs, but i didn't want an alloc for every message connection :/ |
13:55:45 | FromDiscord | <Clyybber> You don't have =sink defined |
13:55:58 | Yardanico | lol |
13:56:10 | FromDiscord | <Clyybber> If you do, you should get at least one =sink call in the .add line |
13:56:14 | FromDiscord | <Clyybber> I *think* |
14:02:52 | skrylar[m] | proc `=sink`*(dest: var PostboxDeliverer; src: PostboxDeliverer) = echo "BBBBBBBBBBBBB" # no B's ever show up in the test log |
14:04:49 | FromDiscord | <Clyybber> skrylar: Can you try with a custom add proc, that simply does setLen len + 1 and sets the last element? |
14:06:41 | FromDiscord | <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:17 | Yardanico | are you sure the type definitions between both ends match? |
14:07:27 | leorize[m] | @mratsim pretty solid, performance is comparable to azure pipelines, and lots of free tasks :p |
14:07:44 | Yardanico | leorize[m]: and it's owned by MS anyway :P |
14:07:57 | FromDiscord | <Recruit_main707> Yardanico, it did work with json, so i guess they do |
14:09:31 | FromDiscord | <Recruit_main707> it doesnt even work for strings |
14:09:42 | FromDiscord | <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:55 | FromDiscord | <Clyybber> Which means we simply bitcopy instead of sinking |
14:11:11 | leorize[m] | but if the value is sinkable it will be sinked before it enter the function |
14:11:22 | FromDiscord | <Clyybber> No |
14:11:30 | FromDiscord | <Clyybber> It will be bit copied |
14:11:34 | * | rockcavera joined #nim |
14:11:39 | FromDiscord | <Rika> is a 5 nanosecond improvement significant? |
14:12:08 | Yardanico | it's in the level of noise |
14:12:24 | FromDiscord | <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:24 | Yardanico | did you actually run the benchmark like 10_000 times and it still was 5ns? |
14:12:32 | leorize[m] | @Clyybber doesn't sink params enforce sinking or copy-then-sink when that's not possible? |
14:12:36 | FromDiscord | <Rika> uh i did it around 10000000 times |
14:12:46 | Yardanico | and how did you measure time? |
14:12:49 | FromDiscord | <Rika> then repeated the test a few times |
14:12:55 | FromDiscord | <Rika> monotimes + runningstat |
14:12:59 | Yardanico | hmm ok |
14:13:08 | Yardanico | but if that requires you much more code it's not worth it :P |
14:13:15 | leorize[m] | @Rika: use golden |
14:13:16 | Yardanico | and I don't think it's generally worth optimizing too much for a progress bar lib |
14:13:26 | FromDiscord | <Clyybber> leorize: Yeah, but we never call sink, we do a `(let tmp = v; reset(v); tmp)` |
14:13:43 | FromDiscord | <Clyybber> So we simply copy the argument and reset the original location |
14:13:58 | FromDiscord | <Clyybber> This is so that it doesn't get destroyed in the callee scope |
14:14:05 | FromDiscord | <Clyybber> (edit) 'callee' => 'caller' |
14:14:17 | FromDiscord | <Rika> leorize: okay |
14:15:05 | FromDiscord | <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:20 | FromDiscord | <Rika> i'm just looking into it, i got interested |
14:15:35 | FromDiscord | <Rika> its not something i'd put in the lib |
14:17:44 | * | Guest93953 is now known as dadada |
14:18:25 | dadada | is there a call that stops a program/the compiler but doesn't generate an error of statements after it never being reached |
14:18:30 | dadada | I need it for debugging now |
14:18:50 | dadada | wait, I could use macros.error hmm |
14:20:47 | skrylar[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:16 | skrylar[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:03 | skrylar[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:26 | Yardanico | arc won't stop you from compiling your program even if you have cycles everywhere :) |
14:23:36 | Yardanico | although compiler might show warnings |
14:23:40 | skrylar[m] | no but this won't leak |
14:24:53 | Yardanico | well 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:20 | leorize[m] | @Clyybber: then when will we call sink lol |
14:25:38 | * | narimiran joined #nim |
14:25:55 | FromDiscord | <Clyybber> never |
14:26:45 | leorize[m] | wait what |
14:30:02 | FromDiscord | <Clyybber> Its simply copied, no need to call =sink because its add; nothing needs to get destroyed |
14:35:26 | FromDiscord | <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:17 | FromDiscord | <Clyybber> In this line: https://gist.github.com/Skrylar/8b0c95074129cc2de788e20436801be0#file-simple-mailbox-generator-nim-L185 |
14:37:13 | skrylar[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:27 | skrylar[m] | then just let the gc deal with the tombstone :shrug: |
14:39:04 | FromDiscord | <Clyybber> A pointer never counts as a cycle |
14:39:10 | FromDiscord | <Clyybber> You can safely make it ptr T |
14:39:35 | skrylar[m] | theres some type system evasion going on as well |
14:40:04 | leorize[m] | sounds like an use case for shared ptrs |
14:40:42 | skrylar[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:43 | leorize[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:16 | Yardanico | https://github.com/nim-lang/fusion/pull/8 |
14:41:17 | disbot | ➥ add C++11-like smart pointers to fusion |
14:41:19 | skrylar[m] | is that a new branch |
14:42:34 | leorize[m] | it's an external package that would be a part of the nim distribution |
14:43:09 | skrylar[m] | after sleep need to add the glue to make sending stuff less tedious |
14:43:31 | skrylar[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:56 | FromGitter | <zetashift> Dang nimsuggest and macros don't really go together do they |
15:06:34 | leorize | tell me about it :P |
15:07:04 | * | xet7 quit (Read error: Connection reset by peer) |
15:09:19 | FromGitter | <zetashift> I wonder if I know NIm well enough now to just disable it |
15:09:31 | * | xet7 joined #nim |
15:09:38 | leorize | you will never know enough :P |
15:09:39 | FromDiscord | <Rika> i barely notice that it broke |
15:10:01 | leorize | use nim.nvim and you will know how often it crashes |
15:10:06 | FromDiscord | <Rika> (cont.) when i program, so its likely you wont notice either |
15:10:09 | leorize | though I just ignore that most of the time |
15:14:45 | FromGitter | <zetashift> It's not crashing here but just giving me a lot of false positives |
15:15:58 | leorize | ah you're on -d:danger (the default) |
15:16:04 | leorize | I use nimsuggest with -d:release :) |
15:16:29 | leorize | even so much as pointing it to $lib/system.nim kills it :P |
15:17:51 | FromGitter | <zetashift> haha |
15:17:59 | FromGitter | <zetashift> How do I try it with `-d:release`? |
15:18:25 | leorize | compile nimsuggest with -d:release :) |
15:18:51 | leorize | that's assuming we still leave assertions on |
15:18:59 | FromGitter | <zetashift> I don't even know how to set that using choosenim |
15:19:09 | leorize | well you can't :P |
15:19:09 | FromGitter | <zetashift> or do I have to compile from scratch? |
15:19:18 | FromGitter | <zetashift> ah makes sense |
15:19:18 | leorize | pretty much, yes |
15:19:52 | leorize | Araq: why do we keep assertions on for -d:release? |
15:22:59 | FromDiscord | <Clyybber> So that they are on? :p |
15:23:12 | narimiran | :D |
15:23:20 | FromDiscord | <Clyybber> Its a matter of definitions, disabling them is dangerous so it belongs in -d:danger |
15:25:13 | leorize | I need a way to record nimsuggest failures |
15:25:31 | leorize | maybe I can add this into nim.nvim as a debugging feature :P |
15:26:05 | FromDiscord | <waghanza> If someone is interested https://github.com/the-benchmarker/web-frameworks#results |
15:26:36 | FromDiscord | <waghanza> I'd compared jester and httpbeast |
15:26:47 | FromGitter | <bung87> the proc using last expr as return result, is there a term for it ? |
15:26:50 | leorize | wait they didn't test asynchttpserver? |
15:27:50 | leorize | now we also know how much of a bottleneck jester is |
15:28:01 | leorize | though we probably can't mitigate that yet :P |
15:28:18 | * | dadada quit (Ping timeout: 256 seconds) |
15:28:41 | FromDiscord | <dom96> Anyone know if there is a pragma to get rid of the `result` var being generated? |
15:28:48 | FromDiscord | <dom96> (In the C code) |
15:29:17 | leorize | nope |
15:29:25 | leorize | there aren't any |
15:29:33 | leorize | why would you need to get rid of it though? |
15:29:42 | FromDiscord | <Clyybber> bung87: Implicit return |
15:30:02 | FromDiscord | <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:03 | FromDiscord | <dom96> bah, because it messes with my wasm macro 😛 |
15:30:11 | FromGitter | <bung87> Clyybber thank you! |
15:31:20 | FromDiscord | <Technisha Circuit> :p |
15:31:34 | FromDiscord | <Clyybber> @Technisha Circuit Probably not |
15:31:40 | FromDiscord | <Technisha Circuit> Oh? |
15:32:06 | FromDiscord | <Clyybber> I think its best to implement them in Nim from the start |
15:32:16 | FromDiscord | <Clyybber> Since you'll then have a much more fun time with nim |
15:32:17 | FromDiscord | <Technisha Circuit> Okay then, thanks |
15:32:29 | FromDiscord | <Clyybber> np :) |
15:32:33 | FromDiscord | <Technisha Circuit> :) |
15:33:23 | FromDiscord | <Technisha Circuit> ~~Wait so how would i make it so i can turn `{"a":"b"}` into `<a>b<\a>`~~ |
15:33:38 | FromDiscord | <Technisha Circuit> I'm assuming i just need to use the keys to put it in that format |
15:34:59 | FromDiscord | <dom96> !eval import htmlgen; echo(a("b")) |
15:35:03 | NimBot | <a>b</a> |
15:35:22 | FromDiscord | <Technisha Circuit> That's a built-in thing? |
15:35:24 | FromDiscord | <dom96> yep |
15:35:33 | FromDiscord | <Technisha Circuit> Nice |
15:35:43 | FromDiscord | <Technisha Circuit> Is there any other formats that could be put in? |
15:35:58 | FromDiscord | <Technisha Circuit> Since I don't think that's doable if i only have a string |
15:37:19 | FromDiscord | <Technisha Circuit> `"<"&json["a"]&">"&json["b"]&"</"&json["a"]&">"` |
15:37:25 | FromDiscord | <Technisha Circuit> That would work, right? |
15:37:32 | FromDiscord | <Technisha Circuit> It's messy but it works :P |
15:38:11 | FromDiscord | <dom96> I strongly suggest you use htmlgen |
15:38:13 | FromDiscord | <dom96> That's asking for bugs |
15:39:00 | FromDiscord | <Technisha Circuit> I don't know how I'd use html gen for constantly changing files |
15:39:20 | * | dadada joined #nim |
15:39:28 | FromDiscord | <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:30 | FromDiscord | <Technisha Circuit> How would i check all keys in a json string without iterating through the json string multiple types |
15:47:01 | FromGitter | <bung87> you meaning multiple times? |
15:47:13 | FromDiscord | <Technisha Circuit> Yeah :p |
15:47:35 | FromGitter | <bung87> thought could use regex exec ? |
15:47:44 | FromDiscord | <Technisha Circuit> It only has one key and value, but I don't the key |
15:47:50 | FromDiscord | <Technisha Circuit> How exactly? |
15:48:29 | FromDiscord | <Yardanico> You don't need to know the key to get the value, just iterate over all elements in the JSON then? |
15:48:34 | FromGitter | <bung87> "([^"]+)": |
15:50:07 | FromDiscord | <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:20 | FromDiscord | <Technisha Circuit> Actually |
15:50:21 | FromDiscord | <Technisha Circuit> Nevermind |
15:50:31 | FromDiscord | <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:12 | madpata | Should I use the re or nre module for regex purposes? |
16:09:31 | * | silvernode quit (Ping timeout: 246 seconds) |
16:12:11 | liblq-dev | re |
16:12:28 | liblq-dev | or better yet, the `regex` package from nimble |
16:13:47 | FromGitter | <bung87> use regex |
16:14:57 | shashlick | It's time to move regex into stdlib, or at least fusion |
16:24:35 | madpata | yeah 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:49 | madpata | So 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:47 | madpata | Ah my fault. Shouldn't have used a seq it seems |
16:34:43 | * | tyler569 joined #nim |
16:35:00 | FromDiscord | <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:35 | FromDiscord | <exelotl> I wish Nim regex had common usage examples in the docs |
16:36:15 | FromDiscord | <exelotl> it's not obvious how to actually do things with it |
16:38:26 | FromDiscord | <Yardanico> ? |
16:38:35 | FromDiscord | <Yardanico> It has examples in procs https://nitely.github.io/nim-regex/regex.html |
16:41:25 | FromDiscord | <exelotl> https://media.discordapp.net/attachments/371759389889003532/711619394043904080/unknown.png |
16:42:14 | FromDiscord | <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:08 | shashlick | even cligen should be in fusion |
17:12:09 | * | filcuc joined #nim |
17:14:22 | disruptek | thinking about streaming... gaming? game-code? or misc debris? cannot work on compiler today. |
17:14:42 | disruptek | cligen is the poster child for fusion, imo. |
17:19:06 | * | filcuc quit (Ping timeout: 272 seconds) |
17:19:10 | yumaikas | fusion? |
17:22:48 | * | tane joined #nim |
17:22:48 | * | xet7 quit (Quit: Leaving) |
17:23:06 | shashlick | https://github.com/nim-lang/fusion |
17:24:01 | yumaikas | So, a nimble package that's sort of a community sourced stdlib++? |
17:24:44 | FromGitter | <deech> How do I get nimble to run nim commands like `genDepend` on the project? |
17:25:13 | shashlick | When do you want that to run |
17:26:26 | FromGitter | <deech> I want to use it to generate a `dot` diagram of the project dependencies. |
17:28:01 | shashlick | yes but when do you want it to run - when you call a task? `nimble genDot` or during install or when |
17:36:08 | FromGitter | <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:27 | FromDiscord | <exelotl> to me, cligen is clever, docopt is responsible |
18:07:11 | FromDiscord | <exelotl> hot tea |
18:24:46 | FromDiscord | <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:23 | FromDiscord | <RaycatWhoDat> But I am smoothbrain and will probably botch it |
18:29:40 | yumaikas | exelot1: Why is docopt more respnosible than cligen? |
18:32:25 | FromDiscord | <zetashift> I think creating a language is harder than it looks like |
18:32:31 | FromDiscord | <zetashift> even when you leverage stuff like LLVm |
18:35:53 | FromDiscord | <exelotl> with cligen you don't have to document your tool at all |
18:36:08 | FromDiscord | <exelotl> right? |
18:40:16 | FromDiscord | <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:10 | FromDiscord | <Elegant Beef> `echo jsonData.parseJson.pretty()` |
18:42:22 | yumaikas | If you want ordered JSON, you'll want to use an array, no? |
18:42:44 | FromDiscord | <Technisha Circuit> Thanks |
18:42:46 | FromDiscord | <Elegant Beef> I'd imagine that parsin json would be FIFO |
18:42:56 | FromDiscord | <Technisha Circuit> Wdym? |
18:43:28 | FromDiscord | <Elegant Beef> first object in the file would be the first object in the jsonNode, cause any otherway would be rather silly |
18:44:40 | FromDiscord | <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:28 | dadada | yumaikas: 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:21 | Yardanico | Guys can you share your thoughts on https://forum.nim-lang.org/t/6350 https://github.com/github/linguist/pull/4866 ? |
18:57:32 | Yardanico | even a thumbs up/down would be enough :P |
18:59:34 | * | xet7 joined #nim |
19:00:41 | Araq | any 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:18 | FromDiscord | <bedwardly-down> Any new secrets here? 🤪 |
19:07:03 | Araq | no, it's just me learning new tricks |
19:07:29 | leorize[m] | ping @mratsim if he's still up |
19:07:31 | FromDiscord | <bedwardly-down> Sounds great! ☺️ |
19:09:06 | * | xet7 quit (Remote host closed the connection) |
19:09:19 | Araq | yeah, mratsim please help me |
19:09:37 | * | xet7 joined #nim |
19:09:50 | FromDiscord | <Elegant Beef> only you can save araq |
19:11:26 | FromDiscord | <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:05 | FromDiscord | <bedwardly-down> @Elegant Beef , I thought you knew everything nim and the nickname was ironic. I’m confused. 😂 |
19:12:14 | FromDiscord | <Elegant Beef> I know nothing |
19:12:26 | FromDiscord | <bedwardly-down> Exactly |
19:12:38 | FromDiscord | <Elegant Beef> What? |
19:12:49 | Yardanico | @codic that will work fine but it's quite wasteful |
19:13:19 | FromDiscord | <zetashift> how to I instantiate an empty Table? |
19:13:31 | FromDiscord | <Elegant Beef> `initTable[typeA,typeB]()` |
19:13:49 | Yardanico | yeah, and for TableRef it's newTable[A, B]() |
19:13:55 | FromDiscord | <zetashift> `var transitions: Table[(State, Action)] = {}.newTable ` throws ``` Error: cannot instantiate Table↵got: <type tuple of (State, Action)>↵but expected: <A, B> ``` |
19:14:01 | FromDiscord | <zetashift> ah |
19:14:16 | FromDiscord | <Elegant Beef> also your left hand needs to be hashable |
19:14:36 | FromDiscord | <Elegant Beef> So if it's an object you need to follow the hash creation instructions |
19:14:38 | FromDiscord | <codic> What do you mean it's 'wasteful'? |
19:14:43 | FromDiscord | <codic> Is there a better alternative? |
19:14:51 | Yardanico | yes |
19:14:56 | FromDiscord | <Elegant Beef> I assume it creates a new string so it increases memory usage |
19:15:03 | FromDiscord | <codic> hmm, what's the alternative? |
19:15:07 | Yardanico | strutils.find and then a slice |
19:15:26 | * | letto quit (Quit: Konversation terminated!) |
19:15:57 | FromDiscord | <Elegant Beef> I could be wrong about the reason |
19:15:58 | FromDiscord | <codic> "lorem\nispum".find("lorem").slice(what?) |
19:16:35 | FromDiscord | <codic> :p |
19:16:45 | Yardanico | !eval let a = "lorem\nispum"; import strutils; let needed = a[0..a.find('\n')]; echo needed |
19:16:48 | NimBot | lorem↵ |
19:17:04 | Yardanico | !eval let a = "lorem\nispum"; import strutils; let needed = a[0..a.find('\n')-1]; echo needed |
19:17:07 | NimBot | lorem |
19:17:14 | Yardanico | that one |
19:17:19 | FromDiscord | <codic> what did the `-1` do there? |
19:17:33 | Yardanico | find will return the index where it found the \n |
19:17:37 | Yardanico | so it will return "string\n" |
19:17:40 | Yardanico | if you don't want \n you do -1 |
19:17:41 | FromDiscord | <Elegant Beef> couldnt that be `a[0..<a.find('\n)]` |
19:17:44 | Yardanico | yes |
19:17:53 | FromDiscord | <Elegant Beef> Looks nicer to me 😄 |
19:17:54 | FromDiscord | <codic> ah, i dont care about the newline in any case |
19:18:10 | Yardanico | then just a[0 .. a.find('\n')] |
19:18:25 | * | Senketsu joined #nim |
19:18:26 | FromDiscord | <codic> ah thank you |
19:22:23 | Araq | strscans module |
19:28:25 | * | Senketsu quit (Ping timeout: 240 seconds) |
19:30:28 | FromDiscord | <exelotl> is CRLF converted to LF in triple quoted string literals? |
19:36:59 | FromDiscord | <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:13 | FromDiscord | <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:50 | FromDiscord | <codic> Nvm |
20:06:57 | FromDiscord | <codic> was able to do a `var fileContent:string↵` beforehand |
20:07:15 | FromDiscord | <codic> works just fine |
20:09:44 | FromDiscord | <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:19 | Yardanico | well you can use a simple while loop and iterate over the string there |
20:12:24 | FromDiscord | <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:40 | FromDiscord | <zetashift> On Windows, is there any reason to use vcc instead of gcc for compiling NIm? |
20:20:28 | Yardanico | windows compatibility, maybe better speed? |
20:22:17 | FromDiscord | <zetashift> Ah alright, I had a crash with Godot and Nim but gcc works and vcc so I was a bit puzzled |
20:22:36 | Yardanico | you can also use icc on windows btw :P |
20:22:55 | Yardanico | but 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:35 | FromDiscord | <zetashift> I think it's a Godot thing tbh |
20:26:48 | FromDiscord | <mratsim> @Araq, I don't know what SIDD_CMP_RANGES is |
20:27:13 | Yardanico | it's https://doc.rust-lang.org/core/arch/x86_64/constant._SIDD_CMP_RANGES.html |
20:28:09 | FromDiscord | <mratsim> seems like a compare operation flag: https://gitlab.indel.ch/thirdparty/gcc/commit/f98d7ce9315a4219dc737d1bc1aa71644b116530#fdd9f2b998a6f2fcbf3ca91555f07f0149a6074d_478_478 |
20:28:56 | FromDiscord | <mratsim> Here you go: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=mm_cmpestri&expand=834 |
20:29:17 | Yardanico | btw @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:33 | FromDiscord | <zetashift> it's such a minor change 😛 |
20:29:34 | FromDiscord | <mratsim> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/711676802250047510 |
20:30:35 | FromDiscord | <mratsim> upvoted but really don't care |
20:30:49 | Yardanico | yeah I think so too, but it still would be nice to have it in the same colour :D |
20:30:56 | FromDiscord | <mratsim> I'm fighting with concurrent queues/channels and it's hell |
20:42:54 | FromDiscord | <zetashift> Yeah no easy topics to tackle |
20:43:09 | rockcavera | is 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:07 | FromDiscord | <dom96> @Yardanico nice, I like the idea of the #announcements channel |
20:44:19 | Yardanico | yeah it'll be quite useful to keep big news/stuff |
20:44:36 | Yardanico | sadly only discord servers with special privileges can create actual announcement channels you can subscribe to |
20:44:40 | Yardanico | but I hope we'll get that status too |
20:45:02 | FromDiscord | <dom96> Also, love your PR to change the colour |
20:45:05 | FromDiscord | <dom96> Didn't know we could do that |
20:45:09 | FromDiscord | <dom96> the green has bothered me for a while |
20:45:15 | FromDiscord | <dom96> and that golden yellow is beautiful |
20:45:34 | FromGitter | <Willyboar> +1 for the PR |
20:46:03 | FromGitter | <Willyboar> ~stream |
20:46:57 | Yardanico | ~stream |
20:47:24 | FromGitter | <bung87> !status |
20:47:30 | FromDiscord | <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:38 | Yardanico | yeah I noticed that too |
20:47:40 | Yardanico | but it passes :P |
20:47:45 | Yardanico | @bung87 disruptek's bot is down |
20:47:49 | Yardanico | he's on windows playing PoE rn :P |
20:47:49 | FromDiscord | <dom96> Any ideas which languages have those colours? |
20:48:04 | Yardanico | https://github.github.io/linguist/ |
20:48:10 | FromGitter | <bung87> yeah, that's why it answer nothing |
20:48:24 | * | fredrikhr quit (Ping timeout: 256 seconds) |
20:48:30 | Yardanico | Isabelle, JavaScript, Parrot, Lex have similar colors |
20:48:39 | FromDiscord | <dom96> Hm, being close to JS could be bad |
20:48:42 | Yardanico | also HiveQL |
20:48:58 | Yardanico | @dom96 yeah I know, you can propose an alternative one and I can test it locally via their tests |
20:49:04 | Yardanico | to see if it passes the proximity check |
20:49:12 | FromDiscord | <dom96> don't have any better ideas tbh |
20:49:15 | Yardanico | JS has #f1e05a |
20:49:19 | FromDiscord | <dom96> still better than the green |
20:50:01 | Yardanico | yeah I was surprised when I found it was added by the maintainer of the repo in 2012 :P |
20:54:27 | FromDiscord | <Technisha Circuit> I just realized |
20:54:29 | Yardanico | @dom96 https://bl.ocks.org/Yardanico/e7deead840ca477d0c59b0078c229906 |
20:54:38 | Yardanico | golden yellow vs JS |
20:54:40 | FromDiscord | <Technisha Circuit> Because of Nim's amazing metaprogramming capabilities |
20:54:59 | Yardanico | but of course when the color icon is really small they become more similar :P |
20:55:01 | FromDiscord | <Technisha Circuit> You can implement the BrainFuck interpreter *in* a .nim file |
20:55:12 | FromDiscord | <Technisha Circuit> And then you'll be able to compile it |
20:55:51 | Yardanico | that was already done btw :P |
20:56:00 | Yardanico | https://github.com/def-/nim-brainfuck |
20:56:17 | Yardanico | https://github.com/def-/nim-brainfuck/blob/master/src/brainfuck.nim#L104 |
20:56:31 | FromDiscord | <Technisha Circuit> O |
20:56:34 | FromDiscord | <Technisha Circuit> Nice |
20:56:38 | Yardanico | even if it's just a "naive" implementation it's really fast |
20:57:59 | FromDiscord | <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:11 | FromDiscord | <Technisha Circuit> Wait, by using macros and stuff, is it possible to make a more Python-like 'skin' for Nim? |
20:59:18 | FromDiscord | <Technisha Circuit> If so, that'd be cool |
20:59:25 | Yardanico | that was already kinda done :P |
20:59:26 | Yardanico | https://github.com/Yardanico/nimpylib |
20:59:34 | Yardanico | but I personally don't like that, don't use it in real code |
20:59:40 | Yardanico | for educational purposes only (TM) |
20:59:49 | Yardanico | most of the recent stuff there is by Juan |
21:00:08 | FromDiscord | <Technisha Circuit> I was thinking with `__init__` and access to most Python libs |
21:00:13 | Yardanico | huh |
21:00:53 | FromDiscord | <Technisha Circuit> And implementing a more python-like inport feature like `from lib import a, b, c` |
21:01:01 | Yardanico | we have that |
21:01:03 | FromDiscord | <Technisha Circuit> (edit) 'lib' => 'my.lib' |
21:01:07 | Yardanico | oh |
21:01:12 | FromDiscord | <Technisha Circuit> With Python modules? |
21:01:41 | FromDiscord | <Technisha Circuit> I am probably going to be working on that in the long run |
21:02:04 | FromDiscord | <Technisha Circuit> It'll be nice but idiotic if i actually implement that |
21:02:50 | FromDiscord | <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:57 | Yardanico | see https://github.com/metacraft-labs/py2nim |
21:05:02 | Yardanico | https://github.com/metacraft-labs/py2nim_deprecated/ |
21:05:10 | Yardanico | that was a _real_ py2nim transpiler |
21:05:33 | FromDiscord | <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:40 | FromDiscord | <Technisha Circuit> Thanks |
21:16:11 | * | solitudesf quit (Ping timeout: 260 seconds) |
21:17:31 | * | zacharycarter quit (Ping timeout: 256 seconds) |
21:22:51 | FromGitter | <bung87> I did not run it successfully `py2nim` |
21:23:22 | Yardanico | well you might need to adapt it |
21:24:12 | FromGitter | <bung87> I rember he made a python tool , that trace the python variable type |
21:24:17 | Yardanico | yes |
21:24:45 | FromGitter | <bung87> that's the first time I know python has such a api |
21:25:50 | FromGitter | <bung87> my tool not finish yet :( |
21:26:15 | FromGitter | <bung87> next target maybe the java , not python |
21:29:02 | Araq | mratsim: 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:47 | FromDiscord | <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:24 | FromDiscord | <Elegant Beef> If in vscode you can just hover or ctrl + click to see the nim file it's form |
21:39:52 | FromDiscord | <slymilano> sent a long message, see http://ix.io/2myw |
21:39:55 | FromDiscord | <slymilano> (edit) 'http://ix.io/2myw' => 'http://ix.io/2myx' |
21:40:13 | * | gokr quit (Read error: Connection reset by peer) |
21:40:15 | Yardanico | nah, it's not deprecated |
21:40:43 | Yardanico | but almost no one uses it :P |
21:40:47 | FromDiscord | <Elegant Beef> it's just rather unneeded |
21:41:09 | FromDiscord | <Elegant Beef> Unless you have two modules with identical function names and params |
21:41:11 | FromDiscord | <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:29 | FromDiscord | <Elegant Beef> I mean import complex would do the same no? |
21:41:46 | FromDiscord | <Elegant Beef> It tells you you're using that module and importing all of it's exported signatures |
21:42:08 | FromDiscord | <Elegant Beef> Cant you also just import the procs you want directly using the from keyword? |
21:42:39 | Araq | slymilano: 'from' is not going anywhere, use it as you see fit |
21:43:11 | FromDiscord | <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:14 | FromDiscord | <slymilano> https://github.com/sergiotapia/torrentinim/blob/master/src/crawlers/leetx.nim#L100 |
21:43:37 | FromDiscord | <Technisha Circuit> It would do the same if you just did `import complex` but it's not forced to do `complex.function()` |
21:43:40 | FromDiscord | <Elegant Beef> I wonder if it's from the `import ../torrent` |
21:43:59 | FromDiscord | <Elegant Beef> The only issue i see is with functions that have ambigious names |
21:44:21 | FromDiscord | <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:43 | FromDiscord | <Elegant Beef> Doesnt it make the UFCS completely useless? |
21:44:47 | FromDiscord | <exelotl> yep |
21:44:54 | FromDiscord | <Elegant Beef> Completely denimifying nim! |
21:45:20 | FromDiscord | <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:59 | Araq | 'from' is only dangerous for Nim's collections and DSLs |
21:46:07 | FromDiscord | <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:23 | FromDiscord | <Elegant Beef> You ctrl click on it in vscode to see where it comes from 😄 |
21:46:31 | Yardanico | @slymilano but then you can't just have a + b if a and b are both of the type Vector for example |
21:46:31 | FromDiscord | <Elegant Beef> No clue the nvim way |
21:46:39 | Yardanico | and you import that module as "from module import nil" |
21:46:42 | Yardanico | or hmm, lemme see |
21:46:55 | FromDiscord | <Elegant Beef> Does it fuck up operator procs? |
21:47:10 | Araq | nah, you can write module.`+`(a, b) |
21:47:19 | FromDiscord | <Elegant Beef> so yes it does |
21:47:20 | FromDiscord | <Elegant Beef> 😄 |
21:47:45 | FromDiscord | <exelotl> from the article: https://media.discordapp.net/attachments/371759389889003532/711696484885594233/unknown.png |
21:48:23 | FromDiscord | <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:46 | Araq | why? 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:14 | FromDiscord | <UNIcodeX> Oof |
21:50:14 | FromDiscord | <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:43 | FromDiscord | <UNIcodeX> > from the article:↵@exelotl my eyes!!! |
21:51:10 | FromDiscord | <Elegant Beef> I mean im a bad example since i generally a noob when it comes to nim |
21:51:10 | Yardanico | @slymilano I remember the modules :P |
21:51:13 | FromGitter | <bung87> I only using import nil when two lib have same name proc |
21:51:22 | Yardanico | @bung87 you don't need to use import nil then |
21:51:31 | Yardanico | you can fully qualify even if you just use "import a, b" |
21:51:46 | Yardanico | !eval import strutils; echo strutils.isAlphaAscii("abcd1234") |
21:51:48 | NimBot | Compile failed: /usercode/in.nim(1, 44) Error: type mismatch: got <string> |
21:52:02 | FromGitter | <bung87> oh ,yeah that's also right |
21:52:03 | FromDiscord | <slymilano> I see that sounds like a nice compromise. Import normally, no nil - and still fully qualify. |
21:52:13 | Yardanico | !eval import strutils; echo strutils.isAlphaAscii('a') |
21:52:16 | NimBot | true |
21:53:12 | FromGitter | <bung87> there's also `except` |
21:53:15 | Yardanico | yep |
21:53:17 | Araq | slymilano: how do you manage any OOP-ish codebase then? |
21:53:47 | Araq | Python, C#, ... etc are full of obj.call and obj is *not* the module name |
21:53:50 | FromDiscord | <slymilano> My only in-depth experience with OOP was with C# back in 2008, it's.... been a while. |
21:53:59 | FromDiscord | <slymilano> but you're right |
21:54:27 | FromDiscord | <slymilano> I may be trying to write _functional_ Nim code, and I probably shouldn't. |
21:54:37 | FromGitter | <bung87> import nil rarely use, if you do FFF.a(b) you can just b.a() |
21:54:42 | Araq | functional has nothing to do with it |
21:55:53 | FromDiscord | <slymilano> OOP/Procedural: 1.toString() - Functional: String.parseInt(1) |
21:55:56 | FromGitter | <bung87> in editor `.` will trigger tip for you |
21:56:32 | FromGitter | <bung87> no that's not called functional |
21:57:16 | FromDiscord | <slymilano> what's it called |
21:57:43 | FromGitter | <bung87> static method |
21:57:45 | FromDiscord | <Elegant Beef> I mean in nim it's the same as C# `1.toString()` vs `$1` |
21:58:06 | Araq | how 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:23 | FromDiscord | <Elegant Beef> Or search the entire project |
21:58:32 | FromDiscord | <Elegant Beef> Which only works if the module is in the project |
21:58:34 | Araq | yeah yeah, cause bla bla Java bla bla bloatware |
21:58:39 | FromDiscord | <Elegant Beef> So then you have to go find the mdoule |
21:58:45 | FromDiscord | <Elegant Beef> module* |
21:59:18 | FromDiscord | <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:10 | FromDiscord | <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:17 | FromDiscord | <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:31 | FromGitter | <bung87> you will get benefit from nim's procedure |
22:00:35 | FromDiscord | <slymilano> Trying to replicate that dev UX in Nim |
22:00:36 | * | liblq-dev quit (Quit: WeeChat 2.8) |
22:00:43 | FromDiscord | <Elegant Beef> But that implies the module is inside the project folder |
22:00:51 | FromDiscord | <Elegant Beef> If it's a nimble package you cant just go to it |
22:01:05 | FromDiscord | <Elegant Beef> Or a apart of nims stdlib |
22:02:02 | FromDiscord | <Elegant Beef> I should say cant just go to it easily |
22:02:13 | FromDiscord | <Elegant Beef> you dont do system.int do you? |
22:02:51 | Yardanico | !eval let a: system.int = system.`+`(system.int(5), system.int(10)); system.echo(a) |
22:02:54 | NimBot | 15 |
22:02:56 | Yardanico | :D |
22:03:39 | FromGitter | <bung87> that's make source file larger... |
22:03:47 | Yardanico | yes |
22:03:49 | Yardanico | don't do that :P |
22:04:47 | FromDiscord | <Elegant Beef> Wait so i should rewrite all my code? |
22:04:50 | FromGitter | <bung87> when company KPI count on this I will go for it.. |
22:04:58 | Yardanico | @Elegant yes! |
22:05:05 | Yardanico | https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition |
22:05:09 | Yardanico | we need that in Nim |
22:05:37 | Yardanico | https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/tree/master/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl |
22:05:52 | FromDiscord | <Elegant Beef> I personally want this in nim↵https://github.com/AceLewis/my_first_calculator.py/blob/master/my_first_calculator.py |
22:06:13 | FromDiscord | <Elegant Beef> It'd be a good library to have, we'd finally be able to do math |
22:06:13 | Yardanico | this can be easily converted to nim |
22:06:42 | Yardanico | oh it's only 21k lines of code |
22:06:44 | Yardanico | not that much |
22:06:59 | FromDiscord | <Technisha Circuit> I thought that was a myth- |
22:07:09 | FromDiscord | <Technisha Circuit> Someone actually did that... |
22:07:14 | FromDiscord | <Elegant Beef> Well this guy made it after a facebook post |
22:07:24 | FromDiscord | <Elegant Beef> That source isnt exactly real |
22:08:00 | FromDiscord | <Technisha Circuit> Oh god |
22:08:24 | FromDiscord | <zetashift> surely that is generated |
22:08:26 | FromDiscord | <Technisha Circuit> How hard would it be to make a script in Nim to do this? |
22:08:33 | FromDiscord | <Technisha Circuit> I think it is |
22:08:51 | FromDiscord | <zetashift> should be a couple for loops no |
22:09:16 | FromDiscord | <Technisha Circuit> https://github.com/AceLewis/my_first_calculator.py/blob/master/generator.py |
22:09:37 | Yardanico | yeah I translated it |
22:09:40 | Yardanico | the original version |
22:09:49 | FromDiscord | <Technisha Circuit> Oh? |
22:09:56 | FromDiscord | <zetashift> that fast? |
22:09:59 | Yardanico | ye ofc? |
22:10:03 | Yardanico | it's basically the same |
22:10:07 | Yardanico | you just replace print->echo |
22:10:11 | Yardanico | and at the start change the code |
22:10:11 | FromDiscord | <zetashift> idk man 😛 |
22:10:18 | FromDiscord | <Technisha Circuit> Nice hahaha |
22:10:27 | FromDiscord | <Technisha Circuit> How about the generator code? |
22:10:32 | Yardanico | 21k lines, be careful or your browser might crash or something https://gist.github.com/Yardanico/584b90a4aba6a035bffc26901789dbc9 |
22:10:33 | FromDiscord | <Technisha Circuit> Edit that and you are sound |
22:10:49 | FromDiscord | <Technisha Circuit> Chrome crashes so i used puffin |
22:10:55 | Yardanico | i'll try to translate the generator now |
22:11:10 | FromDiscord | <Technisha Circuit> Hahaha ok |
22:12:32 | FromDiscord | <zetashift> oh I thought you had translated the generator |
22:12:42 | FromDiscord | <Technisha Circuit> This is unholy |
22:13:21 | FromDiscord | <Technisha Circuit> Python takes a good few seconds to load it- |
22:13:40 | FromDiscord | <Elegant Beef> The best part about that is↵> # TODO: Make it work for all floating point numbers too |
22:13:47 | FromDiscord | <Technisha Circuit> Hahahahaha |
22:13:59 | FromDiscord | <Technisha Circuit> That'll be a huge pain |
22:14:15 | FromDiscord | <Technisha Circuit> But seems like it's abandoned so ¯\\_(ツ)\_/¯ |
22:14:23 | FromDiscord | <Technisha Circuit> ~~I might implement that~~ |
22:14:33 | FromDiscord | <Elegant Beef> I mean it was based off the facebook post |
22:14:34 | FromDiscord | <Elegant Beef> so... |
22:14:37 | FromDiscord | <Technisha Circuit> Hahahaha |
22:15:07 | FromDiscord | <Technisha Circuit> It'd be funnier if there was a hidden fork bomb in the code |
22:15:14 | FromDiscord | <Technisha Circuit> You give ut to yiur friend |
22:15:25 | FromDiscord | <Technisha Circuit> Then millions of processes get started |
22:15:35 | FromDiscord | <Technisha Circuit> Your PC can't handle it and explodes |
22:15:38 | FromDiscord | <Elegant Beef> ... |
22:15:45 | FromDiscord | <Elegant Beef> We have vastly different definitions of funny |
22:16:25 | FromDiscord | <Technisha Circuit> Well, i am considered the annoying one |
22:16:52 | FromDiscord | <Technisha Circuit> ~~I should make a forkbomb in Nim and rename it to Python and then have my class run the code~~ |
22:17:20 | FromDiscord | <Technisha Circuit> (edit) 'Python' => 'Python.exe' |
22:35:51 | FromGitter | <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:45 | skrylar[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:31 | skrylar[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:16 | Prestige | :w |
23:57:19 | Prestige | woops |
23:57:55 | Prestige | Can I cast a var to a generic type? like cast[T](myVar) |
23:58:43 | FromDiscord | <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:55 | FromDiscord | <Elegant Beef> The first is proper method 90% of the time |
23:59:15 | * | krux02_ joined #nim |
23:59:31 | Prestige | Trying to get the result of XGetWindowProperty back as a seq of T: https://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html |