<< 30-08-2022 >>

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