00:12:13 | FromDiscord | <B L Â D É> how can i get pretty printing in vscode for debugging https://media.discordapp.net/attachments/371759389889003532/1013964315314888774/unknown.png |
00:14:20 | FromDiscord | <B L Â D É> sent a code paste, see https://play.nim-lang.org/#ix=4967 |
00:14:37 | FromDiscord | <Elegantbeef> There is a nim-gdb.py that might help but it doesnt solve everything |
00:14:49 | FromDiscord | <B L Â D É> sent a code paste, see https://play.nim-lang.org/#ix=4968 |
00:15:26 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4969 |
00:15:37 | FromDiscord | <!Patitotective> how do variable definitions work inside templates? |
00:15:42 | FromDiscord | <Elegantbeef> `let coord {.inject.}` |
00:15:50 | FromDiscord | <Elegantbeef> Of course they work |
00:15:56 | FromDiscord | <Elegantbeef> They're hygenic though |
00:15:57 | FromDiscord | <B L Â D É> In reply to @Elegantbeef "There is a nim-gdb.py": how can i do that with vscode? |
00:16:05 | FromDiscord | <B L Â D É> i don't want to debug on the terminal |
00:16:21 | * | wallabra_ joined #nim |
00:16:28 | FromDiscord | <Elegantbeef> if `nim-gdb` works it should be used |
00:17:01 | * | wallabra quit (Ping timeout: 252 seconds) |
00:17:05 | FromDiscord | <B L Â D É> I think i have it? https://media.discordapp.net/attachments/371759389889003532/1013965548045996183/unknown.png |
00:17:13 | FromDiscord | <B L Â D É> So is this the best i can get? |
00:17:24 | FromDiscord | <Elegantbeef> I think it should be used then, i might be wrong, i do not use debuggers |
00:17:52 | FromDiscord | <!Patitotective> In reply to @B L Â D É "i don't want to": im pretty sure there are some gui interfaces for the gdb |
00:18:00 | FromDiscord | <!Patitotective> but debugging from the terminal isnt that bad |
00:18:27 | * | wallabra_ is now known as wallabra |
00:18:47 | FromDiscord | <retkid> any ideas |
00:18:51 | FromDiscord | <retkid> i've spent a few hours on this |
00:18:59 | FromDiscord | <retkid> I cannot... figure out what the fuck is wrong with the zlib stream |
00:19:21 | FromDiscord | <!Patitotective> perhaps opening an issue to zippy (?) |
00:19:28 | FromDiscord | <retkid> i switched to zip |
00:19:29 | FromDiscord | <retkid> same problem |
00:20:17 | FromDiscord | <!Patitotective> actually beef, this is starting to be a mess↵ill better use exceptions ;] |
00:21:05 | FromDiscord | <retkid> we now have the beautifully helpful zip error:↵"Error: unhandled exception: invalid zlib stream parameter! [ZlibStreamError]" |
00:21:15 | FromDiscord | <!Patitotective> ~~(maybe even search for some parser designs out there)~~ |
00:21:54 | FromDiscord | <Elegantbeef> You can look at the stdlib json or packedjson |
00:22:57 | FromDiscord | <!Patitotective> :] |
00:23:37 | FromDiscord | <retkid> i give up I'm just too stupid to decompress a stream ¯\_(ツ)_/¯ |
00:23:56 | FromDiscord | <auxym> do we already have a constant in nim for a null pointer? Or should I use something like `cast[pointer](0)`? |
00:24:05 | FromDiscord | <Elegantbeef> `nil` |
00:24:16 | FromDiscord | <auxym> oh |
00:24:31 | FromDiscord | <Elegantbeef> you may need to do `pointer(nil)` depending |
00:27:13 | FromDiscord | <voidwalker> Is there really no effort to make a file downloading library that supports various file hosting services ? gdrive, onedrive, mega and so on. Everything that I know of (pyload, jdownloader, plowshare) is written in sucky languages (python, java, bash) |
00:27:20 | FromDiscord | <!Patitotective> they caught me https://media.discordapp.net/attachments/371759389889003532/1013968125164793896/unknown.png |
00:27:51 | FromDiscord | <retkid> encase anyone wants to try and figure it out (nobody does) heres the stream, lmao https://media.discordapp.net/attachments/371759389889003532/1013968256698171476/retkid.zlib |
00:28:13 | FromDiscord | <retkid> i shall make popcorn |
00:28:25 | FromDiscord | <!Patitotective> In reply to @voidwalker "Is there really no": well, i guess those services prove an api, so you should just use that |
00:28:30 | FromDiscord | <!Patitotective> (edit) "prove" => "provide" |
00:29:01 | FromDiscord | <voidwalker> the api is for registered/paying users usually, while there is a way to download the files without the API |
00:29:31 | FromDiscord | <!Patitotective> and that way is just a direct download link? |
00:29:49 | FromDiscord | <voidwalker> eventually yes, but you have to get to that link : ) |
00:30:07 | FromDiscord | <voidwalker> might involve all kinds of extra requests, maybe even javascript |
00:30:09 | FromDiscord | <!Patitotective> then you migh just use std/httpclient, chronos or puppy |
00:30:51 | FromDiscord | <!Patitotective> (btw this looks really cool to learn https://pgrandinetti.github.io/compilers/) |
00:31:26 | FromDiscord | <Elegantbeef> People generally only need a single download service, but you could wrap each api and download from them |
00:34:33 | FromDiscord | <voidwalker> yes, but there's many people, and many download services. Why a library for this would be nice to have |
00:36:44 | FromDiscord | <voidwalker> https://github.com/pyload/pyload/tree/main/src/pyload/plugins/downloaders |
00:36:52 | FromDiscord | <voidwalker> quite a lot of work to reproduce in nim |
00:37:53 | FromDiscord | <Shiba> is there a striped version of the stdlib without the new features |
00:37:59 | FromDiscord | <Shiba> (edit) "features" => "features?" |
00:38:17 | FromDiscord | <Elegantbeef> "the new features" |
00:38:41 | FromDiscord | <Require Support> anyone know whats `LPWSTR` in nim |
00:39:08 | FromDiscord | <!Patitotective> In reply to @Elegantbeef ""the new features"": the new features since the old features |
00:39:15 | FromDiscord | <Require Support> `array[<int>, wchar]` ? |
00:39:17 | FromDiscord | <Elegantbeef> Ah yes the new features! |
00:39:19 | FromDiscord | <⎝⪩﹏⪨⎠> What if I want to use RegExp in Nim. |
00:39:24 | FromDiscord | <Shiba> since 1.2 |
00:39:27 | FromDiscord | <Shiba> (edit) "1.2" => "1.2.O" |
00:39:39 | FromDiscord | <Elegantbeef> If you want 1.2.0 use 1.2.0 |
00:39:48 | FromDiscord | <Shiba> make sense |
00:39:58 | FromDiscord | <Shiba> right now i remember |
00:40:00 | FromDiscord | <Shiba> choosenim |
00:40:04 | FromDiscord | <auxym> In reply to @Elegantbeef "you may need to": yeah just nil seems to work, thanks! |
00:40:32 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/widestrs.html Require Support |
00:40:52 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "If you want 1.2.0": https://media.discordapp.net/attachments/371759389889003532/1013971529647783946/unknown.png |
00:41:07 | FromDiscord | <Elegantbeef> Patito wanna stop with that inanity? |
00:41:10 | FromDiscord | <Rika> In reply to @Patitotective "": https://media.discordapp.net/attachments/371759389889003532/1013971605224960131/95E8AABF-8DED-4541-9AE5-83616439FD1C.jpg |
00:41:35 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Patito wanna stop with": cmooon its really funny |
00:41:35 | FromDiscord | <Shiba> In reply to @Rika "": https://media.discordapp.net/attachments/371759389889003532/1013971712171323534/s-l500.jpg |
00:41:53 | FromDiscord | <Elegantbeef> Sorry i dont have any humour, so is it funny? |
00:42:08 | FromDiscord | <!Patitotective> rika said "lmao", that counts as funny to me |
00:42:20 | FromDiscord | <Rika> I think you missed the point |
00:42:35 | FromDiscord | <Shiba> idk anything that makes laugh |
00:42:37 | FromDiscord | <Shiba> i laugh |
00:42:50 | FromDiscord | <Shiba> (edit) "makes" => "makes"me"" |
00:43:25 | FromDiscord | <!Patitotective> do you want me beef to go back to the boring old nerd emoji? i think the cat is a lot better |
00:43:55 | FromDiscord | <Elegantbeef> Can you look up the word sarcasm |
00:43:55 | FromDiscord | <Elegantbeef> I always forget what it means |
00:44:26 | FromDiscord | <⎝⪩﹏⪨⎠> I used to know how to use RegExp. |
00:44:34 | FromDiscord | <⎝⪩﹏⪨⎠> But with Lua and TypeScript. |
00:44:46 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Can you look up": ;-; |
00:45:06 | FromDiscord | <⎝⪩﹏⪨⎠> I used it for my Discord bot to react with a 👃 every time someone said "che" or "nose". |
00:45:07 | FromDiscord | <Elegantbeef> there are two regex modules in the stdlib and regex on nimble |
00:45:12 | FromDiscord | <Elegantbeef> Choose one then start working |
00:45:25 | FromDiscord | <Elegantbeef> Regex isnt the best tool for the job in most cases |
00:45:26 | FromDiscord | <Elegantbeef> So... yea |
00:45:27 | FromDiscord | <⎝⪩﹏⪨⎠> I choosed the one that came out of the box. |
00:45:44 | FromDiscord | <⎝⪩﹏⪨⎠> I only need it to search for numbers. |
00:45:50 | FromDiscord | <⎝⪩﹏⪨⎠> In a string. |
00:46:00 | FromDiscord | <Elegantbeef> So then why would you use regex |
00:46:02 | FromDiscord | <Rika> Then you can just use the naive search |
00:46:11 | FromDiscord | <Rika> Regex is overkill for that |
00:46:15 | FromDiscord | <⎝⪩﹏⪨⎠> Because I'm familiar with RegExp. |
00:46:28 | FromDiscord | <⎝⪩﹏⪨⎠> At leas tin Lua. |
00:46:34 | FromDiscord | <⎝⪩﹏⪨⎠> (edit) "leas" => "least" |
00:46:38 | FromDiscord | <⎝⪩﹏⪨⎠> (edit) "tin" => "in" |
00:46:39 | FromDiscord | <Require Support> @ElegantBeef i love you, i finally got it to work thanks to you |
00:46:47 | FromDiscord | <Rika> I think string utilities in Lua are pretty fucked so I understand |
00:46:54 | FromDiscord | <Elegantbeef> Shit not even my parents do that! |
00:47:45 | FromDiscord | <Shiba> In reply to @Rika "I think string utilities": nah its okay , i already used love 2d |
00:48:18 | FromDiscord | <Shiba> (edit) "In reply to @Rika "I think string utilities": nah its okay , i already used love 2d ... " added ", some frameworks that has lua provide their own libaries" |
00:48:37 | FromDiscord | <⎝⪩﹏⪨⎠> What's the matter with using RegExp. |
00:48:53 | FromDiscord | <Elegantbeef> Regular expressions are complicated statements that are hard to read and understand |
00:49:14 | FromDiscord | <Shiba> (edit) "love 2d" => ""love 2D"" |
00:49:36 | FromDiscord | <Elegantbeef> I tend to find they're overused for cases they arent needed for, but what do i know |
00:50:20 | FromDiscord | <Rika> “They’re so overused that the thing that people call regular expressions aren’t even actual regular expressions anymore” |
00:50:33 | FromDiscord | <⎝⪩﹏⪨⎠> In reply to @Elegantbeef "Regular expressions are complicated": I know how to read them. |
00:50:52 | FromDiscord | <Rika> In reply to @⎝⪩﹏⪨⎠ "I know how to": He didn’t say “that people don’t know how to read” |
00:50:53 | FromDiscord | <Elegantbeef> What does this do? |
00:50:55 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=496b |
00:50:59 | FromDiscord | <⎝⪩﹏⪨⎠> In reply to @Elegantbeef "What does this do?": Stuff. |
00:51:00 | FromDiscord | <Rika> He said “people have a hard time reading it” |
00:51:02 | FromDiscord | <⎝⪩﹏⪨⎠> :trolo: |
00:51:11 | FromDiscord | <⎝⪩﹏⪨⎠> Of course, I'm not that insane. |
00:51:16 | FromDiscord | <Rika> In reply to @⎝⪩﹏⪨⎠ "Stuff.": Stuff DEEZ NUTS UP YOUR MOUTH OOOOOOO |
00:51:32 | FromDiscord | <⎝⪩﹏⪨⎠> I'm a normal person that breaths oxygen and lives in the planet Earth. |
00:51:35 | FromDiscord | <Elegantbeef> Rika with such a low brow joke i think we've regressed in evolution |
00:51:37 | FromDiscord | <Rika> Sorry it was there I couldn’t pass up the opportunity |
00:51:55 | FromDiscord | <Rika> Forgive me as it is not past ten am yet |
00:52:03 | FromDiscord | <Rika> I’m still initialising |
00:53:12 | FromDiscord | <Shiba> In reply to @⎝⪩﹏⪨⎠ "I'm a normal person": me 2 , except i smoke weed with elon on mars |
00:54:06 | FromDiscord | <⎝⪩﹏⪨⎠> sent a code paste, see https://paste.rs/7ky |
01:01:21 | * | pmp-p left #nim (#nim) |
01:04:29 | FromDiscord | <!Patitotective> sent a code paste, see https://paste.rs/Ibn |
01:09:36 | * | rockcavera quit (Remote host closed the connection) |
01:18:31 | * | wallabra quit (Ping timeout: 260 seconds) |
01:18:50 | * | rockcavera joined #nim |
01:18:50 | * | rockcavera quit (Changing host) |
01:18:50 | * | rockcavera joined #nim |
01:23:31 | FromDiscord | <!&luke> sent a code paste, see https://play.nim-lang.org/#ix=496h |
01:25:02 | * | wallabra joined #nim |
01:43:00 | FromDiscord | <Shiba> what does it mean....? https://media.discordapp.net/attachments/371759389889003532/1013987166390591559/Untitled.png |
01:44:29 | FromDiscord | <Rika> Somewhere something tried accessing an index out of bounds |
01:45:40 | FromDiscord | <Shiba> so the compiler doesnt have any idead |
01:45:42 | FromDiscord | <Shiba> (edit) "idead" => "idea" |
01:47:41 | FromDiscord | <Rika> If you compile on debug it might |
01:48:01 | FromDiscord | <Rika> Oh it already is |
01:48:03 | FromDiscord | <Rika> Weird then |
01:48:36 | FromDiscord | <Rika> Oh I didn’t see that one line over there, the warning might be contributing to the issue |
01:50:03 | FromDiscord | <Shiba> ok , now with debug https://media.discordapp.net/attachments/371759389889003532/1013988943387176970/Screenshot_2022-08-30_02-49-22.png |
01:50:51 | FromDiscord | <Rika> I don’t know, it kinda reads like something is fucked with a package you’re using |
01:53:14 | FromDiscord | <!Patitotective> code would help |
01:55:37 | FromDiscord | <Shiba> i was just using incremental , and its 100% broken |
01:55:50 | FromDiscord | <Shiba> iam just gonna wait until 1.8 |
01:55:53 | FromDiscord | <Elegantbeef> yea ic isnt stable |
02:02:30 | FromDiscord | <halc> sent a code paste, see https://paste.rs/2sJ |
02:04:14 | * | arkurious quit (Quit: Leaving) |
02:12:14 | FromDiscord | <halc> someone should make a programming language with the qualities of regex |
02:12:17 | FromDiscord | <halc> easy to write |
02:12:27 | FromDiscord | <halc> but once you're done, nobody will ever know what that does |
02:12:33 | FromDiscord | <halc> (edit) "easy to write ... " added "a program" |
02:12:41 | FromDiscord | <halc> not even yourself |
02:13:23 | FromDiscord | <Rainbow Asteroids> so like assembly |
02:15:25 | FromDiscord | <Rika> There’s a good amount of languages like that already no? |
02:16:08 | FromDiscord | <Shiba> brainflip |
02:16:23 | NimEventer | New post on r/nim by Dafab: Json Manipulation Help, see https://reddit.com/r/nim/comments/x16wpq/json_manipulation_help/ |
02:17:42 | FromDiscord | <halc> In reply to @Rika "There’s a good amount": I guess some golfing langs would meet those qualities |
02:17:52 | FromDiscord | <Shiba> (edit) "brainflip" => "brainf" |
02:18:07 | FromDiscord | <Shiba> (edit) "brainf" => "brainfu" |
02:29:12 | FromDiscord | <!Patitotective> this looks much better, doesn it beef? https://github.com/Patitotective/kdl-nim/blob/main/src/kdl/new_lexer.nim |
02:33:04 | FromDiscord | <Elegantbeef> Clean |
02:33:04 | FromDiscord | <Elegantbeef> `lexer.source[lexer.current..^1].runes` will be a performance issue eventually |
02:34:39 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "`lexer.source[lexer.current..^1].runes` will be a": then, is better `runeAt`? |
02:35:46 | FromDiscord | <Elegantbeef> The issue is the copy, one needs to replace `string` with `openarray[char]` in `unicode` |
02:36:54 | FromDiscord | <Generic> why do you even decode the utf8 in the first place? |
02:37:15 | FromDiscord | <Elegantbeef> KDL has a limited range of valid characters for an identifier |
02:37:47 | FromDiscord | <!Patitotective> yep |
02:37:48 | FromDiscord | <Generic> yeah but it only checks for those below code point 32 |
02:38:00 | FromDiscord | <Generic> and that's also possible without decoding utf8 |
02:40:16 | FromDiscord | <!Patitotective> but, i still need to iterate through each rune to check if that rune has an invalid codepoint↵for example, `💀 ` would fail since i dont know how many bytes 💀 takes↵or how would you achieve it? |
02:41:09 | FromDiscord | <Generic> no that's the ingenuity of utf 8 |
02:41:44 | FromDiscord | <Elegantbeef> It uses non extended ascii doesnt it, so uses the LSB to indicate when it's apart of another code point eh? |
02:42:08 | FromDiscord | <Generic> yep |
02:45:01 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "It uses non extended": what is LSB? |
02:45:07 | FromDiscord | <Generic> least significant bit |
02:45:26 | FromDiscord | <Generic> it should have been msb though, it's the most significant bit |
02:48:40 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=496t |
02:56:07 | FromDiscord | <Require Support> does nim support unc paths? `walkDir("\\\\<ip>\\c$")` |
03:45:38 | FromDiscord | <Girvo> sent a long message, see http://ix.io/496F |
03:46:07 | FromDiscord | <Girvo> (edit) "long message," => "code paste," | "http://ix.io/496F" => "https://play.nim-lang.org/#ix=496G" |
03:46:09 | FromDiscord | <Girvo> How do other libraries/projects deal with this? |
03:46:23 | FromDiscord | <Elegantbeef> Generally the header should start with the package name |
03:46:35 | FromDiscord | <Elegantbeef> I mean the define |
03:46:37 | FromDiscord | <Elegantbeef> I'm dumb 😄 |
03:47:57 | FromDiscord | <Girvo> Hah I knew what you meant |
03:48:12 | FromDiscord | <Girvo> `nim-libsodium` is the package name, would `libsodium` be fine in this case? |
03:48:40 | FromDiscord | <Elegantbeef> Probably |
03:49:21 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=496H |
03:52:58 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=496I |
03:54:04 | FromDiscord | <Elegantbeef> `const hdr {.strdefine.} = "<sodium.h>"` |
03:54:54 | FromDiscord | <Girvo> Oh cheers. What's that pragma do? Other cases I've done worked without it in some of my other code doing similar things |
03:55:19 | FromDiscord | <Girvo> Does `const hdr = libsodiumHeader` also need it? I'll look it up |
03:55:23 | FromDiscord | <Elegantbeef> It uses `"<sodium.h>"` by default otherwise `-d:libSodiumHeader="myHeader"` |
03:55:30 | FromDiscord | <Girvo> Oh thats awseome |
03:55:33 | FromDiscord | <Girvo> Perfect |
03:56:25 | FromDiscord | <Girvo> Would the `hdr` const need to be named `libsodiumHeader` for it to pick up the right define? |
03:56:49 | FromDiscord | <Elegantbeef> Yes |
03:56:56 | FromDiscord | <Girvo> Sweet, thats clearer anyway |
03:57:24 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=496J |
03:57:45 | FromDiscord | <Elegantbeef> I dont remember if you can use `header` with `dynlib` but if you can that might be easier |
03:58:53 | FromDiscord | <Girvo> Maybe, but in my case I can't use dynlib at all, unless I'm misunderstanding what you mean |
03:59:28 | FromDiscord | <Elegantbeef> dynlib override is what i'm suggesting here |
03:59:32 | FromDiscord | <Elegantbeef> But i dont know if that makes it easier |
04:00:13 | FromDiscord | <Girvo> Yeah I'm on the same page -- we don't have dynamic linking at all in our build system is all 🙂 |
04:00:28 | FromDiscord | <Girvo> It's all just static object from C sources lol |
04:00:34 | FromDiscord | <Girvo> object files |
04:00:43 | FromDiscord | <Elegantbeef> Yea i know |
04:03:11 | FromDiscord | <Elegantbeef> When you use the `dynlib` annotation you can override the imports and statically link, but it's a whole ordeal |
04:03:21 | FromDiscord | <Girvo> I do really want to look into it though, as we _can_ load ELF files into memory and execute them but it's labeled as experimental. And there is no file system, which makes dynlibs... complicated |
04:03:23 | FromDiscord | <Girvo> Ah interesting |
04:03:33 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/nimc.html#dynliboverride briefly explains it |
04:03:56 | FromDiscord | <Elegantbeef> I dont know what is better to use really |
04:04:00 | FromDiscord | <Girvo> Ah I see, its passing linker options? |
04:04:09 | FromDiscord | <Girvo> Or controlling them, rather |
04:04:09 | FromDiscord | <Elegantbeef> Yea that was the issue |
04:04:15 | FromDiscord | <Girvo> If it's purely for desktop, that would be fantastic |
04:04:18 | FromDiscord | <Elegantbeef> I remember the issue for you with this now |
04:04:27 | FromDiscord | <Girvo> In our case, Nim isn't doing any linking 😦 CMake is |
04:04:30 | FromDiscord | <Elegantbeef> You have to move the linking step into your tooling |
04:04:33 | FromDiscord | <Girvo> Yep |
04:04:51 | FromDiscord | <Girvo> Which is on the to-do list, as I'm certain it can be achieved, but that'll have to wait til we've got this board revision out in the field |
04:06:57 | FromDiscord | <Girvo> And nimscript/Nim in general would be much nicer than the CMake magic that exists currently in PlatformIO/ESP-IDF |
04:07:11 | FromDiscord | <Elegantbeef> Looks at pico, yes |
04:10:18 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=496M |
04:10:57 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=496N |
04:11:31 | FromDiscord | <Girvo> Huh, seems the ESP-IDF port of libsodium has some complications with nim-libsodium? |
04:12:52 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=496O |
04:13:09 | FromDiscord | <Elegantbeef> Seems it's wanting `unsigned char` vs. `char` |
04:13:18 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=496P |
04:14:38 | FromDiscord | <Girvo> I'll check the ESP-IDF component version of libsodium (theres a built in one, and a separate component now. No idea why... Espressif does weird things) and see if that has unsigned char in there too |
04:14:41 | FromDiscord | <tandy> what are you working on if you dont mind me asking?↵(@Girvo) |
04:14:46 | FromDiscord | <tandy> nim for embedded is interesting |
04:15:47 | FromDiscord | <Girvo> @tandy It's an industrial IoT sensor platform 🙂 built on top of the ESP32 (-S3 now) and STM32 platforms. Nim's been great, beats the pants off writing all this in C and C++ |
04:18:25 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=496Q |
04:19:18 | FromDiscord | <Girvo> https://github.com/jedisct1/libsodium/blob/master/src/libsodium/crypto_box/crypto_box_easy.c#L52↵That's the exact same as the actual regular libsodium source |
04:19:56 | FromDiscord | <Girvo> I guess the existing nim-libsodium got away with it because of `dynlib` rather than checking against the actual header? |
04:19:56 | FromDiscord | <Elegantbeef> \Doesnt remember what `NIM_CHAR` is |
04:20:27 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=496S |
04:21:02 | FromDiscord | <Elegantbeef> Yea since it's dynamically loaded the type mismatch wasnt evident |
04:21:10 | FromDiscord | <Girvo> Damn. |
04:22:20 | FromDiscord | <Girvo> `cuchar` is deprecated |
04:23:06 | FromDiscord | <Girvo> But `char` should be unsigned by default, no? |
04:23:06 | FromDiscord | <Elegantbeef> It might be the case of using `byte`, i dont really know |
04:23:19 | FromDiscord | <Girvo> https://nim-lang.org/docs/system.html#char at least if the doc is correct |
04:24:17 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=496T |
04:24:54 | FromDiscord | <Elegantbeef> Yea it behaves as untyped afaik, so it's odd this appears |
04:25:46 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=496U |
04:26:30 | FromDiscord | <Elegantbeef> Perhaps `ptr byte` then and import them as `ptr byte` instead |
04:26:48 | FromDiscord | <Girvo> Yeah I'll have a fiddle |
04:27:12 | FromDiscord | <Elegantbeef> Really though i'd imagine `Nim_Char` to be `unsigned char` |
04:27:19 | FromDiscord | <Elegantbeef> Perhaps a query in #internals |
04:27:22 | FromDiscord | <Elegantbeef> is in order |
04:28:27 | FromDiscord | <Girvo> Yeah |
04:31:48 | FromDiscord | <proton> How about to write Nim official website in Nim? |
04:31:59 | FromDiscord | <proton> (edit) "to write" => "writing" |
04:32:06 | FromDiscord | <Elegantbeef> Opposed to writing it in Nim? |
04:32:41 | FromDiscord | <proton> why |
04:32:45 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1014029886916145202/image.png |
04:33:22 | FromDiscord | <Girvo> `ptr cuchar` instead of `ptr char` works, sigh |
04:35:06 | FromDiscord | <flywind> Does `ptr uint8` work? |
04:35:19 | FromDiscord | <Elegantbeef> It should |
04:35:51 | FromDiscord | <Elegantbeef> Actually it probably wont due to it using stddint |
04:37:23 | FromDiscord | <Girvo> I tried `ptr byte` initially but it broke a lot of the bindings further down and I was too lazy to go into them for right this second |
04:37:54 | FromDiscord | <Girvo> But I'm more stumped by why `NIM_CHAR` is `char` and not `unsigned char` in `nimbase.h` when all the docs state it should be unsigned... |
04:38:16 | FromDiscord | <Girvo> Which the author of nim-libsodium seemed to assume as well. I would've done the same thing lol |
04:38:16 | FromDiscord | <Elegantbeef> Yea it's a bit odd |
04:38:33 | FromDiscord | <Elegantbeef> Though doesnt that error go the otherway aswell? |
04:38:44 | FromDiscord | <Elegantbeef> like `char` would be incompatible with `cstring` |
04:39:21 | FromDiscord | <Girvo> Not srue |
04:39:23 | FromDiscord | <Girvo> sure, even |
04:41:14 | FromDiscord | <flywind> Imo the documentation for `char` seems wrong and `cuchar` should be undeprecated. |
04:42:55 | FromDiscord | <Girvo> @flywind I honestly agree with you, modulo something I'm missing here :/ |
04:42:59 | FromDiscord | <flywind> Probably, `char` is unsigned in early C compiler implementation. |
04:43:01 | FromDiscord | <Girvo> `char` isn't unsigned at all |
04:43:09 | FromDiscord | <Girvo> Yeah possibly |
04:43:36 | FromDiscord | <Girvo> Oh well, I can use `cuchar` for now, but it does mean I can't put the PR up for nim-libsodium 😦 |
04:47:17 | FromDiscord | <Girvo> I wonder how much changing the `NIM_CHAR` typedef to `unsigned char` would break lol |
05:13:48 | FromDiscord | <d4rckh> is there any way to tell the nim compiler not to include these error messages? https://media.discordapp.net/attachments/371759389889003532/1014040215821766686/unknown.png |
05:21:14 | FromDiscord | <Elegantbeef> Doubtful |
05:35:13 | FromDiscord | <Girvo> Whats everyones preferred storage engine (ideally to a file) aside from SQLite for Nim usage? |
05:35:34 | FromDiscord | <Elegantbeef> Wait people store data |
05:36:14 | FromDiscord | <Girvo> _shakes fist at game developers and their weird habits_ |
05:36:17 | * | rockcavera quit (Remote host closed the connection) |
05:36:24 | FromDiscord | <Elegantbeef> Lol |
05:36:30 | FromDiscord | <Elegantbeef> I just use a binary serialiser and carry on |
05:36:42 | FromDiscord | <Elegantbeef> Though for versioned saves i do have that `vershun` toy |
05:37:40 | FromDiscord | <Girvo> Haha if I didn't need slightly more, I'd be doing exactly that lol |
05:38:15 | FromDiscord | <Girvo> I might go with leveldb, might work well for this for now. It'll eventually be chucked into Postgres, but that's for someone else to deal with, not me |
05:38:41 | FromDiscord | <Elegantbeef> Statically typed versioned data is pretty nifty though |
05:38:54 | FromDiscord | <Elegantbeef> One day i'll play with a DB, one day |
05:40:27 | FromDiscord | <Elegantbeef> Though i'm likely to make my own language before then 😛 |
05:42:45 | FromDiscord | <Girvo> hahaha |
05:45:30 | FromDiscord | <Girvo> LiteStore is exactly what I was after actually. nice. |
05:46:33 | FromDiscord | <Elegantbeef> Oh that's made by the dev of min |
05:46:38 | FromDiscord | <Elegantbeef> Nifty |
05:50:29 | FromDiscord | <Girvo> Yeah, seems well written and architected too. |
05:55:27 | FromDiscord | <Rika> Why aside from SQLite |
05:57:28 | FromDiscord | <Girvo> I couldn't be arsed writing a schema 😛 |
05:57:49 | FromDiscord | <Ras> litestore is backed by sqlite anyways iirc |
06:06:27 | FromDiscord | <EyeCon> There's also CBOR. I will never stop mentioning CBOR. |
06:07:20 | FromDiscord | <⎝⪩﹏⪨⎠> So, what do you think about my use of RegExp? https://media.discordapp.net/attachments/371759389889003532/1014053689612308490/unknown.png |
06:07:47 | FromDiscord | <⎝⪩﹏⪨⎠> Small, simple and spew all the tokens I wanted from my test. |
06:08:03 | FromDiscord | <⎝⪩﹏⪨⎠> (edit) "Small, simple and spew all the ... tokens" added "correct" |
06:09:43 | FromDiscord | <⎝⪩﹏⪨⎠> Test: https://media.discordapp.net/attachments/371759389889003532/1014054285060886558/unknown.png |
06:09:46 | FromDiscord | <Elegantbeef> It's fine but it's pretty much just `parseWhile(Digits)` |
06:10:08 | FromDiscord | <⎝⪩﹏⪨⎠> Result: https://media.discordapp.net/attachments/371759389889003532/1014054394381205544/unknown.png |
06:11:15 | FromDiscord | <⎝⪩﹏⪨⎠> Oh wait, some bug, I'll fix it easy. |
06:11:53 | FromDiscord | <⎝⪩﹏⪨⎠> Fixed: https://media.discordapp.net/attachments/371759389889003532/1014054832987967498/unknown.png |
06:12:18 | FromDiscord | <⎝⪩﹏⪨⎠> In reply to @Elegantbeef "It's fine but it's": Plz don't make me feel like I'm in C++. |
06:12:48 | FromDiscord | <⎝⪩﹏⪨⎠> Whenever I was doing a C++ program, some dude in the Discord server would say: "there's a library/function for that". |
06:13:05 | FromDiscord | <⎝⪩﹏⪨⎠> (edit) "that"." => "that in the STD/STL"." |
06:13:25 | FromDiscord | <⎝⪩﹏⪨⎠> That's why I changed from C++ to Nim. |
06:13:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4977 |
06:14:06 | FromDiscord | <Elegantbeef> I mean i dislike use of regex |
06:14:13 | FromDiscord | <EyeCon> In reply to @⎝⪩﹏⪨⎠ "Whenever I was doing": How is that a bad thing? Would you prefer a weaker stdlib? |
06:14:30 | FromDiscord | <Elegantbeef> They apparently dont like getting told they can write code differently |
06:14:39 | FromDiscord | <⎝⪩﹏⪨⎠> In reply to @EyeCon "How is that a": I felt like I didn't know the program and I felt overwhelmed. |
06:14:46 | FromDiscord | <⎝⪩﹏⪨⎠> (edit) "program" => "programming language" |
06:15:00 | FromDiscord | <Elegantbeef> I mean the above is simpler than regex if you ask me |
06:15:11 | FromDiscord | <Girvo> One upside is that Nims standard library is better documented 🙂 |
06:15:48 | * | PMunch joined #nim |
06:15:54 | FromDiscord | <EyeCon> Well, C++ is a low bar |
06:16:05 | FromDiscord | <⎝⪩﹏⪨⎠> I'm just starting, don't punish me like if I were a professional already. |
06:16:36 | FromDiscord | <Elegantbeef> Actuall that should be `value: tok` 😄 |
06:16:42 | FromDiscord | <Elegantbeef> No one is punishing you |
06:16:42 | FromDiscord | <EyeCon> If you felt what I wrote as a punishment, I'll shut up, sure |
06:17:44 | FromDiscord | <Elegantbeef> Nim also has less questionable design choices in it's builtin types... Glares at `std::vector<bool>`↵(@Girvo) |
06:18:43 | FromDiscord | <Elegantbeef> "We've optimized the size of a specific vector, hopefully you never need a pointer to this or anything else" |
06:18:48 | FromDiscord | <Girvo> hahaha |
06:19:41 | FromDiscord | <Girvo> You should see the horror that is `esp_modem` -- its C++, but with a C header file thats done entirely with macros of macros. It's layers of pain |
06:28:46 | FromDiscord | <Phil> Is the complete aversion to just write out variable names something that is simply inherent to C/C++ coding or sth? |
06:29:34 | FromDiscord | <Phil> (edit) "sth?" => "sth - and infects you from that point onward?" |
06:40:13 | FromDiscord | <d4rckh> https://nim-lang.org/docs/json.html#pairs.i%2CJsonNode |
06:40:22 | FromDiscord | <d4rckh> can anyone check if this function gets stuck if they do something like this |
06:40:54 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=497d |
06:41:03 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=497d" => "https://play.nim-lang.org/#ix=497e" |
06:41:07 | FromDiscord | <d4rckh> here |
06:41:11 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=497e" => "https://play.nim-lang.org/#ix=497f" |
06:42:23 | FromDiscord | <Rika> No I get an error where it says data isn’t found |
06:42:51 | FromDiscord | <d4rckh> for some reason it compiles fine for me and will just stop execution of the function i use it (causing the function to not return anything) |
06:42:58 | FromDiscord | <d4rckh> (edit) "for some reason it compiles fine for me and will just stop execution of the function i use it ... (causing" added "in" |
06:51:03 | FromDiscord | <Girvo> In reply to @Isofruit "Is the complete aversion": Yeah it seems like it lol. Layers of inscrutable abstraction is the name of the C++ game |
06:52:06 | FromDiscord | <⎝⪩﹏⪨⎠> Sorry if I overreacted, but first I want to learn how to write interpreters/compilers, the language (Nim) and learn the libraries along the way/latter. |
06:53:08 | NimEventer | New thread by Halloleo: How to install packages via nimble on a machine without internet, see https://forum.nim-lang.org/t/9418 |
06:54:56 | FromDiscord | <Phil> In reply to @⎝⪩﹏⪨⎠ "Sorry if I overreacted,": I found libraries to always be something on a "look at it when you need it" manner.↵The second it seems like something is so standard it should already exist I start looking for procs in libs, otherwise often one lib or another pops up during debates about my code here that I then take a look at. |
06:55:17 | FromDiscord | <Phil> (edit) "In reply to @⎝⪩﹏⪨⎠ "Sorry if I overreacted,": I found libraries to always be something ... onbasis.↵The" added "to use" | "manner.↵The" => "basis.↵The" |
06:57:39 | FromDiscord | <d4rckh> im trying to make my own `std/prelude` for some files that have same imports, i wrote a `prelude.nim` file and put all of my imports in it but nim warns me that i didnt use in the prelude file |
06:58:27 | FromDiscord | <enthus1ast> when you export it this error should be gone |
06:58:41 | FromDiscord | <enthus1ast> also, import the prelude not include it |
06:58:53 | FromDiscord | <enthus1ast> this warning i mean |
06:59:11 | FromDiscord | <d4rckh> and how do i export? |
06:59:27 | FromDiscord | <enthus1ast> import foo↵export foo |
06:59:28 | FromDiscord | <d4rckh> (edit) "export?" => "export the imports?" |
06:59:35 | FromDiscord | <d4rckh> ugh thats gonna be a bit ugly |
06:59:37 | FromDiscord | <⎝⪩﹏⪨⎠> Is there a way I can iterate over every value of an enum? |
07:00:16 | FromDiscord | <enthus1ast> for elem in enum.low .. enum.high\:↵works imho |
07:00:27 | FromDiscord | <Elegantbeef> `for elem in MyEnum` |
07:00:42 | FromDiscord | <⎝⪩﹏⪨⎠> Ok thanks. |
07:01:30 | * | sagax joined #nim |
07:03:09 | NimEventer | New thread by Pp: Info about gcc compiler options used by nim, see https://forum.nim-lang.org/t/9419 |
07:05:30 | FromDiscord | <Stuffe> is there any way to get line errors for nil reference access errors? |
07:05:47 | FromDiscord | <Elegantbeef> It should give a line |
07:06:12 | FromDiscord | <Stuffe> I just get "Error: execution of an external program failed: `sompath`" |
07:06:23 | FromDiscord | <Elegantbeef> !eval var a = new int; echo a[] |
07:06:28 | NimBot | 0 |
07:06:36 | FromDiscord | <Elegantbeef> Fuck i'm dumb |
07:06:51 | FromDiscord | <Elegantbeef> !eval var a = (ref int)(nil); echo a[] |
07:06:56 | NimBot | Traceback (most recent call last)↵/usercode/in.nim(1) in↵SIGSEGV: Illegal storage access. (Attempt to read from nil?)↵Segmentation fault (core dumped) |
07:07:05 | FromDiscord | <Stuffe> let me create a reduced example of what i have |
07:07:25 | FromDiscord | <d4rckh> can i somehow run a function when a function i called with asyncCheck finisheD? |
07:07:31 | FromDiscord | <d4rckh> (edit) "function" => "proc" |
07:07:34 | FromDiscord | <d4rckh> (edit) "finisheD?" => "finished?" |
07:08:00 | FromDiscord | <Elegantbeef> You can add a callback to the future then await that |
07:08:59 | FromDiscord | <d4rckh> i dont want to add more code to my proc |
07:09:02 | FromDiscord | <d4rckh> (edit) "i dont want to add more code to my proc ... " added "async" |
07:09:14 | FromDiscord | <Elegantbeef> Not to your proc async, as a callback to the future |
07:10:23 | FromDiscord | <d4rckh> i dont have a future? |
07:10:28 | FromDiscord | <d4rckh> (edit) "have a" => "return" |
07:10:29 | FromDiscord | <d4rckh> (edit) "i dont return ... future?" added "a" |
07:10:39 | FromDiscord | <Phil> In reply to @d4rckh "i dont return a": Nice save |
07:10:53 | FromDiscord | <Elegantbeef> Your async code creates a future |
07:11:01 | FromDiscord | <Elegantbeef> if you call an async procedure you get a future |
07:11:16 | FromDiscord | <Girvo> https://nim-lang.org/docs/asyncfutures.html#addCallback%2CFutureBase%2Cproc%29 |
07:11:51 | FromDiscord | <Girvo> It's like `.then` in Javascript |
07:12:01 | FromDiscord | <d4rckh> yeah thats what im looking for |
07:12:13 | FromDiscord | <Girvo> And the same way that all `async` functions return `Promise<T>` in JS, same here in Nim, except its `Future[T]` |
07:22:18 | FromDiscord | <d4rckh> i see, thanks @Girvo and elegantbeef 😄 |
07:23:59 | FromDiscord | <d4rckh> ok looks like if i call another await function in the function i asyncCheck it wont execute my callback? |
07:25:14 | PMunch | Did you remember to await or asyncCheck that function? |
07:26:12 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=497o |
07:26:19 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=497o" => "https://play.nim-lang.org/#ix=497p" |
07:26:27 | FromDiscord | <d4rckh> its a cli program |
07:26:45 | FromDiscord | <d4rckh> i want to have it reset some things after a command ran |
07:26:57 | FromDiscord | <d4rckh> (edit) "i want to have it reset some things after a command ran ... " added "(all are ran using asyncCheck)" |
07:27:05 | FromDiscord | <d4rckh> some commands await other stuff |
07:28:01 | FromDiscord | <d4rckh> if i execute a command that doesnt have any awaits in it the callback gets executed normally but if the function is more advanced it doesnt |
07:28:21 | FromDiscord | <d4rckh> and the biggest difference is the usage of await |
07:29:16 | PMunch | And the whole execProc completes? Including all the awaited things? |
07:29:29 | FromDiscord | <d4rckh> i remove the await from the function and the cb gets executed |
07:29:39 | FromDiscord | <d4rckh> i added an echo at the end of the function (after the await) and it does complete |
07:29:48 | PMunch | Then it seems like the thing you await doesn't complete |
07:30:01 | PMunch | Hmm, that's weird |
07:30:44 | PMunch | Hard to tell without a more complete sample though |
07:32:07 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=497r |
07:32:28 | FromDiscord | <d4rckh> when this finishes executing, it wont execute my callback |
07:32:49 | FromDiscord | <d4rckh> this will tho |
07:32:52 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=497t |
07:33:51 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=497u |
07:34:28 | FromDiscord | <d4rckh> oh |
07:34:33 | FromDiscord | <d4rckh> 🤔 |
07:35:33 | FromDiscord | <d4rckh> nvm, its weird that if i remove the second await only it works normally |
07:35:39 | FromDiscord | <retkid> I thought that if I used STDERR out, I would be able to not include it in the STDout for the pipe |
07:35:40 | FromDiscord | <d4rckh> (edit) removed "nvm," |
07:35:46 | FromDiscord | <retkid> but it appears to be getting swepped up in there |
07:35:50 | FromDiscord | <retkid> what am i doing wrong? |
07:35:57 | PMunch | @retkid, yup |
07:36:10 | FromDiscord | <retkid> hmm |
07:36:18 | FromDiscord | <retkid> maybe i had an echo in there last time i tried |
07:36:37 | PMunch | If you only use stderr.writeLine then all that should be written to stderr and not be piped to the next application |
07:36:51 | PMunch | (Unless of course you do 2>&1) |
07:37:05 | FromDiscord | <retkid> i just use stderr.write |
07:37:10 | FromDiscord | <retkid> .-. |
07:37:32 | FromDiscord | <retkid> i use | for pipes |
07:37:41 | PMunch | Yeah, that should work |
07:37:52 | PMunch | And you don't have any stdout.write by accident? |
07:39:24 | FromDiscord | <retkid> i might have had an echo somewhere |
07:39:42 | FromDiscord | <retkid> is there anyway to use treeform's print in stderr out? |
07:40:24 | PMunch | treeforms print? |
07:41:05 | FromDiscord | <retkid> https://github.com/treeform/print |
07:42:35 | FromDiscord | <retkid> seems not |
07:48:59 | PMunch | Well |
07:49:02 | PMunch | You can use dup2 |
07:49:18 | FromDiscord | <flywind> Is there a better solution for https://github.com/nim-lang/Nim/issues/19006#issuecomment-1231271759 except adding an empt check logic for ARC/ORC? |
07:49:37 | FromDiscord | <flywind> (edit) "empt" => "empty string" |
07:49:53 | FromDiscord | <retkid> In reply to @PMunch "You can use dup2": what the hell is dup2 🤔 |
07:50:43 | FromDiscord | <voidwalker> what should I search for to find examples of proc with "type1 | type2", and how they work ? |
07:51:06 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#generics-type-classes |
07:52:07 | FromDiscord | <enthus1ast> not exactly, but maybe reopen helps https://nim-lang.org/docs/io.html#reopen%2CFile%2Cstring%2CFileMode↵(@retkid) |
07:52:41 | PMunch | @retkid, http://ix.io/497D/nim |
07:53:06 | FromDiscord | <planetis> In reply to @flywind "Is there a better": there are: https://forum.nim-lang.org/t/8188 |
07:54:10 | FromDiscord | <retkid> In reply to @PMunch "<@217459674700578816>, http://ix.io/497D/nim": slightly hideous |
07:54:24 | FromDiscord | <retkid> how expensive is this? |
07:54:27 | PMunch | I mean it's possible to clean it up :P |
07:54:39 | PMunch | $5 |
07:54:47 | FromDiscord | <retkid> can i write a template that executes a void statement? |
07:54:56 | FromDiscord | <retkid> teplate(print(42)) |
07:55:01 | PMunch | What do you mean? |
07:55:08 | FromDiscord | <retkid> (edit) "teplate(print(42))" => "template(print(42))" |
07:55:28 | PMunch | Ah you want to create a template that swaps stderr and stdout? |
07:55:44 | FromDiscord | <retkid> yea |
07:55:46 | PMunch | I mean you could, no idea about performance though |
07:56:03 | FromDiscord | <retkid> i'll put it behind a debug compile arg |
07:56:05 | PMunch | You are fiddling with files, but they are "files" so who knows |
07:56:15 | PMunch | Why do you need this anyways? |
07:56:22 | FromDiscord | <retkid> stuff that works in pipes |
07:56:27 | FromDiscord | <retkid> i wanna have debug stuff |
07:56:35 | FromDiscord | <retkid> print is perty |
07:56:53 | * | xet7 joined #nim |
07:57:18 | FromDiscord | <flywind> In reply to @planetis "there are: https://forum.nim-lang.org/t/8188": Cool, thanks |
07:57:34 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/1014081430134984714/unknown.png |
07:57:55 | FromDiscord | <retkid> implementation isn't piped because of some archaine error in a library i wrote i cant figure out |
07:58:35 | FromDiscord | <retkid> yes im doing ldpc encoding stuff |
07:58:42 | FromDiscord | <retkid> probably gonna write my own library for it... eventually |
07:58:53 | FromDiscord | <retkid> i gotta read about it and understand it more |
08:01:39 | * | PMunch quit (Remote host closed the connection) |
08:02:01 | * | PMunch joined #nim |
08:02:11 | PMunch | retkid, something like this works: http://ix.io/497J/nim |
08:03:22 | FromDiscord | <retkid> PMC do you know anything about the zip? |
08:03:25 | FromDiscord | <retkid> (edit) removed "the" |
08:03:55 | FromDiscord | <Elegantbeef> PME\ 😛 |
08:04:05 | FromDiscord | <retkid> PMU |
08:04:39 | * | Vladar joined #nim |
08:05:52 | PMunch | Was that aimed at me? |
08:05:59 | PMunch | I know plenty about zip |
08:06:00 | FromDiscord | <Elegantbeef> I assume so |
08:06:09 | FromDiscord | <Elegantbeef> Apparently pmunch is too much to type |
08:06:27 | PMunch | In IRC it's just PM<tab> |
08:06:56 | FromDiscord | <retkid> In reply to @PMunch "I know plenty about": I was having a problem decoding the zlib stream from a png file |
08:07:06 | FromDiscord | <retkid> dooooo you know why might this be |
08:07:14 | FromDiscord | <retkid> because i couldn't figure it out |
08:08:48 | PMunch | Do you use pure DEFLATE, or do you actually try to use zip? |
08:10:08 | FromDiscord | <retkid> uncompress(parseHexStr(readBuffer(true)). stream=DETECT_STREAM) |
08:10:17 | FromDiscord | <retkid> (edit) |
08:10:29 | FromDiscord | <retkid> yea |
08:10:32 | FromDiscord | <retkid> weird code i know |
08:10:45 | FromDiscord | <retkid> (edit) "> uncompress(parseHexStr(readBuffer(true)). stream=DETECT_STREAM)" => "sent a code paste, see https://play.nim-lang.org/#ix=" |
08:10:53 | FromDiscord | <retkid> in context it makes sense for a prototype |
08:11:10 | FromDiscord | <retkid> (edit) |
08:11:19 | PMunch | Try stream=RAW_DEFLATE |
08:11:27 | madprops | PMunch, PMunch PMunch |
08:11:37 | FromDiscord | <retkid> I thought about trying that |
08:11:40 | FromDiscord | <retkid> then i was like |
08:11:48 | FromDiscord | <retkid> "eh its probably .rar encoding" |
08:12:01 | PMunch | And have you implemented the filtering? |
08:12:13 | PMunch | madprops, are you trying to summon me Bloody Mary style? |
08:12:21 | madprops | yes and it worked |
08:12:22 | FromDiscord | <retkid> I have implemented nothing besides PLTE |
08:12:27 | PMunch | @retkid, naw it's pure deflate |
08:12:46 | FromDiscord | <4zv4l> how do I remove an element from an `openarray` ? |
08:12:57 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/1014085297123893308/unknown.png |
08:13:00 | FromDiscord | <retkid> nah it doesn't like me |
08:13:52 | FromDiscord | <Elegantbeef> You cannot change the length of an open array↵(@4zv4l) |
08:14:27 | FromDiscord | <4zv4l> cannot append or remove element from it ? |
08:14:27 | PMunch | @retkid, uhm that seems like a bug |
08:14:35 | PMunch | Have you tried with zippy? |
08:14:41 | FromDiscord | <retkid> same problem |
08:14:42 | FromDiscord | <retkid> i assume its me |
08:14:50 | FromDiscord | <retkid> but the data should be valid |
08:14:58 | FromDiscord | <retkid> the image reads fine |
08:15:08 | PMunch | Same problem? You get a ZlibStreamError when you try zippy? |
08:15:17 | FromDiscord | <retkid> ye |
08:15:27 | FromDiscord | <retkid> zippy says its a checksum issue |
08:15:28 | PMunch | Then you didn't do it right :P |
08:15:30 | PMunch | Ah |
08:15:56 | FromDiscord | <retkid> I am certain, unless im not suppose to include the last 3 00 00 00 bytes |
08:15:58 | FromDiscord | <retkid> of the stream |
08:16:04 | FromDiscord | <retkid> but i probably tried that |
08:16:33 | FromDiscord | <Elegantbeef> Openarray allows `array` and `slices` of a sequence |
08:16:43 | FromDiscord | <Elegantbeef> How would you remove an element |
08:17:17 | PMunch | @retkid, did you pass dfDeflate to the zippy call? |
08:17:25 | PMunch | It shouldn't do checksum testing |
08:17:29 | FromDiscord | <retkid> i passed zippy |
08:17:34 | FromDiscord | <retkid> (edit) "zippy" => "zlib" |
08:17:47 | PMunch | Yeah, that's wrong |
08:17:50 | PMunch | It's deflate |
08:17:54 | FromDiscord | <4zv4l> alright, I thought openarray were like sequence |
08:18:06 | FromDiscord | <Elegantbeef> No `seq[T]` is like a sequence |
08:18:22 | FromDiscord | <4zv4l> when is an openarray useful for example ? |
08:18:25 | FromDiscord | <Elegantbeef> Openarray is a convergence type for all arrays and sequences specialised on their T |
08:18:46 | FromDiscord | <4zv4l> so that can be a seq or a slice or an array ? |
08:18:48 | FromDiscord | <Elegantbeef> An open array is useful whenever you want to have a 0 cost slice of an array or sequence, or what a procedure that specialises on array/seqs |
08:19:18 | FromDiscord | <4zv4l> alright |
08:19:37 | FromDiscord | <4zv4l> thank you ^^ |
08:20:19 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=497P |
08:20:32 | FromDiscord | <4zv4l> example:↵`partsSums(@[0, 1, 3, 6, 10]) == @[20, 20, 19, 16, 10, 0]` |
08:20:57 | FromDiscord | <Elegantbeef> So just slide the slice |
08:21:15 | FromDiscord | <4zv4l> slide the slice ? |
08:21:24 | FromDiscord | <Elegantbeef> You're allocating a whole seq doing `ls[index..ls.len - 1]` |
08:21:32 | FromDiscord | <Elegantbeef> here i'll rewrite this |
08:21:53 | FromDiscord | <4zv4l> In reply to @Elegantbeef "You're allocating a whole": why allocating ? |
08:21:59 | PMunch | By the way @retkid, why aren't you just using nimPNG? |
08:22:01 | FromDiscord | <Elegantbeef> Cause it's a slice |
08:22:17 | FromDiscord | <Elegantbeef> Slices are copies since nim doesnt have any save way to hold onto a openarray |
08:22:19 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=497R |
08:22:19 | FromDiscord | <4zv4l> why need to allocate ? |
08:22:19 | FromDiscord | <retkid> In reply to @PMunch "By the way <@217459674700578816>,": writing too slow |
08:22:26 | FromDiscord | <Elegantbeef> Cause you cannot safely hold onto that |
08:22:36 | FromDiscord | <4zv4l> alright |
08:23:06 | FromDiscord | <retkid> for zippy |
08:23:13 | FromDiscord | <retkid> sent a code paste, see https://paste.rs/0sc |
08:23:23 | FromDiscord | <retkid> i have no idea what form of the data it wants |
08:23:39 | FromDiscord | <retkid> does it want in bytes, in hex characters, in hex values? |
08:23:52 | FromDiscord | <retkid> i tried all 3 none worked |
08:24:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=497T |
08:24:56 | FromDiscord | <retkid> (edit) "bytes," => "bytes(0, 1, 255)," | "characters," => "characters(0,1,FF)," | "values?" => "values(\00, \01, \i forget the character) ?" |
08:25:01 | FromDiscord | <Elegantbeef> `toOpenArray` is a 0 cost slice |
08:25:06 | FromDiscord | <Elegantbeef> So no allocation |
08:25:28 | FromDiscord | <AlexG> sent a code paste, see https://play.nim-lang.org/#ix=497U |
08:25:32 | FromDiscord | <4zv4l> why isn't `idk[i..ls.high]` using toOpenArray by default ? |
08:25:47 | FromDiscord | <Elegantbeef> to make this faster we could do `result = newSeqOfCapt[int](ls.len + 1)` |
08:25:58 | FromDiscord | <Elegantbeef> Cause nim by default does not have a mechanism to safely hold onto slices |
08:26:04 | FromDiscord | <Elegantbeef> Do i have to say this multiple times 😄 |
08:26:26 | FromDiscord | <Elegantbeef> Just make that \`cstring"clap.latence" |
08:26:26 | FromDiscord | <4zv4l> I just don't totally understand |
08:26:44 | FromDiscord | <retkid> @PMunch if you wanna see the file, i linked it recently |
08:26:46 | FromDiscord | <Elegantbeef> You cannot safely hold onto `toOpenArray` as such it has to be eaten by a procedure or iterator directly |
08:26:55 | FromDiscord | <Elegantbeef> It's unsafe to be able to hold onto an open array |
08:27:05 | FromDiscord | <Elegantbeef> Cause you do not know the lifetime of the collection you're borrowing from |
08:27:15 | FromDiscord | <4zv4l> alllright, gotcha |
08:27:24 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=497V |
08:27:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=497W |
08:27:50 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=497V" => "https://paste.rs/Wrq" |
08:28:00 | FromDiscord | <4zv4l> wouldn't nim allocate a on the heap then ? |
08:28:10 | FromDiscord | <Elegantbeef> No cause an array is stack allocated |
08:28:29 | FromDiscord | <4zv4l> then get a warning at compile time ? |
08:28:45 | FromDiscord | <Elegantbeef> That's what a borrow checker is for |
08:28:58 | FromDiscord | <Elegantbeef> Which is an experimental feature Nim has and will eventually be on by default |
08:29:23 | FromDiscord | <4zv4l> In reply to @Elegantbeef "to make this faster": I looked at the doc but I don't get why is would be faster |
08:29:33 | FromDiscord | <Elegantbeef> Cause you preallocate the array |
08:29:34 | FromDiscord | <Gabben> In reply to @4zv4l "why isn't `idk[i..ls.high]` using": Because [view types](https://nim-lang.org/docs/manual_experimental.html#view-types) are experimental |
08:29:37 | FromDiscord | <d4rckh> oh nim turning into rust haha 😅 |
08:29:40 | PMunch | @retkid, it neends the data in bytes |
08:29:41 | FromDiscord | <Elegantbeef> That means you do not grow it as the procedure goes |
08:29:42 | FromDiscord | <Gabben> (edit) "[view types](https://nim-lang.org/docs/manual_experimental.html#view-types)" => "view types (https://nim-lang.org/docs/manual_experimental.html#view-types)" |
08:29:53 | FromDiscord | <Elegantbeef> No nim isnt turning into rust, it's getting features that make it easier to write fast and safe code |
08:30:07 | FromDiscord | <retkid> In reply to @PMunch "<@217459674700578816>, it neends the": as in (0, 1,2,3,255) |
08:30:20 | PMunch | Sure |
08:30:24 | FromDiscord | <Elegantbeef> Nim's generally in the view that the programmer is always right, which is why it's move semantics are generally nice to use |
08:30:50 | FromDiscord | <Elegantbeef> Instead of throwing an error when you cannot move memory Nim copies the data assuming you did want that |
08:31:46 | FromDiscord | <4zv4l> I personally am not a huge fan of Rust |
08:32:08 | FromDiscord | <4zv4l> I chose Zig for doing low level programming |
08:32:19 | FromDiscord | <4zv4l> and Nim is becoming my default programming language |
08:32:31 | FromDiscord | <Elegantbeef> Cool not many are a fan of rust here |
08:32:31 | FromDiscord | <retkid> nim has long since become my default |
08:32:39 | FromDiscord | <retkid> i... honestly |
08:32:41 | FromDiscord | <Elegantbeef> It has good ideas but less than amazing solutions |
08:32:41 | FromDiscord | <retkid> prefer c to rust |
08:33:06 | FromDiscord | <Elegantbeef> Eh C is garbage so i'd take Zig, Odin, Rust over it |
08:33:10 | FromDiscord | <4zv4l> In reply to @Elegantbeef "Cool not many are": well I tend not liking community that are comparable to religious community |
08:33:13 | FromDiscord | <Elegantbeef> C++ is probably the only language i wouldnt take over it |
08:33:15 | FromDiscord | <retkid> C isn't that bad |
08:33:20 | FromDiscord | <retkid> its |
08:33:22 | FromDiscord | <retkid> standard |
08:33:25 | FromDiscord | <retkid> quaint |
08:33:29 | FromDiscord | <Elegantbeef> C's type system or lack therefore is the worst |
08:33:36 | FromDiscord | <retkid> which is why i dont usei t |
08:33:59 | FromDiscord | <retkid> but when I read C code, I know what im getting into |
08:34:08 | FromDiscord | <retkid> i cant say the same for rust and c++ |
08:34:15 | FromDiscord | <4zv4l> so I tried your code |
08:34:18 | FromDiscord | <4zv4l> https://media.discordapp.net/attachments/371759389889003532/1014090673013674045/unknown.png |
08:34:26 | FromDiscord | <4zv4l> still not fast enough, I'm gonna try the thing you told me with sequence |
08:34:28 | FromDiscord | <retkid> i fucking despise c++ |
08:34:31 | FromDiscord | <retkid> i dont understand |
08:34:34 | FromDiscord | <retkid> how they dropped the ball so much |
08:34:53 | FromDiscord | <4zv4l> In reply to @Elegantbeef "to make this faster": that will create a new seq right ? so allocate memory again ? |
08:34:54 | FromDiscord | <Elegantbeef> Is this even building with release? |
08:35:03 | FromDiscord | <4zv4l> I don't know, I don't control the test code |
08:35:23 | FromDiscord | <retkid> In reply to @PMunch "Sure": please be my sanity check and check it https://media.discordapp.net/attachments/371759389889003532/1014090948298424320/retkid.zlib |
08:35:32 | FromDiscord | <Elegantbeef> It allocates a large chunk of memory before so you dont constantly grow it |
08:35:49 | FromDiscord | <retkid> i honestly would like a programming language with less GC so i can do my own stuff |
08:35:56 | FromDiscord | <retkid> sometimes |
08:35:58 | FromDiscord | <retkid> not all the time |
08:36:08 | FromDiscord | <Elegantbeef> Eh GC isnt a problem when you have Arc/Orc |
08:36:23 | FromDiscord | <retkid> I just like memory management |
08:36:25 | FromDiscord | <retkid> maybe im ill |
08:36:45 | FromDiscord | <Elegantbeef> I very much find that it's just doing the compilers job |
08:37:06 | PMunch | @retkid, I'm on IRC so those file transfers don't work great.. |
08:37:22 | FromDiscord | <retkid> i can find the file bit by bit |
08:37:26 | FromDiscord | <retkid> would that help |
08:38:06 | FromDiscord | <retkid> https://tmpfiles.org/29487/retkid.zlib |
08:38:56 | PMunch | What is that file? |
08:39:27 | FromDiscord | <4zv4l> even like that it says it's too slow https://media.discordapp.net/attachments/371759389889003532/1014091972069314640/unknown.png |
08:39:28 | FromDiscord | <retkid> the ZLIB stream im failing to decompress |
08:39:42 | PMunch | @retkid, again, it's not zlib.. It's just deflate |
08:39:48 | FromDiscord | <retkid> (╯°□°)╯︵ ┻━┻ |
08:39:59 | PMunch | I've told you like 100 times now |
08:40:25 | FromDiscord | <4zv4l> that's written in the exo detail↵`Take a look at performance: some lists have thousands of elements` |
08:40:40 | FromDiscord | <retkid> its not my fault im misinformed https://media.discordapp.net/attachments/371759389889003532/1014092278056361994/unknown.png |
08:41:15 | FromDiscord | <Rika> In reply to @4zv4l "even like that it": Perhaps it’s the approach you’re taking? |
08:41:21 | FromDiscord | <4zv4l> yeah |
08:41:27 | FromDiscord | <4zv4l> I don't see how to do differently and faster |
08:41:32 | FromDiscord | <d4rckh> okay... the future callbacks work fine with `await`, but not always with `asyncCheck` |
08:42:24 | FromDiscord | <4zv4l> or maybe I simply keep the sum in a variable and substract the number I remove each time ? |
08:42:34 | FromDiscord | <Rika> Iterate through the list in reverse, have an accumulator variable and add that to the end of the list every iteration then add the next value to the accumulator |
08:42:34 | FromDiscord | <4zv4l> instead of looping to do the sum everytime |
08:42:55 | FromDiscord | <Rika> In reply to @4zv4l "or maybe I simply": Yes |
08:42:59 | FromDiscord | <Rika> Something like that |
08:43:06 | FromDiscord | <Rika> That’s your bottleneck in my eyes |
08:43:22 | PMunch | @retkid, by the way, you know you're going to have to do filtering after this decompression right? |
08:44:36 | FromDiscord | <retkid> Yes |
08:44:38 | FromDiscord | <d4rckh> hey @PMunch just letting u know that i fixed it by adding the callback after the asyncCheck |
08:44:44 | FromDiscord | <retkid> i just need to see the compression in order to filter it |
08:45:08 | PMunch | @d4rckh, huh, that's weird |
08:45:18 | PMunch | Oh wait, maybe asyncCheck works by setting a callback.. |
08:45:21 | FromDiscord | <4zv4l> alright ! |
08:45:28 | FromDiscord | <Rika> In reply to @PMunch "Oh wait, maybe asyncCheck": It does |
08:45:28 | FromDiscord | <4zv4l> this succeeded |
08:45:29 | FromDiscord | <d4rckh> you can have multiple callbacks cant you |
08:45:32 | FromDiscord | <4zv4l> sent a code paste, see https://paste.rs/7HS |
08:45:38 | FromDiscord | <Rika> Yes |
08:45:42 | PMunch | @d4rckh, I dunno |
08:45:44 | FromDiscord | <Rika> I think |
08:45:59 | FromDiscord | <d4rckh> i added 2 callbacks for testing and it worked |
08:48:11 | FromDiscord | <EyeCon> In reply to @4zv4l "even like that it": Which website is this? |
08:48:53 | PMunch | @d4rckh, hmm I think you should create an issue for this |
08:49:19 | FromDiscord | <Rika> In reply to @EyeCon "Which website is this?": Code wars |
08:49:21 | FromDiscord | <4zv4l> https://www.codewars.com/ |
08:49:57 | FromDiscord | <EyeCon> Thanks! |
08:55:57 | FromDiscord | <4zv4l> I think that's the 'biggest' project I made in Nim so far↵https://github.com/4zv4l/jpscan↵I'm not a dev so I don't make super optimized code xD↵I just wanted to rewrite my friend's shell script in Nim and to improve it |
08:57:19 | FromDiscord | <EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=4983 |
08:57:44 | FromDiscord | <EyeCon> I tried to put it between spoiler tags but apparently it doesn't work with code blocks |
08:58:40 | FromDiscord | <4zv4l> did you try it on the website ? |
08:59:06 | FromDiscord | <EyeCon> No, I wasn't a member, so I'm not sure if it fulfills the timing conditions |
08:59:11 | FromDiscord | <EyeCon> I will |
08:59:17 | FromDiscord | <4zv4l> https://www.codewars.com/kata/5ce399e0047a45001c853c2b |
08:59:21 | FromDiscord | <4zv4l> this is the kata link |
08:59:42 | FromDiscord | <4zv4l> I'll try with your code |
09:00:18 | FromDiscord | <retkid> I've realized this simple project has been dragged out to months |
09:00:28 | FromDiscord | <retkid> due to depression mixed with perfectonism |
09:01:01 | FromDiscord | <retkid> deadly combo |
09:01:34 | FromDiscord | <4zv4l> In reply to @retkid "I've realized this simple": which one ? |
09:03:37 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4984 |
09:03:39 | FromDiscord | <4zv4l> should be good right ?↵because I get this |
09:04:04 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4985 |
09:04:10 | FromDiscord | <4zv4l> (edit) "https://play.nim-lang.org/#ix=4986" => "https://paste.rs/Bsw" |
09:04:15 | FromDiscord | <Gabben> sent a code paste, see https://play.nim-lang.org/#ix=4987 |
09:05:26 | FromDiscord | <Gabben> sent a code paste, see https://play.nim-lang.org/#ix=4989 |
09:06:37 | FromDiscord | <Gabben> (edit) "https://play.nim-lang.org/#ix=4989" => "https://play.nim-lang.org/#ix=498a" |
09:07:07 | FromDiscord | <Gabben> sent a code paste, see https://paste.rs/AAJ |
09:09:18 | FromDiscord | <EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=498b |
09:10:31 | FromDiscord | <jmgomez> The docs says that we should use macro cache across module boundaries instead of compile time variables because the later will break IC. Based on that definition we should be fine with non exported variables, right? Since even if the macro is used in multiple places, it wont be "across module boundaries". Is that right? |
09:10:50 | FromDiscord | <EyeCon> We can move to #aoc if it is not strictly for the AoC but also for other coding challenges |
09:11:32 | FromDiscord | <EyeCon> I love Nim being so expressive |
09:19:55 | FromDiscord | <4zv4l> one of my friend told me this when I told him about Nim and macros↵> Then that must be super confusing if anyone can modify the syntax tree as they want to do shortcut, how do you know what do what when you look at code on the internet ? |
09:20:15 | FromDiscord | <4zv4l> I like the freedom macros give↵but idk how to reply to this xD |
09:20:58 | FromDiscord | <Elegantbeef> Macros are tools just like anything else they can be misused |
09:21:54 | FromDiscord | <b1rdf00d> less magic is better, but it's good to have it when it's needed↵I think it also depends who's consuming the code |
09:22:57 | FromDiscord | <Elegantbeef> A language that can be heavily extended in userspace is a lovely language |
09:22:58 | FromDiscord | <b1rdf00d> One thing I really appreciate about nim is this freedom, instead of having my code constrained by the language implementers' ideology |
09:23:04 | FromDiscord | <Elegantbeef> A language that cannot be extended in userspace is fucking annoying |
09:28:51 | FromDiscord | <EyeCon> In reply to @4zv4l "one of my friend": They are right, I think. I try to use macros as little as possible as they decrease discoverability |
09:29:11 | FromDiscord | <EyeCon> But it's good to have the power for when it becomes necessary |
09:38:55 | FromDiscord | <retkid> how does nim unitesting work |
09:39:05 | FromDiscord | <retkid> is it worth using the fancy stdlib stuff |
09:39:10 | FromDiscord | <retkid> and not just writing functions |
09:39:21 | FromDiscord | <4zv4l> you can import `unittest` and do easy test |
09:40:22 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=498k |
09:40:54 | FromDiscord | <retkid> how do i execute the tesats tho |
09:41:02 | FromDiscord | <retkid> (edit) "tesats tho" => "tes" |
09:41:13 | FromDiscord | <retkid> (edit) "tes" => "tests" |
09:41:50 | FromDiscord | <4zv4l> you simply run the file↵`nim r file.nim` |
09:42:23 | FromDiscord | <4zv4l> or you can compile it and run it to have a clearer interface |
09:42:35 | FromDiscord | <retkid> hmm |
09:42:52 | FromDiscord | <retkid> I'll make an independent file to test the entire project |
09:43:06 | FromDiscord | <4zv4l> https://media.discordapp.net/attachments/371759389889003532/1014107984881799179/unknown.png |
09:48:09 | FromDiscord | <4zv4l> is there a way to do `nim r program.nim` and hide all the compilation stuff ?↵like just to get the program output ? otherwise it can be a bit too verbose |
09:51:47 | FromDiscord | <sealmove> `newSeq` allocates managed memory right? |
09:51:50 | qwr | https://nim-lang.org/docs/nims.html - search for Silent (but imho the nimscript startup is too slow, better compile) |
09:54:59 | qwr | sealmove: i guess so, it has to be able to reallocate it later when the seq grows |
09:58:20 | FromDiscord | <sealmove> i stumbled upon an interesting situation |
09:58:37 | FromDiscord | <sealmove> i am interfacing with wasm and i get memory out of bound errors |
09:58:59 | FromDiscord | <sealmove> i am thinking i have to understand how memory is managed |
09:59:07 | FromDiscord | <sealmove> inside this environment |
10:01:15 | FromDiscord | <sealmove> sent a code paste, see https://paste.rs/U5g |
10:04:18 | FromDiscord | <Rika> In reply to @รєคɭ๓๏שє "`newSeq` allocates managed memory": All sequences that are made safely (with the regular system procs) are managed |
10:05:18 | FromDiscord | <MagPhi> How to keep nim code running |
10:05:24 | FromDiscord | <sealmove> the memory is managed by wasmtime so... not sure how to properly interface with it. what/how is mm delegated to wasmtime? |
10:05:29 | FromDiscord | <MagPhi> Like host it on the cloud? Idk |
10:06:31 | FromDiscord | <planetis> In reply to @รєคɭ๓๏שє "i stumbled upon an": Don't you need -d:usemalloc ? |
10:06:42 | FromDiscord | <Rika> In reply to @รєคɭ๓๏שє "the memory is managed": If Nim isn’t aware of it then nothing special is done |
10:07:00 | FromDiscord | <Rika> In reply to @MagPhi "How to keep nim": What do you mean exactly |
10:08:05 | FromDiscord | <MagPhi> In reply to @Rika "What do you mean": Like if I build something with nim thats needs to keep running where should I host it? |
10:08:29 | FromDiscord | <Rika> Anywhere you can keep online? It depends on your circumstance |
10:08:30 | FromDiscord | <MagPhi> (edit) "thats" => "that" |
10:08:38 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=498q |
10:08:47 | FromDiscord | <Rika> How much are you willing to pay? Do you have spare machines at home? Do you want to use those machines? |
10:08:48 | FromDiscord | <Rika> Etc |
10:08:49 | FromDiscord | <sealmove> `handle-http-request` is the entrypoint and I partially control it |
10:09:11 | FromDiscord | <sealmove> In reply to @planetis "Don't you need -d:usemalloc": oh I do? no idea, thanks for the tip! |
10:09:23 | FromDiscord | <MagPhi> In reply to @Rika "How much are you": But what am I looking for? |
10:09:33 | FromDiscord | <MagPhi> Serverless functions? |
10:09:36 | FromDiscord | <Rika> A computer |
10:09:37 | FromDiscord | <MagPhi> Edge functions? |
10:09:46 | FromDiscord | <Rika> VPS most likely |
10:10:04 | FromDiscord | <Rika> Other managed solutions are most likely annoying to set up |
10:10:10 | FromDiscord | <Rika> Heroku probably works but that’s paid as well |
10:10:11 | FromDiscord | <d4rckh> any quick function to convert a jsonnode array of jsonnode objects to a seq of tuples? |
10:10:15 | FromDiscord | <MagPhi> I see |
10:10:16 | FromDiscord | <planetis> I think you can plug your own allocator in Nim, there was a repo by Yardanico that used mimalloc |
10:10:29 | FromDiscord | <Rika> In reply to @Rika "Other managed solutions are": because they don’t have first class Nim support |
10:10:36 | qwr | MagPhi: you can also host on some sbc, rpi is expensive currently, but but some others like rockpi, odroid or rockpro64 are available |
10:10:40 | FromDiscord | <planetis> https://github.com/Yardanico/mimalloc_nim |
10:10:44 | FromDiscord | <Rika> In reply to @planetis "I think you can": I believe that’s by plugging malloc itself |
10:11:06 | FromDiscord | <MagPhi> In reply to @Rika "*because they don’t have": Well i mean I could obviously transpile to C/C++/JS |
10:11:18 | FromDiscord | <Rika> In reply to @d4rckh "any quick function to": Will only work if the objects all have the same fields |
10:11:24 | FromDiscord | <d4rckh> In reply to @Rika "Will only work if": they do |
10:11:37 | FromDiscord | <Rika> In reply to @MagPhi "Well i mean I": Yes but for C you have the Nim base header to deal with |
10:11:40 | FromDiscord | <Rika> And C++ too |
10:11:48 | FromDiscord | <Rika> JS is probably easy to use |
10:11:49 | FromDiscord | <MagPhi> In reply to @qwr "<@695937684673134594>: you can also": I have an arduino but that wont work I am guessing |
10:12:20 | FromDiscord | <Rika> In reply to @d4rckh "they do": Easiest is probably with a 3rd party library like jsony or whatever it was called I guess |
10:12:23 | FromDiscord | <radsoc> LMDB k/v store, way faster than SQLite https://forum.nim-lang.org/t/9210#60355↵(@Girvo) |
10:12:36 | FromDiscord | <Rika> Oh wait, you already have them in std/json types! |
10:12:39 | FromDiscord | <Rika> ? |
10:18:28 | FromDiscord | <planetis> In reply to @d4rckh "they do": json.to |
10:18:48 | FromDiscord | <d4rckh> great thanks |
10:41:32 | FromDiscord | <EyeCon> In reply to @MagPhi "But what am I": I use a 2 $/year VPS hosting service |
10:41:43 | FromDiscord | <EyeCon> For a Discord bot |
10:41:48 | FromDiscord | <d4rckh> why does terminal.eraseScreen(stdout) erase the screen and then put my cursor at the bottom of the terminal? |
10:41:58 | FromDiscord | <d4rckh> shouldnt it put it at the top of the screen? like `cls` on windows? |
10:42:58 | FromDiscord | <EyeCon> In reply to @d4rckh "why does terminal.eraseScreen(stdout) erase": That's just how it works AFAIK, use `setCursorPos(0, 0)` afterwards |
10:44:10 | FromDiscord | <d4rckh> tysm |
11:09:50 | NimEventer | New thread by Miran: NimConf 2022 - registrations, see https://forum.nim-lang.org/t/9420 |
11:14:07 | PMunch | @miran, do you need me to whip up a new 2022 logo for conf.nim-lang.org? |
11:14:27 | PMunch | (and by new logo I mean copy one of the twos and replace the one :P) |
11:16:52 | FromDiscord | <b1rdf00d> is using `quote do` frowned upon and if so what's the replacement? |
11:20:29 | FromDiscord | <Rika> https://nim-lang.org/docs/genasts.html |
11:23:08 | FromDiscord | <b1rdf00d> In reply to @Rika "https://nim-lang.org/docs/genasts.html": thanks! |
11:25:27 | * | jmdaemon quit (Ping timeout: 252 seconds) |
11:49:29 | PMunch | Hmm, what are people using to do GPU stuff in Nim? |
11:49:44 | PMunch | I need to dither some images |
11:51:55 | FromDiscord | <b1rdf00d> I haven't used it yet, but shady? |
11:54:53 | PMunch | Ah, yes that's the one I was thinking of! |
11:56:33 | FromDiscord | <b1rdf00d> I'm pretty keen to play around with it |
12:00:13 | FromDiscord | <Ducko> hey, how would you go about making a detached process with `osproc`? docs don't mention anything and not sure. thanks! |
12:02:03 | NimEventer | New thread by Alexgustafson: C2nim problem with char[] to UncheckardArray[char], see https://forum.nim-lang.org/t/9421 |
12:02:21 | FromDiscord | <Rika> In reply to @PMunch "I need to dither": A dither is really really easy to shaderise |
12:02:37 | PMunch | @b1rdf00d, if you want to play around with it feel free to implement dithering :P |
12:02:46 | FromDiscord | <Rika> As in the dithering algorithm called “a dither” the one you experimented magic numbers on if you don’t recall |
12:02:49 | FromDiscord | <4zv4l> I am really not used with Macros and I think the use case isn't the best but that's neat https://media.discordapp.net/attachments/371759389889003532/1014143150136234004/unknown.png |
12:02:49 | PMunch | @Rika, yeah I know. I just haven't gotten around to do it :P |
12:03:00 | FromDiscord | <Rika> I did it before but I lost the code lol |
12:03:08 | PMunch | @Rika, yeah a dither would be simple |
12:03:19 | PMunch | I've also played around with a pattern based ditherer |
12:03:29 | FromDiscord | <Rika> I don’t think any error diffusion dithers are parallelisable |
12:03:41 | FromDiscord | <Rika> Ordered dithers are possible |
12:04:15 | PMunch | Error diffusion would be tricky |
12:04:30 | FromDiscord | <Rika> It’s not tricky, it’s just not possible |
12:04:36 | PMunch | There are ones that makes small spirals and such which would be parallelisable |
12:04:50 | FromDiscord | <Rika> Void and cluster is not error diffusion |
12:04:54 | PMunch | Well as long as errors can't propagate over the entire image you're fine |
12:05:17 | FromDiscord | <Rika> If it doesn’t then I believe formally they’re not called error diffusion algorithms |
12:05:31 | FromDiscord | <Rika> I don’t know why don’t ask me |
12:05:38 | PMunch | Ah right |
12:06:04 | PMunch | Well I was thinking more about running a normal error diffusion, but on sub-parts of the image in parallel |
12:06:06 | FromDiscord | <b1rdf00d> In reply to @Ducko "hey, how would you": does it need to be cross platform? on linux you could use `execCmd` with a traling `&` (I think) |
12:06:22 | FromDiscord | <Rika> In reply to @PMunch "Well I was thinking": Then you’ll have residual error per block |
12:06:24 | FromDiscord | <b1rdf00d> (edit) "traling" => "trailing" |
12:06:27 | FromDiscord | <Rika> That adds up |
12:06:39 | FromDiscord | <Ducko> In reply to @b1rdf00d "does it need to": windows :P |
12:06:47 | PMunch | Oh yeah, the blocks would have some residiual |
12:06:51 | FromDiscord | <Ducko> i know i can do that, i tried using `start` on windows but only a cmd thing |
12:07:10 | FromDiscord | <Ducko> i kinda got it to work but it fails when I try to inherit stdio with `poParentStreams` |
12:07:19 | FromDiscord | <Rika> It’s fun how people who experiment with e ink end up researching about similar technologies |
12:07:38 | FromDiscord | <creikey> this is a compiler bug right https://media.discordapp.net/attachments/371759389889003532/1014144362655006790/unknown.png |
12:07:41 | FromDiscord | <Ducko> (edit) "i kinda got it to work but it fails when I try to inherit stdio with `poParentStreams`" => "sent a code paste, see https://play.nim-lang.org/#ix=498I" |
12:07:48 | FromDiscord | <Rika> The benefit of stuff that don’t depend on error diffusion in some sense is that they can be stable with animation, which is important for e ink |
12:07:50 | PMunch | But anyways, the dithering I've sorta landed on is a brown-noise pattern solution. So you have a pattern in a file, then you compare the pixel you want to dither with the value at the same position in the pattern (potentially with modulo). If it's lower than the value then it's black, otherwise it's white. |
12:08:17 | FromDiscord | <creikey> In reply to @creikey "this is a compiler": nevermind I'm stupid |
12:08:18 | FromDiscord | <Rika> “A dither” is animation stable |
12:08:26 | FromDiscord | <Rika> Ordered dithers are as well |
12:08:33 | PMunch | That should be very simply to extend to a 16 levels of grey dithering as well, which is kind of what I need |
12:08:59 | PMunch | Yeah I can't use error diffusion |
12:09:02 | PMunch | It looks terrible |
12:09:07 | FromDiscord | <Rika> I hope you’re reading what I wrote lol |
12:09:33 | FromDiscord | <Rika> In reply to @PMunch "It looks terrible": Me with an e ink tablet that uses floyd steinberg for their fast animation mode, yeah it’s bad |
12:09:49 | PMunch | This is the kind of pattern I'm using: https://uploads.peterme.net/pattern.png |
12:10:25 | FromDiscord | <Rika> I personally like it when the pattern is uniform rather than random but that’s a preference thing |
12:10:59 | PMunch | I found that adither had some directional artifacts |
12:11:08 | PMunch | Not a lot, but ever so slightly |
12:11:15 | * | _________ quit (Ping timeout: 248 seconds) |
12:11:35 | * | _________ joined #nim |
12:13:21 | PMunch | The pattern dithering should be stupidly simple to implement on a GPU |
12:15:08 | FromDiscord | <Rika> In reply to @PMunch "I found that adither": ? Really? |
12:15:10 | FromDiscord | <Rika> In what sense |
12:15:47 | FromDiscord | <Rika> I tried a dither on my tablet with 16 levels and it looks unnoticeable compared to the hard thresholding it does instead |
12:15:58 | FromDiscord | <Rika> This is the add version, not the xor one |
12:17:01 | PMunch | Ah with 16 levels you probably wouldn't notice |
12:17:05 | PMunch | I'm only doing 2 |
12:17:09 | PMunch | For speed :P |
12:17:15 | FromDiscord | <Rika> Oh the speed mode |
12:17:31 | PMunch | I plan on adding 16 as well |
12:17:42 | PMunch | The idea is to control it with X11 window hints |
12:18:10 | FromDiscord | <Rika> I’ve no clue with that |
12:20:09 | * | Vladar quit (Ping timeout: 244 seconds) |
12:25:59 | * | sagax quit (Quit: Konversation terminated!) |
12:27:34 | * | rockcavera joined #nim |
12:27:35 | * | rockcavera quit (Changing host) |
12:27:35 | * | rockcavera joined #nim |
12:34:33 | * | tiorock joined #nim |
12:34:34 | * | tiorock quit (Changing host) |
12:34:34 | * | tiorock joined #nim |
12:34:34 | * | rockcavera is now known as Guest412 |
12:34:34 | * | Guest412 quit (Killed (molybdenum.libera.chat (Nickname regained by services))) |
12:34:34 | * | tiorock is now known as rockcavera |
12:35:20 | * | Vladar joined #nim |
12:50:57 | * | arkurious joined #nim |
13:01:20 | * | Vladar quit (Quit: Leaving) |
13:12:50 | FromDiscord | <sealmove> is there a convenient way to allocation an unmanaged cstring? |
13:14:08 | PMunch | alloc? |
13:15:02 | FromDiscord | <sealmove> yeah i was thinking if there is an easier way. with alloc i have to take care of terminating null byte right? |
13:15:14 | PMunch | var cstr = cast[cstring](alloc0(100)) |
13:15:17 | PMunch | For example |
13:15:28 | PMunch | Yes, of course |
13:15:34 | FromDiscord | <sealmove> ok great ty |
13:16:04 | PMunch | I mean if you don't want to deal with stuff like that, don't use C strings :P |
13:16:18 | PMunch | You're really only meant to use them for compatability |
13:26:09 | FromDiscord | <sealmove> yeah I am using them for compatibility |
13:26:36 | FromDiscord | <sealmove> someone else is calling `free()` on them |
13:26:49 | FromDiscord | <sealmove> so using nim's orc results in double-free |
13:27:12 | FromDiscord | <sealmove> i want to use nim's orc for everything except specific objects |
13:27:23 | FromDiscord | <sealmove> these objects interface with wasi abi |
13:29:14 | PMunch | Ah I see |
13:29:58 | PMunch | I guess you could add a reference to Nim, tricking it into thinking it has one more reference than it actually has and therefore not trying to free it |
13:30:16 | PMunch | Ah wait, I think that wouldn't work.. |
13:31:22 | FromDiscord | <sealmove> manual alloc _should_ work though right? |
13:32:21 | FromDiscord | <auxym> yes |
13:37:55 | FromDiscord | <sealmove> omg it works =) !! |
13:41:08 | * | radsoc joined #nim |
13:41:24 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=4998 |
13:42:49 | FromDiscord | <Rika> In reply to @รєคɭ๓๏שє "if you have a": Writing the default state of the type, which might not be zero because of strings and sequences |
13:42:49 | * | radsoc quit (Read error: Connection reset by peer) |
13:44:30 | FromDiscord | <sealmove> hmm these are not all zeros? |
13:44:56 | FromDiscord | <sealmove> what's their memory layout then? |
13:46:12 | FromDiscord | <huantian> On refc they are just a pointer, on arc they are a pointer plus a length iirc |
13:46:47 | * | LuxuryMode joined #nim |
13:48:56 | PMunch | They're all still zeros though |
13:49:27 | PMunch | @sealmove, unless I missed a major change Nim still initialises everything to all zeros |
13:50:05 | PMunch | There where some changes to how it handled strings and such so you can't set them as "null", but that's just because it has some added null checks. |
13:52:12 | * | PMunch quit (Quit: Leaving) |
14:05:17 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=499e |
14:05:51 | FromDiscord | <sealmove> make a convertor |
14:06:06 | FromDiscord | <sealmove> (edit) "convertor" => "`converter`" |
14:06:18 | FromDiscord | <Nalmyth> In reply to @รєคɭ๓๏שє "make a `converter`": Thank you will research |
14:06:47 | FromDiscord | <sealmove> It's really simple but discouraged https://nim-lang.org/docs/manual.html#converters |
14:07:00 | FromDiscord | <sealmove> One of the hated features of nim :p |
14:08:01 | FromDiscord | <sealmove> It exists for c interop but ppl abuse it which make ppl who make the nim lang sick :p |
14:08:16 | FromDiscord | <sealmove> (edit) "One" => "~~One" | ":p" => ":p~~" |
14:09:16 | FromDiscord | <Nalmyth> Basically I have some vendor code which I don't want to modify |
14:09:21 | FromDiscord | <Nalmyth> And they have a `distinct` type |
14:09:35 | FromDiscord | <Nalmyth> And I want to convert it into my own type system for readability and utility |
14:09:49 | FromDiscord | <Rika> In reply to @รєคɭ๓๏שє "~~One of the hated": Not really |
14:12:02 | FromDiscord | <Nalmyth> It doesn't compile 🤔 |
14:12:04 | FromDiscord | <Nalmyth> sent a code paste, see https://paste.rs/xSX |
14:12:14 | FromDiscord | <Nalmyth> `Error: type mismatch: got <PayloadID> but expected 'array[0..7, byte]'` |
14:12:25 | FromDiscord | <Tanguy> `array[8, byte](payload_id)`↵That's how you convert a distinct type to it's parent |
14:12:31 | FromDiscord | <Tanguy> (edit) "parent" => "original type" |
14:12:44 | FromDiscord | <Nalmyth> Ah I see |
14:13:05 | FromDiscord | <Tanguy> converter allows you to do it systematically, but you can just do it manually when required |
14:13:10 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=499j |
14:13:22 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=499j" => "https://play.nim-lang.org/#ix=499k" |
14:14:00 | FromDiscord | <sealmove> converters enable loose typing |
14:15:27 | * | vicecea quit (Remote host closed the connection) |
14:15:55 | * | vicecea joined #nim |
14:16:05 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=499o |
14:16:45 | FromDiscord | <sealmove> (edit) "https://play.nim-lang.org/#ix=499o" => "https://play.nim-lang.org/#ix=499r" |
14:18:04 | FromDiscord | <sealmove> (edit) "https://play.nim-lang.org/#ix=499r" => "https://play.nim-lang.org/#ix=499s" |
14:18:51 | FromDiscord | <sealmove> the name of your converter is kinda irrelevant (except if you plan to call it explicitly like proc) |
14:19:43 | FromDiscord | <Nalmyth> In reply to @รєคɭ๓๏שє "the name of your": Ah cool, so it's just called automatically |
14:19:50 | FromDiscord | <Nalmyth> Even better, thank you it's working now 🙏 |
14:19:59 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=499t |
14:22:22 | FromDiscord | <Tanguy> Some don't like this feature because "Explicit is better than implicit." 🙂 |
14:23:16 | FromDiscord | <4zv4l> except for macros where distinct allowed to do something I don't remember what↵what's its use case ? |
14:23:27 | FromDiscord | <4zv4l> of the `distinct` keyword I mean |
14:28:20 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=499u |
14:28:56 | FromDiscord | <4zv4l> oooh otherwise it will convert them ? |
14:29:34 | FromDiscord | <auxym> well you can make your own conversion proc `proc inches2meters(x: inches): meters = ...` |
14:29:53 | FromDiscord | <4zv4l> wait I'll code what I meant |
14:29:54 | FromDiscord | <auxym> maybe a converter could automatically do the conversion but those are experimental and I'm not very familia |
14:31:08 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=499y |
14:31:23 | FromDiscord | <auxym> yeah |
14:31:29 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=499z |
14:31:33 | FromDiscord | <auxym> exactly |
14:31:36 | FromDiscord | <4zv4l> alright ! |
14:31:43 | FromDiscord | <auxym> nasa crashed a rover because of a bug like this! 😛 |
14:31:51 | FromDiscord | <4zv4l> really ? xD |
14:31:59 | FromDiscord | <4zv4l> damn |
14:32:24 | FromDiscord | <auxym> https://everydayastronaut.com/mars-climate-orbiter/ |
14:34:03 | FromDiscord | <4zv4l> well well well xD |
14:34:36 | FromDiscord | <4zv4l> silly bug indeed |
14:36:52 | FromDiscord | <auxym> expensive, too |
14:37:14 | FromDiscord | <auxym> see, distincts could save you hundreds of millions of dollars! |
14:40:30 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=499B |
14:41:43 | FromDiscord | <4zv4l> In reply to @Nalmyth "This is a really": my pleasure |
15:09:47 | FromDiscord | <Forest [She/Her]> How long does it take for a package to be accepted to Nimble? |
15:11:34 | FromDiscord | <! Yes, i hoist> The source code for nim makes it look like nim’s compiler is written in itself, how is this possible? |
15:12:14 | FromDiscord | <auxym> self-hosting, as far as I know most compilers do it these days |
15:12:17 | FromDiscord | <Forest [She/Her]> In reply to @not logged in "The source code for": Since Nim compiles to C, it compiles the Nim compiler to C and builds that |
15:12:51 | FromDiscord | <auxym> the first version was written in C or something like that, once you have a first version, you can rewrite it in Nim |
15:12:55 | FromDiscord | <Forest [She/Her]> It also has csources which basically is just the outputted C source from the Nim compiler |
15:12:58 | FromDiscord | <Forest [She/Her]> In reply to @auxym "the first version was": Yup |
15:13:01 | FromDiscord | <! Yes, i hoist> In reply to @Forest "Since Nim compiles to": But you need a nim compiler to compile the compiler to c |
15:13:16 | FromDiscord | <! Yes, i hoist> In reply to @auxym "the first version was": ah |
15:13:39 | FromDiscord | <Forest [She/Her]> In reply to @not logged in "But you need a": The first Nim compiler was written in Pascal (iirc), they then ported that to Nim so it could compile itself to C |
15:14:21 | FromDiscord | <auxym> just like the first C compiler was likely written in assembler (?, or perhaps Algol or something) |
15:14:40 | FromDiscord | <Forest [She/Her]> Mhm |
15:14:44 | FromDiscord | <auxym> but nowadays all C compilers are written in C |
15:14:47 | FromDiscord | <Forest [She/Her]> Probably assembly idk |
15:14:58 | FromDiscord | <auxym> would be my guess too |
15:15:14 | FromDiscord | <Forest [She/Her]> In reply to @auxym "but nowadays all C": Yeah, C is a really good base language |
15:15:39 | FromDiscord | <Forest [She/Her]> Simple too, just way more boilerplate for complex things |
15:15:54 | FromDiscord | <auxym> https://stackoverflow.com/questions/18125490/how-was-the-first-c-compiler-written |
15:16:15 | FromDiscord | <auxym> apparently they used something called BCPL to write a B compiler, then used B to write the first C compiler |
15:17:59 | FromDiscord | <Rika> bcpl is weird lol |
15:22:33 | FromDiscord | <Yardanico> In reply to @auxym "but nowadays all C": a bit of bikeshedding, but not necessarily - clang (and llvm which it uses for backend) is written in C++ |
15:23:49 | FromDiscord | <!&luke> In reply to @Yardanico "a bit of bikeshedding,": Yea |
15:29:46 | FromDiscord | <! Yes, i hoist> im honestly suprised nim is not a bigger language (Like more people use/know about it) |
15:30:58 | * | kenran joined #nim |
15:35:21 | FromDiscord | <sealmove> ιτ τακεσ τιμε |
15:35:24 | FromDiscord | <sealmove> (edit) "ιτ τακεσ τιμε" => "it takes time" |
15:39:52 | FromDiscord | <Rainbow Asteroids> nim is pretty young compared to industry giants, like javascript, python, C, etc. |
15:41:34 | FromDiscord | <Rika> just like how rust and go and zig and ... are young? |
15:45:09 | FromDiscord | <Prestige> didn't those have a lot more backing? Idk how new they are comparatively but I don't think age is the issue |
15:47:21 | FromDiscord | <Rika> thats my point |
15:48:53 | FromDiscord | <sealmove> In reply to @Rika "just like how rust": a bit older than rust/go/zig |
16:03:15 | * | kenran quit (Ping timeout: 268 seconds) |
16:05:09 | FromDiscord | <auxym> yeah. Nim is young-ish but still has less traction than go/rust/julia which are also young |
16:05:22 | FromDiscord | <auxym> go was started by google and rust but mozilla though |
16:06:36 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
16:11:16 | FromDiscord | <leetnewb> I described nim in two sentences as a suggestion to a retired networking guy. maybe it was my explanation, but he was more drawn to go/python. |
16:20:08 | FromDiscord | <Rainbow Asteroids> what was your explanation? |
16:22:14 | FromDiscord | <dom96> In reply to @Forest "How long does it": Depends how quickly one of us with write access to the packages repo takes to merge it |
16:22:31 | FromDiscord | <leetnewb> In reply to @Rainbow Asteroids "what was your explanation?": compiled, more concise than go, and can wrap python, c, c++ libs if necessary |
16:22:58 | FromDiscord | <Forest [She/Her]> Question: If i was to wrap a java library to create Nim pseudo-bindings, how would i go about it? Like, how would it actually say what method is being called with what parameters? I'd want to stay away from a proc but if that's unavoidable, fair enough |
16:23:05 | FromDiscord | <Forest [She/Her]> In reply to @leetnewb "compiled, more concise than": Fair |
16:23:11 | FromDiscord | <dom96> Just merged it for you |
16:23:38 | FromDiscord | <Forest [She/Her]> Thanks! |
16:23:50 | NimEventer | New Nimble package! codegenlib - A simple code generation library for other programming languages!, see https://github.com/Mythical-Forest-Collective/CodeGenLib |
16:24:08 | FromDiscord | <Forest [She/Her]> Eyyy |
16:25:15 | FromDiscord | <dom96> In reply to @Avahe "didn't those have a": Rust and Go yes, but Zig not so much |
16:25:43 | FromDiscord | <dom96> though to be fair to Nim, a lot of its beginnings were Araq working in his spare time after work |
16:26:06 | FromDiscord | <dom96> AFAIK Zig's author quit his job almost immediately after beginning to work on it |
16:26:19 | FromDiscord | <Prestige> I really think improved editor support would go a long way to get more traction |
16:26:29 | FromDiscord | <Prestige> In reply to @dom96 "AFAIK Zig's author quit": I wonder how he survived, donations? |
16:26:52 | FromDiscord | <dom96> Yes, I believe so |
16:27:09 | FromDiscord | <Prestige> That's impressive |
16:27:38 | FromDiscord | <auxym> does zig really have more traction at this point compared to Nim? it was not my impression |
16:28:20 | FromDiscord | <Prestige> I think more people know about zig |
16:28:21 | FromDiscord | <dom96> hard to say, but I think they are at least even |
16:37:35 | FromDiscord | <Forest [She/Her]> In reply to @Forest "Question: If i was": Yeah tryna figure this out but really don't know how |
16:39:22 | FromDiscord | <auxym> shitton of pragmas? Maybe something like importcpp? |
16:41:40 | FromDiscord | <Forest [She/Her]> In reply to @auxym "shitton of pragmas? Maybe": I'd be generating the code automatically, there's tools that do it for TS so I'd adapt it to my needs, my issue is that i need to make it easily handled by my library and i want it to be compatible like how Nim does it |
16:41:58 | FromDiscord | <Forest [She/Her]> (function calling and objects and stuff) |
16:42:39 | FromDiscord | <Forest [She/Her]> So i just need to know how to reference the object really |
16:42:45 | FromDiscord | <Forest [She/Her]> Especially with nested classes |
16:42:54 | FromDiscord | <Forest [She/Her]> Since `System.out.println` exists for example |
16:43:12 | FromDiscord | <sealmove> I've found it's really annoying to model nested java classes with nim |
16:43:15 | FromDiscord | <Forest [She/Her]> I'd want it so you could even do `println(System.out, "Hello!")` |
16:43:45 | FromDiscord | <sealmove> Could not find a way to translate code that uses type elision |
16:44:21 | FromDiscord | <Forest [She/Her]> Elision? |
16:44:39 | FromDiscord | <sealmove> Java uses an actual class for generic code, the class Object |
16:44:46 | FromDiscord | <Forest [She/Her]> In reply to @รєคɭ๓๏שє "I've found it's really": It's why I'm dedicating so much time trying to make a structure for it lmao |
16:44:49 | FromDiscord | <sealmove> Nim can't do that |
16:44:56 | FromDiscord | <Forest [She/Her]> In reply to @รєคɭ๓๏שє "Java uses an actual": Ah yeah, for me that's not the issue |
16:45:05 | FromDiscord | <sealmove> Yet :p |
16:45:13 | FromDiscord | <Forest [She/Her]> My code is just meant to wrap Java classes in a very thin layer so it's outputted as strings |
16:45:21 | FromDiscord | <sealmove> Well Nim have Obj but it doesn't really fit in this way |
16:45:41 | FromDiscord | <Forest [She/Her]> In reply to @รєคɭ๓๏שє "Nim can't do that": Well, RootObj can work but you'd need to check the type |
16:45:51 | FromDiscord | <Forest [She/Her]> Also maybe ref objects only? |
16:45:57 | FromDiscord | <sealmove> Yes RootObj |
16:45:58 | FromDiscord | <Forest [She/Her]> In reply to @Forest "My code is just": But yeah, this is my issue |
16:46:23 | FromDiscord | <Forest [She/Her]> First i was thinking of using fields but that doesn't feel clean? |
16:46:38 | FromDiscord | <sealmove> No its fine |
16:46:54 | FromDiscord | <sealmove> But u will have to write () |
16:46:56 | FromDiscord | <Forest [She/Her]> Then i was thinking of making procs inheriting from a generic JavaWrapper object but the same issue as using fields, I can't use nested classes |
16:47:05 | FromDiscord | <Forest [She/Her]> In reply to @รєคɭ๓๏שє "But u will have": Yeahhh |
16:47:11 | FromDiscord | <Forest [She/Her]> Templates could possibly work? |
16:47:32 | FromDiscord | <sealmove> I have tried experimental dot operator for this |
16:47:50 | FromDiscord | <sealmove> Not without problems but it works i guess |
16:48:01 | FromDiscord | <Forest [She/Her]> But still feels really bad, since I'd probably have to also make types for nested classes |
16:48:03 | FromDiscord | <Forest [She/Her]> In reply to @รєคɭ๓๏שє "I have tried experimental": Oh? |
16:48:43 | * | rockcavera quit (Read error: Connection reset by peer) |
16:49:02 | * | rockcavera joined #nim |
16:49:02 | * | rockcavera quit (Changing host) |
16:49:02 | * | rockcavera joined #nim |
16:50:52 | FromDiscord | <Forest [She/Her]> Hm... |
16:51:08 | FromDiscord | <Forest [She/Her]> Does Nim have a way i can dynamically declare 'fields'? |
16:51:30 | FromDiscord | <Rika> Dynamic in what way |
16:51:42 | FromDiscord | <Forest [She/Her]> (Me making a layer over a table that lets you do `MyCustomObject.keyOfValueInTable` |
16:51:57 | FromDiscord | <Forest [She/Her]> I'd assume I'd have to initialise the type which is fine |
16:52:05 | FromDiscord | <Rika> Runtime? Not really no |
16:52:14 | FromDiscord | <sealmove> In reply to @Forest "Does Nim have a": Seq? |
16:52:15 | FromDiscord | <Forest [She/Her]> Compile time is also fine |
16:52:29 | FromDiscord | <Forest [She/Her]> In reply to @รєคɭ๓๏שє "Seq?": That wouldn't work, i want it in a Nim-like way |
16:52:36 | FromDiscord | <sealmove> (edit) "Seq?" => "~~Seq?~~" |
16:52:38 | FromDiscord | <Rika> In reply to @Forest "Compile time is also": Macro? |
16:52:54 | FromDiscord | <sealmove> In reply to @Forest "Does Nim have a": Lua :D |
16:53:05 | FromDiscord | <Forest [She/Her]> In reply to @Forest "Compile time is also": Hm but this would make you have to do `System.out.println` when i also want `println(System.out)` |
16:53:16 | FromDiscord | <Forest [She/Her]> In reply to @Rika "Macro?": That's probably my only viable option rip |
16:53:33 | FromDiscord | <Forest [She/Her]> Wanted to try and avoid macros because they're such a pain lmao but, looks like I'll have to make do |
16:53:52 | FromDiscord | <Forest [She/Her]> Even with macros this'll be tricky... |
16:54:35 | FromDiscord | <sealmove> Start from templates |
16:56:25 | FromDiscord | <Forest [She/Her]> Yeah may try that |
16:56:37 | FromDiscord | <Forest [She/Her]> Still going to struggle with types :/ |
17:00:33 | FromDiscord | <Forest [She/Her]> Hm i don't think macros or templates could do what i want... |
17:00:46 | FromDiscord | <Rika> I understand templates but why not macros |
17:00:56 | FromDiscord | <Rika> You said compile time should be fine |
17:01:40 | FromDiscord | <Forest [She/Her]> I'm just trying to put together a mental image of how the code should work and idk if macros can like, help me replicate accessing fields/nested classes in the way Nim can? |
17:02:43 | FromDiscord | <Forest [She/Her]> This is the only downside of having many ways to do one thing lmao, you don't wanna restrict the programmer and/or yourself using the library and want to figure out how to use one method for many things |
17:02:55 | FromDiscord | <Forest [She/Her]> Can macros contain Nim code instead of raw ast? |
17:03:41 | FromDiscord | <Rika> There are convenience procs for converting Nim code to AST |
17:04:13 | FromDiscord | <Rika> Like quote in module macros or https://nim-lang.org/docs/genasts.html |
17:08:28 | FromDiscord | <Forest [She/Her]> Oh that's neat |
17:08:44 | FromDiscord | <Forest [She/Her]> Welp, i gotta start doing something with this now lmao |
17:16:11 | FromDiscord | <Forest [She/Her]> Hm can macros accept an argument? |
17:16:45 | FromDiscord | <Forest [She/Her]> So `myObject.myMacro`, `myMacro myObject`, etc |
17:38:47 | NimEventer | New thread by Randbox: Hello World with --mm:none and --warningAsError:GcMem, see https://forum.nim-lang.org/t/9423 |
17:43:28 | FromDiscord | <EyeCon> I don't know what would be the best channel for this but the IRC #nim channel (I think, appears in Matrix as `!dwYcWaeApgvslpHviW:matrix.org`) has in its topic:↵> Latest version: 1.4.2 - https://nim-lang.org/install.html↵↵Should we maybe update it? |
17:44:17 | FromDiscord | <EyeCon> Or let it die, considering that the last non-system message is from April? |
18:10:57 | FromDiscord | <that_dude> In reply to @Forest "Hm can macros accept": https://github.com/beef331/micros may be of use/help if you're messing with macros |
18:14:13 | FromDiscord | <that_dude> sorry that's not an answer, I just wanted to tag you |
18:26:08 | * | jmdaemon joined #nim |
18:49:26 | FromDiscord | <ezquerra> sent a long message, see http://ix.io/49b4 |
18:52:34 | FromDiscord | <ezquerra> BTW, it seems that importing random, strutils and strformat causes a few `DuplicateModuleImport` hints, and that importing random causes a few Deprecated and UnusedImport warnings |
19:08:37 | FromDiscord | <4zv4l> I'm trying to make a LinkedList in nim↵how can I make a variable that can be either null or have a value ?↵like `?u8` in zig or `Result<>` in rust |
19:08:37 | FromDiscord | <Bung> same name proc? |
19:09:41 | FromDiscord | <Bung> you can use std options module or define as ptr TypeA |
19:10:26 | FromDiscord | <Rainbow Asteroids> don't use a pointer if you don't have to. Use a reference, or define your data type to be a ref objecy |
19:10:34 | FromDiscord | <Rainbow Asteroids> (edit) "objecy" => "object" |
19:11:01 | FromDiscord | <4zv4l> is that good ? |
19:11:05 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49b9 |
19:13:37 | * | neceve joined #nim |
19:13:50 | FromDiscord | <Forest [She/Her]> In reply to @that_dude "https://github.com/beef331/micros may be of": Ah nice! Thanks! |
19:15:32 | FromDiscord | <Forest [She/Her]> I'm currently making a near automatic nimble package version releaser, that just creates a github tag for the package but uh, how should i tag versione? |
19:15:36 | FromDiscord | <Forest [She/Her]> Versions |
19:16:05 | FromDiscord | <Forest [She/Her]> Should it be `v{major}.{minor}.{patch}` or just `{major}.{minor}.{patch}`? |
19:16:15 | FromDiscord | <Bung> git tag v1.2.3 , that's common |
19:17:04 | FromDiscord | <Forest [She/Her]> Alright, but how does nimble handle that? |
19:17:57 | FromDiscord | <Bung> it will fetch tags start with v , get the latest , like go |
19:18:12 | FromDiscord | <Forest [She/Her]> Ah sweet |
19:18:42 | FromDiscord | <4zv4l> how do I assign to a `ref Node` ? what do I need to add in front of my `Node` variable to make it a ref ? |
19:19:15 | FromDiscord | <Bung> new YourType , assign to that field |
19:19:28 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49be |
19:19:39 | FromDiscord | <4zv4l> In reply to @Bung "new YourType , assign": new ? |
19:19:50 | FromDiscord | <4zv4l> In reply to @4zv4l "for now I made": that's how I made them |
19:20:07 | FromDiscord | <Bung> yeah , that's keyword |
19:20:20 | FromDiscord | <4zv4l> I add `new` in front of `newNode` ? |
19:21:03 | FromDiscord | <Bung> https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types see manual |
19:21:11 | * | neceve quit (Ping timeout: 260 seconds) |
19:21:47 | FromDiscord | <Bung> new(n) or new Node , same |
19:28:27 | FromDiscord | <Forest [She/Her]> For some reason my tag isn't being committed? `git tag -a v{myPkgVersion} {prevCommitHash} -m "my message"` |
19:28:54 | FromDiscord | <Forest [She/Her]> Then i do `git push origin v{myPkgVersion}` and it doesn't show up in github |
19:29:07 | FromDiscord | <Forest [She/Her]> I've tried adding the force flag too but still doesn't work |
19:31:58 | FromDiscord | <Bung> that's your network or github problem , I guess |
19:34:07 | FromDiscord | <planetis> @4zv4l see how std/lists is done. |
19:38:24 | FromDiscord | <4zv4l> how can I print the addr of a variable ? |
19:38:38 | FromDiscord | <4zv4l> I tried `echo $(addr variable)` but that doesn't work |
19:41:34 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/28z |
19:41:51 | FromDiscord | <Forest [She/Her]> Ah i figured out the issue |
19:41:54 | FromDiscord | <Forest [She/Her]> My format string was wrong |
19:49:26 | FromDiscord | <dom96> !eval var x = "hello"; echo(repr(x)) |
19:49:28 | NimBot | 0x7fdad1fd8060"hello" |
19:51:20 | FromDiscord | <Prestige> Interesting |
19:55:08 | * | rockcavera quit (*.net *.split) |
19:55:08 | * | wallabra quit (*.net *.split) |
19:55:08 | * | mahlon quit (*.net *.split) |
19:55:08 | * | cornfeedhobo quit (*.net *.split) |
19:55:09 | * | estiquelapice quit (*.net *.split) |
19:55:09 | * | def- quit (*.net *.split) |
19:55:09 | * | pech quit (*.net *.split) |
19:55:09 | * | oprypin quit (*.net *.split) |
19:55:09 | * | jkl quit (*.net *.split) |
19:55:09 | * | genpaku quit (*.net *.split) |
19:55:09 | * | alice quit (*.net *.split) |
19:55:09 | * | xet7 quit (*.net *.split) |
19:55:09 | * | droidrage quit (*.net *.split) |
19:55:09 | * | om3ga quit (*.net *.split) |
19:55:10 | * | LyndsySimon quit (*.net *.split) |
19:55:10 | * | attah quit (*.net *.split) |
19:55:10 | * | Lord_Nightmare quit (*.net *.split) |
19:55:10 | * | xaltsc quit (*.net *.split) |
19:55:11 | * | ixmpp quit (*.net *.split) |
19:55:11 | * | buster_blue[m] quit (*.net *.split) |
19:55:11 | * | FromDiscord quit (*.net *.split) |
19:55:11 | * | via__ quit (*.net *.split) |
19:55:11 | * | euantorano quit (*.net *.split) |
19:55:11 | * | rb quit (*.net *.split) |
19:55:11 | * | dv^_^ quit (*.net *.split) |
19:55:12 | * | _________ quit (*.net *.split) |
19:55:12 | * | arkurious quit (*.net *.split) |
19:55:12 | * | adium quit (*.net *.split) |
19:55:13 | * | qwestion quit (*.net *.split) |
19:55:13 | * | void09 quit (*.net *.split) |
19:55:13 | * | nyeaa4 quit (*.net *.split) |
19:55:13 | * | NimEventer quit (*.net *.split) |
19:55:13 | * | Amun-Ra quit (*.net *.split) |
19:55:14 | * | qwr quit (*.net *.split) |
19:55:14 | * | syl quit (*.net *.split) |
19:55:14 | * | fallback quit (*.net *.split) |
19:55:14 | * | oisota quit (*.net *.split) |
19:55:14 | * | blackbeard420 quit (*.net *.split) |
19:55:14 | * | koltrast quit (*.net *.split) |
19:55:14 | * | lumidify quit (*.net *.split) |
19:55:14 | * | oz quit (*.net *.split) |
19:55:14 | * | DixieFlatline quit (*.net *.split) |
19:55:14 | * | robertmeta quit (*.net *.split) |
19:55:15 | * | mal`` quit (*.net *.split) |
19:55:15 | * | gshumway quit (*.net *.split) |
19:55:15 | * | Yardanico quit (*.net *.split) |
19:55:15 | * | madprog quit (*.net *.split) |
19:55:15 | * | Jjp137 quit (*.net *.split) |
19:55:15 | * | nisstyre quit (*.net *.split) |
19:55:15 | * | djanatyn quit (*.net *.split) |
19:55:15 | * | systemdsucks quit (*.net *.split) |
19:55:15 | * | supakeen quit (*.net *.split) |
19:55:15 | * | redj quit (*.net *.split) |
19:55:16 | * | drewr quit (*.net *.split) |
19:57:03 | * | rockcavera joined #nim |
19:57:03 | * | arkurious joined #nim |
19:57:03 | * | _________ joined #nim |
19:57:03 | * | xet7 joined #nim |
19:57:03 | * | wallabra joined #nim |
19:57:03 | * | droidrage joined #nim |
19:57:03 | * | om3ga joined #nim |
19:57:03 | * | mahlon joined #nim |
19:57:03 | * | cornfeedhobo joined #nim |
19:57:03 | * | adium joined #nim |
19:57:03 | * | estiquelapice joined #nim |
19:57:03 | * | def- joined #nim |
19:57:03 | * | pech joined #nim |
19:57:03 | * | qwestion joined #nim |
19:57:03 | * | oprypin joined #nim |
19:57:03 | * | buster_blue[m] joined #nim |
19:57:03 | * | jkl joined #nim |
19:57:03 | * | void09 joined #nim |
19:57:03 | * | genpaku joined #nim |
19:57:03 | * | alice joined #nim |
19:57:03 | * | Jjp137 joined #nim |
19:57:03 | * | LyndsySimon joined #nim |
19:57:03 | * | nyeaa4 joined #nim |
19:57:03 | * | attah joined #nim |
19:57:03 | * | Lord_Nightmare joined #nim |
19:57:03 | * | NimEventer joined #nim |
19:57:03 | * | xaltsc joined #nim |
19:57:03 | * | ixmpp joined #nim |
19:57:03 | * | Amun-Ra joined #nim |
19:57:03 | * | fallback joined #nim |
19:57:03 | * | FromDiscord joined #nim |
19:57:03 | * | oz joined #nim |
19:57:03 | * | via__ joined #nim |
19:57:03 | * | euantorano joined #nim |
19:57:03 | * | rb joined #nim |
19:57:03 | * | dv^_^ joined #nim |
19:57:03 | * | nisstyre joined #nim |
19:57:03 | * | DixieFlatline joined #nim |
19:57:03 | * | robertmeta joined #nim |
19:57:03 | * | oisota joined #nim |
19:57:03 | * | blackbeard420 joined #nim |
19:57:03 | * | mal`` joined #nim |
19:57:03 | * | supakeen joined #nim |
19:57:03 | * | qwr joined #nim |
19:57:03 | * | syl joined #nim |
19:57:03 | * | djanatyn joined #nim |
19:57:03 | * | koltrast joined #nim |
19:57:03 | * | gshumway joined #nim |
19:57:03 | * | Yardanico joined #nim |
19:57:03 | * | lumidify joined #nim |
19:57:03 | * | systemdsucks joined #nim |
19:57:03 | * | redj joined #nim |
19:57:03 | * | drewr joined #nim |
19:57:03 | * | madprog joined #nim |
19:57:10 | FromDiscord | <ezquerra> In reply to @ezquerra "I am trying to": I’ve tried it on both windows and MAC and I get the same error in both cases |
19:57:43 | * | nyeaa4 quit (Quit: Ping timeout (120 seconds)) |
19:57:56 | * | nyeaa4 joined #nim |
19:59:53 | * | reversem3[m] quit (Ping timeout: 255 seconds) |
20:00:10 | * | buster_blue[m] quit (Ping timeout: 268 seconds) |
20:00:31 | FromDiscord | <auxym> could you post the code in the playground?https://play.nim-lang.org/ |
20:09:25 | FromDiscord | <enthus1ast> @ezquerra\: do you do some manual linking? |
20:17:21 | FromDiscord | <!Patitotective> 🌄 |
20:21:52 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49bs |
20:22:06 | FromDiscord | <Elegantbeef> `Box[string]` |
20:22:25 | FromDiscord | <Elegantbeef> There is no generic inference on constructors presently |
20:22:41 | FromDiscord | <4zv4l> aaalright |
20:22:55 | FromDiscord | <4zv4l> so I cant use a function/template to create my object ? |
20:23:10 | FromDiscord | <Elegantbeef> You can |
20:23:15 | FromDiscord | <4zv4l> how ? |
20:23:17 | FromDiscord | <Elegantbeef> You just do `Box[string](data: data)` |
20:23:28 | FromDiscord | <4zv4l> oooh |
20:23:33 | FromDiscord | <Elegantbeef> So in the above `Box[T](data: data)` |
20:24:40 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49bt |
20:24:44 | FromDiscord | <4zv4l> I have an error with the `let ...` line |
20:24:52 | FromDiscord | <4zv4l> `Error: identifier expected, but found '"Simon"'` |
20:25:04 | FromDiscord | <Elegantbeef> inside templates all usages of parameters are replaced |
20:25:20 | FromDiscord | <Elegantbeef> so either change the template parameter from `data` or just use a proc like a normal person |
20:25:47 | FromDiscord | <Elegantbeef> A single statement procedure is likely to get inlined by the C compiler, if you're concerned marked it inline |
20:25:49 | FromDiscord | <4zv4l> thaaaanks !! |
20:26:11 | FromDiscord | <4zv4l> oh no, I made it template because the compiler wanted me to do so at first |
20:26:18 | FromDiscord | <Elegantbeef> No it didnt |
20:26:25 | FromDiscord | <4zv4l> I swear it was |
20:26:35 | FromDiscord | <Elegantbeef> template/generic instantiation error is not "make it a template" |
20:26:40 | FromDiscord | <4zv4l> oh |
20:26:40 | FromDiscord | <4zv4l> xD |
20:26:42 | FromDiscord | <4zv4l> alright |
20:26:45 | FromDiscord | <Elegantbeef> It's a error saying "Something went wrong in generic instantiation" |
20:27:11 | FromDiscord | <4zv4l> https://tenor.com/view/cat-for-akza-gif-24166857 |
20:27:13 | FromDiscord | <4zv4l> thank you |
20:30:31 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49bu |
20:30:40 | FromDiscord | <4zv4l> oooh |
20:30:47 | FromDiscord | <Elegantbeef> `Node` is a generic typeclass |
20:31:09 | FromDiscord | <4zv4l> yep |
20:31:09 | FromDiscord | <4zv4l> (edit) "https://play.nim-lang.org/#ix=49bu" => "https://play.nim-lang.org/#ix=49bv" |
20:31:11 | FromDiscord | <Elegantbeef> Of course you should add `[T]` |
20:32:59 | FromDiscord | <4zv4l> can I do something like this |
20:33:01 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49bw |
20:33:06 | FromDiscord | <4zv4l> to keep the T type for the function body ? |
20:33:22 | FromDiscord | <4zv4l> then I'll only need to precise the type when creating the object LinkedList |
20:33:25 | FromDiscord | <Elegantbeef> Of course you can, not that i see why you'd want to |
20:33:37 | FromDiscord | <Elegantbeef> Actually you cannot |
20:33:50 | FromDiscord | <4zv4l> because otherwise I have to precise `list.add[string]("hello")` |
20:33:51 | FromDiscord | <Elegantbeef> `LinkedList` is again a generic typeclass so needs a specified `LinkedList[T]` |
20:34:02 | FromDiscord | <Elegantbeef> No you do not |
20:34:13 | FromDiscord | <Elegantbeef> It's a pointer proc so it'd be stored with the type |
20:34:22 | FromDiscord | <Elegantbeef> The real question is why are you using a pointer proc here |
20:35:19 | FromDiscord | <4zv4l> because when I add a value to the linked list |
20:35:22 | FromDiscord | <4zv4l> I need to modify the node in it |
20:35:27 | FromDiscord | <Elegantbeef> So what? |
20:35:32 | FromDiscord | <Elegantbeef> It doesnt need to be a pointer proc |
20:35:45 | FromDiscord | <4zv4l> oh yeah no |
20:35:48 | FromDiscord | <4zv4l> I added the proc in the struct |
20:35:54 | FromDiscord | <4zv4l> because I thought that was needed to keep the type |
20:35:56 | FromDiscord | <4zv4l> T |
20:35:56 | FromDiscord | <Elegantbeef> No that |
20:35:59 | FromDiscord | <Elegantbeef> s a pointer proc |
20:36:10 | FromDiscord | <4zv4l> wdym pointer proc ? |
20:36:20 | FromDiscord | <4zv4l> function pointer ? |
20:36:31 | FromDiscord | <Elegantbeef> Yes |
20:36:40 | FromDiscord | <4zv4l> In reply to @4zv4l "T": here |
20:36:43 | FromDiscord | <4zv4l> wait |
20:36:46 | FromDiscord | <4zv4l> In reply to @4zv4l "because I thought that": here |
20:37:03 | FromDiscord | <4zv4l> this is a part of the code now |
20:37:06 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49by |
20:37:08 | FromDiscord | <4zv4l> and when I try to compile |
20:37:25 | FromDiscord | <4zv4l> `(14, 31) Error: undeclared identifier: 'T'`↵line 14 being `proc add` |
20:37:48 | FromDiscord | <!Patitotective> `proc add[T]` |
20:37:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49bz |
20:38:18 | FromDiscord | <creikey> On line 225, what is 0.N doing? https://media.discordapp.net/attachments/371759389889003532/1014272875299082310/unknown.png |
20:38:29 | FromDiscord | <creikey> is that just casting 0 to the type n |
20:38:29 | FromDiscord | <Elegantbeef> Converting to N |
20:38:30 | FromDiscord | <creikey> (edit) removed "n" |
20:38:32 | FromDiscord | <creikey> (edit) "is that just casting 0 to the type ... " added "N" |
20:38:34 | FromDiscord | <creikey> yeah |
20:38:38 | FromDiscord | <Elegantbeef> That's wrong anyway |
20:38:45 | FromDiscord | <Elegantbeef> It should be `N.low` |
20:38:51 | FromDiscord | <creikey> yeah |
20:38:59 | FromDiscord | <Elegantbeef> If you use a `array[-10..1, int]` it'll be wrong |
20:39:01 | FromDiscord | <creikey> interesting that low can take a type or a variable of the type |
20:39:19 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49bA |
20:39:26 | FromDiscord | <4zv4l> yeah it just feels weird to me to init my list variable like that |
20:39:31 | FromDiscord | <creikey> I've got a pretty cool nim project almost up and running, science related |
20:39:44 | FromDiscord | <4zv4l> still have the C fear of having a variable not 0 initialized |
20:40:11 | FromDiscord | <Elegantbeef> Hmm does flatty not work with enum indexed arrays? |
20:40:19 | FromDiscord | <!Patitotective> In reply to @creikey "interesting that low can": `variable.low` is deprecated |
20:41:12 | FromDiscord | <creikey> In reply to @Patitotective "`variable.low` is deprecated": what are you supposed to do instead? |
20:41:20 | FromDiscord | <!Patitotective> type.low |
20:41:39 | FromDiscord | <creikey> In reply to @Patitotective "type.low": is there like `typeof(variable).low`? |
20:41:53 | FromDiscord | <!Patitotective> In reply to @creikey "is there like `typeof(variable).low`?": that is type.low |
20:41:56 | FromDiscord | <creikey> oh yeah I had this issue where the DSL of arraymancer to declare a neural network used a global context variable that conflicted with a pixie name, anybody have any idea how to fix that? I want to like "unimport" a module for a section of code |
20:48:31 | FromDiscord | <Elegantbeef> There we go creikey you made me write an issue |
20:48:33 | FromDiscord | <Elegantbeef> So 10 points to you |
20:50:38 | * | buster_blue[m] joined #nim |
20:54:32 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=49bH |
20:56:53 | FromDiscord | <leorize> your index is prolly wrong |
20:57:22 | FromDiscord | <Elegantbeef> `echo body.treeRepr` |
20:57:29 | FromDiscord | <leorize> yea, the return value is the first entry of the parameter list |
20:57:37 | FromDiscord | <leorize> type\ |
20:57:46 | FromDiscord | <Elegantbeef> so should be `body.params[0]` |
20:59:58 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=49bJ |
21:01:25 | FromDiscord | <d4rckh> Any library for parsing TLVs? |
21:01:43 | FromDiscord | <d4rckh> If there isn't any, I'm making one |
21:02:02 | FromDiscord | <d4rckh> From my Google searches I ound nothing |
21:02:11 | FromDiscord | <d4rckh> (edit) "ound" => "found" |
21:04:04 | FromDiscord | <Elegantbeef> https://github.com/beef331/micros/blob/master/tests/test1.nim to do the dew |
22:03:16 | FromDiscord | <Forest [She/Her]> I hate hyperfixations :p↵https://github.com/Mythical-Forest-Collective/CodeGenLib/blob/master/scripts/autotagger.nim |
22:04:37 | FromDiscord | <Forest [She/Her]> i just spent ages perfecting that dumb af script |
22:10:57 | FromDiscord | <creikey> anybody remember that macro that's like when this compiles |
22:11:03 | FromDiscord | <creikey> like I want to do this https://media.discordapp.net/attachments/371759389889003532/1014296215879417856/unknown.png |
22:11:07 | FromDiscord | <creikey> only have that line of code if it compiles |
22:11:13 | FromDiscord | <Elegantbeef> `compiles()` |
22:12:29 | FromDiscord | <creikey> lol I don't think it's working |
22:12:34 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/1014296599725359144/unknown.png |
22:12:40 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/1014296623448346745/unknown.png |
22:12:43 | FromDiscord | <Elegantbeef> `when compiles(print(s, e))` |
22:13:05 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/1014296724124221450/unknown.png |
22:13:07 | FromDiscord | <creikey> generic instantiation too nested? |
22:13:23 | FromDiscord | <Elegantbeef> Recursive calls? |
22:13:27 | FromDiscord | <creikey> I guess I have to setup debugging with nim ☠️ |
22:14:43 | FromDiscord | <Elegantbeef> Or just go to line 230 and see what's calling it recursively |
22:15:23 | FromDiscord | <!Patitotective> debugging is funnier |
22:15:38 | FromDiscord | <Elegantbeef> Especially since it wouldnt help |
22:16:24 | FromDiscord | <creikey> In reply to @Elegantbeef "Or just go to": https://media.discordapp.net/attachments/371759389889003532/1014297560254513173/unknown.png |
22:16:31 | FromDiscord | <creikey> I'm not even sure |
22:17:11 | FromDiscord | <creikey> the debugger doesn't breakpoint on segfault |
22:17:42 | FromDiscord | <creikey> I don't think it's working at all? |
22:21:28 | FromDiscord | <creikey> wow wait does flatty not work with options |
22:21:47 | FromDiscord | <creikey> it does not |
22:22:05 | FromDiscord | <Elegantbeef> It should |
22:22:13 | FromDiscord | <Elegantbeef> You might have to make your own serialiser |
22:22:27 | FromDiscord | <creikey> that's so far from the point of what I'm experimenting with |
22:22:32 | FromDiscord | <creikey> I would just not use nim at that poitn |
22:22:34 | FromDiscord | <creikey> (edit) "poitn" => "point" |
22:22:41 | FromDiscord | <Elegantbeef> I mean for flatty |
22:22:45 | FromDiscord | <Elegantbeef> It allows you to define your own serialisers |
22:22:46 | FromDiscord | <creikey> oh yeah I did |
22:22:57 | FromDiscord | <creikey> I made flatty serialization for arraymancer tensors |
22:23:18 | FromDiscord | <creikey> the problem is some of the tensors are nil |
22:23:35 | FromDiscord | <creikey> so I made them an option hoping flatty would ignore them |
22:24:16 | FromDiscord | <Elegantbeef> I mean you just dont save if nil |
22:24:36 | * | reversem3[m] joined #nim |
22:24:36 | FromDiscord | <creikey> on rereading I need to do something |
22:24:45 | FromDiscord | <creikey> how can I know if the current tensor is null from the binary blob? |
22:24:55 | FromDiscord | <creikey> I'd need to write a true or false at the beginning to say if it's nil or not |
22:25:02 | FromDiscord | <creikey> and i thought that's what option would be |
22:25:14 | FromDiscord | <Elegantbeef> Options dont add an extra value to refs |
22:25:16 | FromDiscord | <creikey> unfortunately I have been trolled |
22:25:22 | FromDiscord | <Elegantbeef> They wrap `nil` as the option |
22:25:31 | FromDiscord | <Elegantbeef> Flatty should properly handle ref objects |
22:25:32 | FromDiscord | <creikey> In reply to @Elegantbeef "They wrap `nil` as": so you can't tell if an option is nil or not from its data? |
22:25:51 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/1014299940362670131/unknown.png |
22:25:56 | FromDiscord | <creikey> it should work |
22:26:10 | FromDiscord | <creikey> oh I overrode this code |
22:26:25 | FromDiscord | <creikey> because I'm overriding Variable[Tensor[T]] |
22:35:57 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=49cc |
22:41:26 | * | Jovan quit (Ping timeout: 255 seconds) |
22:44:10 | * | Jovan joined #nim |
22:53:22 | FromDiscord | <Elegantbeef> It's fine, the name is dumb though |
22:54:25 | FromDiscord | <!Patitotective> then? `wasChanged`? :P |
22:54:28 | FromDiscord | <!Patitotective> (edit) ":P" => ":p" |
22:54:33 | FromDiscord | <Elegantbeef> Changed to what? |
22:54:38 | FromDiscord | <Elegantbeef> Like what is that name |
22:54:52 | FromDiscord | <Elegantbeef> There's a reason it's called `{.async.}` and not `{.doesSomethingOrAnother.}` |
22:54:55 | FromDiscord | <!Patitotective> like, the currend index was changed to something it wasnt before calling the function |
22:55:07 | FromDiscord | <!Patitotective> (edit) "currend" => "lexer" |
22:55:32 | FromDiscord | <Elegantbeef> So i dont know why not `lexerProc` or something similar |
22:55:44 | FromDiscord | <!Patitotective> perhaps |
22:55:53 | FromDiscord | <!Patitotective> lexing 😎 |
22:56:56 | FromDiscord | <Elegantbeef> Also dont use `ident"before"` do `let before = genSym(nskLet, "before"` |
22:57:45 | FromDiscord | <creikey> how do I do this? https://media.discordapp.net/attachments/371759389889003532/1014307965177692161/unknown.png |
22:57:48 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Also dont use `ident"before"`": k |
22:58:20 | FromDiscord | <creikey> like take an untyped statement in a template and use it to access the field of an object |
22:58:25 | FromDiscord | <Elegantbeef> templates replace all usages of `theObject` with the tree you give it |
22:58:58 | FromDiscord | <creikey> ah so that should work |
23:00:04 | FromDiscord | <creikey> In reply to @Elegantbeef "templates replace all usages": at the call site it doesn't like a parameter that means nothing https://media.discordapp.net/attachments/371759389889003532/1014308551893733456/unknown.png |
23:00:11 | FromDiscord | <creikey> that only makes sense when indexing an object |
23:00:29 | FromDiscord | <Elegantbeef> What's the compiler say |
23:00:55 | FromDiscord | <creikey> In reply to @Elegantbeef "What's the compiler say": (136, 16) Error: undeclared identifier: 'brain' |
23:01:34 | FromDiscord | <Elegantbeef> is `creature.brain....` valid? |
23:01:47 | FromDiscord | <Elegantbeef> do you have two cloneLayers ? |
23:01:50 | FromDiscord | <creikey> In reply to @Elegantbeef "is `creature.brain....` valid?": yeah |
23:01:54 | FromDiscord | <creikey> In reply to @Elegantbeef "do you have two": no |
23:30:37 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |