00:06:30 | * | krux02` quit (Remote host closed the connection) |
00:30:32 | audiofile | how do I have an empty function as default arg in a function signature |
00:30:55 | audiofile | proc(givefunc: proc = ??? ) |
00:31:12 | audiofile | proc ABC(givefunc: proc = ??? ) |
00:31:40 | FromDiscord | <Yardanico> proc myproc(givefunc: proc = proc = discard) = discard |
00:31:41 | FromDiscord | <Yardanico> XDDDD |
00:31:52 | FromDiscord | <Yardanico> (this works, but jk)β΅β΅proc myproc(givefunc = proc() = discard) |
00:32:26 | FromDiscord | <Yardanico> it really depends on if your proc needs to be a closure or a nimcall, etc |
00:32:49 | audiofile | can I not pass a function as it is so I can call it later () in my function |
00:33:06 | audiofile | like proc myproc(givefunc: proc = discard) |
00:33:17 | FromDiscord | <Yardanico> wdym |
00:33:37 | audiofile | will pastebin |
00:33:48 | FromDiscord | <Yardanico> you can use play.nim-lang.org |
00:33:56 | audiofile | yes that is the one |
00:35:32 | audiofile | error 502 bad gateway |
00:36:01 | audiofile | https://play.nim-lang.org/#ix=2Rfw Yardanico |
00:36:22 | Yardanico | I still didn't understand what you want |
00:36:28 | Yardanico | you can do this just fine with the example I sent |
00:37:08 | Yardanico | ah, if you mean "different number arguments", then you'll have to make a generic proc at the very least |
00:37:23 | Yardanico | different number of arguments means different proc types |
00:37:46 | audiofile | oh sorry I misread the proc = proc = |
00:37:52 | audiofile | your solutions works! |
00:37:58 | Yardanico | I just want to give you an advice - don't try to replicate Python idioms in Nim :) |
00:38:08 | audiofile | indeed |
00:40:38 | saem | Yardanico: that DFA issue ate my brain this entire weekend. :D I have an idea for a fix but it seems terrible. I'm curious where Clyybber ends up with it. |
00:40:51 | FromDiscord | <Yardanico> lol, don't force yourself too much :D |
00:41:07 | FromDiscord | <Yardanico> afaik Clyybber will be busy doing exams for a ~month |
00:41:41 | saem | I can't help it, my brain doesn't give me a choice in this matter. I kept trying to go back to sem and looking at nkError but couldn't focus. |
00:43:35 | saem | Not a terrible thing, I did learn a few things about DFA. |
00:54:10 | FromDiscord | <Clyybber> hey, maybe I'll have some more time this week or next one |
00:54:36 | FromDiscord | <Clyybber> My fix would be to not make it recursive anymore |
01:01:34 | audiofile | what si the default encoding? like is convert(destEncoding=getCurrentEncoding()) safe? |
01:02:00 | audiofile | Is that equivalent to .decode() from python? |
01:02:00 | FromDiscord | <Yardanico> did you read the docs? |
01:02:00 | FromDiscord | <Yardanico> https://nim-lang.org/docs/encodings.html#getCurrentEncoding |
01:02:14 | FromDiscord | <Yardanico> kind of |
01:02:24 | FromDiscord | <Yardanico> nim strings aren't "encoded" in any encoding |
01:02:28 | FromDiscord | <Yardanico> they are just a sequence of chars/bytes |
01:04:33 | FromDiscord | <ElegantBeef> Well you can think of them as ascii encoded but they do support unicode, but that's just intepreted as a grouping of chars |
01:04:49 | FromDiscord | <ElegantBeef> So yea just think of them as a byte sequence or char sequence π |
01:06:46 | FromDiscord | <treeform> If you need encoding stuff: https://github.com/treeform/encode |
01:07:10 | FromDiscord | <treeform> I can do all UTF encoding and decoding |
01:07:15 | FromDiscord | <treeform> (without using system libs) |
01:08:08 | * | wasted_youth2 quit (Quit: Leaving) |
01:08:08 | FromDiscord | <Yardanico> @audiofile you only need to care about "encodings" module if you receive input that's not utf-8 |
01:08:27 | FromDiscord | <Yardanico> which is pretty rare nowadays |
01:08:41 | audiofile | so what if I receive a utf-8 encoded string, how do I make it a nim string |
01:08:46 | FromDiscord | <ElegantBeef> Treeform has so many libraries i'm surprised he doesnt just have his own stdlib π |
01:09:10 | FromDiscord | <Yardanico> @audiofile as I said, nim strings aren't encoded in any way |
01:09:18 | FromDiscord | <Yardanico> so you don't need to care about it if it's utf8 |
01:09:25 | audiofile | sorry, I'm a bit confused |
01:09:29 | FromDiscord | <treeform> In reply to @ElegantBeef "Treeform has so many": soon I will have enough for my own stdlib π |
01:09:41 | FromDiscord | <Rika> nim strings can contain any encoding |
01:09:42 | FromDiscord | <Yardanico> idk how to explain so that it's easier to understand :D |
01:09:44 | FromDiscord | <ElegantBeef> Just make sure you include my constructor so i can whore it more π |
01:09:49 | audiofile | I am receiving a string froom a socket, it is going to be in utf-8 so how do I make it normal |
01:09:50 | FromDiscord | <Rika> so a utf8 string is a nim string |
01:09:56 | FromDiscord | <ElegantBeef> It is normal |
01:09:58 | FromDiscord | <Rika> it already is normal |
01:09:58 | audiofile | oh |
01:09:59 | FromDiscord | <Yardanico> @audiofile everything's going to be ok |
01:10:08 | audiofile | you sound like my therapist xD |
01:10:09 | FromDiscord | <ElegantBeef> In nim there is one type of string, a string |
01:10:18 | FromDiscord | <treeform> nim uses utf8 internally |
01:10:22 | FromDiscord | <Yardanico> you might need the https://nim-lang.org/docs/unicode.html module if you want to do unicode string handling |
01:10:27 | audiofile | so why am I doing "string".convert() <- that is useless right? |
01:10:30 | FromDiscord | <Yardanico> yes |
01:10:38 | audiofile | hmm got it |
01:10:40 | FromDiscord | <ElegantBeef> There is also `unidecode` which attempts to convert unicode to ascii |
01:10:48 | FromDiscord | <Yardanico> well that's a bit different |
01:10:55 | FromDiscord | <treeform> yeah, you loose information there? |
01:11:03 | FromDiscord | <ElegantBeef> Well you get different characters |
01:11:10 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/unidecode.html#unidecode%2Cstring |
01:11:11 | FromDiscord | <Yardanico> @treeform yes, it's mostly for human readability |
01:11:24 | FromDiscord | <ElegantBeef> It has an example |
01:11:44 | * | Vladar quit (Remote host closed the connection) |
01:11:48 | FromDiscord | <treeform> Usually if you are dealing with windows or the non ObjC macOS apis you need to worry about UTF16 |
01:12:09 | FromDiscord | <Yardanico> yes, nim has a pure-nim module for that :P |
01:12:26 | FromDiscord | <treeform> Tons of file formats also have UTF16 strings in them. |
01:12:31 | FromDiscord | <Yardanico> https://nim-lang.org/docs/widestrs.html |
01:13:02 | FromDiscord | <treeform> I need to handle UTF16 LE or BE I forget which is not supported. |
01:13:19 | FromDiscord | <treeform> Does not handle the BOM marker which some times also happens. |
01:13:33 | FromDiscord | <treeform> Usually older windows crap |
01:13:40 | FromDiscord | <Yardanico> sure, but I mean that for APIs it's usually okay |
01:13:47 | FromDiscord | <treeform> yes |
01:14:15 | FromDiscord | <treeform> There is also UCS16 vs UTF16 etc... |
01:14:52 | FromDiscord | <treeform> sorry UCS2 is roughly UTF16 mostly |
01:16:06 | * | oprypin quit (Quit: Bye) |
01:16:13 | * | oprypin joined #nim |
01:23:57 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:24:16 | * | njoseph joined #nim |
01:32:43 | * | phpostrich joined #nim |
01:34:12 | audiofile | https://bpa.st/JD7X2 can someone help me figure out what is type mismatch here |
01:34:45 | audiofile | errr wait |
01:35:09 | audiofile | https://bpa.st/VL6JG HERE |
01:35:58 | phpostrich | Undeclared Identifier for "Thread", from the vscode plugin for nim |
01:36:10 | audiofile | I dont even have thread...? |
01:36:21 | phpostrich | as a module? |
01:36:35 | phpostrich | its there just not detected by the plugin i guess |
01:37:43 | audiofile | oh wow yes, `import threads` worked... |
01:37:58 | phpostrich | hmm not for me |
01:37:59 | audiofile | I'm guessing sockets needs it? |
01:38:07 | audiofile | thanks phpostrich |
01:38:18 | phpostrich | k |
01:38:34 | audiofile | oh i have an error for the import lmao |
01:38:42 | phpostrich | lol |
01:39:24 | phpostrich | you can use threads but its not really useable if the plugin breaks |
01:40:57 | FromDiscord | <ElegantBeef> You dont import threads manually |
01:41:20 | FromDiscord | <ElegantBeef> you do `--threads:on` in a .cfg or `switch("threads", "on")` in a .nims |
01:41:59 | phpostrich | ik but the vscode plugin doesnt work for the module |
01:42:29 | FromDiscord | <ElegantBeef> If you enable threads in a config and restart vscode the new config should tell nimsuggest to look there |
01:42:44 | phpostrich | ohh didnt think about that |
01:42:46 | phpostrich | thanks |
01:43:09 | phpostrich | dang technology |
01:52:18 | phpostrich | how long has nim been around? |
01:52:36 | * | asdflkj quit (Ping timeout: 240 seconds) |
01:52:42 | phpostrich | its my favorite, no doubt. |
01:52:59 | FromDiscord | <ElegantBeef> Since around 2008 π |
01:54:18 | phpostrich | that dope. I went from Go to Rust to Nim. Nim is like the god of all languages. |
01:54:42 | FromDiscord | <γγγΆγΌγ> alright how do i vendor this |
01:54:48 | FromDiscord | <ElegantBeef> I came from C# and agree |
01:55:13 | FromDiscord | <γγγΆγΌγ> https://media.discordapp.net/attachments/371759389889003532/815764074457333770/unknown.png |
01:55:17 | FromDiscord | <γγγΆγΌγ> i want to import that into this |
01:55:23 | FromDiscord | <ElegantBeef> Hmmm dont know about this concept interface method https://media.discordapp.net/attachments/371759389889003532/815764118978953256/unknown.png |
01:55:29 | FromDiscord | <γγγΆγΌγ> https://media.discordapp.net/attachments/371759389889003532/815764140743983134/unknown.png |
01:55:53 | FromDiscord | <ElegantBeef> You can do `nimble develop` at the root of the one project if it's a nimble package and then it'll locally connect it |
01:56:22 | FromDiscord | <ElegantBeef> The fuck is this https://media.discordapp.net/attachments/371759389889003532/815764365911392256/unknown.png |
01:56:49 | audiofile | https://bpa.st/VYFQW how do I get a to be the first element in the sequence and not the index |
01:57:01 | audiofile | I want to do unpacking, not implicitly get index |
01:57:43 | FromDiscord | <Yardanico> @ElegantBeef again? The article was considered for deletion a long time ago, now it shouldn't |
01:57:48 | FromDiscord | <Yardanico> Who started the process |
01:58:04 | FromDiscord | <Yardanico> https://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Nim_(programming_language)_(5th_nomination) |
01:58:50 | FromDiscord | <ElegantBeef> Audio try this https://play.nim-lang.org/#ix=2Rgc |
01:59:24 | FromDiscord | <ElegantBeef> It's really the rust people π |
01:59:30 | FromDiscord | <Yardanico> "Yet another open source computer language that never quite achieved notability despite the developer's attempts to promote it." I'm angry |
02:00:07 | FromDiscord | <InventorMatt> They seem to underestimate the growth nim has had recently |
02:00:47 | FromDiscord | <Yardanico> How come Zig has an article on wiki |
02:01:22 | FromDiscord | <Yardanico> Despite literally being less popular than Nim (I'm not saying it's bad, just the popularity facts) |
02:01:34 | FromDiscord | <Yardanico> But yeah, don't worry, people will vote against deletion |
02:01:43 | * | audiofile quit (Ping timeout: 245 seconds) |
02:01:59 | FromDiscord | <Yardanico> that guy probably just came around Nim article randomly |
02:02:47 | FromDiscord | <mattrb> This is largely unrelated to nim, but does anyone here have any examples of using sdl2 audio with emscripten? |
02:04:34 | FromDiscord | <Yardanico> Ahahaha |
02:04:48 | FromDiscord | <Yardanico> So that guy recently opened a vote for deletion for Zig |
02:04:50 | FromDiscord | <Yardanico> And it failed |
02:04:52 | FromDiscord | <Yardanico> https://en.m.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Zig_(programming_language) |
02:04:55 | FromDiscord | <Yardanico> @ElegantBeef |
02:05:08 | FromDiscord | <Yardanico> Maybe he has a grudge against smaller languages or whatever |
02:05:18 | FromDiscord | <ElegantBeef> How do you see who opened it? |
02:05:59 | FromDiscord | <Yardanico> The first message |
02:06:50 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/815766996125614140/Screenshot_20210301-050630430.jpg |
02:07:31 | FromDiscord | <MapleSyrup|TagMeIfReply> @ElegantBeef thanks (I'm audio) why change from seq[array[2, string]] to seq[(string, string)] tho? |
02:07:49 | FromDiscord | <ElegantBeef> Cause we dont have array unpacking in the base language |
02:09:03 | FromDiscord | <ElegantBeef> Sidenote, why do people swap between Discord/Irc depending on who's talking to them, it's weird π |
02:09:19 | phpostrich | would it be overkill to use a random number generator with an elliptical curve algorithm for encryption? |
02:09:33 | FromDiscord | <ElegantBeef> Just use `nimcrypto` π |
02:09:47 | FromDiscord | <Hi02Hi> wait why are wiki pages linked in the most unrelated places? |
02:09:50 | phpostrich | ill check it out |
02:10:13 | federico3 | phpostrich: please use well known libraries and methods |
02:10:15 | FromDiscord | <Yardanico> @Hi02Hi wdym? |
02:10:17 | FromDiscord | <ElegantBeef> We're talking about the Nim language page getting a AfD |
02:10:37 | phpostrich | federico3, k |
02:11:05 | FromDiscord | <Yardanico> Wikipedia has Zig, Crystal just fine |
02:11:15 | FromDiscord | <Hi02Hi> according to https://en.wikipedia.org/w/index.php?title=Special%3AWhatLinksHere&limit=500&target=Rust+%28programming+language%29&namespace=, i kid you not, rust is linked in the page for "Grin" |
02:11:25 | FromDiscord | <ElegantBeef> Ah that's what you meant π |
02:11:53 | federico3 | Yardanico: deletion requests are not based by rankings and comparisons |
02:12:03 | FromDiscord | <Yardanico> I know |
02:12:03 | FromDiscord | <konsumlamm> In reply to @Hi02Hi "according to https://en.wikipedia.org/w/index.php?t": > Grin, a minimal cryptocurrency based on the Rust programming language transaction format |
02:12:29 | FromDiscord | <konsumlamm> you could've just looked up why it's linked there :P |
02:12:36 | * | abm quit (Quit: Leaving) |
02:13:45 | FromDiscord | <ElegantBeef> Hey we average like 250 page views a day according to this pageviews graph! https://media.discordapp.net/attachments/371759389889003532/815768741504876544/unknown.png |
02:14:13 | phpostrich | dats pretty good |
02:14:26 | FromDiscord | <Hi02Hi> nice |
02:14:35 | FromDiscord | <ElegantBeef> Zig does about half |
02:15:36 | FromDiscord | <ElegantBeef> Rust did a lot more in 2020, but actually hit a rather low amount in 2021, though still like averaging 2000 π |
02:15:49 | FromDiscord | <konsumlamm> i think we should delete the Wikipedia page for brainfuck, it's not used anywhere in industry |
02:16:00 | FromDiscord | <Yardanico> I remembered comparing Nim to D :) @ElegantBeef |
02:16:06 | FromDiscord | <Yardanico> @konsumlamm they don't care about that |
02:16:12 | FromDiscord | <ElegantBeef> Weird hitler is more popular than all the languages |
02:16:23 | FromDiscord | <Yardanico> Wikipedia cares about references and trustable sources |
02:16:40 | FromDiscord | <Yardanico> If something is covered in enough sources Wikipedia will have an article about it |
02:16:54 | FromDiscord | <MapleSyrup|TagMeIfReply> can smeone help me figure out a typeerror in my code? I can share my entire program if that would be helpful |
02:17:05 | FromDiscord | <ElegantBeef> Yea that's what we're here for, solving problems π |
02:17:32 | FromDiscord | <MapleSyrup|TagMeIfReply> sorry i mean or do you want me to do a smaller example |
02:17:46 | FromDiscord | <ElegantBeef> Minimal example is always better |
02:17:46 | FromDiscord | <MapleSyrup|TagMeIfReply> you are all much apprciated frfr |
02:17:50 | FromDiscord | <MapleSyrup|TagMeIfReply> ok coming up |
02:18:12 | FromDiscord | <ElegantBeef> Oddly enough there seems to be an increase looking for languages every so often |
02:18:27 | FromDiscord | <ElegantBeef> look at this graph, so weird to see https://media.discordapp.net/attachments/371759389889003532/815769925855477760/unknown.png |
02:18:55 | FromDiscord | <ElegantBeef> Python, C, Rust, Nim, Zig |
02:18:58 | FromDiscord | <ElegantBeef> Top to bottom |
02:19:41 | FromDiscord | <ElegantBeef> Wouldnt expect them all to be so related, but i guess python links to C which then links to rust |
02:21:18 | FromDiscord | <Yardanico> Can you compare views for D, Nim, Crystal, Zig? |
02:22:01 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/815770822157402112/unknown.png |
02:22:21 | FromDiscord | <ElegantBeef> https://pageviews.toolforge.org/ |
02:22:29 | FromDiscord | <Yardanico> Yeah I know, just from the phone rn |
02:22:32 | FromDiscord | <ElegantBeef> Ah |
02:24:24 | FromDiscord | <MapleSyrup|TagMeIfReply> it looks like my short version of the code works, but not the full file... |
02:24:41 | FromDiscord | <MapleSyrup|TagMeIfReply> have I unwittingly excluded the error |
02:24:56 | FromDiscord | <ElegantBeef> Wonder if prestige is around, he might find my interface somewhat interesting, though doesnt percisely solve MI |
02:32:57 | * | lritter quit (Ping timeout: 264 seconds) |
02:33:10 | * | lritter joined #nim |
02:33:42 | phpostrich | does the "random" module have an iterator that produces random numbers, its like 4 lines of code to implement but I might be doing that for no reason |
02:39:10 | FromDiscord | <Yardanico> No, you can check that it doesn't yourself :) |
02:40:49 | phpostrich | We should make a nim-lang anime. That'd be cool |
02:42:33 | FromDiscord | <Rika> and difficult |
02:42:48 | FromDiscord | <Rika> dont think an anime has been centred around a programming language before |
02:43:15 | phpostrich | Yeah but we can inspire weebs to program in nim, making it more popular |
02:44:36 | FromDiscord | <Rika> i think youre missing the issue |
02:45:04 | FromDiscord | <exelotl> What if Kobayashi was actually writing Nim all along |
02:47:01 | phpostrich | openbsd releases a song every year. we can do something like that |
02:47:28 | phpostrich | for each update we could do some deep poetry |
02:48:53 | FromDiscord | <MapleSyrup|TagMeIfReply> here is the error and code: https://bpa.st/XCTL2 can someone help me figure this out |
02:49:02 | Prestige | Hello Beef - link? |
02:49:26 | Prestige | @ElegantBeef ^ |
02:49:29 | FromDiscord | <MapleSyrup|TagMeIfReply> I can make house music so count me in if you want same boring repetitive music |
02:49:35 | FromDiscord | <ElegantBeef> Just this impl atm https://media.discordapp.net/attachments/371759389889003532/815777759209062441/unknown.png |
02:50:50 | Prestige | looks interesting, could be useful |
02:51:06 | Prestige | Wish I could actually implement the MI example I wanted in my PR |
02:51:13 | Prestige | er, RFC |
02:51:24 | FromDiscord | <Rika> @MapleSyrup|TagMeIfReply onSend cannot take any parameters |
02:53:44 | FromDiscord | <Rika> make it `onSend: proc(a, b: string) = proc(a, b: string) = discard` |
02:54:19 | FromDiscord | <MapleSyrup|TagMeIfReply> oh...I see. so why doesn't this work? https://bpa.st/TPE3A |
02:54:56 | FromDiscord | <MapleSyrup|TagMeIfReply> oh |
02:55:10 | FromDiscord | <Rika> because proc anon({this has to contain definitions, not values) |
02:55:13 | FromDiscord | <Rika> (edit) "values)" => "values})" |
02:55:19 | FromDiscord | <Rika> lol |
02:55:25 | FromDiscord | <Rika> did you realize? |
02:56:58 | FromDiscord | <MapleSyrup|TagMeIfReply> thanks that worked |
02:57:06 | FromDiscord | <MapleSyrup|TagMeIfReply> yes I'm still getting used to the syntax lol |
02:57:35 | FromDiscord | <Rika> okay |
03:00:02 | phpostrich | Is Nim funded? If so, how? |
03:05:19 | saem | There is a compiler bug here, but also am I doing something really dumb when generating this giant if/else expr: https://play.nim-lang.org/#ix=2Rgu |
03:06:45 | FromDiscord | <MapleSyrup|TagMeIfReply> is there anything I need to do before switching from socket.send() to socket.recv()? |
03:06:58 | FromDiscord | <MapleSyrup|TagMeIfReply> server isn't sending a response T_T |
03:08:37 | saem | Wow, I found the regression, can't believe we don't have tests for that -- fixing. |
03:12:13 | FromDiscord | <ElegantBeef> Nim is funded by the community and also status.im afaik |
03:12:23 | saem | OK, crap... that's tricky as heck. |
03:12:47 | saem | The removal of noNilSeqs is a problem for object variants, well at least the AST. |
03:12:51 | saem | π€ |
03:15:33 | * | phpostrich quit (Ping timeout: 264 seconds) |
03:18:54 | saem | Hmm, so PNode is an object variant, one part of the variant has a seq of `sons`, the compiler was using `isNil` (now an error) to guard against the variants that don't have an `sons`. That's not a thing anymore with nimNoNilSeqs gone. So most code will work fine, except for things like `if true: ...` which the compiler will attempt to sem and will now try to access a nil sons (wrong kinds). π |
03:19:43 | * | phpostrich joined #nim |
03:20:27 | Prestige | That sounds odd |
03:20:35 | saem | oh... maybe I can just use `safeLen` |
03:20:51 | saem | Oh, it's not odd, it's easy to miss. |
03:21:09 | saem | Control flow based type narrowing can't come soon enough. |
03:27:47 | * | muffindrake quit (Ping timeout: 272 seconds) |
03:29:25 | * | muffindrake joined #nim |
03:30:04 | FromDiscord | <MapleSyrup|TagMeIfReply> thanks for all the help, folks, I've finished writing my library gonna ZZZ now |
03:31:08 | FromDiscord | <Rika> See you |
03:35:39 | saem | also fixed my playground issue |
03:36:01 | FromDiscord | <γγγΆγΌγ> how would i actually make a variable a fixed point using this library |
03:36:12 | FromDiscord | <ElegantBeef> What library? |
03:36:43 | FromDiscord | <γγγΆγΌγ> https://gitlab.com/lbartoletti/fpn/-/tree/master/ |
03:37:19 | FromDiscord | <γγγΆγΌγ> sent a code paste, see https://play.nim-lang.org/#ix=2RgA |
03:40:41 | FromDiscord | <Rika> What library |
03:40:52 | FromDiscord | <Rika> Oh the linked |
03:40:54 | FromDiscord | <γγγΆγΌγ> ye |
03:41:37 | FromDiscord | <Rika> The first should work |
03:41:56 | FromDiscord | <γγγΆγΌγ> but it doesnt |
03:41:57 | FromDiscord | <γγγΆγΌγ> π |
03:42:14 | FromDiscord | <ElegantBeef> Errors help |
03:42:17 | FromDiscord | <Rika> Yeah |
03:43:07 | FromDiscord | <γγγΆγΌγ> sent a code paste, see https://paste.rs/KGk |
03:43:46 | FromDiscord | <γγγΆγΌγ> https://pastebin.com/a2L5gMNU |
03:44:26 | FromDiscord | <ElegantBeef> Did you not try `FixedPoint`? |
03:45:03 | FromDiscord | <Rika> That is honestly very strange |
03:45:14 | FromDiscord | <γγγΆγΌγ> tried that too, I get this error: C:\Users\sraya\OneDrive\Documents\Nim\Projects\test_game\src\main.nim(44, 15) Error: undeclared identifier: 'FixedPoint'β΅stack trace: (most recent call last) |
03:45:53 | FromDiscord | <Rika> Make a file that only imports the module and instantiates a variable of that type |
03:45:56 | FromDiscord | <Rika> See if it works |
03:46:08 | FromDiscord | <γγγΆγΌγ> kk |
03:46:23 | FromDiscord | <γγγΆγΌγ> i should mention that i 'vendored' the module |
03:46:31 | FromDiscord | <γγγΆγΌγ> i copied the source code and put it in my project |
03:46:45 | FromDiscord | <γγγΆγΌγ> https://media.discordapp.net/attachments/371759389889003532/815792146028036126/unknown.png |
03:46:46 | FromDiscord | <γγγΆγΌγ> like so |
03:47:10 | FromDiscord | <γγγΆγΌγ> i could try removing this and installing with nimble instead, but i wanted to be able to modify it as i want |
03:47:34 | FromDiscord | <Rika> Well are you importing it right then |
03:47:45 | FromDiscord | <γγγΆγΌγ> import fpn |
03:47:48 | FromDiscord | <γγγΆγΌγ> i just did that |
03:47:52 | FromDiscord | <γγγΆγΌγ> and it gave me no errosr |
03:47:53 | FromDiscord | <Rika> Doesnβt look correct to me |
03:47:59 | FromDiscord | <Rika> How did you install it |
03:48:14 | FromDiscord | <γγγΆγΌγ> i didnt i just copied the source code and dragged it to my project |
03:48:23 | FromDiscord | <Rika> Then import fpn shouldnβt work at all |
03:48:35 | FromDiscord | <γγγΆγΌγ> but vscode gave me no errors |
03:48:38 | FromDiscord | <γγγΆγΌγ> and it complied fine |
03:48:48 | FromDiscord | <Rika> Then that means itβs installed somewhere in nimble |
03:48:58 | FromDiscord | <γγγΆγΌγ> oh i see |
03:49:11 | FromDiscord | <γγγΆγΌγ> ok lemme try removing it |
03:49:18 | FromDiscord | <Rika> Try nimble uninstall fpn |
03:49:57 | FromDiscord | <γγγΆγΌγ> ok uhhhh |
03:50:04 | FromDiscord | <γγγΆγΌγ> i guess i reintall now? |
03:50:08 | FromDiscord | <γγγΆγΌγ> is fpn on nimble? |
03:50:15 | FromDiscord | <Rika> Uh |
03:50:25 | FromDiscord | <Rika> Wait |
03:50:31 | FromDiscord | <Rika> Did you do what I say |
03:50:42 | FromDiscord | <γγγΆγΌγ> yep |
03:50:43 | FromDiscord | <Rika> Or did you delete the folder you made |
03:50:47 | FromDiscord | <γγγΆγΌγ> i did both |
03:50:50 | FromDiscord | <Rika> Why |
03:50:57 | FromDiscord | <Rika> You didnβt have to do the second one |
03:51:02 | FromDiscord | <γγγΆγΌγ> oh |
03:51:09 | FromDiscord | <γγγΆγΌγ> aight ill recopy it lol |
03:51:33 | FromDiscord | <Rika> You could have changed the import to `import ./FixedPoint-lib/fpnβ |
03:51:38 | FromDiscord | <Rika> (edit) "./FixedPoint-lib/fpnβ" => "./FixedPoint-lib/fpn`" |
03:51:47 | FromDiscord | <ElegantBeef> you know you can just do `nimble develop giturl` and it'll clone the project and put it in your `pkg` path |
03:52:04 | FromDiscord | <Rika> Yeah but thatβs global not per project |
03:52:07 | FromDiscord | <γγγΆγΌγ> yeah but i want to be able to edit the orignal code |
03:52:17 | FromDiscord | <Rika> You will still be able to edit the code with develop |
03:52:39 | FromDiscord | <Rika> Itβs just like install except the code is put into the current directory |
03:52:45 | FromDiscord | <Rika> But itβs also still global |
03:52:59 | FromDiscord | <Rika> So the code you change will apply for all projects you use the library in |
03:53:24 | FromDiscord | <γγγΆγΌγ> ok so it still doesnt work |
03:53:36 | FromDiscord | <γγγΆγΌγ> i recopied it, and changed the import path |
03:54:08 | FromDiscord | <γγγΆγΌγ> ill try the git thing elegant suggested |
03:54:16 | FromDiscord | <γγγΆγΌγ> maybe that will work better π
|
03:54:30 | * | krux02 quit (Remote host closed the connection) |
03:55:20 | FromDiscord | <γγγΆγΌγ> .... nope that failed too |
03:55:29 | FromDiscord | <ElegantBeef> Well i do it whenever i'm forking packages as it just works better especially since you're wanting to change the package |
03:55:45 | FromDiscord | <ElegantBeef> I'll have to try this package in a minute to figure what's going wrong |
03:56:10 | FromDiscord | <γγγΆγΌγ> yeah |
03:58:17 | FromDiscord | <ElegantBeef> So `fixedPoint32` is a generic |
03:58:31 | FromDiscord | <ElegantBeef> It takes a size i believe being bits |
03:59:09 | FromDiscord | <γγγΆγΌγ> .... |
03:59:15 | FromDiscord | <γγγΆγΌγ> but.... |
03:59:20 | FromDiscord | <γγγΆγΌγ> it already says its 32 bits.... |
04:01:20 | FromDiscord | <Rika> That is so odd |
04:02:20 | FromDiscord | <γγγΆγΌγ> i wonder if i should just build my own fixed point library at this rate.... |
04:02:32 | FromDiscord | <γγγΆγΌγ> that or wait for the creator to show up |
04:04:16 | * | lritter quit (Quit: Leaving) |
04:05:16 | FromDiscord | <Rika> Ngl the library doesnβt follow a lot of conventions |
04:05:23 | FromDiscord | <Rika> Like the type name being capitalised |
04:05:43 | FromDiscord | <ElegantBeef> I have to look at it more i just got the code to run π |
04:06:12 | FromDiscord | <ElegantBeef> Ok so you can generate your own fpn type |
04:06:41 | FromDiscord | <Rika> Good luck, Iβm on a phone so I canβt do much |
04:07:41 | FromDiscord | <ElegantBeef> Seems you can do `genQMN(initQ1616, 16, FixedPoint)` then just refer to it as `FixedPoint` |
04:07:49 | FromDiscord | <γγγΆγΌγ> ok thats really fucking weird |
04:08:28 | FromDiscord | <γγγΆγΌγ> ok so i just wanted a fixedPoint type thats like 22,10 |
04:08:38 | FromDiscord | <Rika> Man this is weird shit |
04:08:41 | FromDiscord | <ElegantBeef> Yep |
04:09:02 | FromDiscord | <ElegantBeef> There is a `initQ2210` so congrats! |
04:09:15 | FromDiscord | <γγγΆγΌγ> buuuuuuuuut its untested |
04:09:21 | FromDiscord | <γγγΆγΌγ> all of the unit tests only work for 16 16 |
04:09:31 | FromDiscord | <Rika> I mean |
04:09:36 | FromDiscord | <Rika> You can make the tests |
04:09:41 | FromDiscord | <γγγΆγΌγ> yeah but idk how |
04:10:20 | FromDiscord | <ElegantBeef> I'd imagine the procedures are all generic(they are if i read properly) so you just replicate what they did for 1616 |
04:10:35 | FromDiscord | <γγγΆγΌγ> but there isnt a 10 bit int |
04:10:43 | FromDiscord | <γγγΆγΌγ> so some of the tests would have to be different |
04:11:25 | FromDiscord | <Rika> You can make one with a range canβt you |
04:11:36 | FromDiscord | <Rika> Just find the limits of a 10 bit integer and put that in the range |
04:12:08 | FromDiscord | <γγγΆγΌγ> true.... |
04:12:32 | FromDiscord | <γγγΆγΌγ> honestly tho, im just not going to bother righ tnow lol, ill just use the variable and hope it works |
04:12:58 | FromDiscord | <Rika> Bad developer smh not testing their code |
04:13:12 | FromDiscord | <ElegantBeef> I'm kinda surprised that you're needing fixed points for a 2D game π |
04:14:03 | FromDiscord | <ElegantBeef> I say 2D but i mean a single player game non lockstep game |
04:14:13 | FromDiscord | <Rika> I mean if you need it then you need it |
04:14:14 | FromDiscord | <γγγΆγΌγ> hahahahha, i want to try my hand at rollback netcode |
04:14:28 | FromDiscord | <γγγΆγΌγ> which means lockstep |
04:14:32 | FromDiscord | <ElegantBeef> Ah i see |
04:14:50 | FromDiscord | <Rika> I am understanding none of this |
04:14:51 | FromDiscord | <γγγΆγΌγ> its always the fcking fixed point that gets me |
04:14:57 | FromDiscord | <γγγΆγΌγ> ok so rollback netcode |
04:14:58 | FromDiscord | <Rika> Tfw backend dev |
04:15:02 | FromDiscord | <γγγΆγΌγ> here's a good article about it |
04:15:11 | FromDiscord | <Rika> Dude I only make servers |
04:15:17 | FromDiscord | <γγγΆγΌγ> https://ki.infil.net/w02-netcode.html |
04:15:33 | FromDiscord | <γγγΆγΌγ> its pretty simple to understan |
04:15:58 | FromDiscord | <Rika> Will look into it because itβs in my fields of interest |
04:16:17 | FromDiscord | <γγγΆγΌγ> but uh, beef, so how exactly do i instantiate? |
04:16:28 | FromDiscord | <γγγΆγΌγ> do I just do FixedPoint = genwhatever() somewhere? |
04:16:53 | FromDiscord | <ElegantBeef> It makes the type for you |
04:17:18 | FromDiscord | <ElegantBeef> You later should be able to do `let a = FixedPoint()` or use the `fromFloat` or `fromInt` |
04:17:47 | FromDiscord | <γγγΆγΌγ> hm but uh |
04:17:57 | FromDiscord | <γγγΆγΌγ> when i do fixedPoint32 or FixedPoint it doesnt work |
04:18:28 | FromDiscord | <γγγΆγΌγ> oh |
04:18:29 | FromDiscord | <γγγΆγΌγ> ok |
04:18:49 | FromDiscord | <γγγΆγΌγ> nvm that doesnt work |
04:18:50 | FromDiscord | <γγγΆγΌγ> AHHHHHHH |
04:19:50 | FromDiscord | <ElegantBeef> Yep idk how to properly use it |
04:20:21 | FromDiscord | <γγγΆγΌγ> this is terrible |
04:20:31 | FromDiscord | <γγγΆγΌγ> i might just go with my hack idea of just rounding the last three decimal places |
04:27:54 | * | spiderstew joined #nim |
04:28:12 | * | spiderstew_ quit (Ping timeout: 260 seconds) |
04:42:19 | * | vicfred quit (Quit: Leaving) |
04:43:52 | FromDiscord | <ElegantBeef> This probably isnt possible but is there a way to bind a symbol in a macro in in the scope of the calling file, without using include on the file with the macro? |
05:29:25 | FromDiscord | <γγγΆγΌγ> so uh, networking in nim |
05:29:27 | FromDiscord | <γγγΆγΌγ> whats the status |
05:34:15 | FromDiscord | <ElegantBeef> Depends on what you want |
05:34:40 | FromDiscord | <ElegantBeef> Reliable udp can use Netty |
05:40:40 | FromDiscord | <γγγΆγΌγ> how about universal plug and play |
05:41:51 | FromDiscord | <Rika> I think netty still fits there |
05:41:52 | FromDiscord | <ElegantBeef> Netty has nat punch-through |
05:42:31 | FromDiscord | <γγγΆγΌγ> oh shit ok |
05:42:36 | FromDiscord | <ElegantBeef> But you should be able to use upnp and netty |
05:42:45 | FromDiscord | <ElegantBeef> idk much about networking to be honest π |
05:43:31 | FromDiscord | <γγγΆγΌγ> oh shit it was made by treeform |
05:43:36 | FromDiscord | <γγγΆγΌγ> @treeform hello! |
05:43:50 | FromDiscord | <ElegantBeef> Like i said earlier he should make his own stdlib |
05:44:35 | FromDiscord | <Rika> Most people donβt have access to upnp do they? |
05:44:46 | FromDiscord | <ElegantBeef> It's based on the modem/router afaik |
05:45:17 | FromDiscord | <treeform> In reply to @γγγΆγΌγ "<@!107140179025735680> hello!": hello |
05:45:36 | FromDiscord | <γγγΆγΌγ> so it really works? it does nat hole punching??? |
05:46:01 | FromDiscord | <ElegantBeef> Nah treeform thought it was funny to put it in his readme, he realized he'd prank this random person named "Valor" |
05:46:16 | FromDiscord | <γγγΆγΌγ> ha ha very funny |
05:46:21 | FromDiscord | <γγγΆγΌγ> its just |
05:46:22 | FromDiscord | <γγγΆγΌγ> suprising |
05:46:32 | FromDiscord | <γγγΆγΌγ> most programming lirbaries in the world dont do nat holepunching |
05:46:38 | FromDiscord | <γγγΆγΌγ> its exceedingly rare |
05:47:01 | FromDiscord | <γγγΆγΌγ> like, godots own networking doesnt do nat holepunching |
05:47:05 | FromDiscord | <γγγΆγΌγ> nor does unity |
05:47:07 | FromDiscord | <ElegantBeef> The C# reliable UDP i used did nat hole punching |
05:47:14 | FromDiscord | <γγγΆγΌγ> oh, ruffle? |
05:47:18 | FromDiscord | <ElegantBeef> So i just expect it, since both i used id |
05:47:23 | FromDiscord | <ElegantBeef> Litenetlib |
05:47:25 | FromDiscord | <γγγΆγΌγ> ah |
05:47:36 | FromDiscord | <γγγΆγΌγ> yeah no, i tried doing nat holepunching in godot |
05:47:38 | FromDiscord | <γγγΆγΌγ> no luck |
05:48:48 | FromDiscord | <γγγΆγΌγ> sorry if i come across as rude |
05:48:51 | FromDiscord | <γγγΆγΌγ> i apologize |
05:49:17 | FromDiscord | <γγγΆγΌγ> i knwo ive asked you guys a lot today and i really do appreciate all the help you've given |
05:50:46 | FromDiscord | <ElegantBeef> No need to apologize you werent rude |
05:52:02 | FromDiscord | <γγγΆγΌγ> π |
05:56:15 | FromDiscord | <Rika> In reply to @ElegantBeef "It's based on the": I know, when I think games I think children and most of them will be rejected when they ask their parents to open a port lol |
05:58:29 | FromDiscord | <ElegantBeef> Yea |
06:12:18 | * | NimBot joined #nim |
06:18:11 | FromGitter | <redblack3_gitlab> So I just found that this works exactly like a ternary operator in C: β β ```code paste, see link``` β β It works so well that I'm afraid it might not be on purpose. Using this as short-hand to test 1-line "truthy" values. Does this have a chance to break? [https://gitter.im/nim-lang/Nim?at=603c8723a3a2f04f1fc63916] |
06:20:09 | FromDiscord | <γγγΆγΌγ> people use gitter??? |
06:20:55 | FromDiscord | <ElegantBeef> Well it's matrix based now, so why not! |
06:21:38 | FromDiscord | <ElegantBeef> nah `?` invokes the procedure and `:` passes the next variable |
06:21:48 | FromDiscord | <ElegantBeef> last variable |
06:22:06 | FromDiscord | <ElegantBeef> That's completely expected and solves the whole "How to do ternary operator in Nim" |
06:22:35 | FromGitter | <redblack3_gitlab> Awesome. will keep it then :) |
06:22:44 | FromDiscord | <Rika> Kinda cursed though ngl |
06:25:31 | FromDiscord | <ElegantBeef> On the plus side though it cannot be nested |
06:26:14 | FromDiscord | <ElegantBeef> Atleast i dont think it can |
06:32:04 | FromDiscord | <γγγΆγΌγ> Alright, ive made a bunch of progress on my game the past two days |
06:32:41 | FromDiscord | <γγγΆγΌγ> im going to do a dumb and make it a smash bros style game, but super stripped down and simple, and I will attempt to add netcode. You can see my repo and the current goals here: https://github.com/ValorZard/Nim-Platformer |
06:32:50 | FromDiscord | <γγγΆγΌγ> I wrote down the list of stuff i need to work on in my readme |
06:33:26 | FromDiscord | <γγγΆγΌγ> Let's see how far I can go |
06:34:03 | FromDiscord | <ElegantBeef> You're pushing binaries |
06:34:16 | FromDiscord | <ElegantBeef> both your executable and your sdl π |
06:34:21 | FromDiscord | <γγγΆγΌγ> oh woop |
06:34:56 | FromDiscord | <ElegantBeef> How are you liking nico anywho? |
06:35:14 | FromDiscord | <γγγΆγΌγ> It .... strangly feels more fun/easy to use than godot |
06:35:15 | FromDiscord | <γγγΆγΌγ> idk why |
06:35:24 | FromDiscord | <γγγΆγΌγ> probably cuz i dont have to use motherfucking GDSCRIPT |
06:35:27 | FromDiscord | <ElegantBeef> Might just be the amount of control π |
06:35:33 | FromDiscord | <γγγΆγΌγ> that too |
06:35:38 | FromDiscord | <γγγΆγΌγ> but mostly its gdscript |
06:35:41 | FromDiscord | <ElegantBeef> Now now, Nim is basically just grown up gdscript |
06:35:59 | FromDiscord | <γγγΆγΌγ> nim is what gdscript is going to end up turning into lol |
06:36:31 | FromDiscord | <ElegantBeef> Imagine if they just you know threw nim in there π |
06:37:28 | FromDiscord | <γγγΆγΌγ> there ARE nim bindings, but i really dont want to deal with gdnative, and i suspect it would end up giving me the same amount of frustration as using gdscript anyways |
06:37:40 | FromDiscord | <ElegantBeef> I used the bindings |
06:37:57 | FromDiscord | <ElegantBeef> They're ok, would be nice if it was firstclass and you could create everything you need with a single button |
06:38:09 | FromDiscord | <γγγΆγΌγ> having an editor is super nice |
06:38:18 | FromDiscord | <γγγΆγΌγ> Sure im able to get programming super fast NOW |
06:38:25 | FromDiscord | <γγγΆγΌγ> but once i have to start adding actual assets |
06:38:27 | FromDiscord | <γγγΆγΌγ> oh boy |
06:39:00 | FromDiscord | <γγγΆγΌγ> i mean, it would be cool if we could turn nico into an actual game engine, but idk if anyone wants that to happen |
06:39:15 | FromDiscord | <ElegantBeef> Impbox doesnt, he likes it being out of the way |
06:39:21 | FromDiscord | <γγγΆγΌγ> ah k |
06:39:42 | FromDiscord | <ElegantBeef> But it's OSS so you can always do it yourself |
06:39:56 | FromDiscord | <ElegantBeef> Though i'm uncertain how you could really turn it into an engine |
06:40:05 | FromDiscord | <γγγΆγΌγ> i mean i just want a nice way to import assets |
06:40:13 | FromDiscord | <γγγΆγΌγ> and manage scenes and stuff |
06:40:18 | FromDiscord | <ElegantBeef> You can use tiled for thata |
06:40:20 | FromDiscord | <ElegantBeef> (edit) "thata" => "that" |
06:40:25 | FromDiscord | <γγγΆγΌγ> does tiled do animations? |
06:40:34 | FromDiscord | <ElegantBeef> No, you'd have to make your own editor for that |
06:40:38 | FromDiscord | <γγγΆγΌγ> sigh |
06:41:07 | FromDiscord | <ElegantBeef> My player animation for linerino is just `time.floor.int.mod(playerSpriteCount)` π |
06:41:46 | FromDiscord | <γγγΆγΌγ> one of the things i like about godot is that you can add a lot of stuff to their animations |
06:41:51 | FromDiscord | <γγγΆγΌγ> including hooks and animations and stuff |
06:42:00 | FromDiscord | <γγγΆγΌγ> (edit) "animations" => "scripts" |
06:42:06 | FromDiscord | <γγγΆγΌγ> but i guess ill just do that manually lol |
06:42:38 | FromDiscord | <ElegantBeef> I might be misremembering but i do recall him mentioning he had some sort of animation setup |
06:42:45 | FromDiscord | <γγγΆγΌγ> ah k |
06:42:55 | FromDiscord | <γγγΆγΌγ> i mean everything is there for nico to turn into a full engine |
06:42:59 | FromDiscord | <γγγΆγΌγ> it just needs ui and its good to go |
06:43:14 | FromDiscord | <ElegantBeef> You mean an inspector or a gui toolkit? |
06:43:20 | FromDiscord | <γγγΆγΌγ> gui toolkit |
06:43:24 | FromDiscord | <ElegantBeef> It has a built in imgui |
06:43:28 | FromDiscord | <γγγΆγΌγ> oh |
06:43:29 | FromDiscord | <γγγΆγΌγ> lol |
06:43:44 | FromDiscord | <ElegantBeef> https://github.com/ftsf/nico/blob/master/examples/gui.nim |
06:43:51 | FromDiscord | <γγγΆγΌγ> i mean nico already has the same amount of tools as bevy |
06:43:59 | FromDiscord | <γγγΆγΌγ> its just that bevy has fancy smancy ecs |
06:44:11 | FromDiscord | <γγγΆγΌγ> which they've spent so much development time on |
06:44:18 | FromDiscord | <ElegantBeef> So does Nico, just pull in your favourite ECS library π |
06:44:24 | FromDiscord | <γγγΆγΌγ> no i hate ecs lol |
06:44:50 | FromDiscord | <ElegantBeef> it doesnt enforce a paradigm so you have whatever you want |
06:44:55 | FromDiscord | <γγγΆγΌγ> i mean, im sure its nice, but observing how bevy has had to deal with it |
06:45:00 | FromDiscord | <γγγΆγΌγ> it seems like a MASSIVE time sink |
06:45:24 | FromDiscord | <γγγΆγΌγ> the people making bevy have had to spend so much time optimizing ecs that its taken away resources from (what i think) are more pressing matters |
06:45:27 | FromDiscord | <ElegantBeef> Fairly certain anukens framework is using ECS, and pixeye also is investigating ECS |
06:45:38 | FromDiscord | <γγγΆγΌγ> what are those |
06:45:48 | FromDiscord | <ElegantBeef> Both Nim users |
06:45:51 | FromDiscord | <γγγΆγΌγ> ah |
06:45:59 | FromDiscord | <γγγΆγΌγ> i mean if you can make ecs work, more power to you |
06:46:02 | FromDiscord | <γγγΆγΌγ> just dont like |
06:46:06 | FromDiscord | <γγγΆγΌγ> make it one of your core tenets |
06:46:09 | FromDiscord | <γγγΆγΌγ> or something |
06:46:26 | FromDiscord | <ElegantBeef> Well it's that rust mantra of "There is only one right way" |
06:46:35 | FromDiscord | <γγγΆγΌγ> yeahhhhhh |
06:46:47 | FromDiscord | <γγγΆγΌγ> definetly starting to sour on that rust mentality |
06:47:15 | FromDiscord | <γγγΆγΌγ> it feels like rust people are too orthodox with their ideology |
06:47:26 | FromDiscord | <ElegantBeef> The general idea that the Rust community spews are nice ideas |
06:47:58 | FromDiscord | <ElegantBeef> No unneeded copies, dont allow nil refs, write performant code |
06:47:59 | FromDiscord | <γγγΆγΌγ> i agree, i mean what drew me to rust was how egronomic cargo was, compared to the messy dependency hell of c++ |
06:48:04 | FromDiscord | <γγγΆγΌγ> and i liked the memory stuff |
06:48:07 | FromDiscord | <γγγΆγΌγ> but like |
06:48:07 | FromDiscord | <γγγΆγΌγ> yeah |
06:48:25 | FromDiscord | <ElegantBeef> Well i like borrowing as much as the next person but i really like it being opt in |
06:48:38 | FromDiscord | <ElegantBeef> ~~Glances at views~~ |
06:48:43 | FromDiscord | <hamidb80> i remember i wanted to pass a string to another function in rust ... |
06:48:54 | FromDiscord | <hamidb80> that moment was ... |
06:48:57 | FromDiscord | <ElegantBeef> You need to give up ownership or lend it |
06:49:17 | FromDiscord | <ElegantBeef> I like that behaviour in some cases where it makes sense |
06:49:24 | FromDiscord | <ElegantBeef> strutils for instance |
06:49:40 | FromDiscord | <ElegantBeef> Most of those operations can be borrow only |
06:50:50 | FromDiscord | <ElegantBeef> Although apparently they've made ownership less annoying, but i've never wrote rust code so not a clue |
06:51:22 | ForumUpdaterBot | New thread by Neodim: SQLite getRow data changing, see https://forum.nim-lang.org/t/7567 |
06:51:47 | FromDiscord | <hamidb80> hey treeform |
06:51:55 | FromDiscord | <hamidb80> hows going |
06:52:05 | FromDiscord | <treeform> In reply to @γγγΆγΌγ "most programming lirbaries in": Well home punching is complex. It involves a central server... so a library can't implement it all on its own, it needs some thing else. I provide the call but you need to provide the central server. |
06:52:23 | FromDiscord | <treeform> In reply to @hamidb80 "hey treeform": hey |
06:57:15 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
07:10:13 | FromDiscord | <hamidb80> is it possible to `sleep` less than 1ms or it is a OS limitation? |
07:10:20 | FromDiscord | <hamidb80> (edit) "is it possible to `sleep` ... less" added "for" |
07:10:26 | FromDiscord | <hamidb80> (edit) "a" => "an" |
07:11:25 | FromDiscord | <ElegantBeef> It's an OS limitation, hell sleeping for 1ms isnt even certain to last one ms |
07:12:55 | * | JustASlacker joined #nim |
07:21:47 | FromDiscord | <Rika> ~~and sleeping is pretty wasteful of resources xd~~ |
07:22:43 | saem | Fun the tests passed, hopefully that doesn't introduce a ton of issues: https://github.com/nim-lang/Nim/pull/17210 |
07:25:30 | FromDiscord | <hamidb80> In reply to @Rika "~~and sleeping is pretty": to be honest, i wanna run 2 async procs together |
07:25:38 | FromDiscord | <ElegantBeef> So then do it |
07:26:02 | FromDiscord | <hamidb80> ` await sleepAsync 1` |
07:26:09 | FromDiscord | <Rika> thats what i do too, yeah |
07:26:13 | FromDiscord | <Rika> 1 is fine |
07:26:23 | FromDiscord | <Rika> well i'd recommend something like 50 |
07:26:38 | FromDiscord | <Rika> too fast and you're polling too quickly and wasting a lot of resources π |
07:26:50 | FromDiscord | <hamidb80> tnx |
07:27:05 | FromDiscord | <Rika> if its polling too slow just change the number then ig |
07:33:37 | lbart | Thanks Yardanico :) |
07:33:41 | * | narimiran joined #nim |
07:34:16 | * | PMunch joined #nim |
07:40:00 | FromDiscord | <lbart> @treeform Nice: https://github.com/treeform/spacy ! |
07:53:27 | FromDiscord | <hyu1996> good work |
07:56:54 | phpostrich | Is Nim's default garbage collector the best one? |
07:57:06 | saem | best for? |
07:57:32 | saem | Personally, for development productivity I prefer the default. |
07:57:32 | phpostrich | Speed |
07:58:22 | saem | In which case my understanding is that in most cases that's not true, wherein when you say speed you're primarily concerned about avoiding allocations or GC pauses. |
07:59:52 | FromDiscord | <ElegantBeef> Arc/Orc are the lowest latency and Arc can improve speped a lot |
08:00:00 | FromDiscord | <ElegantBeef> (edit) "speped" => "speed" |
08:00:06 | FromDiscord | <Rika> i think best for throughput is mark and sweep |
08:00:18 | FromDiscord | <ElegantBeef> It's highly dependant on what you're doing |
08:00:23 | saem | really depends upon the type of speed you want, yeah |
08:00:29 | FromDiscord | <Rika> dependent |
08:01:00 | FromDiscord | <ElegantBeef> Is that not grammatically correct? |
08:01:24 | saem | In a non-prescriptive language at that. :D |
08:01:51 | phpostrich | I only made it to English 2 in high school (not far in my state) |
08:02:01 | phpostrich | I'z a dropout boy |
08:02:02 | FromDiscord | <Rika> dependant is a noun |
08:02:48 | FromDiscord | <Rika> im not a native english speaker (though i also am technically native depending on definition) |
08:02:53 | FromDiscord | <ElegantBeef> All the dicts i see say it's an adjective |
08:02:59 | saem | and a noun |
08:03:11 | FromDiscord | <Rika> dependant? im pretty sure its a noun |
08:03:16 | FromDiscord | <ElegantBeef> a dependant is |
08:03:16 | saem | Though the whole which dictionary you subscribe to matters |
08:03:20 | FromDiscord | <Rika> dependent is the adjective |
08:03:25 | phpostrich | I wish to only speak Nim one day |
08:03:41 | FromDiscord | <ElegantBeef> They're different spellings of the same word afaik |
08:03:42 | phpostrich | Reprogram the universe |
08:04:41 | FromDiscord | <Rika> https://media.discordapp.net/attachments/371759389889003532/815857054047535114/image0.png |
08:04:45 | FromDiscord | <Rika> phone dict doesnt say so |
08:04:57 | saem | That's all Oxford |
08:05:11 | FromDiscord | <Rika> i mean i guess it is |
08:05:15 | FromDiscord | <ElegantBeef> > dependent tends to be used for the adjective and dependant for the noun |
08:05:18 | FromDiscord | <ElegantBeef> tends to |
08:05:24 | FromDiscord | <ElegantBeef> Indicates it's not an enforcement |
08:05:39 | phpostrich | Is Nim every going to adapt Rust's ownership model? |
08:06:00 | phpostrich | not adapt but implement ig |
08:06:01 | FromDiscord | <ElegantBeef> That's Merriam Webster and talking about British English, which as a Canadian I prescribe more to than that stuff spoken south of me π |
08:06:13 | FromDiscord | <ElegantBeef> It already has a small implementation |
08:06:18 | FromDiscord | <Rika> something similar but not exactly |
08:06:24 | FromDiscord | <ElegantBeef> It's just not enforced and is expiremental |
08:06:28 | FromDiscord | <Rika> one difference is that |
08:06:29 | FromDiscord | <Rika> yeah |
08:06:30 | FromDiscord | <Rika> that |
08:06:42 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual_experimental.html#view-types |
08:06:51 | FromDiscord | <Rika> how experimental is it btw |
08:06:56 | FromDiscord | <ElegantBeef> I mean i made <https://github.com/beef331/strviewutils> with it |
08:07:08 | FromDiscord | <Rika> still disappointed its not strviewtils |
08:07:11 | FromDiscord | <ElegantBeef> It gets a lot of codegen issues, if not using arc/orc afaik |
08:07:50 | phpostrich | Hmm, what would be the benefit of using ownership in Nim? |
08:07:56 | FromDiscord | <Rika> LMAO the program i made got `out of memory` with orc |
08:08:02 | phpostrich | Its already pretty darn fast |
08:08:20 | FromDiscord | <treeform> In reply to @lbart "<@!107140179025735680> Nice: https://github.com/tre": I am glad you like it. |
08:08:40 | FromDiscord | <ElegantBeef> In reply to @phpostrich "Its already pretty darn": Fewer allocations, and as my strviewutils shows it can be faster |
08:08:54 | FromDiscord | <Rika> actually very strange, valgrind says i only allocate a few kb... |
08:09:08 | FromDiscord | <ElegantBeef> are you using `-d:useMalloc` or w/e it is? |
08:09:10 | FromDiscord | <Rika> how do i oom at a few kb? |
08:09:20 | FromDiscord | <Rika> oh i didnt |
08:09:23 | FromDiscord | <Rika> okay let me check again |
08:09:27 | FromDiscord | <ElegantBeef> Valgrind doesnt follow nim's allocator |
08:10:12 | saem | what you working on lately, Beef? |
08:10:37 | FromDiscord | <ElegantBeef> Playing with macros. Also aglet |
08:10:42 | FromDiscord | <ElegantBeef> (edit) "Playing with macros. Also ... aglet" added "playing with" |
08:11:06 | FromDiscord | <ElegantBeef> Made some weird runtime interface with concepts today |
08:11:07 | saem | aglet? |
08:11:13 | saem | Oh, game |
08:11:16 | FromDiscord | <ElegantBeef> A opengl abstraction |
08:11:19 | phpostrich | Named after the end of a shoelace? |
08:11:34 | FromDiscord | <ElegantBeef> I'm not the one that made the library! |
08:11:42 | FromDiscord | <Rika> i wish people cared about what i make π |
08:11:49 | phpostrich | I care |
08:11:50 | FromDiscord | <ElegantBeef> Eh no one cares about what i make either |
08:11:56 | saem | What'd you make Rika? |
08:12:03 | FromDiscord | <Rika> saem just asked you! you're awful at lying |
08:12:07 | saem | People only care about what I made when it breaks. |
08:12:14 | phpostrich | Lol |
08:12:16 | saem | Rika, I asked, but I didn't say I cared. |
08:12:17 | FromDiscord | <Rika> that means theyre relying on what you make |
08:12:24 | FromDiscord | <Rika> oh oof wow |
08:12:25 | FromDiscord | <ElegantBeef> Here is the weird interface i mentioned https://github.com/beef331/constructor/blob/master/tests/timplements.nim |
08:12:28 | saem | Users, they're the worst. :D |
08:12:42 | FromDiscord | <Rika> dont people want more users? |
08:12:50 | FromDiscord | <ElegantBeef> Uses the new concepts and idk how i feel about it |
08:13:03 | saem | Holy crap, I just realized how much my code is actually used. Ugh, I feel awful. |
08:14:06 | FromDiscord | <lbart> In reply to @treeform "I am glad you": I'm writing a CAD/GIS lib in Nim. Maybe I'll use or contribute on spacy. Don't know yet |
08:15:16 | FromDiscord | <ElegantBeef> Hey saem atleast you get issues for more than just you're month moderation of the blog post π |
08:15:23 | FromDiscord | <ElegantBeef> (edit) "you're" => "your" |
08:16:04 | saem | wait what? |
08:16:17 | saem | Oh yeah, the blog posts, where are those again <-- I'm the worst. |
08:16:36 | FromDiscord | <ElegantBeef> This month with nim |
08:16:50 | FromDiscord | <ElegantBeef> You know the monthly blog post i started for people to submit their projects to π |
08:17:03 | saem | OH yeah, i remember that thread. |
08:17:22 | * | lbart left #nim ("https://quassel-irc.org - Chat comfortably. Anywhere.") |
08:17:29 | saem | My advice, do the lazy thing. I stand by it. |
08:17:41 | saem | Spacy is cool |
08:19:20 | saem | Hmm, not sure if I can muster up a few sentences. |
08:19:24 | FromDiscord | <ElegantBeef> What do you mean do the lazy thing? |
08:20:16 | saem | The one that's sustainable and can grow over time rather than person who thought you had to go whole hog from the get go. |
08:20:54 | FromDiscord | <ElegantBeef> Ah |
08:21:15 | FromDiscord | <ElegantBeef> Well so far in two months we have had 12 posts π |
08:25:21 | PMunch | Are you telling me another month has passed without me writing a single new (public) Nim project? |
08:25:22 | PMunch | Huh |
08:25:35 | saem | ikr |
08:25:44 | PMunch | I guess I could release v2 of stacklang |
08:26:02 | PMunch | And my stacksheet program based on the library version of said language |
08:30:15 | * | Josh_ joined #nim |
08:33:11 | * | Josh__ joined #nim |
08:33:42 | * | Josh__ quit (Client Quit) |
08:34:21 | * | Josh__ joined #nim |
08:34:23 | * | phpostrich quit (Ping timeout: 260 seconds) |
08:34:40 | saem | I madez a post. |
08:35:44 | * | Josh__ quit (Client Quit) |
08:35:50 | * | phpostrich joined #nim |
08:35:54 | FromDiscord | <ElegantBeef> Lol sounds fine |
08:36:15 | * | Josh_ quit (Ping timeout: 240 seconds) |
08:36:57 | saem | I wonder if it's possible to auto post an issue easy enough every time I do a release of the extension, that way you get a post "for free". |
08:38:49 | FromDiscord | <ElegantBeef> Well ideally we dont just spam the same packages over and over again |
08:39:00 | FromDiscord | <ElegantBeef> So we just watch treeforms postings and take those and submit them π |
08:39:09 | saem | haha |
08:39:15 | saem | Fair |
08:39:42 | saem | Is there a particular type of posting you'd like to see? |
08:40:34 | FromDiscord | <ElegantBeef> Unique packages that draw in more users π |
08:40:38 | saem | Because besides me releasing an occasional improvement to the extension. I'm mostly screwing around fixing random issues in the compiler's semantic analysis layer (sem) and this weekend perhaps DFA. |
08:41:21 | FromDiscord | <ElegantBeef> Well it's mostly about software around Nim and not the compiler itself, i did think that the core devs want a monthly blog post for documenting compiler development and the like, but idk |
08:42:03 | saem | OK |
08:42:40 | FromDiscord | <ElegantBeef> Like i said in the forum post that's why it's "This Month In Nim" |
08:42:45 | FromDiscord | <ElegantBeef> (edit) "Like i said in the forum post that's why it's ... " added "not" |
08:46:34 | FromDiscord | <iWonderAboutTuatara> Is there a way to compile across platforms easily? |
08:48:05 | FromDiscord | <iWonderAboutTuatara> aka can I compile to macos without owning one |
08:49:09 | FromDiscord | <Rika> maybe clang can cross compile for you |
08:49:23 | FromDiscord | <ElegantBeef> you can do linux -> windows fairly easily |
08:49:35 | FromDiscord | <ElegantBeef> Assuming you dont use any native windows libraries |
09:01:54 | FromDiscord | <treeform> In reply to @lbart "I'm writing a CAD/GIS": Let me know how it turns out. |
09:16:50 | JustASlacker | there is a nice cross compile docker somewhere @iWonderAboutTuatar |
09:18:35 | JustASlacker | think this is it https://github.com/juancarlospaco/nim-crosscompile |
09:19:09 | * | phpostrich quit (Ping timeout: 264 seconds) |
09:19:45 | * | krux02 joined #nim |
09:24:06 | FromDiscord | <enthus1ast> In reply to @iWonderAboutTuatara "aka can I": yes, i've done this with OSXCross |
09:24:35 | JustASlacker | Actually, take a look at this: https://github.com/chrisheller/docker-nim-cross |
09:24:54 | JustASlacker | docker run --rm -v `pwd`:/usr/local/src \ |
09:24:55 | JustASlacker | chrishellerappsian/docker-nim-cross:latest \ |
09:24:55 | JustASlacker | nim c --os:macosx --cpu:amd64 --out:hello32.osx.bin hello.nim |
09:25:28 | JustASlacker | was planning on using that these days |
09:26:35 | FromDiscord | <enthus1ast> ive once build a cross compile docker for linux, windows, macos, arm, it took a whole day(!) to build/install. |
09:35:02 | FromDiscord | <Clyybber> saem: nice |
09:35:26 | FromDiscord | <Clyybber> saem: WDYM with "no longer guard on nil as they used to"? |
09:36:45 | FromDiscord | <phpOstrich> What does this pragma do? {.inline} |
09:37:07 | FromDiscord | <phpOstrich> {.inline.} |
09:37:09 | FromDiscord | <ElegantBeef> Enforces(or attempts to) inline the body of the procedure in it's call site |
09:37:30 | FromDiscord | <phpOstrich> I don't follow |
09:37:54 | FromDiscord | <ElegantBeef> So say you have `proc add(a,b: int): int = a + b` |
09:38:05 | FromDiscord | <Rika> think of it as a "tries to use it as a template" |
09:38:06 | FromDiscord | <ElegantBeef> when you call that you have a procedure call to it |
09:38:07 | * | JustASlacker quit (Ping timeout: 276 seconds) |
09:38:28 | FromDiscord | <ElegantBeef> but with inline it turns `let a = 10.add(20)` into `let a = 10 + 20` |
09:38:59 | FromDiscord | <ElegantBeef> The reason it exists is to allow procedure calls, but in areas of high traffic or where you want it to you can inline it to produce code which is faster |
09:39:11 | FromDiscord | <ElegantBeef> Cause procedure calls add up |
09:39:22 | FromDiscord | <phpOstrich> Oh gotcha. |
09:39:36 | FromDiscord | <enthus1ast> its a trade between faster calls / executable size |
09:39:40 | FromDiscord | <ElegantBeef> > The inline convention means the the caller should not call the procedure, but inline its code directly. Note that Nim does not inline, but leaves this to the C compiler; it generates inline procedures. This is only a hint for the compiler: it may completely ignore it and it may inline procedures that are not marked as inline. |
09:39:53 | FromDiscord | <ElegantBeef> But like i said it attempts to |
09:40:24 | FromDiscord | <mratsim> Not always a tradeoff, a function calls requires most of the time 5~10 instructions to deal with parameter passing |
09:40:41 | FromDiscord | <mratsim> inline functions would skip that, if the code inlined is small, you reduce code size |
09:40:45 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#types-procedural-type can read all the calling conventions below |
09:40:49 | FromDiscord | <mratsim> if it's big well you duplicate big code |
09:41:38 | FromDiscord | <phpOstrich> Ah, I see people use it with all there procs. Is that bad habit or what? |
09:41:51 | FromDiscord | <ElegantBeef> It can be, since it duplicates code with 0 benefit in some cases |
09:42:19 | FromDiscord | <ElegantBeef> Increases binary size, and probably compile time, though dont quote me on the latter |
09:42:23 | FromDiscord | <Rika> and the c compiler can already see whats best inlined |
09:43:22 | FromDiscord | <phpOstrich> Is nim always going to be dependent on a c compiler? |
09:43:30 | FromDiscord | <ElegantBeef> Well nlvm exists |
09:43:42 | FromDiscord | <ElegantBeef> But really relying on a C compiler isnt overly bad |
09:44:03 | * | JustASlacker joined #nim |
09:44:16 | FromDiscord | <phpOstrich> Ig you could see it as a good thing |
09:44:19 | krux02 | phpOstrich: nim does not depend on llvm but instead cas use all platforms that have a C compiler |
09:44:52 | FromDiscord | <mratsim> In reply to @Rika "and the c compiler": across modules it doesn't. |
09:45:05 | FromDiscord | <ElegantBeef> Well it gives you more portability, and already very good optimized compilers |
09:45:22 | FromDiscord | <phpOstrich> True |
09:45:43 | FromDiscord | <ElegantBeef> Based off these benchmarks Nim shoots pretty high https://github.com/kostya/benchmarks |
09:48:09 | JustASlacker | anybody using the compile to javascript for anythgin? |
09:48:41 | FromDiscord | <phpOstrich> It generates like 400 lines of js |
09:48:54 | FromDiscord | <phpOstrich> But it works I assume |
09:49:11 | krux02 | JustASlacker, AFAIK the vscode plugin is written in Nim using the javascript backend. |
09:49:25 | JustASlacker | oh? kinda impressive |
09:49:30 | FromDiscord | <Unaimend> good morning π |
09:49:32 | FromDiscord | <ElegantBeef> do `-d:release` php |
09:49:38 | ForumUpdaterBot | New thread by Ofsho: How to get the value of an input element by name when POST., see https://forum.nim-lang.org/t/7568 |
09:49:50 | FromDiscord | <ElegantBeef> The nico game framework currently outputs using JS for web builds |
09:49:56 | FromDiscord | <ElegantBeef> So i've used it for my game |
09:50:19 | FromDiscord | <enthus1ast> battlestory: we have generated a html interface from nim types (for a games map generator) with nim js compilation, no coding needed to add more parameters, just add types, nice |
09:51:00 | FromDiscord | <phpOstrich> @ElegantBeef does -d:release minify the js? |
09:51:08 | FromDiscord | <ElegantBeef> No it just removes all the debug logic |
09:51:15 | FromDiscord | <ElegantBeef> You can minify it afterword of course |
09:51:27 | FromDiscord | <phpOstrich> Oh I didn't think about that |
09:51:32 | JustASlacker | so people actually use it. thats nice |
09:51:52 | * | clyybber joined #nim |
09:51:59 | FromDiscord | <ElegantBeef> Hell even this exists |
09:52:00 | FromDiscord | <ElegantBeef> https://github.com/juancarlospaco/nodejs |
09:52:01 | * | clyybber quit (Client Quit) |
09:52:56 | FromDiscord | <phpOstrich> Hmm would it be possible to compile nim to dart |
09:53:09 | FromDiscord | <phpOstrich> Or how hard would that be to implement |
09:53:18 | FromDiscord | <ElegantBeef> You'd need to make an entire backend |
09:53:36 | FromDiscord | <phpOstrich> Probably difficult |
09:53:37 | FromDiscord | <ElegantBeef> Easier to just work on fidget or similar GUI library |
09:54:13 | FromDiscord | <phpOstrich> Yeah ui in nim isnt to mature yet, I don't think. |
09:54:22 | JustASlacker | ui is bad in any language |
09:54:31 | FromDiscord | <ElegantBeef> I mean we've got things that draw but it's similar to Rust's state |
09:54:39 | FromDiscord | <phpOstrich> True |
09:54:48 | FromDiscord | <ElegantBeef> Fidget and Nimx are the most notable pure libraries |
09:55:44 | FromDiscord | <ElegantBeef> Then you got the typical bindings to Gtk/qt, and nigui for abstractions ontop of Gtk/Windows/Mac ui |
09:55:59 | FromDiscord | <phpOstrich> Doesn't Status use nim and qt? |
09:56:11 | FromDiscord | <mratsim> QT isn't pure |
09:57:01 | FromDiscord | <phpOstrich> Anything made with qt looks pretty good. Gtk is kinda dull |
09:57:28 | FromDiscord | <mratsim> Both requires designers to make them good. |
09:57:36 | FromDiscord | <ElegantBeef> Fidget can look pretty good, but still not polished yet π¦ |
09:57:38 | FromDiscord | <mratsim> we have full time designers at Status. |
09:57:48 | PMunch | You've got bindings to WxWidgets as well |
09:57:49 | FromDiscord | <ElegantBeef> Looks nice https://media.discordapp.net/attachments/371759389889003532/815885526375858206/uiExampleIce.png |
09:58:01 | FromDiscord | <ElegantBeef> Ah i forgot that wxwidgets existed sorry pmunch |
09:58:08 | FromDiscord | <phpOstrich> Fidget is the figma thing right? |
09:58:11 | FromDiscord | <ElegantBeef> Yea |
09:58:19 | FromDiscord | <phpOstrich> It is nice looking |
09:58:59 | FromDiscord | <phpOstrich> Anyone ever use GoDot to make a gui ? |
09:59:01 | PMunch | @ElegantBeef, I mean it's not native either. And I'm not the one who made the bindings, I'm just the one who maintains them after I made the genui macro to make it simple to create UIs in code. |
09:59:13 | FromDiscord | <mratsim> Why use GoDot? that's a game engine |
09:59:23 | FromDiscord | <mratsim> if you want immediate UI, use imgui or nuklear |
09:59:34 | FromDiscord | <ElegantBeef> Some people do use is it, pixelrama for instance is built in it |
09:59:36 | FromDiscord | <mratsim> or OpenGL, like nimx does |
09:59:43 | FromDiscord | <ElegantBeef> The editor afterall is made inside the engine |
10:00:14 | FromDiscord | <phpOstrich> Godots ui is made with Godot ui |
10:00:23 | FromDiscord | <phpOstrich> Crazy |
10:00:40 | FromDiscord | <dk> you won't guess what nim is made in |
10:00:50 | FromDiscord | <mratsim> Made in China |
10:01:57 | FromDiscord | <phpOstrich> Ives always wanted to make my own gui framework, I just don't know how to start |
10:03:13 | FromDiscord | <ElegantBeef> Well congrats nimx and fidget are both open source π |
10:04:08 | FromDiscord | <phpOstrich> I meant "library from scratch" kinda deal |
10:04:19 | FromDiscord | <ElegantBeef> So did I |
10:04:24 | FromDiscord | <phpOstrich> Ohh |
10:04:28 | FromDiscord | <mratsim> See you in 10 years it was nice meeting you |
10:04:30 | FromDiscord | <ElegantBeef> ^ |
10:05:13 | FromDiscord | <phpOstrich> How will we reunite? @mratsim |
10:05:29 | FromDiscord | <ElegantBeef> Well he'll find you in 10 years when you submit to this month with nim |
10:05:39 | FromDiscord | <mratsim> If you're not a UX designer yourself, you need to collaborate with one or you will repeat the mistakes of the past. |
10:05:42 | FromDiscord | <ElegantBeef> I'm sorry did i say month, i meant decade |
10:06:15 | FromDiscord | <phpOstrich> I use to most web stuff before learning about the cooler stuff |
10:06:29 | FromDiscord | <phpOstrich> To do mostly |
10:06:51 | FromDiscord | <enthus1ast> In reply to @mratsim "Why use GoDot? that's": build guis with an editor, lots of widgets, easily composite your own widgets thanks to how godot scenes work, export to many platforms without all the platforms nitty gritty, yeah its tempting to use. |
10:07:42 | FromDiscord | <ElegantBeef> Plus you can use native code if you want to get performance |
10:07:48 | FromDiscord | <Unaimend> I would kill for a nice gui framework in nim |
10:07:50 | FromDiscord | <phpOstrich> I just did it because I was learning maths and saw it had 2d sh |
10:08:16 | FromDiscord | <ElegantBeef> In reply to @Unaimend "I would kill for": Well make it then off yourself, and we'll bid you farewell for your sacrifice |
10:08:55 | FromDiscord | <phpOstrich> All you need a cool name and that's 75% of the battle |
10:09:02 | FromDiscord | <phpOstrich> Need is a |
10:09:08 | FromDiscord | <ElegantBeef> Ah so guirino |
10:09:13 | FromDiscord | <mratsim> all you need is pick one from C, C++, JS |
10:09:26 | FromDiscord | <mratsim> if there aren't any well, what can I do |
10:09:52 | FromDiscord | <phpOstrich> Ive made a ui in canvas before learning about wasm |
10:10:04 | FromDiscord | <phpOstrich> It wasn't good |
10:10:11 | FromDiscord | <ElegantBeef> Hey dont be knocking canvas that's how nico renders on the web π |
10:10:24 | FromDiscord | <phpOstrich> Fr? |
10:10:31 | FromDiscord | <Unaimend> In reply to @ElegantBeef "Well make it then": If I tried, the framework would be really shitty π’ |
10:10:52 | PMunch | Hmm, one of the many projects I have on the back burner |
10:10:56 | PMunch | A nice GUI framework.. |
10:11:09 | FromDiscord | <ElegantBeef> Just follow cunninghams law and put a shitty implementation |
10:11:19 | FromDiscord | <Unaimend> should net just try to extend the ui framework? |
10:11:27 | FromDiscord | <Unaimend> https://github.com/nim-lang/ui |
10:11:47 | * | tribly joined #nim |
10:11:48 | FromDiscord | <Unaimend> (edit) "net" => "we not" |
10:11:48 | PMunch | Problem is that I want it to choose the platform specific library on compile-time. And they all have slightly different interfaces for callbacks and such.. |
10:11:51 | FromDiscord | <enthus1ast> or nigui |
10:12:29 | FromDiscord | <ElegantBeef> Pure Nim is always preferable imo, but it's a shit ton of work |
10:12:35 | FromDiscord | <enthus1ast> nigui with basic widgets (aaand tables) would be nice, for a lot of in house stuff |
10:12:54 | * | teasea quit (Quit: teasea) |
10:13:01 | FromDiscord | <phpOstrich> I dont understand how pure nim libraries work |
10:13:01 | FromDiscord | <ElegantBeef> Replace nigui with nimx π |
10:13:15 | FromDiscord | <enthus1ast> every time i try nimx it does not build |
10:13:16 | FromDiscord | <ElegantBeef> Well they rely on C bindings to opengl and the like |
10:13:24 | FromDiscord | <ElegantBeef> Worked here the last time i tried |
10:13:30 | PMunch | @ElegantBeef, problem with pure Nim for UI libraries is that they don't interface with the underlying system |
10:13:35 | FromDiscord | <ElegantBeef> Are you the mac user having issues? π |
10:13:39 | PMunch | Unless you put a lot of work into it |
10:13:44 | FromDiscord | <ElegantBeef> Eh i dont need my UI to interface with the underlying system |
10:14:04 | FromDiscord | <mratsim> So you like your Windows applications from space? |
10:14:04 | PMunch | But your vision impaired users might need it to |
10:14:21 | PMunch | In order to have accessibility options |
10:14:26 | FromDiscord | <ElegantBeef> I like my windows applications like i like my Windows OS, rarely used |
10:14:36 | FromDiscord | <ElegantBeef> Yea i know pmunch |
10:14:41 | PMunch | Or just people like me who prefer my programs to have a cohesive appearance |
10:15:48 | FromDiscord | <ElegantBeef> Well considering there isnt really a standardized GUI anywhere arent we a little stymied on what is "system" π |
10:16:27 | FromDiscord | <phpOstrich> Is there no electron bindings for nim? |
10:16:37 | FromDiscord | <ElegantBeef> There is the door, leave! |
10:16:41 | FromDiscord | <ElegantBeef> Jokes aside there are |
10:16:54 | FromDiscord | <ElegantBeef> Or similar atleast |
10:17:07 | FromDiscord | <ElegantBeef> https://github.com/Niminem/Neel |
10:17:15 | FromDiscord | <phpOstrich> I'd never use electron but I was just wondering if anyone cared |
10:18:05 | FromDiscord | <enthus1ast> yeah all the windows bashing, but have you tried running 32 Bit apps on recent macs? Or have you found yourself with an ancient centos with old clib and newer applications, have fun tinkering. |
10:18:07 | FromDiscord | <ElegantBeef> Also pmunch have you decided to leave nico? |
10:18:15 | FromDiscord | <ElegantBeef> Nope |
10:18:23 | FromDiscord | <ElegantBeef> My software works as the good lord intended |
10:18:31 | FromDiscord | <enthus1ast> Windows is not sexy but it works. |
10:18:51 | FromDiscord | <ElegantBeef> It works like my strain works as a sieve, slightly and only if you dont mind the visible holes |
10:18:55 | FromDiscord | <ElegantBeef> (edit) "strain" => "strainer" |
10:18:58 | FromDiscord | <ElegantBeef> (edit) "sieve," => "bowl," |
10:19:06 | FromDiscord | <phpOstrich> Bodhi linux is baller |
10:19:40 | FromDiscord | <phpOstrich> Unfortunately my intel graphics didn't like wayland |
10:20:00 | PMunch | @ElegantBeef, nah I've decided to keep using it |
10:20:14 | PMunch | I've gotten the graphics to a point where I'm pretty happy |
10:20:32 | FromDiscord | <phpOstrich> Is anyone using sway? |
10:20:47 | PMunch | So I'll focus on gameplay and then redo the whole thing in something different later if I want to do a full redo of the graphics |
10:20:47 | FromDiscord | <ElegantBeef> I couldnt ever care enough to move over |
10:20:48 | FromDiscord | <phpOstrich> I3's replacement |
10:21:02 | PMunch | @phpOstrich, nah I use i3 |
10:21:04 | FromDiscord | <ElegantBeef> I3wm-gaps works for me and i cannot be arsed to try sway |
10:21:20 | PMunch | And sway isn't really a replacement as just a port for Wayland |
10:21:21 | FromDiscord | <phpOstrich> But sway is sway? |
10:21:22 | FromDiscord | <ElegantBeef> I game on my linux machine and have 0 plans to fuck with xwayland if it fails |
10:21:39 | PMunch | I use Nimdow at work though |
10:21:54 | FromDiscord | <ElegantBeef> A true nimion |
10:22:05 | FromDiscord | <phpOstrich> Nimoid |
10:22:43 | PMunch | And @phpOstrich, there are electron bindings, I've used them before (and by used them I mean tried them to see if I could do some weird abuse with it) |
10:23:03 | FromDiscord | <phpOstrich> Oh ok so ... Assembly in nim. How do you get that to work? |
10:23:05 | PMunch | @ElegantBeef, I use pakku on all my machines as well (it's written in Nim) |
10:23:31 | PMunch | Assembly? |
10:23:36 | FromDiscord | <ElegantBeef> Yea i've heard of it from another discord server(the only time i've heard someone using nim written software) |
10:23:49 | FromDiscord | <ElegantBeef> You use `asm """ #asm here """` |
10:24:18 | FromDiscord | <phpOstrich> I'm not at my computer rn but I get an error |
10:24:33 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-assembler-statement |
10:24:38 | PMunch | Well try running it on a computer |
10:24:41 | FromDiscord | <ElegantBeef> Well read that when you get to that computer of yours |
10:24:56 | PMunch | Nim only runs on computer |
10:25:04 | FromDiscord | <ElegantBeef> Termux says otherwise |
10:25:13 | FromDiscord | <phpOstrich> I was gonna say that |
10:25:15 | PMunch | Eh, phones are practically computers nowadays |
10:25:23 | FromDiscord | <ElegantBeef> Lol |
10:25:27 | FromDiscord | <phpOstrich> I mean they are |
10:25:32 | FromDiscord | <phpOstrich> Computers |
10:25:46 | * | teasea joined #nim |
10:26:04 | FromDiscord | <phpOstrich> I'm a computer, technically |
10:26:06 | FromDiscord | <ElegantBeef> Well buh bye, yall have one assignment, make a GUI framework by tomorrow |
10:26:26 | FromDiscord | <phpOstrich> Eh homework is for chumps |
10:26:49 | PMunch | Shit one day GUI framework challenge |
10:27:13 | FromDiscord | <phpOstrich> I would just automate mspaint |
10:27:22 | FromDiscord | <enthus1ast> > make a GUI framework by tomorrowβ΅it all start and fails with tables π |
10:27:31 | PMunch | Haha, oh that would be brilliant phpOstrich! |
10:28:00 | JustASlacker | if you guys want a challenge, Id like to talk to TPM2 with nim |
10:28:05 | FromDiscord | <phpOstrich> I was talking about that with my older brother yesterday. We should revive mspaint |
10:28:07 | PMunch | Using some kind of mouse automation to draw a UI in Paint :P |
10:28:31 | FromDiscord | <phpOstrich> Lol |
10:28:42 | FromDiscord | <phpOstrich> Next generation technology |
10:28:57 | FromDiscord | <phpOstrich> Everyone is drawing websites |
10:29:27 | liblq-dev | i made three already |
10:29:27 | liblq-dev | how |
10:29:27 | liblq-dev | how's that sound |
10:29:40 | liblq-dev | also frickin' network connection sucks |
10:30:00 | liblq-dev | i was responding to the one day GUI framework challenge |
10:30:00 | FromDiscord | <phpOstrich> Who is the youngest here? |
10:30:06 | liblq-dev | 16 |
10:30:08 | FromDiscord | <phpOstrich> Oh |
10:30:13 | liblq-dev | pmunch is old |
10:30:17 | FromDiscord | <phpOstrich> You are young |
10:30:28 | FromDiscord | <phpOstrich> Im 17 |
10:31:53 | liblq-dev | though actually thinking about it |
10:32:01 | liblq-dev | i'm almost 17 as well so there's that |
10:32:03 | liblq-dev | i'm old now |
10:32:35 | FromDiscord | <phpOstrich> No. I disagree |
10:32:58 | FromDiscord | <phpOstrich> What got you into programming? |
10:33:56 | liblq-dev | computercraft |
10:34:07 | liblq-dev | maybe when i was 12 or 13 |
10:34:09 | liblq-dev | i don't remember |
10:34:23 | FromDiscord | <phpOstrich> Computercraft? |
10:34:33 | FromDiscord | <phpOstrich> Like building computers? |
10:34:51 | * | Vladar joined #nim |
10:35:05 | narimiran | ITT: 17-year-old telling 16-year old that they (16) are young |
10:35:40 | narimiran | i have T-shirts i wear that are older than that!! |
10:36:09 | liblq-dev | @phpOstrich it's a minecraft mod that adds Lua-programmable computers |
10:36:28 | PMunch | liblq-dev, ey! |
10:36:32 | FromDiscord | <phpOstrich> Lua is cool |
10:36:37 | liblq-dev | yes |
10:36:58 | narimiran | PMunch: don't listen to those kids! we're not old!! |
10:37:12 | FromDiscord | <phpOstrich> I started out with php and web stuff at age 9 |
10:37:12 | PMunch | Haha, thanks :P |
10:37:45 | liblq-dev | well alright i did kinda start out that young |
10:38:01 | liblq-dev | maybe when i was 10 i was playing around with UI design and visual basic |
10:38:10 | FromDiscord | <phpOstrich> I have 2 brothers that also program |
10:38:22 | FromDiscord | <phpOstrich> And my dad was a linux wizard |
10:38:30 | liblq-dev | you were lucky then |
10:38:48 | liblq-dev | i'm self-taught |
10:39:07 | FromDiscord | <phpOstrich> No because I didn't really have my dad and my brothers pretty much said fuck off and learn it yourself |
10:39:20 | FromDiscord | <Clyybber> In reply to @phpOstrich "No because I didn't": thats the way! |
10:39:38 | FromDiscord | <phpOstrich> Yeah self taught is the only way pretty much |
10:40:14 | FromDiscord | <phpOstrich> Ur old |
10:40:23 | FromDiscord | <phpOstrich> Anyone into crypto? |
10:41:40 | JustASlacker | as in crypto money? |
10:41:58 | JustASlacker | or just general crypto |
10:41:59 | FromGitter | <gogolxdong> Is there any nim stack of developping Polkdot parachain?It uses rust. |
10:42:03 | FromDiscord | <phpOstrich> Oh yes. I guess I could have been more clear |
10:42:36 | FromDiscord | <phpOstrich> I put $400 in ethereum or eth based tokens |
10:42:44 | FromDiscord | <phpOstrich> It's not $300 |
10:42:51 | FromDiscord | <phpOstrich> It's now |
10:43:18 | PMunch | When did you put that in? |
10:43:18 | JustASlacker | does ethereum do something useful already? |
10:43:28 | PMunch | Ethereum is at an all time high now isn't it? |
10:43:31 | narimiran | i like the oldschool way of burning money.... |
10:43:39 | JustASlacker | I thought its supposed to run distributed code |
10:43:42 | FromDiscord | <phpOstrich> Yeah kind of |
10:44:02 | FromDiscord | <Rika> yall hate it when youre at the age where younger people call you old and older people call you young |
10:44:03 | FromDiscord | <phpOstrich> It went down and gas was a lot so I loss some there |
10:44:04 | PMunch | narimiran, buy low sell high. I've only made money on the small investments in crypto I've made |
10:44:04 | JustASlacker | and isnt ethereum supposed to give you interest soonish? Ive heard like 7% |
10:44:43 | FromDiscord | <Clyybber> https://status.im/ is a company that uses nim to implement the ethereum blockchain protocol |
10:44:45 | narimiran | PMunch: but 'low' and 'high' are hard to guess correctly, aren't they? |
10:44:54 | FromDiscord | <phpOstrich> I have a status wallet |
10:45:03 | FromDiscord | <Clyybber> is that how you discovered nim? |
10:45:06 | FromDiscord | <phpOstrich> There desktop app is noice asf |
10:45:10 | FromDiscord | <phpOstrich> No |
10:45:30 | FromDiscord | <phpOstrich> I test out like every language as a hobby type thing |
10:45:40 | PMunch | narimiran, my system is fool-proof. Haven't heard of crypto in the news for a couple months? Buy some. Is it all over the news? Sell |
10:45:54 | FromDiscord | <Rika> In reply to @narimiran "<@392962235737047041>: but 'low' and": nah you just get it with ethereum.low and ethereum.high π |
10:46:24 | FromDiscord | <phpOstrich> Anyone heard of galas games |
10:46:36 | FromDiscord | <phpOstrich> Gala Games |
10:46:52 | narimiran | @Rika why didn't i think of that? brb, i need to go and make myself some millions in gains.... |
10:47:05 | FromDiscord | <phpOstrich> It's a crypto gaming platform made by the people that made words for friends |
10:48:36 | PMunch | while true: if ethereum.price == ethereum.low: buy() elif ethereum.price == ethereum.high: sell() |
10:49:15 | FromDiscord | <phpOstrich> Basic economics |
10:50:54 | FromDiscord | <phpOstrich> Im gonna hang in #offtopic for now on. |
11:00:55 | * | Vladar quit (Remote host closed the connection) |
11:11:17 | * | JustASlacker quit (Quit: Leaving) |
11:11:36 | * | JustASlacker joined #nim |
11:12:45 | * | Vladar joined #nim |
11:14:03 | FromDiscord | <inv> sent a code paste, see https://play.nim-lang.org/#ix=2Ric |
11:14:51 | FromDiscord | <inv> looks like choosenim . helped |
11:17:29 | FromDiscord | <inv> But I remember I built it with stable and then just koch test |
11:17:52 | FromDiscord | <inv> how to build koch from table but using the gitutils? |
11:46:37 | * | abm joined #nim |
12:00:08 | * | tane joined #nim |
13:00:53 | * | narimiran quit (Ping timeout: 245 seconds) |
13:04:38 | * | sacredfrog quit (Quit: ZNC 1.8.2 - https://znc.in) |
13:04:58 | * | sacredfrog joined #nim |
13:19:46 | * | JustASlacker quit (Quit: Leaving) |
13:48:36 | * | wasted_youth2 joined #nim |
13:49:52 | FromGitter | <HJarausch> How to create a sequence of type T and *given length* on the *heap* β One could use β ```but this causes reallocation. β β Thanks for a hint, β Helmut``` [https://gitter.im/nim-lang/Nim?at=603cf100a3a2f04f1fc76ff6] |
13:50:52 | FromGitter | <ynfle> Use `newSeq()` |
13:51:38 | FromGitter | <ynfle> Do you want a reference to a `seq`? |
13:52:25 | FromGitter | <ynfle> https://nim-lang.org/docs/system.html#newSeq%2Cseq%5BT%5D%2CNatural |
13:53:38 | FromGitter | <HJarausch> Yes, I do need a ref seq, and despite of its name, newSeq cannot be used. |
13:56:11 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2RiV |
13:58:07 | FromGitter | <ynfle> Doesn't work |
13:58:28 | FromDiscord | <Solitude> `s[].newSeq(1000)`? |
13:59:01 | FromDiscord | <mratsim> not my fault if autodereference doesn't work with var |
13:59:29 | FromDiscord | <Solitude> it works for field access, not for callables |
14:00:45 | FromDiscord | <Solitude> deref for call is exprimental https://nim-lang.org/docs/manual_experimental.html#automatic-dereferencing |
14:00:51 | FromGitter | <ynfle> @Solitude, they said that it causes it to allocate twice |
14:04:13 | FromGitter | <HJarausch> Thanks to you all. I haven't thought of the ``newSeq`` proc which takes a ``var seq`` parameter. |
14:08:38 | FromGitter | <ynfle> `var seq` means "this proc modifies this seq and is therefore passed by reference" |
14:16:36 | * | narimiran joined #nim |
14:27:23 | * | wasted_youth2 quit (Read error: Connection reset by peer) |
14:27:41 | * | wasted_youth2 joined #nim |
14:28:10 | * | wasted_youth2 quit (Read error: Connection reset by peer) |
14:28:36 | * | wasted_youth2 joined #nim |
14:31:31 | FromGitter | <HJarausch> My Nim compiler (GIT 0222) doesn't accept β β ```var Sq: ref seq[float] β newSeq(Sq[], 1000)``` β β is accepted. Strange, isn't it? ... [https://gitter.im/nim-lang/Nim?at=603cfac3a3a2f04f1fc791b0] |
14:32:22 | FromDiscord | <Yardanico> works fine here, what is "git 0222"? |
14:32:27 | FromDiscord | <Yardanico> can you show the output of "nim -v" |
14:32:41 | FromDiscord | <Yardanico> that said, your first example will SIGSEGV at runtime because you need to allocate the ref itself |
14:32:56 | FromDiscord | <Yardanico> you need something like |
14:33:01 | FromGitter | <HJarausch_gitlab> `` β Nim Compiler Version 1.5.1 [Linux: amd64] β Compiled at 2021-02-22 β Copyright (c) 2006-2021 by Andreas Rumpf β ... [https://gitter.im/nim-lang/Nim?at=603cfb1d823b6654d27781e6] |
14:33:03 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Rj6 |
14:35:16 | FromGitter | <HJarausch_gitlab> Thanks! Is there a difference between β β ```var Sq = new(seq[float]) β Sq[].newSeq(1000)``` [https://gitter.im/nim-lang/Nim?at=603cfba4e8267a46f2e53e32] |
14:35:42 | FromDiscord | <Yardanico> yes, first one will SIGSEGV because you need to allocate the ref itself |
14:35:51 | FromGitter | <ynfle> The different in the initialization |
14:35:52 | FromDiscord | <Yardanico> second line is the same though |
14:36:04 | FromGitter | <ynfle> I don't think ref types are initialized automatically |
14:45:37 | * | magdril joined #nim |
14:48:01 | * | vicfred joined #nim |
14:55:48 | FromDiscord | <mratsim> ah yes I forgot a new |
14:56:09 | FromDiscord | <Yardanico> seems like github doesn't want to forget 4raq's old profile picture (I checked, it's not my cache's fault) :P https://media.discordapp.net/attachments/371759389889003532/815960603931181117/unknown.png |
15:06:38 | * | teasea quit (Quit: teasea) |
15:06:43 | FromDiscord | <Araq> does it matter? |
15:09:45 | * | muffindrake quit (Quit: muffindrake) |
15:10:29 | FromDiscord | <Yardanico> no, i was just surprised a bit :) |
15:10:53 | * | muffindrake joined #nim |
15:31:44 | FromDiscord | <Yardanico> https://nim-lang.org/blog/2021/03/01/this-month-with-nim.html |
15:33:29 | FromDiscord | <Yardanico> Nim #announcements |
15:34:28 | narimiran | @Yardanico don't you have your bot for that? :) |
15:35:12 | Yardanico | yes, but why not post it in #main as well :P |
15:36:13 | narimiran | no, i meant: your bot posts here new forum threads, stuff from r/nim, etc. - why not from the website too? |
15:36:27 | narimiran | although, it would often be duplicated |
15:38:31 | FromDiscord | <Yardanico> yeah, that's a good idea |
15:43:07 | narimiran | the more i think about it, the less i'm sure it is a good idea :) |
15:43:25 | FromDiscord | <mratsim> it's just the new posts right? |
15:43:34 | FromDiscord | <mratsim> not everyone's replies |
15:43:54 | FromDiscord | <Yardanico> my bot also checks for new replies |
15:43:58 | FromDiscord | <Yardanico> but only posts them in some channels |
15:44:17 | FromDiscord | <Yardanico> e..g in #community-events, #nim-news on IRC and https://t.me/nimforum_updates on Telegram |
15:44:35 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/815972796265136148/unknown.png |
15:54:40 | FromGitter | <HJarausch_gitlab> A for loop variable shadows an ordinary variable without notice - how to detect this latent bug? β β ```var Id = 0 β for Id in 0 .. 10 : β if Id == 3 : break β echo Id # prints 0``` [https://gitter.im/nim-lang/Nim?at=603d0e40823b6654d277c350] |
15:55:34 | * | teasea joined #nim |
15:56:14 | FromDiscord | <terkwood> In reply to @phpOstrich "Im gonna hang in": same lol. i wanna learn nim but i 'm having trouble focusing on one virtuously shiny thing at a time |
16:00:09 | * | jk13579[m] quit (Quit: Idle for 30+ days) |
16:00:51 | narimiran | @HJarausch_gitlab and what behaviour would you expect? this seems normal to me |
16:01:15 | narimiran | alternatively, use while loop |
16:03:34 | narimiran | and please refrain from classifications such as "latent bug" or "Nim can be so difficult to understand" for stuff that you personally don't understand |
16:04:30 | FromDiscord | <Araq> I use this idiom in order to avoid bugs fwiw, you cannot access the other name accidentically |
16:05:47 | FromGitter | <HJarausch_gitlab> @narimiran I'm just looking if there is a possibility to get warned if the loop variable shadows an ordinary variable. (Coming from C++ this error in Nim is insidious) |
16:07:52 | FromDiscord | <Araq> https://godbolt.org/z/q7o5a3 C++ doesn't mind it either |
16:11:05 | * | haxscramper joined #nim |
16:25:58 | federico3 | @Araq what do you mean https://github.com/nim-lang/security/issues/2#issuecomment-787808460 ? |
16:32:26 | FromDiscord | <Araq> I replied there |
16:34:57 | * | rockcavera joined #nim |
16:45:01 | ForumUpdaterBot | New question by Michael Hecht: Nim-Lang compiler error with leading @ character, see https://stackoverflow.com/questions/66426124/nim-lang-compiler-error-with-leading-character |
16:46:34 | * | magdril quit (Quit: Connection closed) |
16:50:36 | * | Vladar quit (Quit: Leaving) |
17:01:39 | FromDiscord | <γγγΆγΌγ> Ok, so, I want to have a gamestate data structure, but i dont really know what to use |
17:01:50 | FromDiscord | <γγγΆγΌγ> its basically going to be a giant nested dictionary... |
17:01:54 | FromDiscord | <γγγΆγΌγ> wait ill just do that lol |
17:01:58 | federico3 | @Araq we are reinventing the wheel (badly): the draft advisories are already kept secret by github automatically and become public when... published |
17:02:36 | * | waleee-cl joined #nim |
17:04:16 | FromDiscord | <γγγΆγΌγ> Can tables in nim have values mapped to multiple types |
17:06:21 | FromDiscord | <haxscramper> No, you need to use object variants or type erasure |
17:07:03 | FromDiscord | <γγγΆγΌγ> .... and that is? |
17:07:32 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#types-object-variants |
17:10:22 | FromDiscord | <dk> also inherance |
17:14:44 | FromDiscord | <mratsim> pretty sure the question was asked yesterday |
17:24:02 | ForumUpdaterBot | New thread by Michaelhecht: Compiler error with generated compile script, see https://forum.nim-lang.org/t/7569 |
17:26:58 | * | Tuatarian joined #nim |
17:29:05 | haxscramper | Is it possible to determine at compile-time if expression can raise `FieldDefect` error? |
17:29:47 | haxscramper | Maybe it is possible to somehow use https://nim-lang.org/docs/effecttraits.html#getTagsList%2CNimNode by wrapping expression in temporary proc, getting it's raises list and working from that, but I hope there is a cleaner solution. |
17:30:59 | FromDiscord | <mratsim> `when compiles(raise newException(FieldDefect, "")` |
17:31:17 | FromDiscord | <mratsim> but now that raises: [] doesn't prevent raising Defect I fear you can't |
17:31:22 | haxscramper | I have object pretty-printer that checks if `items()` is implemented and tries to use that first, but sometimes (especially for AST-like structures) `for item in items(node):` can raise field **defect**, which are not always catchable. |
17:35:09 | * | PMunch quit (Quit: leaving) |
17:39:05 | haxscramper | Even `getRaisesList` cannot determine if expression can raise defect: https://play.nim-lang.org/#ix=2Rk2. Is there *anything* else that would allow to detect defects? |
17:40:14 | haxscramper | Because the only other option would be to `try .. except FieldDefect:` and pretend that `--panics:on` does not exist. |
17:43:00 | FromDiscord | <mratsim> RFC βͺβ« |
17:43:56 | haxscramper | The whole RFC would be "Can I check for `FieldDefect` please?" |
17:44:38 | FromDiscord | <Yardanico> pretty please |
17:46:40 | FromDiscord | <mratsim> Can I check that a proc raises no Defect please |
17:58:01 | * | solitudesf joined #nim |
18:05:57 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
18:09:44 | * | magdril joined #nim |
18:11:07 | * | magdril quit (Client Quit) |
18:27:01 | * | fosred joined #nim |
18:32:52 | * | Vladar joined #nim |
18:36:39 | * | vivus joined #nim |
18:47:25 | * | fosred quit (Quit: Leaving) |
18:56:29 | * | blackpawn_ quit (Quit: ZNC 1.7.2+deb3 - https://znc.in) |
18:56:46 | * | blackpawn joined #nim |
18:59:30 | Oddmonger | with foo( v:ref machin = nil) , how to modify v in the function ? |
19:00:20 | Oddmonger | nak forget it |
19:00:54 | Oddmonger | with foo( v:ref machin = addr(truc) ) , how to get it compiled ? ^^' |
19:01:38 | FromDiscord | <Yardanico> uhh, what does this mean? |
19:02:01 | FromDiscord | <Yardanico> first of all, "ref" is a traced reference, you can't get a "ref" with addr |
19:02:09 | Oddmonger | ah forget it, i want ptr instead |
19:02:35 | Oddmonger | it's for a recursive calling, with a ptr on my root elem at first pass |
19:13:56 | FromDiscord | <γγγΆγΌγ> ok so ive been starting at the description for object varaints and im very confused |
19:15:15 | FromDiscord | <Yardanico> why? |
19:15:47 | FromDiscord | <Yardanico> it's actually not hard - basically you have an enum with possible "kinds" of object, and then object itself can be initialized with that kind and different "branches" become active |
19:16:09 | FromDiscord | <Yardanico> json in nim is modelled with object variants too - https://nim-lang.org/docs/json.html#JsonNodeObj |
19:16:17 | FromDiscord | <Yardanico> even the ast is made with object variants |
19:16:31 | FromDiscord | <γγγΆγΌγ> i see.... so its how you build a dictionary right |
19:16:41 | FromDiscord | <γγγΆγΌγ> i should probably have a new project to fully understand |
19:38:45 | * | junland quit (Quit: %ZNC Disconnected%) |
19:39:36 | * | junland joined #nim |
19:44:17 | FromDiscord | <exelotl> you might use it for a dictionary that can have multiple different kinds of values (without resorting to inheritance) |
19:45:17 | FromDiscord | <exelotl> honestly json is still the best example for that |
19:47:38 | FromDiscord | <exelotl> a JSON object is a dictionary with strings as keys, and the values can be strings, ints or any other valid JSON value |
19:55:08 | * | vivus quit (Quit: Leaving) |
20:05:45 | FromDiscord | <enthus1ast> In reply to @γγγΆγΌγ "Ok, so, I want": maybe use an ESC for your gamestate? |
20:05:52 | FromDiscord | <enthus1ast> (edit) "ESC" => "ECS" |
20:06:49 | FromDiscord | <enthus1ast> depends on the type of game oc. |
20:08:40 | * | superbia joined #nim |
20:09:26 | FromDiscord | <exelotl> In reply to @exelotl "you might use it": oh... I just realised this is exactly what you were asking for lol |
20:09:40 | * | vicfred quit (Quit: Leaving) |
20:10:18 | * | Q-Master quit (Ping timeout: 260 seconds) |
20:10:21 | FromDiscord | <exelotl> tbh for an actors list I'd just inheritance rather than case objects |
20:10:54 | FromDiscord | <exelotl> you want to be able to easily add new kinds of actors to the game |
20:12:07 | FromDiscord | <exelotl> without having to go edit some lists in several different files |
20:18:23 | * | haxscramper quit (Remote host closed the connection) |
20:27:24 | FromDiscord | <γγγΆγΌγ> ah k |
20:27:41 | FromDiscord | <γγγΆγΌγ> yeah ill just use inheritance loool |
20:27:48 | FromDiscord | <γγγΆγΌγ> will probably be easier tbh |
20:30:29 | * | Q-Master joined #nim |
20:56:26 | * | jess quit (Quit: K-Lined) |
20:57:33 | * | jess joined #nim |
20:57:59 | FromDiscord | <martinium> anyone here have experience using the chronos async library? I am curious in how it performs in comparison to the standard libraries current implementation? |
20:58:13 | FromDiscord | <martinium> (edit) "libraries" => "library's" |
21:03:11 | FromDiscord | <mratsim> Works well for dealing with high volume of P2P messaging in blockchain. |
21:05:00 | FromDiscord | <mratsim> (edit) "messaging" => "message" |
21:15:02 | * | asdflkj joined #nim |
21:18:53 | FromDiscord | <enthus1ast> @Valor i would also consider ECS for a gamestate, since they map quite nicely to a lot of games. eg.: a living tree (with collision and stuff), a tree "item" on the ground , a tree in your inventory, does it has trade value? Health? A name? Then an enemy, they might have stuff in common (Name, Health), a collision, but cannot be placed in an inventory. |
21:19:39 | FromGitter | <wrq> Will there ever be a Discourse forum for Nim? |
21:19:55 | FromDiscord | <enthus1ast> In an ESC you would give Entities Components when they fit |
21:20:45 | FromDiscord | <mratsim> In reply to @wrq "Will there ever be": If Discourse switches to Nim sure |
21:21:05 | FromDiscord | <enthus1ast> Then the System would operate on those Entities that have given Component ("Mana regeneration", "poison damage") |
21:21:22 | FromDiscord | <exelotl> @wrq we eat our own dogfood, as the idiom goes |
21:21:44 | FromGitter | <wrq> it's really the main thing holding me back from taking nim seriously. without a place like Discourse, or even Github Discussions to have medium/long-form discussions, I can't really invest that much time in it |
21:21:53 | FromGitter | <wrq> I know, the dog food idea is awful. The forum is terrible |
21:22:04 | FromGitter | <wrq> I've seen a number of conversations about it |
21:22:20 | FromGitter | <wrq> it seems like there's only 2-3 core devs and the author of the forum that actually oppose it. |
21:23:49 | FromDiscord | <mratsim> You realize that Github Discussions are not even a month old. |
21:24:04 | FromDiscord | <mratsim> And we use the RFC repo for deeper think |
21:24:14 | FromDiscord | <Solitude> how is forums functionality stopping you from using the language? what discourse feature is so vital to your workflow? |
21:28:23 | * | narimiran quit (Ping timeout: 245 seconds) |
21:33:15 | Prestige | Is there a way to run single tests in a file with testament? Like in some js testing libs, you can do `test.only` |
21:45:12 | * | Gustavo6046 joined #nim |
22:00:20 | FromDiscord | <γγγΆγΌγ> isnt blockchain like increbly wasteful for the enviroment |
22:01:07 | Prestige | what do you mean? |
22:01:17 | FromDiscord | <ElegantBeef> Yea i dont get the detractor i'm fairly active on the forum and it's fine |
22:01:27 | FromDiscord | <γγγΆγΌγ> like apparently bitcoin takes up a shitton of electricity |
22:01:39 | Prestige | oh, yeah |
22:03:27 | FromDiscord | <exelotl> yeah I'm not a fan of blockchain stuff either |
22:03:39 | FromDiscord | <ElegantBeef> Well it's a nice idea but it's incredibly wasteful |
22:03:40 | FromDiscord | <γγγΆγΌγ> i mean i like the IDEA of blockchain as a way to own something so artists dont get scammed |
22:03:49 | FromDiscord | <γγγΆγΌγ> but yeah, the implementation is,,,, bad |
22:03:51 | FromDiscord | <Recruit_main707> @Valor likes proof-of-stake :P |
22:04:12 | FromDiscord | <γγγΆγΌγ> i mean, i have artist friends who id like to see make lots of money off comission |
22:04:24 | FromDiscord | <γγγΆγΌγ> and they cant do that if random people photoshop their works into memes lol |
22:05:00 | FromDiscord | <Recruit_main707> this reminds me of the pepe blockchain |
22:06:24 | * | NimBot joined #nim |
22:12:20 | * | Q-Master quit (Read error: Connection reset by peer) |
22:12:31 | * | Q-Master joined #nim |
22:24:20 | FromDiscord | <mratsim> In reply to @γγγΆγΌγ "isnt blockchain like increbly": It's the proof-of-work consensus algorithm that is wasteful, environment waste is not inherent to the blockchain. |
22:24:32 | FromDiscord | <mratsim> (edit) "the blockchain." => "blockchains." |
22:25:21 | FromDiscord | <mratsim> I would put proof-of-work in the same bucket as javascript in terms of environmental waste. |
22:27:13 | FromDiscord | <mratsim> channels specified ... https://github.com/mratsim/weave/commit/30bacedc841c5a4caf8424c5c342f352805ccf73β΅β΅Now only misc definitions TODO. |
22:29:09 | giaco | I want to check if string contains all elements of a set, but I'm failing to find the proper function. "in", "find", "contains" seems all doing different things |
22:29:10 | FromDiscord | <γγγΆγΌγ> I mean theres also the fact that bitcoin/crytocurrency people are just .... creepy. |
22:29:21 | giaco | set is a char set |
22:29:23 | FromDiscord | <ElegantBeef> mratsim you might know a way about this aside from using include, anyway from binding a symbol in the file that invoked the macro instead of the macro scope? π |
22:29:44 | FromDiscord | <ElegantBeef> in and contains are the same |
22:29:56 | FromDiscord | <ElegantBeef> `if set in string` == `if string.contains(set)` |
22:30:17 | FromDiscord | <ElegantBeef> make sure you import strutils and you'll be fine |
22:30:18 | FromDiscord | <dom96> In reply to @wrq "I know, the dog": The forum definitely ainβt perfect. But thatβs a strange reason not to use a language. |
22:30:48 | giaco | yeah, but they are not doing what I need |
22:30:59 | FromDiscord | <ElegantBeef> What do yo uneed |
22:31:16 | FromDiscord | <Yardanico> one way you can do it is with allIt from sequtils |
22:31:17 | giaco | I want to check if string contains all elements of a char set |
22:31:29 | FromDiscord | <Yardanico> But that's not the most efficient way :P |
22:31:30 | FromDiscord | <treeform> I think forum is great. |
22:31:34 | FromDiscord | <ElegantBeef> If on devel you could use `setutils` and do `toSet` on the string and compare to your set |
22:31:55 | FromDiscord | <Yardanico> https://nim-lang.org/docs/strutils.html#allCharsInSet%2Cstring%2Cset%5Bchar%5D |
22:31:58 | FromDiscord | <ElegantBeef> Though again not too efficient |
22:32:01 | FromDiscord | <Yardanico> @giaco |
22:32:11 | FromDiscord | <Yardanico> Ah sorry |
22:32:17 | FromDiscord | <Yardanico> It's the wrong one xd |
22:32:24 | FromDiscord | <ElegantBeef> Ah weird that the contains is just "if any char in set") |
22:32:29 | FromDiscord | <ElegantBeef> Nah that's the right one |
22:32:42 | FromDiscord | <ElegantBeef> Isnt it? |
22:32:48 | giaco | allCharsInSet is not doing what I need |
22:32:52 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
22:33:07 | giaco | allIt might do it, but is not better than a for loop |
22:33:32 | giaco | but I could be the best way, dunno |
22:33:36 | giaco | *it |
22:34:17 | FromDiscord | <ElegantBeef> Well there is always `toSet` in setutils, but it's just a for loop over the entire string |
22:34:30 | FromDiscord | <Yardanico> I don't think it's possible to do much optimization, just loop and short circuit if some char doesn't match |
22:34:52 | FromDiscord | <Yardanico> Uhh, again talking about the wrong thing here |
22:35:03 | FromDiscord | <ElegantBeef> Well that's what allChars does, they just want to see if the set is in the string. so it's iterate the entire string and when all chars match exit |
22:36:41 | * | superbia quit (Quit: WeeChat 3.0) |
22:42:03 | * | solitudesf quit (Quit: Leaving) |
22:42:16 | giaco | for c in {'a'..'z'}:; if c notin mysentence.lower:; return false; return true. Ugly but works. If you have any suggestions I'm just experimenting |
22:42:48 | * | Gustavo6046 joined #nim |
22:43:09 | Prestige | return c in mysentence.lower ? |
22:43:26 | FromDiscord | <ElegantBeef> That'd early exit |
22:43:51 | FromDiscord | <Yardanico> That's a bit unoptimized though |
22:44:05 | Prestige | since there's no formatting I can't tell where they are returning |
22:44:15 | FromDiscord | <Yardanico> For one you can convert the whole string to lowercase or just have birth lowercase and uppercase in your set |
22:44:22 | FromDiscord | <Yardanico> both |
22:45:39 | giaco | I'm already converting it to lowercase, as you can see |
22:46:49 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2RlP |
22:46:51 | FromDiscord | <ElegantBeef> There you go |
22:47:31 | FromDiscord | <Yardanico> @giaco I meant that you do it for each letter individually |
22:47:55 | giaco | ElengantBeef, my solution is exactly like your but I'm not using variable i, that seems unnecessary to me |
22:48:01 | FromDiscord | <Yardanico> Wait @ElegantBeef why i |
22:48:05 | FromDiscord | <ElegantBeef> yea it's a `O(strLen charsN)` in your case |
22:48:06 | FromDiscord | <Yardanico> :nimAngry: |
22:48:11 | FromDiscord | <ElegantBeef> True can do for c in s |
22:48:22 | FromDiscord | <ElegantBeef> too used to iterating strings from my strview |
22:48:26 | Prestige | are you doing something like https://play.nim-lang.org/#ix=2RlS giaco |
22:48:44 | giaco | Prestige: precisely that |
22:48:51 | FromDiscord | <ElegantBeef> Yea that's iterating twice |
22:49:06 | FromDiscord | <ElegantBeef> once per char in the set and again the entire string until a hit |
22:49:49 | FromDiscord | <ElegantBeef> Here we go a proper idiomatic solution π https://play.nim-lang.org/#ix=2RlT |
22:50:09 | FromDiscord | <ElegantBeef> The `c in chars` is a non iterative operation |
22:50:18 | FromDiscord | <ElegantBeef> Plus ever iteration you're converting s to lower |
22:50:27 | FromDiscord | <ElegantBeef> You've got like 3 loops going on vs the one of mine |
22:51:13 | FromDiscord | <GamzWithJamz> Do any of you know how to print string values in LLDB for Nim? The instructions from the book "Nim in Action" are not valid anymore: https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.htmlβ΅β΅I get this error: https://media.discordapp.net/attachments/371759389889003532/816080158704009216/unknown.png |
22:52:16 | FromDiscord | <Yardanico> https://www.reddit.com/r/nim/comments/lhaaa6/debugging_support_formatters_for_lldb_in_vscode/ might be useful |
22:52:26 | FromDiscord | <dom96> This isn't part of the book btw |
22:52:30 | FromDiscord | <dom96> it's just a separate article |
22:52:39 | FromDiscord | <GamzWithJamz> In reply to @GamzWithJamz "Do any of you": Realized I missed something in the instructions. Just needed to cast it to `char` https://media.discordapp.net/attachments/371759389889003532/816080522286989322/unknown.png |
22:52:49 | giaco | ElegantBeef, I just wrote toLower inside the for loop for simplicity here on irc, but really is outside like in the play.nim link posted by Prestige. Also, I'm using "c in chars" too, so according to what you are saying also mine is 1 loop |
22:53:06 | FromDiscord | <dom96> would appreciate a PR to fix the article if you find the solution π |
22:53:08 | FromDiscord | <ElegantBeef> Well it's not one loop |
22:53:22 | FromDiscord | <ElegantBeef> for each character you're iterating the entire string checking if it's in the string |
22:53:37 | FromDiscord | <GamzWithJamz> In reply to @dom96 "This isn't part of": You're right. My mistake. |
22:53:56 | FromDiscord | <ElegantBeef> Mine also doesnt do the same thing, but i can quickly fix that |
22:54:19 | FromDiscord | <Delta> sent a long message, see http://ix.io/2RlV |
22:58:43 | FromDiscord | <dom96> @Delta This is just my opinion, so take it as purely that, but if I was in your shoes I would write a simple suggestion engine that works for 90% of cases and which doesn't depend on the Nim compiler. |
22:59:43 | FromDiscord | <dom96> New developments in Nim are meant to improve nimsuggest but I'm skeptical and I think that we can get good enough suggestions that are fast by simply indexing the Nim code ourselves. |
22:59:49 | FromDiscord | <Delta> simple suggestion engine i.e. simple autocomplete? |
22:59:56 | FromDiscord | <Delta> (to get started) |
23:00:09 | giaco | ElengantBeef, if you iterate over the string instead of the char set, you're assuming the string doesn't contains chars outside the set. It doesn't return the same result as the dual loop |
23:00:29 | FromDiscord | <dom96> In reply to @Delta "simple suggestion engine i.e.": yeah, it could be as simple as finding all the `proc` in the project's Nim files |
23:01:26 | * | tane quit (Quit: Leaving) |
23:02:02 | FromDiscord | <Delta> Wonderful, thanks for the suggestion. I'll see where this takes me. Is there any prior work on "indexing the Nim code ourselves" outside of the compiler? I know there is https://github.com/tree-sitter/tree-sitter which could probably be used here. |
23:02:31 | FromDiscord | <Yardanico> there was a ctags tool written quite a long time ago, there's also the nim plugin for jetbrains IDEs |
23:02:44 | FromDiscord | <GamzWithJamz> In reply to @Yardanico "https://www.reddit.com/r/nim/comments/lhaaa6/debugg": This thing is also out of date, but I believe I can fix it. I will post the updated one on that reddit. |
23:04:27 | FromDiscord | <Yardanico> actually there's `ctags` embedded in the Nim compiler already |
23:05:00 | FromDiscord | <Yardanico> not sure how usable it is though |
23:06:34 | FromDiscord | <Yardanico> also you can use `jsondoc` to build the documentation in machine-readable json which then can be used for suggestions |
23:08:29 | FromDiscord | <Delta> Thanks for the pointers, I'll check it out. |
23:11:51 | FromDiscord | <ElegantBeef> giaco i did actually time it and my method is measurably faster |
23:11:54 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2Rm6 |
23:12:15 | FromDiscord | <ElegantBeef> Compiled with -d:danger and --gc:arc |
23:12:20 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/816085469397516308/unknown.png |
23:14:04 | FromDiscord | <ElegantBeef> doing `c notin lower` requires iterating from the start over and over again, whereas me iterating over the entire string left to right means i dont restart the search for every character |
23:14:26 | FromDiscord | <ElegantBeef> So yes your method iterates twice |
23:14:53 | * | krux02 quit (Remote host closed the connection) |
23:16:14 | FromDiscord | <ElegantBeef> Ah turns out most of that speed is just form using `toLowerAscii` instead of `toLower` |
23:16:21 | FromDiscord | <ElegantBeef> So i guess i'm a numpty |
23:16:23 | giaco | ElegantBeef, sure now it is, but you've changed your previously proposed solution. Thanks for the hint! Surely more elegant solution triggering early return after set comparison |
23:16:39 | FromDiscord | <ElegantBeef> Well i pointed that issue out, and said i was going to resolve it |
23:18:34 | FromDiscord | <Yardanico> heh nep1 in devel is funny |
23:18:39 | FromDiscord | <Yardanico> http://nim-lang.github.io/Nim/nep1.html |
23:18:41 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/816087070761811968/unknown.png |
23:18:45 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/816087087711387650/unknown.png |
23:19:25 | FromDiscord | <Yardanico> time to fix |
23:20:31 | Prestige | Is there not a specific style enforced with linting? |
23:20:40 | FromDiscord | <Yardanico> no, nim is not about "one style for all" |
23:20:49 | FromDiscord | <Yardanico> I've grown to like `a .. b` over `a..b` by the way, I don't really know why |
23:21:02 | FromDiscord | <ElegantBeef> So yea disregard everything i said about performance |
23:21:19 | FromDiscord | <ElegantBeef> Checking if a set is apart of another set is apparently somehow slower |
23:23:23 | FromDiscord | <flywind> timoth like a..<b |
23:23:44 | FromDiscord | <Yardanico> well, that was discussed in a PR |
23:23:46 | FromDiscord | <Yardanico> before he merged it |
23:24:20 | FromDiscord | <Yardanico> but yeah, I like spaces before and after more anyway :D |
23:24:23 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/pull/16992 |
23:24:46 | Prestige | I thought the compiler would just have a single style so it's more readable |
23:25:02 | FromDiscord | <Yardanico> we're not talking about the compiler though |
23:25:03 | FromDiscord | <Yardanico> we're talking about user code |
23:25:07 | Prestige | ah |
23:25:13 | FromDiscord | <Yardanico> nep1 is basically "pep8 but for nim" :D |
23:25:26 | FromDiscord | <Yardanico> (since then nim switched to normal RFCs) |
23:25:31 | Prestige | oh, I wasn't familiar with the term |
23:25:49 | FromDiscord | <Yardanico> https://nim-lang.org/docs/nep1.html |
23:27:35 | Prestige | Thanks, cool to see this exists |
23:27:41 | FromDiscord | <Yardanico> hm, I think like the note about old naming conventions (TFoo/PFoo) should be removed from nep1 too, nowadays no stdlib module has those |
23:28:14 | FromDiscord | <flywind> some pure enum is not fit for nep1 too |
23:28:30 | FromDiscord | <Yardanico> yeah it's just a general guide to follow in most (not all) cases |
23:31:12 | FromDiscord | <ElegantBeef> Giaco this is my last version i promise i'll stop spamming you π https://play.nim-lang.org/#ix=2Rme |
23:31:24 | FromDiscord | <ElegantBeef> No copying = much faster for larger string |
23:32:13 | FromDiscord | <ElegantBeef> Thus ends this day's edition of code golf |
23:32:41 | FromDiscord | <Yardanico> π₯΄ |
23:33:06 | FromDiscord | <Recruit_main707> In reply to @γγγΆγΌγ "I mean theres also": why lol |
23:34:03 | giaco | in a sequence of and, or, mod, div, !=, == on a single line, you think is better to wrap things with parenthesis even is not necessary, or better leave reader to comply with natural order of operations? |
23:34:25 | giaco | ElegantBeef, thanks a lot? Haven't though about that. Nice exercise |
23:34:57 | FromDiscord | <Yardanico> @giaco I'd say it depends on the context, but a bit of parenthesis won't hurt |
23:40:41 | FromDiscord | <Rika> how does one debug an error that changes when i add any one of `--gc:orc` `--debugger:native` `-d:useMalloc` |
23:41:03 | FromDiscord | <Rika> each one (and combinations of each) makes the error change |
23:41:11 | FromDiscord | <Rika> its making me go crazy |
23:41:50 | FromDiscord | <Yardanico> what kind of errors do you get? |
23:44:11 | FromDiscord | <Rika> index not in, sigsegv, another index not in with different indices |
23:44:29 | FromDiscord | <Rika> fg |
23:44:32 | FromDiscord | <Yardanico> i'm assuming devel? try with --gc:arc to see if it still crashes |
23:44:33 | FromDiscord | <Rika> wrong chat |
23:44:37 | FromDiscord | <Rika> okay |
23:44:39 | FromDiscord | <Yardanico> then try with --gc:arc --cursorInference:off |
23:44:44 | FromDiscord | <Yardanico> (if it still crashes) |
23:44:44 | FromDiscord | <Rika> ah wait |
23:44:46 | FromDiscord | <Rika> this is async |
23:44:52 | FromDiscord | <Yardanico> yes I understand |
23:44:59 | FromDiscord | <Rika> okay |
23:45:05 | FromDiscord | <Yardanico> your async code will still run with arc just fine, it'll "just" leak :) |
23:45:14 | FromDiscord | <Yardanico> so it's much easier to understand if it's an orc bug (cycles) or not |
23:45:27 | FromDiscord | <Rika> i know yes |
23:45:31 | FromDiscord | <Rika> okay |
23:49:44 | FromDiscord | <Rika> ill report back next time, this is mind numbing |
23:50:17 | FromDiscord | <ElegantBeef> After that string impl i kinda now want a `for x.toLowerAscii in s` π |
23:51:12 | FromDiscord | <Rika> that makes no sense |
23:52:01 | FromDiscord | <ElegantBeef> It iterates the for loop then shadows the identifier in the procedure call internally |
23:52:14 | FromDiscord | <Yardanico> you know the rules and so do I |
23:52:16 | FromDiscord | <Yardanico> (edit) "you" => "you" | removed "" |
23:52:18 | FromDiscord | <Yardanico> (edit) "you" => "you" | "I" => "I" |
23:52:58 | FromDiscord | <Yardanico> write a \\\\\ |
23:53:16 | FromDiscord | <ElegantBeef> Hmm 5 letters must be RFFCC π |
23:53:24 | FromDiscord | <phpOstrich> What are methods good for? |
23:53:24 | FromDiscord | <Rika> In reply to @ElegantBeef "It iterates the for": ?? |
23:53:29 | FromDiscord | <ElegantBeef> Inheritance |
23:53:33 | FromDiscord | <Yardanico> @phpOstrich dynamic dispatch, quite obviously :P |
23:53:42 | FromDiscord | <ElegantBeef> What rika |
23:53:51 | FromDiscord | <Rika> i dont understand |
23:53:58 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Rmp |
23:54:03 | FromDiscord | <Rika> that makes no sense |
23:54:11 | FromDiscord | <Yardanico> of course the expression will be assigned to a temp var instead, but you get the idea |
23:54:24 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2Rmq |
23:54:27 | FromDiscord | <Rika> why would that be? |
23:54:43 | FromDiscord | <ElegantBeef> What do you mean? |
23:55:10 | FromDiscord | <Rika> why would `for x.call in y` make sense to you |
23:55:27 | FromDiscord | <ElegantBeef> I said i kinda wanted it |
23:55:32 | FromDiscord | <Rika> it does not make sense to me, i know what you want it to do but it does not conceptually or logically connect |
23:55:33 | FromDiscord | <ElegantBeef> Didnt say it made sense |
23:58:09 | FromDiscord | <InventorMatt> I could see some use cases for it such as converting integers to float or if you wanted to square a number coming out. it would just reduce everything by one line of code |
23:58:40 | FromDiscord | <Yardanico> you can write most of Nim in one line of code, but do you want to? :D |
23:58:50 | giaco | I'm trying to find the way-to-go to alias a proc, I see some old merged PR, but not the line in official docs |
23:59:09 | FromDiscord | <Yardanico> a template? |
23:59:33 | FromDiscord | <Yardanico> it depends on what you want to do really :P |
23:59:45 | FromDiscord | <Yardanico> you can always write a "wrapper" proc if you really need a "proc", but in most cases you can get away with a template |