00:08:14 | ForumUpdaterBot | New thread by Masiarek2: Nim program name with spaces, see https://forum.nim-lang.org/t/7741 |
00:50:33 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
00:50:53 | * | njoseph joined #nim |
01:10:59 | FromDiscord | <ilkxy_y> In reply to @Yardanico "nice spam,": lmfao |
01:41:10 | * | wasted_youth2 quit (Quit: Leaving) |
01:44:10 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
01:49:23 | FromDiscord | <JSONBash> Anyone know why my mongoDB connection takes ~30s on startup? Using anonimongo |
02:16:21 | leorize[m] | @zetashift I added a configuration for nim.nvim: `let g:nim_highlight_wait = v:true` which would delay the highlighter update |
02:16:58 | leorize[m] | the delay will be `updatetime` (see `:h updatetime`) |
02:48:43 | FromGitter | <bung87> how to handle chronos hint `cannot raise 'Defect'` ? |
02:49:39 | FromGitter | <bung87> I update from chronos 2.6.1 to 3.0 can't run my program now `rror: type mismatch: got 'proc (udata`gensym105: pointer){.closure, locks: <unknown>.}' for 'proc (udata`gensym105: pointer) {.raises: [Defect].} = try: ⏎ if not finished(nameIterVar`gensym105):` |
03:35:34 | * | spiderstew_ joined #nim |
03:35:47 | FromDiscord | <Tuatarian> In reply to @Yardanico "nice spam,": loll who on a programming forum is falling for this? |
03:35:55 | FromDiscord | <Yardanico> ? |
03:36:00 | FromDiscord | <Tuatarian> the scam |
03:36:11 | FromDiscord | <Yardanico> idk really, but nim forum is moderated anyway |
03:36:14 | FromDiscord | <Tuatarian> nnevermind it's not a scam |
03:36:17 | FromDiscord | <Tuatarian> it's just some guy memeing |
03:36:23 | FromDiscord | <Tuatarian> that's even funnier |
03:36:31 | FromDiscord | <Yardanico> just a new account, that's not memeing, that's just useless spam |
03:36:40 | * | spiderstew quit (Ping timeout: 258 seconds) |
03:36:50 | FromDiscord | <Tuatarian> spam yeah but at least it doesn't seem to be a scam |
03:36:59 | FromDiscord | <Tuatarian> maybe they reply to comments with the links to the scam |
03:37:21 | FromDiscord | <Tuatarian> quite funny ty for posting |
03:50:36 | * | shmorgle quit (Quit: [TalkSoup] via NEXTSPACE) |
03:53:59 | * | shmorgle joined #nim |
04:01:03 | * | gpanders quit (Ping timeout: 268 seconds) |
04:47:38 | * | vicfred_ joined #nim |
04:49:58 | * | vicfred quit (Ping timeout: 240 seconds) |
04:51:13 | * | vicfred_ quit (Client Quit) |
04:57:42 | * | vicfred joined #nim |
05:08:46 | * | aeverr quit (Ping timeout: 260 seconds) |
06:06:42 | * | letto quit (Quit: Konversation terminated!) |
06:18:14 | * | narimiran joined #nim |
06:23:18 | * | hoijui joined #nim |
06:25:55 | * | ee7[m] joined #nim |
06:26:45 | * | vicfred quit (Quit: Leaving) |
07:23:36 | * | hoijui quit (Ping timeout: 246 seconds) |
07:41:58 | * | Vladar joined #nim |
07:48:45 | * | letto joined #nim |
07:49:42 | * | letto quit (Client Quit) |
07:50:20 | * | letto joined #nim |
08:08:29 | saem | Sadly, I don't think I can improve the display of object variants with the nim-gdb.py script. |
08:20:38 | * | hoijui joined #nim |
08:27:37 | * | haxscramper joined #nim |
08:45:51 | * | lritter joined #nim |
08:51:22 | * | haxscram` joined #nim |
08:53:37 | * | haxscram` left #nim (#nim) |
08:53:43 | * | haxscramper quit (Ping timeout: 265 seconds) |
08:56:26 | * | hoijui quit (Quit: Leaving) |
09:02:33 | * | waleee-cl joined #nim |
09:27:56 | FromDiscord | <XxDiCaprioxX> now this may sound dumb but how can I get a char at position i of a string? |
09:29:29 | FromDiscord | <XxDiCaprioxX> is it `string(i)` ? |
09:30:06 | FromDiscord | <haxscramper> !eval echo "werwer"[0] |
09:30:10 | NimBot | w |
09:30:18 | FromDiscord | <sealmove> is there a way to access the first field of an object without using its name? |
09:30:20 | FromDiscord | <XxDiCaprioxX> okay thanks |
09:30:22 | FromDiscord | <XxDiCaprioxX> got it |
09:30:41 | FromDiscord | <haxscramper> In reply to @รєคɭ๓๏שє "is there a way": You can try https://nim-lang.org/docs/iterators.html#fields.i%2CT |
09:31:11 | FromDiscord | <haxscramper> The other option is to use `getTypeImpl` for object and just directly get first field |
09:31:50 | FromDiscord | <sealmove> great, thanks |
09:49:15 | * | Vladar quit (Remote host closed the connection) |
10:05:48 | FromGitter | <bung87> https://github.com/bung87/scorper/blob/devel/tests/trange.nim I use chronos that test multiple requests , it randomly fails, am wondering is it address binding time gap ? |
10:14:33 | FromDiscord | <KnorrFG> sent a long message, see http://ix.io/2UTo |
10:38:20 | * | PMunch joined #nim |
11:03:33 | Zoom[m] | @KnorrFG can't really help you with the problem in your code, but a nice task to get the day started. Do you need to consider illegal boards? |
11:04:03 | FromDiscord | <KnorrFG> 😄 I just assumed no ^^ |
11:05:55 | FromDiscord | <Rika> ~~next goal after this is to determine the winner of a chess board~~ |
11:05:59 | FromDiscord | <Rika> I kid of course |
11:07:05 | * | filcuc joined #nim |
11:07:29 | PMunch | @KnorrFG, what's the issue you have with that code? |
11:08:29 | FromDiscord | <KnorrFG> In reply to @PMunch "<@689821975463460892>, what's the issue": /usercode/in.nim(56, 12) template/generic instantiation from here↵/usercode/in.nim(21, 19) Error: cannot instantiate: 'B' |
11:09:19 | FromDiscord | <Rika> How do I test the AST output of a macro |
11:09:21 | PMunch | Hmm, not too familiar with the sugar syntax. What does f => f(field) mean? |
11:09:28 | PMunch | @Rika, define test |
11:09:40 | FromDiscord | <Rika> Check against a premade AST |
11:09:59 | FromDiscord | <KnorrFG> basically that line and the commented lines that follow should all be identical, in my mind. they yield different error messages, but none of them works |
11:10:00 | FromDiscord | <Rika> So I guess pattern matching applies here |
11:10:24 | PMunch | @Rika, this might help: https://uploads.peterme.net/macroutils.html#verifying-dsl-trees |
11:10:43 | PMunch | @KnorrFG, but what is f there? |
11:10:44 | FromDiscord | <Rika> Can I do that without editing the original macro |
11:11:08 | FromDiscord | <KnorrFG> one of the functions in the list that is the second argument to firstSome |
11:11:34 | Zoom[m] | Sorry for not answering the question again. Guess this is not functional enough. https://play.nim-lang.org/#ix=2UTB |
11:11:46 | PMunch | Uhm |
11:12:30 | FromDiscord | <haxscramper> In reply to @Rika "So I guess pattern": https://nim-lang.github.io/fusion/src/fusion/matching.html#tree-matching |
11:14:17 | FromDiscord | <KnorrFG> In reply to @PMunch "Uhm": Each of these functions checks one win condition, and returns a winner, or none. if a winner is returned, firstSome returns the winner, else it calls the next function |
11:14:27 | FromDiscord | <Rika> Now how do I get the AST output of a macro lol |
11:14:36 | FromDiscord | <Rika> Without editing the macro |
11:15:11 | PMunch | @KnorrFg, but he's not calling them |
11:15:28 | FromDiscord | <haxscramper> In reply to @Rika "Without editing the macro": I doubt it is possible. you can try and wrap call into `typed` argument, but that would not give you resulting AST |
11:15:37 | PMunch | So he passes in a sequence of functions |
11:15:45 | FromDiscord | <Rika> Okay |
11:15:51 | PMunch | Or he passes in a function and a sequence of functions |
11:17:23 | FromDiscord | <KnorrFG> think of firstSome as a map that has the restriction, that the mapping function must map to an option type, and instead of the sequence it returns the first some result |
11:17:49 | FromDiscord | <KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2UTF |
11:18:41 | FromDiscord | <KnorrFG> the idea is: "is there a winner among the rows? if not: is there ar winner among cols? ... etc" |
11:18:49 | FromDiscord | <KnorrFG> just expression functionally |
11:19:29 | PMunch | I don't think closures can recurse like that.. |
11:19:58 | FromDiscord | <KnorrFG> and the function that is the first argument to firstSome is just calling the functions that are the second argument, with the field object as argument |
11:21:40 | FromDiscord | <KnorrFG> In reply to @Zoom "Sorry for not answering": i like your solution. still want to get mine to work |
11:22:11 | * | filcuc quit (Ping timeout: 240 seconds) |
11:23:40 | FromDiscord | <KnorrFG> In reply to @PMunch "I don't think closures": this is a very unsattisfying answer xD But thanks for looking at it ^^ |
11:24:15 | Zoom[m] | Thanks. Of course! Hope you'll get to the bottom of it. I was under impression functional style is not considered the first-class citizen with Nim so I stopped looking into it for a while, at least until the situation improves. |
11:26:04 | FromDiscord | <KnorrFG> In reply to @Zoom "Thanks. Of course! Hope": can I use urs in the blog post too when I write it? Ofc, ill mention you. But the view count will probably stay below 20 anyway 😄 |
11:29:49 | * | liblq-dev < https://matrix.org/_matrix/media/r0/download/matrix.org/oqYnGniTNeJpEXtZmoZuLXXT/message.txt > |
11:30:00 | liblq-dev | nice 👌👌💯 |
11:30:36 | PMunch | Hmm @Zoom[m] tried to create a non-generic version of firstSome and managed to get it to work |
11:33:04 | PMunch | @Zoom[m] okay this works: http://ix.io/2UTK |
11:35:03 | FromDiscord | <KnorrFG> Ok, great. thanks but, this looks like the only reason that it didnt work before was that nim does not automatically assume {.nimcall.}? |
11:35:12 | FromDiscord | <KnorrFG> no offense, but: WHAT THE FUCK? |
11:35:14 | PMunch | Correct |
11:35:32 | PMunch | I mean it assumes {.closure.} |
11:36:01 | FromDiscord | <KnorrFG> are those incompatible? |
11:36:13 | FromDiscord | <KnorrFG> I havent rly looked into these pragmas yet |
11:36:21 | PMunch | Apparently |
11:36:50 | PMunch | https://forum.nim-lang.org/t/6117 <- this might clear it up for you |
11:36:54 | FromDiscord | <KnorrFG> but if you add nimcall, it still is a closure, even if it does not have that pragma anymore |
11:37:03 | FromDiscord | <KnorrFG> as it grabs field from the scope |
11:37:12 | PMunch | But the TLDR is that closure carries a scope along with it, while nimcall is what the top-level procedures are |
11:37:33 | PMunch | Yeah the outer proc is closure |
11:37:45 | PMunch | But it takes a proc that is not a closure as its argument |
11:38:20 | FromDiscord | <KnorrFG> ahh, i see |
11:38:56 | FromDiscord | <KnorrFG> but shouldnt that be derivable form the list arguments? |
11:39:08 | FromDiscord | <KnorrFG> i mean the list of functions that is passed to firstSome |
11:41:04 | * | krux02 joined #nim |
11:41:07 | PMunch | Well that is the problem |
11:42:10 | PMunch | Since f: A -> Option[B] is the first argument A is determined there to be {.closure.} because f => f(field) apparently creates a closure. Then it gets a list of {.nimcall.} and throws an error |
11:42:18 | FromDiscord | <KnorrFG> should I open a bug report for that? |
11:43:08 | FromDiscord | <KnorrFG> ah. hmm. yeah makes sense. |
11:44:50 | FromDiscord | <KnorrFG> so ideally, the => macro should only create a closure function if something is actually grabbed from the scope |
11:45:33 | FromDiscord | <KnorrFG> or even better, nimcall and closures should be compatible. |
11:45:53 | FromDiscord | <KnorrFG> i mean from a user pov its both functions. the code that uses them looks the same |
11:47:41 | PMunch | Hmm, I tried to flip the arguments in firstSome but that didn't work.. |
11:48:59 | * | wasted_youth2 joined #nim |
11:50:58 | PMunch | But now I can't even get it to work by adding {.nimcall.} |
11:52:47 | FromDiscord | <KnorrFG> I also just noticed: on play nim, if use the line where you introduced nimcall, it works, if i do that on my pc i get an error: lock levels differ. But I do use the latest stable, so my pc and play nom should run the same version |
11:54:14 | PMunch | Hmm, are you on Windows? |
11:54:22 | FromDiscord | <KnorrFG> wsl2 |
11:54:37 | FromDiscord | <KnorrFG> with ubuntu |
11:54:39 | PMunch | Hmm, the playground uses Linux. So that might be it |
11:54:55 | PMunch | It shouldn't matter though.. |
11:55:38 | PMunch | Hmm, is there an easy way to get a byte array of an object on compile-time? |
11:56:08 | PMunch | I'm trying to work around this: https://github.com/nim-lang/Nim/issues/17497 |
12:01:18 | FromDiscord | <vieru> hi |
12:01:59 | FromDiscord | <vieru> can anyone help me run this ? |
12:02:00 | FromDiscord | <vieru> https://github.com/khchen/winim/blob/master/examples/com/threads/thread1.nim |
12:02:22 | FromDiscord | <vieru> the example just gives me this error |
12:02:23 | FromDiscord | <vieru> 'thread' is not GC-safe as it calls 'get' |
12:02:28 | FromDiscord | <vieru> (edit) "'thread'" => "`'thread'" | "'get'" => "'get'`" |
12:03:10 | liblq-dev | PMunch, idk, https://github.com/disruptek/frosty ? |
12:05:32 | FromDiscord | <zetashift> In reply to @leorize "<@77574388035100672> I added a": Thanks!! Great plugin and thank you for your work |
12:08:14 | FromDiscord | <vieru> are there any winim devs on atm ? |
12:08:22 | FromDiscord | <vieru> (edit) "on" => "online" |
12:09:25 | Zoom[m] | <FromDiscord "<KnorrFG> In reply to @Zoom "Tha"> Of course, my pleasure! |
12:10:40 | Zoom[m] | Is there a difference between `setLen(0)` and `== ""` for strings? |
12:10:43 | FromDiscord | <KnorrFG> In reply to @Zoom "<FromDiscord "<KnorrFG> In reply": wanna give me any link to a profile of yours? |
12:12:14 | Zoom[m] | I guess it's https://github.com/ZoomRmc/ |
12:12:20 | PMunch | @Zoom[m], not sure TBH |
12:12:39 | PMunch | I think setLen(0) won't touch the underlying string data |
12:12:52 | Zoom[m] | PMunch: Both are some Magic stuff |
12:17:10 | liblq-dev | Zoom: yes, there is a difference. s.setLen(0) will clear the contents of the string, and s == "" will return whether the string is empty |
12:17:40 | liblq-dev | unless you meant to type a single `=` |
12:17:42 | Zoom[m] | lqdev: I mistyped `= ""` sorry |
12:17:46 | liblq-dev | ah |
12:17:59 | liblq-dev | then presumably it'll clear the internal buffer of the string |
12:18:10 | liblq-dev | but i suppose the compiler can optimize that away if it's smart enough |
12:18:24 | liblq-dev | i'd go with s.setLen(0) just to be sure |
12:19:11 | Zoom[m] | I just want to reuse allocated memory and start pushing to the string anew |
12:22:15 | liblq-dev | so yeah go with s.setLen(0) |
12:23:47 | * | mmohammadi9812 joined #nim |
12:31:18 | * | gpanders joined #nim |
12:34:50 | FromDiscord | <haxscramper> Is there any benchmarking library that is available on playground? And if no, can https://github.com/treeform/benchy be added there? |
12:38:18 | FromDiscord | <flywind> feel free to make a PR |
12:38:31 | FromDiscord | <flywind> https://github.com/PMunch/nim-playground/pull/3 |
12:38:35 | FromDiscord | <flywind> ^ |
12:53:07 | FromDiscord | <vieru> In reply to @vieru "are there any winim": anyone ? |
12:57:06 | PMunch | @haxscramper, here is the list of all packages on the playground: https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble |
12:58:19 | PMunch | @vieru, I'd love to help but I'm not a Windows user so not very familiar with winim. The way you're trying to use threads though looks very sketchy |
12:59:01 | FromDiscord | <haxscramper> PMunch: yes, I've already made a PR https://github.com/PMunch/nim-playground/pull/7 |
12:59:37 | PMunch | Keep in mind that the playground has a run time limit and is very limited on CPU and memory time |
12:59:44 | PMunch | So not exactly a great place to benchmark stuff |
13:00:24 | FromDiscord | <haxscramper> yes, but benchy stops after 60 seconds. And that is too long I can probably make a PR in order to make it configurable somehow |
13:01:25 | FromDiscord | <haxscramper> But that is mostly for simple comparison purposes, only to show X vs Y speeds |
13:02:24 | FromDiscord | <vieru> PMunch: i just want to make https requests from a thread to not interrupt my app, using the default nim procs for https requests add openssl as dep and i cant get it to link statically on windows |
13:02:38 | PMunch | The container runs for 20s before it's aborted |
13:05:23 | FromDiscord | <vieru> i think ill just wait and reply to myself until someone can help me |
13:05:32 | FromDiscord | <vieru> thanks pmunch |
13:05:38 | * | aeverr joined #nim |
13:06:06 | PMunch | @vieru, it sounds like what you actually want is async |
13:06:14 | PMunch | If you're doing http |
13:06:23 | PMunch | But not sure if winim works with async |
13:06:31 | PMunch | So you might need a thread after all |
13:06:44 | FromDiscord | <vieru> yeah thats why |
13:07:07 | PMunch | But essentially threads in Nim have their own heap. So you can't just pass a dictionary from one thread to another and expect that to work out well |
13:07:08 | FromDiscord | <vieru> async would be great |
13:07:21 | PMunch | (Although not sure what the `com` type is) |
13:07:56 | FromDiscord | <flywind> it's a ref object |
13:10:52 | PMunch | Hmm, that entire example seems a bit dubious |
13:11:00 | PMunch | Not sure if that ever could've worked properly |
13:12:14 | PMunch | I mean you could possibly be able to do it with async |
13:12:28 | FromDiscord | <vieru> basically i just need to call methods from winim/com in a thread but i cant because there's something in the winim code https://media.discordapp.net/attachments/371759389889003532/827893310215028746/unknown.png |
13:12:46 | FromDiscord | <vieru> line 999 com.nim |
13:13:02 | FromDiscord | <vieru> sent a code paste, see https://play.nim-lang.org/#ix=2UUc |
13:13:03 | PMunch | Yeah, they try to access globally GC-ed memory |
13:13:05 | PMunch | Which isn't allowed |
13:13:27 | PMunch | But it has never been allowed, so I'm not sure how he wrote those examples.. |
13:14:15 | FromDiscord | <vieru> the problem is there arent any global variables |
13:14:23 | FromDiscord | <vieru> inside |
13:14:36 | FromDiscord | <vieru> sent a code paste, see https://play.nim-lang.org/#ix=2UUd |
13:14:44 | FromDiscord | <vieru> thats line 826 |
13:14:51 | FromDiscord | <vieru> (edit) "826" => "926" |
13:15:17 | FromDiscord | <vieru> you find the definition for excep |
13:15:26 | FromDiscord | <vieru> sent a code paste, see https://play.nim-lang.org/#ix=2UUe |
13:15:51 | FromDiscord | <vieru> sent a code paste, see https://play.nim-lang.org/#ix=2UUf |
13:16:18 | FromDiscord | <vieru> this is the code https://media.discordapp.net/attachments/371759389889003532/827894276116578364/unknown.png |
13:17:38 | FromDiscord | <vieru> https://media.discordapp.net/attachments/371759389889003532/827894614899032104/unknown.png |
13:17:51 | FromDiscord | <vieru> if you wonder whats that underline about |
13:18:16 | PMunch | Hmm, that looks weird |
13:19:24 | FromDiscord | <vieru> ill try nim 1.2.8 mby there's a bug in 1.4.4 |
13:23:51 | FromDiscord | <vieru> yeah nim 1.2.8 doesnt give any errors |
13:24:00 | FromDiscord | <vieru> whats all of this about |
13:24:02 | FromDiscord | <vieru> i dont get it |
13:25:56 | FromDiscord | <Rika> its git bisect time |
13:27:34 | FromDiscord | <vieru> lol its like every time i get back to nim i discover a new bug |
13:31:58 | PMunch | That just means you're pushing ever further into what Nim can do :) |
13:35:21 | FromDiscord | <vieru> its just really a headache |
13:36:22 | PMunch | Unless I'm missing something obvious there I don't really see how that could've worked before.. |
13:36:31 | PMunch | Have you tried with --gc:arc by the way? |
13:36:36 | FromDiscord | <haxscramper> PMunch: actually benchy does always run for 60 seconds, but insead runs no longer than 60 seconds if execution of each test devaites too much. So it can finish in less than a second |
13:36:50 | PMunch | Not sure if that enables/disables any checks, but it should be better for threading |
13:36:51 | FromDiscord | <haxscramper> And it won't run more than a thousand times for a test |
13:37:37 | PMunch | Aah I see |
13:38:01 | PMunch | So you don't want to make any PRs? |
13:40:37 | FromDiscord | <haxscramper> I will open issue in benchy to discuss possible ways how it can be configured (because right now it is just simple `timeIt` template that has 60s hardcoded) |
13:41:18 | FromDiscord | <haxscramper> Maybe treeform doesn't want to make it extra-configurable (keep it simple `timeIt` without any extra complexity) |
13:42:20 | FromDiscord | <haxscramper> Although if you want you can merge my PR now |
13:42:40 | FromDiscord | <haxscramper> And I will work out other details later |
13:43:01 | PMunch | Sure, it just involves a little bit of manual work to actually rebuild an image every time I add a package |
13:43:14 | PMunch | So I didn't want to merge it if you were going to make a small PR very soon |
13:45:52 | FromDiscord | <haxscramper> You mean you have to rebuild the image after I make edits to benchy itsel too? |
13:48:44 | PMunch | Yup |
13:49:08 | PMunch | It rebuilds automatically when new versions of Nim are released, but not when I approve PRs to the packages list |
13:50:31 | FromDiscord | <haxscramper> It is not urgent anyway, so if you want to delay it until I sort out 60s execution cap it is not a big deal |
13:54:30 | * | Cadey quit (Quit: WeeChat 3.0.1) |
13:58:07 | FromGitter | <bung87> is there a nimble flag turn off verify packages and download when `nimble build`? when my nimble file requires packages as url , it always download from GitHub |
13:58:28 | FromDiscord | <haxscramper> no |
13:59:15 | FromGitter | <bung87> that's very weird behaviour for me . |
13:59:16 | FromDiscord | <haxscramper> Package verification and download is coded together with dependency resolution, so it is not possible to my knowledge |
14:00:26 | FromGitter | <bung87> I think it only needed when installation, dont know why that nimble run also do same thing. |
14:01:22 | FromGitter | <bung87> no like any other language package manager run scripts. |
14:03:01 | FromGitter | <bung87> just because it doesn't have registry and lock file ,I guess |
14:03:35 | FromDiscord | <haxscramper> https://forum.nim-lang.org/t/7671 |
14:05:57 | * | shodan45 quit (Remote host closed the connection) |
14:06:40 | * | kitech1 quit (Remote host closed the connection) |
14:06:58 | * | kitech1 joined #nim |
14:08:03 | * | Xe joined #nim |
14:08:05 | * | shodan45 joined #nim |
14:08:41 | * | Xe is now known as Cadey |
14:17:20 | * | dddddd quit (Quit: dddddd) |
14:17:23 | * | filcuc joined #nim |
14:18:40 | FromDiscord | <jseb> with nimble, what about git packages ? For exemple, godot package is installed on my PC on version 0.8.1. There has been updates on the github since my installation, but if i want to update the package (`nimble install godot`) it says the package is already up-to-date (no version change, i don't know what are the criteria for this). So if i answer «yes», i guess it's updated to the last commit ? |
14:21:32 | FromGitter | <bung87> if you dont specify the version , it will get local package from install directory |
14:22:00 | FromGitter | <bung87> your nimble package installed as <packageName>@version |
14:22:54 | FromGitter | <bung87> if it requires install it will check GitHub tags compare versions then decide to whether download |
14:26:15 | * | filcuc quit (Ping timeout: 265 seconds) |
14:28:57 | * | xet7 quit (Quit: Leaving) |
14:29:18 | * | filcuc joined #nim |
14:29:24 | * | xet7 joined #nim |
14:29:36 | FromDiscord | <jseb> so no update , then ? If the github tag doesn't change |
14:33:15 | * | filcuc quit (Client Quit) |
14:33:21 | * | filcuc_ joined #nim |
14:33:42 | FromDiscord | <vieru> hi again |
14:33:46 | FromDiscord | <vieru> quick question |
14:33:53 | FromDiscord | <vieru> `2021-04-03T14:06:36.053789Z` |
14:33:58 | FromDiscord | <vieru> what date format is this ? |
14:34:12 | FromDiscord | <vieru> im confused by the part after the dot |
14:34:43 | FromDiscord | <vieru> parse("2021-04-03T14:06:36.053789Z", "yyyy-MM-dd'T'HH:mm:ss.ffffff'Z'") |
14:34:52 | FromDiscord | <vieru> (edit) "parse("2021-04-03T14:06:36.053789Z", "yyyy-MM-dd'T'HH:mm:ss.ffffff'Z'")" => "`parse("2021-04-03T14:06:36.053789Z", "yyyy-MM-dd'T'HH:mm:ss.ffffff'Z'")`" |
14:35:02 | PMunch | ISO8601 |
14:37:51 | FromDiscord | <vieru> so what would be the correct way for the format ? |
14:37:59 | FromDiscord | <vieru> i cant get it to work |
14:38:23 | FromDiscord | <vieru> (edit) "what would be" => "whats" | "way" => "format" | "the format ?" => "parse" |
14:42:39 | FromDiscord | <vieru> nevermind |
14:42:44 | FromDiscord | <vieru> i got it to work |
14:42:49 | FromDiscord | <vieru> `"yyyy-MM-dd'T'HH:mm:ss'.'ffffff'Z'"` |
14:42:57 | FromDiscord | <dom96> @jseb nimble installs the latest tagged version by default |
14:42:57 | FromDiscord | <vieru> thanks for the tip tho |
14:43:10 | FromDiscord | <dom96> if you want latest commit you can install via `nimble install godot@#head` |
14:47:26 | * | filcuc_ quit (Ping timeout: 240 seconds) |
14:52:09 | FromDiscord | <jseb> ok i understand now, thank you for the answers |
14:58:14 | PMunch | @vieru, technically that Z is the timezone. Z is Zulu time, or UTC. It can also be something like `-04:30` |
15:01:36 | PMunch | Hmm, is there a way to get Nim to create a UTF16 literal from a normal string literal? |
15:08:59 | PMunch | Something like `L"Hello"` |
15:09:17 | * | mmohammadi9812 quit (Remote host closed the connection) |
15:12:10 | liblq-dev | i mean you can make a macro that does conversion from UTF-8 to UTF-16 |
15:12:16 | liblq-dev | maybe even a template if you're brave enough ;) |
15:12:16 | PMunch | Sure |
15:12:27 | PMunch | Not sure that would work in this case |
15:12:41 | liblq-dev | what's your "case" |
15:13:13 | * | Vladar joined #nim |
15:13:33 | PMunch | The string must pass through a PROGMEM macro that converts it to be stored in the flash memory of a microcontroller |
15:13:43 | PMunch | It's for implementing the USB HID spec |
15:24:00 | FromDiscord | <KnorrFG> sent a long message, see http://ix.io/2UUG |
15:28:05 | * | rockcavera joined #nim |
15:48:58 | * | filcuc_ joined #nim |
15:50:04 | PMunch | Hmm, that looks weird indeed |
16:37:14 | * | filcuc_ quit (Ping timeout: 265 seconds) |
16:47:55 | * | filcuc_ joined #nim |
16:55:11 | * | filcuc_ quit (Ping timeout: 240 seconds) |
16:55:59 | FromDiscord | <JSONBash> Anyone know why my mongoDB connection takes ~30s on startup? Using anonimongo |
16:57:06 | * | m4r35n357 quit (Ping timeout: 240 seconds) |
16:57:42 | * | m4r35n357 joined #nim |
17:10:43 | FromDiscord | <DavidKunz> sent a code paste, see https://play.nim-lang.org/#ix=2UVg |
17:12:23 | FromDiscord | <ElegantBeef> make a block statement, and have the last statement be `yourReturnObject` |
17:12:51 | FromDiscord | <DavidKunz> Thanm you @ElegantBeef , will try that! |
17:12:52 | FromDiscord | <ElegantBeef> sent a code paste, see https://paste.rs/BaK |
17:12:59 | FromDiscord | <DavidKunz> (edit) "Thanm" => "Thank" |
17:13:30 | FromDiscord | <ElegantBeef> If the last statement in each branch is a non-null value and the same type it's returned to the left hand of `=` |
17:13:38 | FromDiscord | <ElegantBeef> non-void |
17:14:20 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2UVm |
17:16:42 | FromDiscord | <DavidKunz> sent a code paste, see https://play.nim-lang.org/#ix=2UVn |
17:17:18 | FromDiscord | <ElegantBeef> can you throw it on here? https://play.nim-lang.org/ |
17:17:22 | FromDiscord | <DavidKunz> sure! |
17:17:55 | FromDiscord | <DavidKunz> let me create a minimal example first |
17:18:00 | FromDiscord | <Yardanico> https://therecord.media/github-investigating-crypto-mining-campaign-abusing-its-server-infrastructure/ |
17:20:56 | FromDiscord | <DavidKunz> https://play.nim-lang.org/#ix=2UVq |
17:21:13 | FromDiscord | <ElegantBeef> Ah |
17:21:27 | FromDiscord | <ElegantBeef> wrap it in`newLit(MyObj(...))` |
17:22:34 | FromDiscord | <DavidKunz> It worked! Thank you very much @ElegantBeef 🙂 |
17:22:45 | FromDiscord | <DavidKunz> Made my day |
17:22:48 | FromDiscord | <ElegantBeef> If this is all you're doing you dont need the `block:` |
17:22:57 | FromDiscord | <DavidKunz> Got it! Thank you |
17:24:11 | FromDiscord | <DavidKunz> In case others are interested, this is the working solution: https://play.nim-lang.org/#ix=2UVr |
17:25:00 | FromDiscord | <ElegantBeef> Helping lurkers... wild 😛 |
17:28:15 | * | algun joined #nim |
17:29:10 | algun | Hello everyone. Just picked up Nim today. And now I'm "attempting to call routine: 'walkDir'". Why doesn't nim want me to do that? |
17:30:27 | FromDiscord | <ElegantBeef> It's an iterator |
17:31:07 | FromDiscord | <ElegantBeef> so you need to `import std/os` and do `for dir in walkDir("path/to/walk")` |
17:31:55 | algun | So the functional approach is out of the question? I was thinking it would return an iterator, and I could toSeq it |
17:32:01 | algun | (at least) |
17:32:40 | FromDiscord | <ElegantBeef> ah you can `import std/sequtils` then do `toSeq(walkDir(args, ...))` |
17:33:08 | FromDiscord | <ElegantBeef> Presently iterators do not abide by the UFCS, so you have to pretend it's C with them |
17:35:44 | algun | Thanks ElegantBeef, that fixes that! |
17:35:59 | algun | But now I get "Error: typeless parameters are obsolete". Does nim not have type inference? |
17:36:44 | FromDiscord | <ElegantBeef> It does have type inference just not extreme backtracking inference |
17:38:31 | FromDiscord | <ElegantBeef> So you need to specify parameter types/return types |
17:38:48 | FromDiscord | <Solitude> and thats a good thing |
17:38:52 | algun | ElegantBeef: Does it have structural deconstruction? |
17:38:54 | FromDiscord | <ElegantBeef> I agree |
17:39:05 | FromDiscord | <ElegantBeef> Through macros yes |
17:39:07 | algun | Why? You value compilation time over convenience? |
17:39:46 | FromDiscord | <Solitude> i value looking at function and understanding what data it manipulates |
17:39:57 | FromDiscord | <ElegantBeef> I like having static function signatures that dont change cause i changed a function that was called internally |
17:40:27 | algun | Solitude: I'm just trying to process pairs with filter proc(first, second) = .. |
17:40:29 | FromDiscord | <Solitude> and overloading needs types |
17:41:24 | algun | C# does overloading and allows me to .Where((first, second) => ...) just the same |
17:41:41 | algun | (for just one) |
17:41:52 | FromDiscord | <Solitude> can you show a failing snippet |
17:43:10 | algun | actually, I'm not sure it does, its tuple implementation is new and lacking |
17:43:15 | algun | ok, sec |
17:43:37 | algun | https://play.nim-lang.org/#ix=2UVw |
17:44:24 | algun | u,v,w hehe 🧒 |
17:44:42 | algun | (i just added type annotations at line 24) |
17:46:39 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2UVx |
17:46:42 | FromDiscord | <ElegantBeef> Atleast how i'd do it |
17:47:07 | FromDiscord | <ElegantBeef> It does have tuple destructuring |
17:47:39 | algun | ok :( |
17:49:58 | FromDiscord | <ElegantBeef> Well `filter` takes a `proc(x: T)` so you need to do that |
17:50:11 | FromDiscord | <ElegantBeef> You could use `filterIt` and have it not use that anonymous procedure |
17:50:57 | FromDiscord | <ElegantBeef> Or you could use `sugar.collect` |
17:51:08 | FromDiscord | <Unaimend> Regarding the nimble project structure, is it allowed to have subfolders? I am having problems importing a src file which is in a subfolder in another package. |
17:51:33 | FromDiscord | <ElegantBeef> should be `packagename/subfile` |
17:51:42 | FromDiscord | <ElegantBeef> If it's a properly made nimble package |
17:52:24 | FromDiscord | <Unaimend> so `src/<packagename>/<subfolder>` is not allowed? |
17:52:48 | FromDiscord | <Unaimend> only `src/<packagename>/<subfile>` |
17:53:16 | FromDiscord | <ElegantBeef> You can have a subfolder |
17:54:19 | FromDiscord | <Unaimend> Ok, I am trying to import the files from io subfolder from this package at cant get it to work↵https://github.com/kerrycobb/PhylogeNi/tree/main/src/phylogeni |
17:54:38 | FromDiscord | <Yardanico> how are you doing it? |
17:54:46 | FromDiscord | <ElegantBeef> should just be `import phylogeni/io/newick` |
17:55:04 | FromDiscord | <ElegantBeef> or prefixed with `pkg/` if you live that life |
17:55:37 | FromDiscord | <Unaimend> In reply to @Yardanico "how are you doing": import phylogeni/io/newick |
17:55:57 | FromDiscord | <Unaimend> nvm. works. |
17:56:01 | FromDiscord | <Unaimend> I have to check sth |
17:56:11 | FromDiscord | <Yardanico> @ElegantBeef what if someone publishes a nim package called "pkg" :D |
17:56:19 | FromDiscord | <Yardanico> or "std" |
17:57:55 | algun | ElegantBeef: "untyped" scares me a bit |
17:57:57 | FromDiscord | <Unaimend> Because in this package it doesnt work ↵https://github.com/kerrycobb/nim-dna-seq/tree/main/src |
17:58:14 | FromDiscord | <Unaimend> maybe there is sth. wrong with my locale copy of it |
17:58:15 | algun | even though the code is much cleaner |
17:58:33 | FromDiscord | <haxscramper> there is nothing wrong with `untyped` |
17:59:09 | FromDiscord | <haxscramper> I.e. almost no debugging-resistant gotchas that you have to watch out for |
18:01:25 | FromDiscord | <Yardanico> @algun nim's "untyped" is only related to compile time |
18:01:40 | FromDiscord | <Yardanico> and it doesn't make the nim compiler not check the types, all types are still checked in the end |
18:01:48 | algun | Yardanico: that's the only time that matters ;) |
18:02:18 | algun | i'm not really joking really |
18:03:17 | algun | that sounds suspicious so let me be clear about what I think: Whatever can be handled compile time, should be handled compile time. Except if it takes a monad to do it. |
18:04:01 | FromDiscord | <Yardanico> yes, that's true |
18:04:09 | FromDiscord | <Yardanico> untyped is only related to compile time and it's only needed for templates/macros |
18:04:22 | FromDiscord | <Yardanico> when you don't want the compiler to do type checking on the code that is being passed to a template/macro |
18:04:31 | FromDiscord | <Yardanico> the code is still type checked in the end (after all transformations), so it's not unsafe |
18:04:42 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#templates-typed-vs-untyped-parameters |
18:05:14 | FromDiscord | <Yardanico> by saying "untyped" you say to the compiler "don't do semantic checking for the code that is being passed to a template/macro" |
18:05:39 | algun | because the template does it? |
18:05:59 | FromDiscord | <Yardanico> ? |
18:06:02 | algun | i don't know anything about templates |
18:06:04 | FromDiscord | <Yardanico> because the compiler does it after it evaluates the template |
18:06:07 | FromDiscord | <Yardanico> or the macro |
18:06:14 | algun | so then it is compile time, is it not? |
18:06:22 | FromDiscord | <Yardanico> yes, did I say that it's not? |
18:06:28 | FromDiscord | <Yardanico> you might not unterstand all of the things, but as I said, the compiler still checks all the code in the end |
18:06:35 | FromDiscord | <Yardanico> after all macro/template/etc transformations |
18:06:58 | algun | ok, I was afraid you meant it would be checked at run-time |
18:07:14 | algun | some dynamic typing affectionados like to point that out for some reason |
18:07:27 | FromDiscord | <Yardanico> again, nim is a statically compiled language |
18:07:27 | algun | no offense to dynamic typing affectionados |
18:07:45 | algun | Yardanico, no escape hatch? |
18:07:46 | FromDiscord | <zidsal> sent a long message, see http://ix.io/2UVK |
18:07:57 | FromDiscord | <Yardanico> you can do type erasure with pointers if you want of course |
18:07:58 | FromDiscord | <Yardanico> but why? |
18:08:19 | FromDiscord | <Yardanico> In reply to @zidsal "I have a weird": is == your own defined operator? |
18:08:22 | FromDiscord | <zidsal> yes |
18:08:25 | FromDiscord | <zidsal> for a ref type |
18:08:32 | FromDiscord | <Yardanico> maybe it's the difference of comparing references and their underlying data |
18:08:42 | algun | Yardanico, I wouldn't want to, I'm just forming a picture |
18:09:35 | algun | in any case thanks ElegantBeef and Yardanico for the chat, let me see if I can finish my prog now... |
18:14:31 | * | PMunch quit (Quit: leaving) |
18:20:55 | * | PMunch joined #nim |
18:30:54 | PMunch | More keyboard shenanigans, it's finally time for a nice layout DSL! https://www.twitch.tv/pmunche |
18:41:17 | algun | I haven yet to tested it, but I reckon this will be it: https://play.nim-lang.org/#ix=2UVT |
18:46:26 | FromDiscord | <Yardanico> now go and rewrite that to use sugar.collect or https://github.com/zero-functional/zero-functional |
18:46:37 | FromDiscord | <Yardanico> :P |
18:47:06 | FromDiscord | <Unaimend> Do we have sth. like mathplotlib? |
18:47:15 | FromDiscord | <Yardanico> matplotlib? yes |
18:47:22 | FromDiscord | <Yardanico> https://github.com/Vindaar/ggplotnim |
18:47:26 | FromDiscord | <Unaimend> In reply to @Yardanico "matplotlib*? yes": yeah, upsi |
18:47:27 | FromDiscord | <Unaimend> thx |
18:47:35 | FromDiscord | <Yardanico> and https://github.com/brentp/nim-plotly for plotly |
18:47:44 | FromDiscord | <Yardanico> ggplotnim is native nim though |
18:47:49 | algun | fixed: https://play.nim-lang.org/#ix=2UVX |
18:48:48 | algun | Yardanico: What's the advantage? Is it "iterable"? |
18:49:04 | FromDiscord | <Yardanico> sugar.collect is more nim-stylke |
18:49:06 | FromDiscord | <Yardanico> (edit) "nim-stylke" => "nim-style" |
18:49:14 | algun | More than the standard lib? |
18:49:15 | FromDiscord | <Yardanico> and zero functional is more efficient than sequtils |
18:49:15 | algun | Weird |
18:49:21 | FromDiscord | <Yardanico> sugar.collect is from the stdlib as well |
18:49:29 | FromDiscord | <Yardanico> https://nim-lang.org/docs/sugar.html#collect.m%2Cuntyped%2Cuntyped |
18:50:02 | FromDiscord | <Yardanico> also you don't really need regexes in your program, although they allow for a bit less code |
18:50:30 | algun | Please explain |
18:50:54 | FromDiscord | <Yardanico> you can do same string checks and captures via normal string operations |
18:50:55 | FromDiscord | <Yardanico> or strscans |
18:51:01 | FromDiscord | <Yardanico> https://nim-lang.org/docs/strscans.html |
18:51:12 | algun | I'm doing this program for a windows user, if I rewrite it in sugar.collections, will it compile just as well? |
18:51:19 | FromDiscord | <Yardanico> of course? |
18:51:22 | FromDiscord | <Yardanico> that's a nim stdlib module |
18:51:41 | FromDiscord | <Yardanico> and it's really better to rewrite regexes into strscans |
18:51:49 | FromDiscord | <Yardanico> because otherwise you'll have to ship pcre dll with your binary on windows |
18:52:23 | algun | ouch |
18:52:36 | FromDiscord | <Yardanico> can you show an example of what your program does so I can test it ? |
18:52:40 | algun | will do both then I guess :| |
18:53:25 | leorize[m] | there's also nim-regex if you want a native regex implementation |
18:53:32 | FromDiscord | <Yardanico> true |
18:54:47 | algun | Eh, it's a bit specialized. Basically, when you save a site, you get .html and images/. The prog finds all occurrences of image_N.EXT in the html, and then in the other in which it finds them, it copies them from images/ to images_ordered/, naming them sequentially (ie in order they appear on the site). Help provides a hint. |
18:55:15 | algun | *int the order |
18:57:29 | leorize[m] | htmlparser should get you the document tree which then you can just dig in to get all img tags |
18:58:05 | algun | is it stdlib? does it have dependencies? |
18:58:10 | FromDiscord | <Yardanico> it is stdlib |
18:58:18 | FromDiscord | <Yardanico> and why are you so resilent about using non-stdlib modules? |
18:58:29 | FromDiscord | <Yardanico> nim modules are compiled statically in the binary anyway |
18:58:37 | algun | ah, k |
18:58:40 | FromDiscord | <Yardanico> as long as they don't sure some dll dependencies (which most libraries don't) |
18:58:44 | FromDiscord | <Yardanico> (edit) "sure" => "use" |
18:58:52 | algun | except the stdlib regex ones ;) |
18:59:06 | FromDiscord | <Yardanico> yes, we have modules in the stdlib that use DLLs, but it's jusified :) |
18:59:09 | FromDiscord | <Yardanico> (edit) "jusified" => "justified" |
18:59:14 | FromDiscord | <Yardanico> like db_mysql |
18:59:29 | algun | mysql in the stdlib :S |
18:59:46 | FromDiscord | <Yardanico> why not? |
18:59:47 | FromDiscord | <Yardanico> https://nim-lang.org/docs/db_mysql.html |
19:00:10 | FromDiscord | <Yardanico> we have four db_ modules which offer almost the same API |
19:00:14 | FromDiscord | <Yardanico> so they can be swapped more-or-less easily |
19:00:15 | algun | hardly seems a "standard" thing |
19:01:50 | algun | I could understand an ORM with perhaps a SQLLite backend and other interchangable backends, but not shipping mysql/postgresql support. Surely seems an overkill. |
19:02:14 | FromDiscord | <Yardanico> don't see your point here honestly |
19:02:20 | FromDiscord | <Yardanico> it's not like we ship the mysql DLL |
19:06:15 | FromDiscord | <Yardanico> @algun i'm not sure if this is works as I don't know how to export the website that way, but here - https://play.nim-lang.org/#ix=2UW4 |
19:06:25 | FromDiscord | <Yardanico> with collect macro and nim-regex (install via `nimble install regex`) |
19:06:35 | FromDiscord | <Yardanico> or, if your app is a nimble package, add requires "regex" in your nimble file |
19:07:09 | FromDiscord | <Yardanico> ah, right, forgot to remove the "re" import, it's not needed |
19:07:26 | FromDiscord | <Yardanico> also sequtils is no longer needed |
19:08:04 | FromDiscord | <Yardanico> you can actually make your source_image_names an iterator so it will copy images as it finds them |
19:09:36 | FromDiscord | <Yardanico> https://play.nim-lang.org/#ix=2UW5 this uses the small enumerate stdlib package to add index as you seem to use it |
19:11:35 | algun | the for loop returns a seq? nice |
19:11:48 | FromDiscord | <Yardanico> with the collect macro - yes |
19:11:57 | FromDiscord | <Yardanico> with an iterator, the iterator's body is "inlined" into the loop |
19:14:14 | algun | i didn't quite get the way you put it, but yielding-returning for enumerators is a thing in C# too. That's why the first thing caught my eye |
19:14:32 | FromDiscord | <Yardanico> with both enumerate and the iterator inlined that loop will become something like this (rough approximation): |
19:14:49 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/k7R |
19:15:42 | FromDiscord | <Yardanico> enumerate just adds the `i` variable |
19:15:58 | FromDiscord | <Yardanico> but generally you don't need to care about those internal details :P |
19:31:57 | algun | how do I acquire pkg/regex? |
19:35:11 | liblq-dev | nimble install regex |
19:38:34 | algun | thanks, it was findAll that I need to change into findAndCaptureAll actually (i've decided to go with my code I'm afraid Yardanico) |
19:39:26 | algun | (liblq-dev that is, i did do nimble install regex, but the API difference didn't allow me to compile) |
20:03:08 | * | algun quit (Ping timeout: 265 seconds) |
20:09:07 | * | haxscramper joined #nim |
20:09:08 | * | haxscramper quit (Read error: Connection reset by peer) |
20:15:59 | FromDiscord | <Yardanico> @algun well my code had that changed already too |
20:16:18 | FromDiscord | <Yardanico> and there's not much difference between your and my code, I just generally pointed you to sugar.collect :) |
20:17:29 | * | kenran joined #nim |
20:17:46 | * | jess quit (Quit: updates) |
20:18:23 | * | Gustavo6046 quit (Ping timeout: 250 seconds) |
20:28:09 | ForumUpdaterBot | New post on r/nim by JellyFish_AZ: Difference between creating objects via functions, see https://reddit.com/r/nim/comments/mjgkeu/difference_between_creating_objects_via_functions/ |
20:28:56 | * | algun joined #nim |
20:31:19 | * | narimiran quit (Quit: leaving) |
20:34:34 | FromDiscord | <ElegantBeef> Nim has a rather batteries included stdlib so the general view is if it's an "important" package it should be easily accessed |
20:34:47 | FromDiscord | <ElegantBeef> Hell until recently C# didnt even have json in their stdlib |
20:36:30 | FromDiscord | <ElegantBeef> I think that if it's a commonly used library it makes sense to add to the stdlib, but ymmv 😄 |
20:38:55 | * | Gustavo6046 joined #nim |
20:38:57 | * | Gustavo6046 quit (Remote host closed the connection) |
20:39:35 | * | Gustavo6046 joined #nim |
20:43:54 | FromDiscord | <Conifer> Been studying Nim for a while and have to say I like where its going. Albeit not the biggest fan of indentations, but it's matter of getting used to it I guess. |
20:51:25 | FromDiscord | <mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2UWw |
20:52:38 | FromDiscord | <mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2UWy |
20:57:21 | FromDiscord | <mattrb> Turns out I can reduce it to just those 3 procs and it still behaves as described above https://play.nim-lang.org/#ix=2UWz |
20:58:13 | FromDiscord | <mattrb> If you just swap the type of the `bits` parameter on line 3 to `SomeInteger`, you can observe the same behavior in the playground |
21:03:03 | * | kenran quit (Remote host closed the connection) |
21:12:17 | FromDiscord | <ElegantBeef> In reply to @Yoshiharu "Been studying Nim for": Eh indentation wasnt cool before either, but Nim's isnt dumb like python's and you're going to write code the same way without indentation as with |
21:13:12 | FromDiscord | <ElegantBeef> @mattrb it's a bug with typeclasses and generics atm |
21:13:37 | FromDiscord | <mattrb> Is there an issue I can track? |
21:14:34 | FromDiscord | <ElegantBeef> Uhh i think there is a similar bug i can link you to in a moment, but the work around is `[immediate: static bool, I: SomeInteger]` afaik |
21:15:10 | FromDiscord | <ElegantBeef> I think it's the same isue as this one https://github.com/nim-lang/Nim/issues/17212 |
21:16:01 | FromDiscord | <mattrb> Awesome, ty! |
21:17:18 | * | jess joined #nim |
21:17:38 | FromDiscord | <ElegantBeef> Saem and I investigated it a bit(him mostly) and it just turned out the generics were getting evaluated weirdly when using inferred generics + explict |
21:18:23 | * | algun quit (Ping timeout: 246 seconds) |
21:24:44 | saem | (suddenly a wild Saem appears) |
21:25:06 | FromDiscord | <ElegantBeef> I woke you up checking on what you were working on 😄 |
21:25:07 | FromDiscord | <mattrb> sent a code paste, see https://paste.rs/MGv |
21:25:21 | FromDiscord | <ElegantBeef> Yea like i said inferred generic the `SomeInteger` type class + explicit doesnt plaay well |
21:25:32 | FromDiscord | <ElegantBeef> You can make that just `b: bool` and i think it still fails |
21:25:43 | FromDiscord | <mattrb> Yep, just wanted to post a reduced example 👍 |
21:25:48 | saem | I'm trying to figure out if I can figure out the branches of an object variant at runtime via NTI, in gdb land. |
21:26:03 | saem | it is not going well |
21:26:42 | FromDiscord | <G-force 4760> Hey People↵My name is Gonçalo and I'm form Portugal.↵I'm looking for a new language to learn and I just installed Nim on linux to give it a try.↵I'm interested in Scientific computing (Data Science, ML, AI and simulations), automation and Generative art. |
21:26:58 | * | algun joined #nim |
21:28:41 | * | leorize joined #nim |
21:33:28 | FromDiscord | <ElegantBeef> Ah you can just say you're a nerd 😛 (Jokes aside we've got stuff for that) |
21:34:03 | FromDiscord | <G-force 4760> In reply to @ElegantBeef "Ah you can just": I am indeed |
21:34:49 | FromDiscord | <G-force 4760> what do you guys recommend for generative art? I've seen bindings for p5js↵https://github.com/belamenso/p5.nim |
21:35:05 | FromDiscord | <ElegantBeef> More aimed towards games, but nico can do similar |
21:36:40 | saem | hmm, I thought there were some docs about run time type information. |
21:37:00 | FromDiscord | <ElegantBeef> saem this is it https://nim-lang.org/docs/typeinfo.html#runtime-type-information_1 |
21:37:17 | saem | thanks |
21:37:29 | FromDiscord | <ElegantBeef> I mean dont say it until you read it |
21:37:45 | FromDiscord | <G-force 4760> I found nim when looking for gba stuff lol↵It seems to me like python and rust had a baby, and then (Game of thrones style) you found out that C and Bash were also involved in that relationship hahaha↵https://www.youtube.com/watch?v=sZUM7MhWr88&t=496s |
21:38:06 | FromDiscord | <ElegantBeef> I always say it's just a modern wirth language, but yea |
21:38:36 | FromDiscord | <Yardanico> @G-force 4760 just FYI, Nim is older than Rust :) |
21:38:51 | FromDiscord | <G-force 4760> In reply to @Yardanico "<@!391274926541373441> just FYI, Nim": had no idea |
21:39:12 | FromDiscord | <ElegantBeef> It just has relatively little funding compared and as such is mostly a community language |
21:39:43 | FromDiscord | <konsumlamm> almost as if Nim was heavily inspired by wirth languages... |
21:40:00 | saem | now... I gotta figure out what if any of this I can use in gdb land. 🤔 |
21:40:01 | FromDiscord | <ElegantBeef> I mean that's the point |
21:40:04 | FromDiscord | <Yardanico> New Indented Modula |
21:40:26 | FromDiscord | <ElegantBeef> People say it's like python but aside from the indentation it's vastly different |
21:41:34 | FromDiscord | <G-force 4760> I just want to learn a language I can have fun with (JS does not make the cut for me) and since I'm going to be forced to learn c++ in Uni I need to learn a "fun" lower level language |
21:41:45 | FromDiscord | <ElegantBeef> Well then Nim sounds like the place |
21:42:28 | FromDiscord | <ElegantBeef> Plus you can always learn C++ by using the C++ backend and interop with it |
21:43:45 | FromDiscord | <G-force 4760> Nico also seems cool (since I've used pico8 before, but lua's tables starting at 1 is a bit weird lol) |
21:44:05 | FromDiscord | <Yardanico> nim arrays can start at whatever number you want |
21:44:29 | FromDiscord | <ElegantBeef> I dont like you pointing it out but yes |
21:44:41 | FromDiscord | <Yardanico> @ElegantBeef XD |
21:44:44 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/Bbc |
21:44:46 | FromDiscord | <Yardanico> need to add it to lesser known nim features |
21:44:50 | FromDiscord | <Yardanico> forgot to add it before |
21:44:52 | FromDiscord | <G-force 4760> lol |
21:44:56 | FromDiscord | <ElegantBeef> "You can fuck with your users" |
21:45:02 | FromDiscord | <ElegantBeef> Though that's useful for enum slices |
21:45:08 | FromDiscord | <G-force 4760> I guess that it may be useful sometimes |
21:45:18 | FromDiscord | <ElegantBeef> Especially since we have enum indexed arrays |
21:45:41 | FromDiscord | <G-force 4760> I need to go to bed, tomorrow I will dive deeper into nim thx for the help guys |
21:45:42 | FromDiscord | <ElegantBeef> No they arent hashtables |
21:45:57 | FromDiscord | <ElegantBeef> The amount of times i have to explain they arent fucking hashtables to people hurts |
21:46:00 | FromDiscord | <G-force 4760> (edit) "guys" => "guys/girls" |
21:46:16 | FromDiscord | <ElegantBeef> No problem buh bye and hurry back the indoctrination starts tomorrow |
21:46:18 | FromDiscord | <konsumlamm> you have to explain that arrays aren't ahsh tables? |
21:46:18 | FromDiscord | <ElegantBeef> I mean learning |
21:46:29 | FromDiscord | <konsumlamm> (edit) "ahsh" => "hash" |
21:46:38 | FromDiscord | <ElegantBeef> For some reason people think enum indexed arrays are some mad hashtables |
21:46:59 | FromDiscord | <ElegantBeef> Possibly due to the `enumVal: 10` syntax i guess |
21:47:17 | FromDiscord | <Yardanico> In reply to @ElegantBeef "The amount of times": ?????? |
21:47:42 | FromDiscord | <Yardanico> never seen someone thinking that enum indexed arrays are hash tables |
21:47:44 | FromDiscord | <Yardanico> in this chat at least |
21:47:50 | FromDiscord | <Yardanico> do you have a lot of people that you teach nim to? |
21:47:57 | FromDiscord | <Yardanico> private lessons? |
21:48:02 | FromDiscord | <ElegantBeef> Yea when i was making dusty with other people making a sand sim a fair bit of people thought it was a hash table |
21:48:28 | FromDiscord | <ElegantBeef> Nah i just write nim code occasionally to showcase it's features to people in another discord |
21:49:06 | FromDiscord | <ElegantBeef> Also to just mock the C++ code i see |
21:56:21 | * | algun quit (Ping timeout: 260 seconds) |
22:03:51 | saem | using private implementation in stdlib... what could go wrong? |
22:04:19 | FromDiscord | <ElegantBeef> What're you using? |
22:04:38 | saem | typeinfo.selectBranch |
22:11:31 | PMunch | Damn, this keyboard firmware code is getting pretty cool. Now I have layouts with macro buttons and that just takes 2342 bytes :D Compared to QMK which takes 12220 with all extra features disabled, or 21340 with the default config |
22:13:51 | PMunch | My firmware is less than 1/5th the size of the smallest QMK firmware, and that is while supporting some features that would be disabled in that configuration of QMK |
22:14:08 | PMunch | And the code is obviously nice and tidy :) |
22:14:42 | FromDiscord | <Yardanico> showing ther power of macros for embedded devices :) |
22:15:03 | PMunch | Yup! |
22:15:18 | FromDiscord | <ElegantBeef> Nice i still havent wrangled with tinyusb enough to actually get it to compile 😄 |
22:15:29 | FromDiscord | <ElegantBeef> but hey atleast linerino has colorful portals finally |
22:15:53 | PMunch | Of course I'll have to write a really headline-grabbing article about this when it is all done |
22:16:11 | PMunch | Maybe we'll got some more people interested in using Nim on microcontrollers :) |
22:16:22 | PMunch | @ElegantBeef, ooh nice! |
22:16:28 | * | filcuc_ joined #nim |
22:16:29 | FromDiscord | <Yardanico> and post it on sunday evening ETC |
22:16:33 | FromDiscord | <Yardanico> (edit) "ETC" => "EST" |
22:16:37 | FromDiscord | <Yardanico> for max hackernews points |
22:16:58 | FromDiscord | <ElegantBeef> Hey a fair bit of people starred the picotemplate/sdk repo, so already got some people interested |
22:18:33 | PMunch | @Yardanico, is that the best time? |
22:18:47 | FromDiscord | <Yardanico> some article from 2019 claims this |
22:18:53 | FromDiscord | <Yardanico> you better ask some people who know HN better than me :P |
22:19:55 | PMunch | @ElegantBeef, now they're almost too colourful |
22:20:03 | FromDiscord | <ElegantBeef> Jeez |
22:20:10 | FromDiscord | <ElegantBeef> Banned pmunch from playing linerino |
22:20:15 | FromDiscord | <dom96> just post it, if it doesn't hit the front page post again a few days later |
22:20:18 | PMunch | Haha :P |
22:20:19 | FromDiscord | <Yardanico> lol |
22:20:29 | FromDiscord | <Yardanico> just post it every day :) |
22:21:22 | FromDiscord | <Yardanico> @ElegantBeef why backspace instead of R to restart? 🤔 |
22:21:28 | FromDiscord | <Yardanico> to not hit accidentally? |
22:21:40 | FromDiscord | <Yardanico> I mean reset |
22:21:43 | FromDiscord | <Yardanico> oh there's no key for that |
22:21:51 | FromDiscord | <ElegantBeef> `x` |
22:21:58 | FromDiscord | <Yardanico> undocumented |
22:22:02 | FromDiscord | <Yardanico> :D |
22:41:38 | FromDiscord | <Conifer> In reply to @ElegantBeef "Eh indentation wasnt cool": Yeah, I can only hope so. It was one of the reasons why I was thrown off from Python.↵↵I suppose I can assume one wouldn’t have much trouble even following some Python based projects and remake them in Nim without much of a sweat/issue. |
22:41:43 | * | lritter quit (Quit: Leaving) |
22:41:56 | * | filcuc_ quit (Read error: Connection reset by peer) |
22:42:12 | * | filcuc_ joined #nim |
22:42:30 | * | filcuc_ quit (Read error: Connection reset by peer) |
22:42:42 | * | filcuc_ joined #nim |
22:43:57 | FromDiscord | <Yardanico> people overestimate nim's similarness to python |
22:44:12 | FromDiscord | <Yardanico> nim has almost nothing in common with python except the indentation |
22:45:40 | FromDiscord | <dom96> Nim is a better Python |
22:46:55 | FromDiscord | <Yardanico> maybe, but still, advertising nim as compiled python is not a good idea |
22:47:56 | * | filcuc_ quit (Quit: Konversation terminated!) |
22:48:05 | FromDiscord | <checkersai> In reply to @Yardanico "people overestimate nim's similarness": True |
22:48:12 | * | filcuc_ joined #nim |
22:48:32 | PMunch | Going back to Python from Nim it just feels so clunky now |
22:50:02 | FromDiscord | <ElegantBeef> what you dont like `\`? |
22:50:04 | FromDiscord | <Valor> how do i uninstall choosenim |
22:50:13 | * | filcuc_ quit (Read error: No route to host) |
22:50:16 | FromDiscord | <Valor> their gcc steupt is conflicting with my own |
22:50:27 | * | filcuc_ joined #nim |
22:51:49 | FromDiscord | <ElegantBeef> Should be as simple as removing it from your path, but am curious to what the interaction causing this issue is |
22:52:10 | FromDiscord | <Valor> choose nim is ... |
22:52:13 | FromDiscord | <Valor> not in my path |
22:53:00 | FromDiscord | <dom96> In reply to @Yardanico "maybe, but still, advertising": Why? |
22:53:17 | FromDiscord | <Yardanico> In reply to @dom96 "Why?": because it has much less similarities to python than people think |
22:53:27 | FromDiscord | <Yardanico> and if we advertise it as such, they'll think that it's "almost like" python |
22:53:30 | FromDiscord | <Yardanico> which it is totally not |
22:53:37 | FromDiscord | <Yardanico> it has been discussed on the forum a lot already |
22:53:41 | FromDiscord | <Valor> ok i think ill need to unintsall nim in general, how do i do that/ |
22:53:47 | FromDiscord | <Valor> both nim and choose nim |
22:54:02 | FromDiscord | <dom96> @Valor if you installed via choosenim then: remove ~/.choosenim and ~/.nimble |
22:54:21 | FromDiscord | <ElegantBeef> Syntax aside how is it similar to python |
22:54:26 | FromDiscord | <dom96> In reply to @Yardanico "because it has much": it has enough similarities to warrant the comparison |
22:54:30 | FromDiscord | <Yardanico> a good quote from the forum: |
22:54:32 | FromDiscord | <Yardanico> That is, you shouldn't approach Nim as a "compiled, statically typed Python", but rather more as a "C/C++ replacement with modern syntax, package system, metaprogramming and much more". Essentially, Nim is not to Python what Crystal is to Ruby. |
22:54:43 | FromDiscord | <Yardanico> https://forum.nim-lang.org/t/4128#25718 |
22:55:31 | * | filcuc_ quit (Quit: Konversation terminated!) |
22:55:36 | PMunch | Hmm, the USB HID specification has a definition for a Golf club.. |
22:55:39 | FromDiscord | <Valor> also to contribute to this convo, people are going to think it looks like python ... cuz it syntatically looks like pythn, lol |
22:55:42 | * | filcuc_ joined #nim |
22:55:57 | FromDiscord | <dom96> imports, exceptions, iterators and a lot of the syntax are enough similarities to make it usable as a "compiled python" |
22:56:52 | FromDiscord | <Yardanico> I'm not gonna argue any further, I get your point, but I still disagree :) sorry |
22:57:31 | FromDiscord | <dom96> The argument is "we shouldn't advertise it as a compiled Python" |
22:57:37 | FromDiscord | <dom96> I think we very much should |
22:57:58 | FromDiscord | <dom96> Even if we agree that the similarities are just on the surface |
22:58:08 | FromDiscord | <Yardanico> I don't like lying |
22:58:21 | PMunch | Porque no los dos? |
22:58:51 | FromDiscord | <dom96> There is at least one person that has found Nim because they were looking for a compiled Python (me) |
22:58:52 | PMunch | Advertise it as a fast alternative to Python to Python people, and a more modern C++ to C++ people |
22:58:59 | FromDiscord | <dom96> so it's hardly a lie |
22:59:13 | FromDiscord | <dom96> and I bet you I'm not the only one |
22:59:19 | FromDiscord | <ElegantBeef> I mean advertise it as a statically typed compiled language with syntax reminiscent to python |
22:59:33 | FromDiscord | <fenrave> It arguably sets a bad standard to call the language something that it isn't trying to be simply because it shares similar syntax. Its not exactly a compiled python alternative as much as its a C/C++ alternative. Advertising a different goal to different people can lead to serious confusion and create an identity crisis within the language itself as it really wouldn't know what it wants to be. |
22:59:51 | FromDiscord | <Yardanico> araq said that he's writing his nim vision document :) |
23:00:40 | * | filcuc_ quit (Read error: Connection reset by peer) |
23:00:42 | PMunch | I mean I think we can all agree that we shouldn't advertise Nim as "compiled Python" then people will imagine it as Cython or something like that with 1:1 syntax and stdlib |
23:00:43 | FromDiscord | <dom96> Nim is definitely closer to Python than C/C++ in my eyes |
23:00:52 | * | filcuc_ joined #nim |
23:00:59 | FromDiscord | <Yardanico> @PMunch exactly |
23:01:05 | FromDiscord | <fenrave> Nython |
23:01:06 | PMunch | It's closer to Python in syntax and "feel", but it's closer to C++ in speed and capabilities |
23:01:18 | FromDiscord | <ElegantBeef> A dynamically typed language that uses programmer contracts instead of actualy static safety? |
23:01:20 | FromDiscord | <Yardanico> We could call nim a compiled python if it was like crystal is to ruby, but it is totally not |
23:01:27 | FromDiscord | <dom96> PMunch: I just said that I think we should advertise it as a "compiled Python"... |
23:01:46 | FromDiscord | <dom96> So no, we can't all agree 😛 |
23:01:46 | PMunch | @fenrave, all sorts of things are advertised differently to different groups of people. It's all about setting it a context they recognise and understand |
23:02:07 | PMunch | Well, then I disagree with you :P |
23:02:31 | FromDiscord | <ElegantBeef> I mean if someone said to me "Hey this is compiled python" i'd have went off on rant about how bad python is then stuck carrots in my ears walking down a hill to my death |
23:02:32 | PMunch | I thought you meant we should advertise it as a compiled replacement to Python, which I can agree with |
23:02:36 | FromDiscord | <dom96> That's fine, but you know, Rust and Golang are currently the languages filling the "compiled Python" niche |
23:02:44 | PMunch | I mean it isn't compiled python, calling it that would just be a lie |
23:02:54 | FromDiscord | <fenrave> Its a fair bit different, this is a programming language that needs to be something consistent and concise, not an identity crisis |
23:03:02 | FromDiscord | <dom96> Marketing is rarely 100% accurate |
23:03:17 | FromDiscord | <fenrave> Makes you wonder why so many people have ad blocks then |
23:03:32 | PMunch | Yes but calling gasoline for frying oil isn't going to go down well.. |
23:04:06 | PMunch | I don't think it would cause an identity crisis, just attract people who come at the language from different angles |
23:04:10 | FromDiscord | <dom96> It all depends how you do it |
23:04:21 | FromDiscord | <dom96> and attracting more people to the language is always a good thing |
23:04:23 | PMunch | I mean depending on what you do Nim can look very different |
23:04:46 | FromDiscord | <fenrave> It would really depend on people understanding that Nim isn't purely a python alternative and that its a compiled language first and foremost |
23:04:53 | FromDiscord | <fenrave> which i imagine they would |
23:04:55 | PMunch | I have a slide in one of my presentations that compares some low level C interfacing code to some high level web code. Barely looks like the same language |
23:05:05 | FromDiscord | <fenrave> programmers are smarter than other places where it would become a problem |
23:05:46 | FromDiscord | <dom96> yeah |
23:05:50 | PMunch | I mean it's all about getting people interested in learning Nim. And you do that by showing them that it can be used in place of whatever they are using at the moment for some kind of benefit |
23:06:02 | FromDiscord | <dom96> and "compiled Python" can mean different things to different people |
23:06:13 | * | filcuc_ quit (Read error: No route to host) |
23:06:17 | PMunch | If a Pythonista is looking for speed and sees "This is how I sped up my Python program 4x by writing it in Nim" they are sure to check it out |
23:06:30 | * | filcuc_ joined #nim |
23:07:26 | PMunch | Similarly if a C programmer sees an article with "This Nim code is 1/5th the size, the same speed, and easier to read than my C code" they might well be piqued to read it |
23:08:40 | FromDiscord | <dom96> I already see a lot of people writing "Have you checked out Nim?" to posts asking for a compiled Python |
23:09:05 | FromDiscord | <dom96> I think we can all agree that we shouldn't discourage people from doing this |
23:09:12 | FromDiscord | <dom96> That's all I want 🙂 |
23:10:14 | PMunch | Oh no, I'm fine with that |
23:10:33 | PMunch | Advertising it to people looking for a compiled alternative to Python is a good idea |
23:10:54 | PMunch | Advertising it as a compiled Python is a bad idea IMO |
23:10:59 | * | filcuc_ quit (Read error: Connection reset by peer) |
23:11:12 | * | filcuc_ joined #nim |
23:11:34 | PMunch | Maybe someone should write a "Nim is not compiled Python, and here's why that's a good thing" |
23:12:08 | FromDiscord | <ElegantBeef> I think it's akin to saying C# is a compiled JS, meanwhile they're fairly different aside from the C-style syntax |
23:14:41 | FromDiscord | <ElegantBeef> "compiled alternative to python" is less misinforming than "compiled python" |
23:15:07 | FromDiscord | <ElegantBeef> But anywho |
23:15:15 | FromDiscord | <ElegantBeef> People can do what they want i'm just a numpty |
23:16:11 | * | filcuc_ quit (Quit: Konversation terminated!) |
23:16:23 | * | filcuc_ joined #nim |
23:21:21 | * | filcuc_ quit (Quit: Konversation terminated!) |
23:21:36 | * | filcuc_ joined #nim |
23:21:46 | FromDiscord | <checkersai> In reply to @dom96 "Nim is definitely closer": The only similarity is the indentation-based syntax. Python is a dynamically typed interpreted language, and Nim is a statically typed, compiled language. |
23:21:56 | FromDiscord | <checkersai> In reply to @fenrave "programmers are smarter than": doubt |
23:23:35 | FromDiscord | <dom96> In reply to @checkersai "The only similarity is": Like I wrote above, those aren't the only similarities |
23:24:39 | FromDiscord | <dom96> Another example: tuples |
23:26:08 | * | filcuc_ quit (Ping timeout: 246 seconds) |
23:28:26 | * | Vladar quit (Remote host closed the connection) |
23:28:45 | * | leorize quit (Ping timeout: 240 seconds) |
23:34:25 | * | leorize joined #nim |
23:49:38 | * | krux02 quit (Remote host closed the connection) |