<< 11-01-2023 >>

00:00:11*jmdaemon quit (Ping timeout: 264 seconds)
00:08:43*fallback quit (Ping timeout: 248 seconds)
00:09:22*jmdaemon joined #nim
00:28:05*jmdaemon quit (Ping timeout: 246 seconds)
00:28:47*fallback joined #nim
00:31:10*jmdaemon joined #nim
01:15:58FromDiscord<@thatrandomperson5-6310e3b26da03> I wrote an xml parse using only stdlib\: https://gist.github.com/thatrandomperson5/482fb4562b72e46900cf736f72759643
01:29:34FromDiscord<pmp-p> if think i've found something to run Nim Wasi target on browser, any chance someone with typescript knowledge can tell me how to build that thing ? https://github.com/qrdate/tinywasi
01:30:10FromDiscord<pmp-p> (edit) "browser," => "browser with reator model,"
01:32:17*xet7 joined #nim
01:34:20FromDiscord<pmp-p> hmm maybe `npx tsc --build`
01:57:31*fallback quit (Ping timeout: 260 seconds)
02:05:52*fallback joined #nim
02:16:10FromDiscord<scipio> In reply to @auxym "<@890692135827959919> we have https://scinim.github": or https://github.com/bluenote10/NimData @Saint
02:18:17*jmdaemon quit (Ping timeout: 246 seconds)
02:22:31*jmdaemon joined #nim
02:24:05FromDiscord<T0lk1en> First project. Check it out. https://github.com/ko-mill/NimCrypt Lmk some feedback
02:25:23FromDiscord<Rika> Remove the debug echo statements lol
02:26:01FromDiscord<scipio> well it is friendly? I feel welcome reading so many hiiiiiiiii's
02:26:09FromDiscord<T0lk1en> Oh shit🥲🥲
02:26:10FromDiscord<Rika> Lmao
02:26:27FromDiscord<T0lk1en> Happens to the best
02:26:51FromDiscord<Elegantbeef> On the plus side you didnt push a binary file
02:27:09FromDiscord<leetnewb> Feel like the debug messages need to be meaner
02:27:23FromDiscord<T0lk1en> I like a friendly program
02:27:41FromDiscord<scipio> I'd throw in a `when` and leave 'em in there as easter eggs
02:27:49FromDiscord<T0lk1en> In reply to @Rika "Remove the debug echo": Removed them
02:27:58FromDiscord<scipio> put 'em back
02:28:00FromDiscord<T0lk1en> What does when do?
02:28:11*byanka joined #nim
02:28:16FromDiscord<scipio> `when` is a compile time i`f`
02:28:21FromDiscord<scipio> (edit) "i`f`" => "`if`"
02:28:22*jmdaemon quit (Ping timeout: 272 seconds)
02:28:31FromDiscord<T0lk1en> Purpose?
02:29:00FromDiscord<scipio> 42
02:29:10FromDiscord<Elegantbeef> Optional compilation of logic depending on flags or types
02:29:20FromDiscord<T0lk1en> Wyd does that mean?
02:29:23FromDiscord<T0lk1en> Wtf
02:29:50FromDiscord<Rika> In reply to @leetnewb "Feel like the debug": Like “fuck you”?
02:30:00FromDiscord<T0lk1en> Like wanting to do logic outside the program during compile time?
02:30:06FromDiscord<Rika> In reply to @T0lk1en "Like wanting to do": Yes pretty much
02:30:19*byanka_ quit (Ping timeout: 260 seconds)
02:30:22FromDiscord<T0lk1en> Why would you want something that does logic on compile time vs when you run it?
02:30:30FromDiscord<Rika> Like if you want to put debug statements only when compiling a debug binary
02:30:32FromDiscord<Elegantbeef> When compiled wiht `-d:doEcho` it will print "hello" otherwise it doesnt do anything
02:30:32FromDiscord<Elegantbeef> This extends to generics and the like
02:30:41FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/JY2
02:30:57FromDiscord<T0lk1en> Ah so basically optional debug statements
02:31:43FromDiscord<T0lk1en> Cool
02:32:02FromDiscord<T0lk1en> But lmk what you guys think. I’m trying to learn and get better
02:32:05FromDiscord<Rika> Not the only use of course
02:32:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4kRf
02:32:30FromDiscord<Elegantbeef> Another usage of `when`
02:32:30FromDiscord<Elegantbeef> Thinking of it as a compile time `if` is generally sufficient, but it behaves differently
02:32:30FromDiscord<Elegantbeef> It's not that it runs at compile time
02:32:31FromDiscord<Elegantbeef> It changes the program based off constant expressions
02:32:31FromDiscord<Elegantbeef> Which means you can specialise for types or just optionally emit code
02:32:31FromDiscord<Elegantbeef> One use of using `when` is to include debug statements only if build with the debug flag
02:32:33FromDiscord<Elegantbeef> Otherwise you dont have the overhead of debug logic
02:32:45FromDiscord<Rika> Beef typing at the speed of light (joke)
02:32:55FromDiscord<Rika> Bridge just being slow I assume
02:33:00FromDiscord<Elegantbeef> There isnt much to comment on
02:33:00FromDiscord<Elegantbeef> It's 12 loc
02:33:06FromDiscord<Elegantbeef> Matrix bridge is slow, but i'm fast
02:33:07FromDiscord<Elegantbeef> Or vice versa
02:42:41FromDiscord<T0lk1en> Interesting
02:44:31FromDiscord<scipio> In reply to @T0lk1en "First project. Check it": other than that, 2 things:↵-1- 25 lines of code (which could be rewritten to about half the size) isn't exactly "publishable", right? What kind of feedback would you expect on this? Kind of "storming / kicking in an already open door".↵↵-2- it's good you're learning and having fun! Keep at it! 🙂
02:46:33FromDiscord<T0lk1en> Ig I didn’t know what to expect. Maybe something about if it’s actually useful or not.
02:47:59FromDiscord<scipio> sent a code paste, see https://play.nim-lang.org/#ix=4kRh
02:48:10FromDiscord<Elegantbeef> Again it's like 12 loc there isnt much to say
02:48:16*acj joined #nim
02:48:30*acj quit (Client Quit)
02:48:37FromDiscord<scipio> It was a joke, not really asking for feedback
02:48:40FromDiscord<scipio> 😁
02:48:43FromDiscord<Elegantbeef> That's not enterprise enoguh sorry scipio
02:49:02FromDiscord<scipio> In reply to @Elegantbeef "That's not enterprise enoguh": But it is _eloquent_
02:49:05FromDiscord<Elegantbeef> I was responding to tolkien about the 12loc
02:49:06FromDiscord<T0lk1en> Whatever bro. Just trying to learn.
02:49:11FromDiscord<Elegantbeef> It's really not scipio
02:49:35FromDiscord<scipio> In reply to @T0lk1en "Whatever bro. Just trying": Like I said: keep at it! iI'm not trying to diss you at all, I'm a beginner in Nim myself
02:49:55FromDiscord<scipio> In reply to @Elegantbeef "It's really not scipio": Well I like it! :p
02:50:01FromDiscord<scipio> (edit) ":p" => "😛"
02:50:27FromDiscord<scipio> In reply to @T0lk1en "Whatever bro. Just trying": You asked for feedback, this is also valid feedback.
02:50:28FromDiscord<voidwalker> In reply to @scipio "Well I like it!": You're hired
02:50:51FromDiscord<T0lk1en> Gotchu bro
02:50:57FromDiscord<T0lk1en> @scipio
02:52:03FromDiscord<voidwalker> is there any way I can assign to an enum value, a type value of another enum type ?
02:52:44FromDiscord<Elegantbeef> `myEnum = MyEnumType(myOtherEnum)`
02:53:14FromDiscord<auxym> wow, I still haven't finished parsing the question
02:53:31FromDiscord<voidwalker> lol I don't think I wrote it properly
02:53:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4kRi
02:53:49FromDiscord<Elegantbeef> I assume you want to assign a enum of a different type to a enum of this tpye
02:54:04FromDiscord<voidwalker> hm no
02:54:15FromDiscord<Elegantbeef> Well then get to using your words
02:54:36FromDiscord<voidwalker> I want an enum value to hold, like it can hold a string, the "value" (like in typedesc?) of another Enum type
02:54:44FromDiscord<voidwalker> so that they are logically linked
02:55:20FromDiscord<Elegantbeef> I mean you can do `myEnumField = $myOtherEnumField`
02:55:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4kRj
02:55:41FromDiscord<voidwalker> well it's not field to field, it's field to type
02:55:42FromDiscord<auxym> or `int(myOtherEnumField)`
02:55:58FromDiscord<Elegantbeef> You need to provide a problem in code
02:56:07FromDiscord<Elegantbeef> Your words are failing you like i did highschool
02:56:07FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4kRk
02:56:11FromDiscord<Elegantbeef> There you go
02:56:12FromDiscord<voidwalker> I want aom to hold "AomParams" type
02:56:28FromDiscord<Elegantbeef> Hold it how?
02:56:33FromDiscord<auxym> types cannot be used as values
02:56:34FromDiscord<voidwalker> as a value 😄
02:56:36FromDiscord<voidwalker> no ?
02:56:43FromDiscord<voidwalker> I thought that's what typedesc is for
02:56:56FromDiscord<auxym> as runtime values
02:57:00FromDiscord<voidwalker> I need it to get rid of a layer of abstraction
02:57:07FromDiscord<Elegantbeef> Typedescs do not exist at runtime
02:57:11FromDiscord<Elegantbeef> They're purely a compile time construct
02:57:15FromDiscord<voidwalker> oh..
02:57:20FromDiscord<Elegantbeef> I dont know what relation you're going for still
02:57:46FromDiscord<voidwalker> related to this: https://forum.nim-lang.org/t/9816 where I have this implemented: https://play.nim-lang.org/#ix=4kRg
03:00:29FromDiscord<voidwalker> sent a code paste, see https://paste.rs/h9E
03:00:54FromDiscord<Elegantbeef> The only way around this is a macro of some form
03:01:00FromDiscord<voidwalker> which adds one more useless layer in the object's nodes of values
03:01:11FromDiscord<Elegantbeef> You want to conditionally flow types based off runtime value, which means you need branching
03:02:34FromDiscord<Elegantbeef> Atleast as far as i can tell you want to change types used based off what value is parsed
03:02:45FromDiscord<Elegantbeef> Alternatively you could just use a `seq[(string, string)]`
03:02:53FromDiscord<Elegantbeef> Or `(int, string)`
03:03:23FromDiscord<voidwalker> yeah, I want to be able to pass the proper type based on a value I already know it should point to that type
03:03:30*argonica quit (Ping timeout: 265 seconds)
03:03:34FromDiscord<voidwalker> (edit) "a" => "an eum"
03:04:17FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/5OT
03:04:18FromDiscord<voidwalker> In reply to @Elegantbeef "Alternatively you could just": use for/in what ?
03:04:24FromDiscord<voidwalker> hmm
03:04:25FromDiscord<Elegantbeef> No clue if you need the int value or what
03:04:32FromDiscord<voidwalker> no, I really don't
03:05:02FromDiscord<Elegantbeef> We could do something else aswell
03:07:45FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4kRn
03:08:07FromDiscord<pyolyokh> it's an array indexed by Encoders
03:08:22FromDiscord<voidwalker> ohhh
03:08:26FromDiscord<Elegantbeef> Then you can do the same of `let myParams = params[aom]`
03:08:30FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/DHJ
03:10:07FromDiscord<scipio> sent a long message, see http://ix.io/4kRo
03:10:29FromDiscord<Elegantbeef> Well you're a cryptoscammer
03:10:30FromDiscord<sealmove> Hello. I am trying to run the tests of an old project of mine with testament, and I can't remember the correct command... The documentation is lacking.
03:10:31FromDiscord<Elegantbeef> 😛
03:11:15FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=4kRp
03:12:07FromDiscord<scipio> In reply to @Elegantbeef "Well you're a cryptoscammer": I made it work anyway https://media.discordapp.net/attachments/371759389889003532/1062569567878127626/image.png
03:12:28FromDiscord<Rika> That looks pretty nice
03:14:08FromDiscord<scipio> Thx. My concept of this UI was to remove human trading input (no fat finger data entry, just clicks) as much as possible. Also created a binding to an Elgato StreamDeck, almost like a gaming controller.
03:15:41FromDiscord<Rika> In reply to @scipio "Thx. My concept of": Now you have accidental click issues lol
03:16:38FromDiscord<scipio> Actually no! 😁 Because of interfacing over API with this app running client-side, I can add in a bunch of checks and computations on the backend
03:17:29FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4kRr
03:23:32*argonica joined #nim
03:24:45FromDiscord<Elegantbeef> What?
03:25:08FromDiscord<amadan> sent a code paste, see https://paste.rs/F7F
03:26:53FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4kRt
03:27:01FromDiscord<voidwalker> (edit) "https://paste.rs/nB4" => "https://play.nim-lang.org/#ix=4kRu"
03:27:18FromDiscord<Elegantbeef> They all have to be the same type of `Params`
03:27:19FromDiscord<voidwalker> different value types, can't mix them
03:27:27FromDiscord<Elegantbeef> Of course you cannot mix them
03:27:46FromDiscord<Elegantbeef> That's the point of the set, you can share them if you need but getting which ones are valid are easy
03:28:33FromDiscord<voidwalker> oh so you mean I should put them all in one big set and separate them in the const array
03:31:48FromDiscord<Elegantbeef> Yes
03:55:26*argonica quit (Remote host closed the connection)
04:13:52*arkurious quit (Quit: Leaving)
04:14:52FromDiscord<T0lk1en> sent a long message, see http://ix.io/4kRF
04:15:05FromDiscord<T0lk1en> This is my code and when I run it I get this error
04:15:37FromDiscord<T0lk1en> ‘Input.Len == 16’ assertion error
04:15:54FromDiscord<T0lk1en> However I know I’m providing it a valid AES key that is the proper length
04:16:04FromDiscord<T0lk1en> The example code works fine
04:16:28FromDiscord<T0lk1en> That is in the libraries readme.md
04:21:55FromDiscord<T0lk1en> I mean like wth bro. The example code work perfect
04:35:59FromDiscord<m4ul3r> sent a code paste, see https://paste.rs/OGM
04:36:25FromDiscord<Rika> It’s not in their code
04:36:30FromDiscord<Rika> It’s in the functions they call
04:36:33FromDiscord<Rika> Most likely
04:37:10FromDiscord<m4ul3r> Ah i see
04:37:18FromDiscord<T0lk1en> How do you get the code to show up so nice?
04:37:21FromDiscord<T0lk1en> On discord?
04:37:41*azimut quit (Ping timeout: 255 seconds)
04:37:48FromDiscord<m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=4kRH
04:37:59FromDiscord<m4ul3r> (edit) "sent a code paste, see https://play.nim-lang.org/#ix=4kRH" => "3 back ticks then nim, close with 3 back ticks"
04:38:09FromDiscord<m4ul3r> (edit) "ticks" => "ticks↵ex:↵'''nim↵'''"
04:38:33FromDiscord<m4ul3r> (edit) "ticks↵ex:↵'''nim↵'''" => "ticks↵ex (single for showing):↵'''nim↵'''"
04:38:39FromDiscord<T0lk1en> Still I don’t u sweat and why my code is t working
04:38:40FromDiscord<m4ul3r> (edit) "3 back ticks then nim, close with 3 back ticks↵ex (single ... for" added "quote"
04:38:44FromDiscord<T0lk1en> Understand
04:39:05FromDiscord<m4ul3r> What args are you giving to encrypt or decrypt?
04:40:14FromDiscord<T0lk1en> A valid file name and a valid aes 16 length key
04:40:36FromDiscord<T0lk1en> It’s almost gotta be a problem w the library
04:41:16FromDiscord<T0lk1en> Yeah it is I’m getting errors on the example code now
04:43:16FromDiscord<m4ul3r> Just tested it, works for me so it isn't a problem with the library
04:43:34FromDiscord<T0lk1en> Lemme delete and redownload the library rq
04:44:25FromDiscord<T0lk1en> Does my code work on your machine?
04:46:42FromDiscord<m4ul3r> let me test
04:47:09FromDiscord<T0lk1en> I left my GitHub earlier
04:48:36FromDiscord<m4ul3r> You're using contents with `aes.encryptECB()` which isn't the key
04:49:15FromDiscord<m4ul3r> contents is probably not 16 and that's why it is failing
04:50:55FromDiscord<T0lk1en> I just deleted the portion of code in the library that was cashing me problems and everything works perfect now. Let’s see if I fucked up big or not
04:53:55FromDiscord<m4ul3r> According to the repo (https://github.com/jangko/nimAES) the implemented AES only works on 1 bock (16 bytes).↵You'd have to implement iteration of each block yourself,
05:00:07*oprypin quit (Quit: Bye)
05:07:11FromDiscord<jtv> Wow, the compiler on OS X runs under rosetta?
05:12:26FromDiscord<jtv> I mean, it definitely does, as I discovered on accident. Why's that the case I guess is the question 🙂
05:12:54FromDiscord<T0lk1en> In reply to @m4ul3r "According to the repo": Wdym
05:14:10FromDiscord<m4ul3r> In reply to @T0lk1en "Wdym": https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation↵ECB is a block cipher, so you would encrypt each block of your data one by one. The library only support 1 block for AES-ECB
05:14:13FromDiscord<T0lk1en> Do I have to portion out my data into 16 but lengths an encrypt it one by one?
05:14:33FromDiscord<jtv> Oh my god, if you do that, it's insecure.
05:14:43FromDiscord<m4ul3r> ecb is insecure yes
05:14:53FromDiscord<T0lk1en> Wtf what is secure
05:14:54FromDiscord<jtv> No, ECB mode is just running the block cipher
05:15:03FromDiscord<jtv> Repeating input, key pairs is insecure
05:15:08FromDiscord<T0lk1en> It seems every time I ask everything is insecure
05:15:11FromDiscord<T0lk1en> Rsa
05:15:12FromDiscord<T0lk1en> AES
05:15:18FromDiscord<T0lk1en> What IS secure
05:15:32FromDiscord<Elegantbeef> If you compile from source it runs on arm
05:15:35FromDiscord<jtv> Right, like I told you, even cryptographers have an incredibly difficult time getting things right.
05:15:56FromDiscord<T0lk1en> This is fucked I’m writing my own encryption
05:15:59FromDiscord<jtv> Ahhh, thanks. I figured I'd have to compile the C myself, so that's good to know, will do
05:16:10FromDiscord<jtv> Yes, rule #1, remember?
05:16:24FromDiscord<T0lk1en> In reply to @jtv "Yes, rule #1, remember?": Which is?
05:16:34FromDiscord<jtv> DON'T ROLL YOUR OWN ENCRYPTION
05:16:38FromDiscord<jtv> You forgot already? 🙂
05:16:52FromDiscord<T0lk1en> That’s right
05:17:45FromDiscord<T0lk1en> Okay here’s 2 questions. What is secure cause y’all got me thinking that encryption just doesn’t exist. #2 what makes something good
05:17:50FromDiscord<T0lk1en> Encryption wise
05:18:16FromDiscord<m4ul3r> Looks at the wiki i sent you
05:18:17FromDiscord<jtv> Well, everything can easily be insecure if you don't use it the way it was intended to be used
05:18:36FromDiscord<jtv> For password storage, there are a LOT of considerations to doing it right
05:19:02FromDiscord<jtv> Meaning, I teach a whole 3 hour class and don't scratch the surface on it
05:19:21FromDiscord<jtv> For most day-to-day stuff, TLS is your best bet.
05:19:32FromDiscord<m4ul3r> AES-CBC is more secure than AES-ECB, nimAES supports n blocks for AES-CBC
05:19:37FromDiscord<jtv> Oh my god, no
05:19:41FromDiscord<T0lk1en> is there a tls nim library?
05:19:54FromDiscord<jtv> CBC no cryptographer has used for 15+ years, and it was removed from TLS1.3
05:20:09FromDiscord<jtv> Just having to pad alone causes problems
05:20:20FromDiscord<T0lk1en> What’s tls
05:20:46FromDiscord<jtv> "Transport Layer Security", the protocol that encrypts virtually all encrypted IP-level traffic
05:20:53FromDiscord<m4ul3r> i didn't say CBC was insecure, just that it's more secure than ECB
05:21:43FromDiscord<m4ul3r> t0lk1en seems to be working on a project to practice encryption, so i'm just giving them suggests
05:21:51FromDiscord<T0lk1en> Yerrr
05:22:17FromDiscord<jtv> Yeah, that'd still be a horrible approach for this problem.
05:22:17FromDiscord<T0lk1en> Fuck all this noise tho I’m gonna write my own encryption library.
05:22:20FromDiscord<Rika> I think encryption and security are topics that are not a good idea to self study
05:22:30FromDiscord<m4ul3r> math is hard
05:22:36FromDiscord<jtv> Agreed, 1000% which is what I told him before he started the project
05:22:38FromDiscord<T0lk1en> I’m not. Cyber security major
05:22:56FromDiscord<Rika> Then what is the course you’re following that makes you write this code?
05:23:34FromDiscord<T0lk1en> They don’t ig you are right. Just figured I wanna learn more and have a good looking GitHub page
05:24:07FromDiscord<Rika> Look, sorry that some people here are real aggressive with how they put it
05:24:22FromDiscord<Rika> But security isn’t easy, it isn’t even just difficult
05:24:33FromDiscord<jtv> I've still been helping him, just making it clear it's not going to be secure 🙂
05:24:44FromDiscord<T0lk1en> Ik it’s not^^^
05:25:07FromDiscord<Rika> JTV we know you’re a cryptographer or whatnot but damn can you be a bit more chill
05:25:09FromDiscord<T0lk1en> I’m on windows rn anyways nothing I do is secure lol
05:25:14FromDiscord<jtv> Lol
05:25:24FromDiscord<T0lk1en> lol I think everyone has been chill
05:25:30FromDiscord<m4ul3r> I think your ECB is a good project to work on. Implement a way to pad your incoming data, then iterate over each block using nimAES to encrypt. Same with decrypting
05:25:37FromDiscord<T0lk1en> It’s hard to understand tone over text
05:25:54FromDiscord<jtv> Tolk1en, that library has gcm mode; use that, but make sure you use the version of the API where you store the output PLUS the tag, and check it on decryption
05:26:07FromDiscord<T0lk1en> In reply to @m4ul3r "I think your ECB": I’m fr gonna write my own encryption library
05:26:12FromDiscord<jtv> Otherwise you will have problems where the bits can be flipped on you and you won't know it
05:26:34FromDiscord<Rika> Creating is much harder than using
05:26:51FromDiscord<m4ul3r> I mean, whatever gets you learning with encryption
05:26:59FromDiscord<m4ul3r> if that's your end goal
05:27:03FromDiscord<T0lk1en> Dudes I just realized why the example problem worked. The fucking input was 16 bits holy
05:27:07FromDiscord<jtv> The nonce is supposed to be a 12 byte random value, which should be the salt for your password.
05:27:17FromDiscord<T0lk1en> Salt?
05:27:51FromDiscord<m4ul3r> In reply to @T0lk1en "Dudes I just realized": yes, i said it only worked on one block at a time. It's written with 16 byte blocks (128 bits)
05:27:59FromDiscord<T0lk1en> I realize now
05:28:37FromDiscord<m4ul3r> You can implement what I suggested above and encrypt larger data than 1 block at a time
05:28:39FromDiscord<jtv> Without salt, you're going to be susceptible to precomputed cracking
05:28:52FromDiscord<T0lk1en> Wdym salt?
05:28:58FromDiscord<T0lk1en> Like fake data?
05:28:59FromDiscord<jtv> I just saw you're not using nimcrypto, it's a slightly better library to start with
05:29:05FromDiscord<T0lk1en> “Salted” over
05:29:23FromDiscord<T0lk1en> Nim crypto threw errors for me but I’ll give it a look
05:29:35FromDiscord<jtv> No, it was the state of the art in password management in 1972
05:29:43FromDiscord<jtv> But it's the basics.
05:29:55FromDiscord<jtv> Any article about storing passwords in the world would give you a good intro to salt
05:29:59FromDiscord<T0lk1en> But also. Why is nothing documented. I have trouble reading code to figure out what something does
05:30:19FromDiscord<T0lk1en> Like nimAES library
05:30:37FromDiscord<jtv> That's not a commonly used library. nimcrypto is the one people use most
05:31:01FromDiscord<m4ul3r> @T0lk1en I recommend checking out https://cryptopals.com/ if you want practice coding crypto stuffs in nim. Start small and work your way up
05:31:02FromDiscord<T0lk1en> So nimcrypto has docs I can read to know exactly how to use it?
05:31:37FromDiscord<jtv> I didn't say THAT :). I think it has some docs, but a lot of people here will have used it
05:32:01FromDiscord<m4ul3r> nimcrypto has examples, here one for ecb https://github.com/cheatfate/nimcrypto/blob/master/examples/ecb.nim
05:33:11FromDiscord<m4ul3r> nim crypto docs are pretty bare https://cheatfate.github.io/nimcrypto/
05:33:48FromDiscord<m4ul3r> nvm, they're fine
05:35:07FromDiscord<m4ul3r> looking at the examples and docs together would be good
05:36:21FromDiscord<jtv> Yeah, though there are some things done wrong, like their API doesn't implement the gcm spec properly; the last person here who was using it wasn't actually getting the integrity check on their code because of the way the API is designed ( and I believe the example doesn't get it right either)
05:37:18FromDiscord<T0lk1en> Gotcha
05:37:36FromDiscord<T0lk1en> I still think I would be fun to make my own library
05:38:13FromDiscord<jtv> It would be, sure
05:42:07FromDiscord<T0lk1en> Here’s a question. If all of our program are compiled to assembly how come some program only work on windows not Linux and some work on ARM but some don’t.
05:42:11*byanka quit (Read error: Connection reset by peer)
05:42:31FromDiscord<Elegantbeef> Arm and amd64 are different assembly
05:42:46FromDiscord<T0lk1en> If it’s all converted to C and assembly can’t any program be compiled for any architecture and OS
05:43:19FromDiscord<jtv> If the C is portable and the libraries that are dependencies exist on those platforms, then generally
05:43:44FromDiscord<T0lk1en> Well the dependencies can be converted too correct?
05:44:11FromDiscord<jtv> Well, sometimes not easily, like if they're heavily dependent on OS-specific functionality
05:44:19FromDiscord<T0lk1en> Hmm
05:44:40FromDiscord<T0lk1en> Like the WinGUI library prob would t worn on Linux huh
05:44:45FromDiscord<T0lk1en> Work
05:45:57FromDiscord<jtv> Unless you want to install Wine, then some stuff that they emulate would work, etc
05:50:20FromDiscord<T0lk1en> Got it
05:50:55FromDiscord<T0lk1en> Ty sm for all your help. It’s prob not fun to answer these easy questions
05:51:27FromDiscord<jtv> No problem, it's not not fun
06:02:59*Batzy_ joined #nim
06:05:43*Batzy quit (Ping timeout: 265 seconds)
06:06:01FromDiscord<demotomohiro> Executable file formats used in Linux and windows are different (ELF/PE) and how to call functions provided by OS(system calls/win32API) are different.↵If you can somehow unify them, you might be able to create an excutable file that works on both OS as long as same ISA is used.
06:06:42FromDiscord<jtv> Well, he did specify if you compiled for each platform
06:07:30FromDiscord<jtv> Cosmopolitan comes closes to unifying modern platforms, but requires a special file handler to be installed on linux
06:10:49*Batzy_ quit (Ping timeout: 260 seconds)
06:28:39FromDiscord<ambient> Win32 is probably the best Linux ABI
06:29:04FromDiscord<ambient> (Use Proton/Wine)
07:11:47*kenran joined #nim
07:12:06*ltriant quit (Ping timeout: 272 seconds)
07:21:12FromDiscord<jos> is there a way to use absolute imports?
07:21:20FromDiscord<jos> relative to root of src, anyway
07:27:41FromDiscord<Elegantbeef> For nimble libraries you can technically do \`packageName/subpath/module
07:28:13FromDiscord<jos> mm
07:28:16FromDiscord<jos> can i write a macro to do it
07:28:30FromDiscord<Elegantbeef> Import macros are quite finicky but probably
08:22:19FromDiscord<Rika> damn that was a very late month post
08:43:58FromDiscord<willyboar> <@&371760044473319454> link in announcements is broken
08:44:40*Guest93 joined #nim
08:45:09Guest93what is the closest analog to pass in python in Nim? I want to do nothing in certain "of" branches
08:45:27FromDiscord<pyolyokh> discard
08:46:54FromDiscord<pyolyokh> that's not called out in <https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers> , but there are mirroring examples that show it
08:47:13FromDiscord<Gumbercules> In reply to @Guest93 "what is the closest": `discard`
08:47:51FromDiscord<Gumbercules> whoops I didn't see @pyolyokh's answer
08:54:03FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4kSf
08:54:52FromDiscord<Elegantbeef> `import std/strutils`
08:54:56FromDiscord<Elegantbeef> sorry `std/strformat`
08:55:16FromDiscord<pyolyokh> that I get. the errors are in expanding the template.
08:55:20*koltrast quit (Ping timeout: 272 seconds)
08:55:42*koltrast joined #nim
08:55:50FromDiscord<Elegantbeef> Actually you're using a template so you need to use `%` basically
08:56:01FromDiscord<pyolyokh> an example of an attempt that I came up with after reading the manual is
08:56:01FromDiscord<pietroppeter> In reply to @Rika "damn that was a": better late than never 🙂
08:56:18FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4kSi
08:56:22FromDiscord<Elegantbeef> `"$# out of bounds of $# ... $#" % [$n, $l, $h]`
08:56:29FromDiscord<pyolyokh> but that fails with `Error: type expected, but got symbol 'n' of kind 'param'`
08:56:37FromDiscord<pietroppeter> In reply to @willyboar "<@&371760044473319454> link in announcements": that's a very weird link indeed, created also a forum thread
08:57:27*Guest93 quit (Quit: Client closed)
08:58:43FromDiscord<pyolyokh> the `%` solution works. I just still feel like I'm missing a trick with templates.
08:59:18FromDiscord<willyboar> In reply to @pietroppeter "that's a very weird": I've seen both. But someone must fix this for the newcomers.
08:59:26FromDiscord<pyolyokh> but this is weird stuff that has exact expectations about the caller, it makes sense for it not to compose well
08:59:31FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4kSj
08:59:43FromDiscord<Elegantbeef> Nope templates are code subsitution so `n`, `l` and `h` do not exist
09:00:10FromDiscord<Gumbercules> (edit) "https://play.nim-lang.org/#ix=4kSj" => "https://play.nim-lang.org/#ix=4kSk"
09:01:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4kSm
09:01:47FromDiscord<pyolyokh> In reply to @Gumbercules "what is `ref n`": manual says ... I misread it, and I shouldn't be using ref, but `N = n`. That's why try #8 gets me, trying to get something to work.
09:02:11FromDiscord<Elegantbeef> The key is `inject`
09:02:21FromDiscord<Elegantbeef> Symbols inside a template are gensym'd
09:02:34FromDiscord<Elegantbeef> Which means they're not accessible in any other way except as the symbol name
09:02:46FromDiscord<Elegantbeef> So you need to tell the compiler "I want this symbol to be inserted verbatim
09:03:27FromDiscord<Gumbercules> couldn't you mark the template as `dirty` as well?
09:03:54FromDiscord<Elegantbeef> Correct
09:03:54FromDiscord<Elegantbeef> I'm just silly and avoid dirty templates
09:04:05FromDiscord<Gumbercules> clean boi
09:04:11FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4kSo
09:04:33FromDiscord<pyolyokh> so the trick I was missing was `{.inject.}`, just need to be more careful with it. Thanks!
09:04:41FromDiscord<Elegantbeef> Of course it doesnt
09:04:42FromDiscord<Elegantbeef> templates replace all usages of their parameters
09:04:47FromDiscord<Gumbercules> https://nim-lang.org/docs/manual.html#templates-hygiene-in-templates
09:04:48FromDiscord<Elegantbeef> so if you do `numberBetween("a", 0, 0)` it does `let "a" {.inject.} = "a"`
09:05:21FromDiscord<pietroppeter> In reply to @willyboar "I've seen both. But": the weird thing is that in the feed.xml https://nim-lang.org/feed.xml the link is correct: https://nim-lang.org//blog/2023/01/11/this-month-with-nim.html maybe some issue on monitorss bot? or is it taking it from somewhere else?
09:07:35FromDiscord<willyboar> I have no idea. Also #community-events is broken a few days.
09:07:49FromDiscord<Gumbercules> at least it broke on a good update
09:07:56FromDiscord<Gumbercules> Qt bindings \o/
09:08:01FromDiscord<Gumbercules> I didn't think I'd live to see the day
09:23:40*PMunch joined #nim
10:00:33*oddish quit (Quit: nyaa~)
10:02:26FromDiscord<fbpyr> for `nimble` is there an equivalent to `pip list --outdated` ?
10:05:32FromDiscord<fbpyr> at first I thought it might be `nimble list --installed --ver` , but that does only seem to show the local version. 🤔
10:10:12FromDiscord<pyolyokh> don't believe so. With a localdeps repo you can blow away nimbledeps and run `nimble install -l -d` and then compare versions to see if nimble grabbed newer ones.
10:14:30FromDiscord<fbpyr> ah I see. thank you @pyolyokh .↵I was pondering over searching a package with --ver and getting the highest version of that to compare vs. installed.↵but maybe `nimble update` followed by a compare via the retrieved packages.json is simpler approach. 🤔
10:26:27FromDiscord<fbpyr> ok nope, `packages_official.json` does not have the versions.↵would need to query from each repo then, I guess
10:30:04*kenran quit (Remote host closed the connection)
10:31:09*kenran joined #nim
10:36:05*oddish joined #nim
10:42:46*ltriant joined #nim
10:52:13*ltriant quit (Ping timeout: 260 seconds)
11:05:15FromDiscord<htac> Greetings! I really need some help here as I continue to fail wrapping my head around what might be wrong here on my part: is anyone using Nim 1.6.10 or devel with the C++ backend, VCC (17.4.0+), and STL containers?
11:05:40FromDiscord<htac> sent a long message, see http://ix.io/4kSP
11:06:51FromDiscord<htac> oh well, Discord newb here, sorry, how to apply Nim syntax highlighting?
11:07:19FromDiscord<pyolyokh> \`\`\`nim↵\`\`\`
11:07:28FromDiscord<htac> Thank you! 😊
11:09:02FromDiscord<htac> that's better, thanks!
11:09:29FromDiscord<htac> I would expect the following output running this program:
11:09:57FromDiscord<htac> sent a code paste, see https://play.nim-lang.org/#ix=4kSR
11:10:52FromDiscord<htac> but, iterating over foo the second time in run, ABC becomes garbled, a random memory string
11:12:08FromDiscord<pyolyokh> what's the /FS flag do?
11:12:09FromDiscord<htac> any clou why that might be? Iterating over an index always works...
11:13:43FromDiscord<htac> it shows the same behaviour without it: apparently, VCC's multiprocessor compilation struggles with multiple access to its debug symbol file, /FS regulates access to it.
11:14:01FromDiscord<htac> In reply to @pyolyokh "what's the /FS flag": it shows the same behaviour without it: apparently, VCC's multiprocessor compilation struggles with multiple access to its debug symbol file, /FS regulates access to it.
11:14:41FromDiscord<pyolyokh> I'm just trying to replicate what you have on Linux with different flags. With --std=c++14 I get a null pointer dereference on the `s.a = createString("ABC")`
11:14:58*oprypin joined #nim
11:15:26FromDiscord<htac> interesting, thanks for trying to replicate it...
11:17:45FromDiscord<htac> sent a code paste, see https://play.nim-lang.org/#ix=4kSV
11:17:53FromDiscord<htac> (edit) "https://play.nim-lang.org/#ix=4kSV" => "https://paste.rs/rHz"
11:18:31FromDiscord<htac> (edit) "https://play.nim-lang.org/#ix=4kSY" => "https://play.nim-lang.org/#ix=4kSX"
11:18:48FromDiscord<htac> (edit) "https://play.nim-lang.org/#ix=4kSX" => "https://play.nim-lang.org/#ix=4kSZ"
11:20:08FromDiscord<pyolyokh> yeah. what fixes it is changing `var s: Stuff` to `var s = Stuff()`
11:20:31FromDiscord<pyolyokh> in `proc run`
11:21:55FromDiscord<htac> I did try that too, same result for me
11:22:14FromDiscord<htac> do you always get ABC now?
11:23:27FromDiscord<pyolyokh> yep, my output is what you expect
11:23:38FromDiscord<htac> very strange
11:24:07FromDiscord<htac> you do not have access to MSVC by any chance? 😊
11:24:32FromDiscord<htac> as I suspect a problem in regards with the codegen for this compiler...
11:24:49FromDiscord<pyolyokh> I don't. You have `foo = Vector[Stuff]()` at the toplevel, which differs from `foo: Vector[Stuff]` in `proc run`. How does it work to change proc run to initialize both of them with explicit constructor calls?
11:25:15FromDiscord<htac> (edit) "in" => "with" | "with" => "to"
11:26:01FromDiscord<htac> same behaviour, as it should be, since from C++'s side, the default constructor MUST be invoked
11:26:35FromDiscord<pyolyokh> OK. Well that it matters for Stuff is a bug already on gcc on linux, in my environment.
11:28:07FromDiscord<pyolyokh> sorry I can't more. My guess is that there are some surprisingly lifetime methods called in the case that you loop over foo's items, instead of looping over indices
11:28:16FromDiscord<pyolyokh> (edit) "surprisingly" => "surprising"
11:28:22FromDiscord<pyolyokh> (edit) "sorry I can't ... more." added "help"
11:28:32FromDiscord<htac> I've also tried these bindings mentioned in the Nim 2 RC post: https://github.com/Clonkk/nim-cppstl
11:28:33FromDiscord<htac> same trouble
11:30:07FromDiscord<htac> In reply to @pyolyokh "sorry I can't help": Yes, exactly, I suspect lifetime issues as well. I try to understand the differences between running the code in the implicit main and in run(), but I utterly fail in isolating the cause
11:31:07FromDiscord<htac> Anyways, thanks a lot for your time and effort! 👍
11:31:45FromDiscord<htac> (edit) "cause" => "cause, even in reading the C++ output generated by Nim"
11:32:19FromDiscord<pyolyokh> toplevel's foo and s aren't created on the stack, but have static locations
11:38:34*ltriant joined #nim
11:43:48*ltriant quit (Ping timeout: 272 seconds)
11:52:38FromDiscord<htac> toplevel's foo and s are statically allocated (globals), yes
11:52:48FromDiscord<htac> sent a long message, see https://paste.rs/DWY
11:53:12FromDiscord<htac> (edit) "long message," => "code paste," | "http://ix.io/4kT3" => "https://paste.rs/Dlc"
11:54:41FromDiscord<htac> Now, the second time I iterate over foo, the first element ABC is garbled, while the second is indeed DEF. Maybe there is something off with the way, the second kind of for loop is set up?
11:55:05FromDiscord<htac> (edit) "foo," => "foo" | "way," => "way"
11:55:18FromDiscord<pyolyokh> no, the for loop itself is fine.
11:55:39FromDiscord<htac> I just don't get it
11:56:29FromDiscord<pyolyokh> the next thing I'd do is write some C++ classes that announce their lifetime functions, and wrap those in place of std::vector and std::string
11:57:00FromDiscord<pyolyokh> `printf("string #%d is being copied", id)`, etc.
11:57:20FromDiscord<htac> yes, good idea, thanks!
12:03:11FromDiscord<htac> I'll give /fsanitize=address /DEBUG a try first...
12:08:25*xet7 quit (Quit: Leaving)
12:08:38*azimut joined #nim
12:08:44*jjido joined #nim
12:10:44*cyraxjoe quit (Ping timeout: 255 seconds)
12:11:04*cyraxjoe joined #nim
12:13:59*azimut quit (Ping timeout: 255 seconds)
12:29:25*xet7 joined #nim
12:30:18*azimut joined #nim
12:45:11FromDiscord<sOkam!> Is it possible to create a `define` in code?
12:46:09PMunchsOkam, what do you mean?
12:46:24FromDiscord<sOkam!> such that when other part of the code does `when defined something: doThing`... it automatically passes as defined without having to add `-d:something` in the compiler
12:46:27PMunchLike have some condition in your code that triggers eg. -d:ssl?
12:46:39PMunchAh, no that's not possible AFAIK
12:46:50PMunchYou can of course do it in a config.nims file
12:47:17PMunchSo you could have e.g. `when defined(windows): <windows specific switches here>`
12:48:03PMunchSince Nim really only does a single pass over all your sources it would mean that other `when` switches could silently fail and create all sorts of issues
12:48:04FromDiscord<sOkam!> yeah, but im creating some nimpretty alternative version, and I don't need to specify `-d:nimpretty` because it is assumed in the code that im writing that it will always be active. but the compiler parser needs it to give access to one of the fields
12:49:48FromDiscord<sOkam!> Here: https://github.com/nim-lang/Nim/blob/b68b28fd2448b15e989b9e8b07e33eee4f9b8822/compiler/parser.nim#L75-L76↵And there are other places in the file where it needs the define
12:50:28*ltriant joined #nim
12:50:36FromDiscord<sOkam!> but, as usual, nimsuggest is choking and giving me an error. so wanted to just hardcode it, since my file is not part of the compiler distribution
12:54:21FromDiscord<sealmove> Hello! Question: Shared field name in object variants. Is it something being considered? Or totally unlikely to change?
12:55:17FromDiscord<Clonkk> It wasn't mentionned in NIm 2023 roadmap but if you want a definitive answer you should ask in Nim-internal
12:55:40FromDiscord<sealmove> ok thanks
12:55:53*ltriant quit (Ping timeout: 260 seconds)
13:04:39FromDiscord<luteva> Hi! I am searching for a simple example of calling a language server (like @PMunch s nimlsp) using a (terminal) tool like curl or something like this. I want to play around and see the requests and responses in clear text etc.↵Any ideas? any example of how to use curl (or something similar) to call an lsp server?
13:05:05FromDiscord<arkanoid> @sealmove\: thanks for the updates on binarylang
13:06:19PMunch@luteva, easiest is probably to have a look at how the log-replay utility does it: https://github.com/PMunch/nimlsp/blob/master/tests/logrunner.nim
13:07:12FromDiscord<sealmove> In reply to @arkanoid "<@173424250319929344>\: thanks for the": are you still using it? i think i lost you as a binarylang user :p
13:08:04PMunchBasically if you set your editor to use `nimlsp_debug` instead of the typical `nimlsp` binary it will produce a log that shows all the messages back and forth. Then you can feed such a log-file to that utility and it will start a new nimlsp instance and replay the log. I plan to use this for debugging, people can just record their bug, submit the log, and I can tweak nimlsp until it does the right thing.
13:08:37PMunchThe actual communication is pretty simple, start nimlsp and write commands over stdin to it, then read its stdout to see the reply
13:10:42FromDiscord<luteva> thx!
13:14:41om3gadjazz , I found the problem, what causes the code we discussed early to compile
13:14:57om3gathat function mismatches with the prototype declaration in C header file from the lib
13:15:10om3gaIn header file : LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index);
13:15:26FromDiscord<arkanoid> Sure, thing! Your lib is processing dozen of messages per second on average on my gps server↵(@sealmove)
13:15:28om3gaif I comment out it, the lib in nim compiles without any problem. But... absence of prototype affects the result - the lib not loads in the host
13:15:58om3gaHost reports with expected err: Could not find the LV2 Descriptor in the plugin library
13:16:14om3gaDirectives {.exportc, cdecl.} generate following code: N_LIB_PRIVATE N_CDECL(LV2_Descriptor*, lv2_descriptor)(unsigned int index) what is not the same as prototype: __attribute__ ((visibility ("default"))) const LV2_Descriptor* lv2_descriptor(uint32_t index)
13:22:55FromDiscord<sealmove> In reply to @arkanoid "Sure, thing! Your lib": wow I am glad it's used in something more than a toy project
13:36:40FromDiscord<djazz> om3ga: okay, well i dunno
13:52:43*azimut quit (Remote host closed the connection)
13:53:16*azimut joined #nim
13:55:24*kenran quit (Remote host closed the connection)
13:56:14om3gadjazz: looks like I found solution - {.emit: """ LV2_SYMBOL_EXPORT const lv2_descriptor """.}
14:02:50FromDiscord<MilaDog> Does Nim have a `pre-commit`?
14:07:40FromDiscord<leorize> nope
14:08:07FromDiscord<djazz> In reply to @om3ga "<@81390960805675008>: looks like I": hmm, yeah that should do it
14:08:23FromDiscord<djazz> codegenDecl might too
14:09:23FromDiscord<djazz> {.codegenDecl: "LV2_SYMBOL_EXPORT const lv2_descriptor $# $#$#", exportc: "your function".}
14:09:37FromDiscord<djazz> in the docs it has this example: {.codegenDecl: "interrupt $# $#$#".}
14:09:39om3gaaha! nice!
14:09:44FromDiscord<djazz> to generate `interrupt void myinterrupt()`
14:09:54FromDiscord<djazz> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-codegendecl-pragma
14:10:01FromDiscord<djazz> bit nicer than emit
14:10:06om3gaawesome, thanks!
14:19:30FromDiscord<sealmove> is it possible to have a set of enum values?
14:20:13FromDiscord<sealmove> sent a code paste, see https://paste.rs/rI2
14:30:56FromDiscord<pyolyokh> In reply to @รєคɭ๓๏שє "is it possible to": swap the two definitions
14:31:38FromDiscord<pyolyokh> devel error: `Error: ordinal type expected; given: Forward`
14:31:56FromDiscord<pyolyokh> still seems like a bug, but that's at least more suggestive of the workaround
14:32:06FromDiscord<sealmove> nice, thanks
14:44:42*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
14:49:46*kenran joined #nim
14:50:04*kenran quit (Remote host closed the connection)
14:50:34FromDiscord<arkanoid> You have no idea how neat your design is compared to other DSL-less solution I've tried before↵(@sealmove)
14:52:02*ltriant joined #nim
14:52:07FromDiscord<sOkam!> how do you check if a string path is either a folder or a file?
14:53:22FromDiscord<Gumbercules> isDir
14:53:29FromDiscord<Gumbercules> Or isFile
14:53:30FromDiscord<sOkam!> strutils or os?
14:53:34FromDiscord<Gumbercules> Os
14:53:51FromDiscord<sOkam!> was searching for that in os and didn't find it. will search better 😔
14:53:54FromDiscord<sealmove> In reply to @arkanoid "You have no idea": Ok at least 2 people are still using it actively. This is motivates me sufficiently. I haven't maintained it for 1.5 year, but I guess it's never too late.,
14:54:27FromDiscord<sOkam!> it actually doesn't show in search in the web
14:54:30FromDiscord<sOkam!> you sure its os?
14:54:36FromDiscord<Gumbercules> In reply to @sOkam! "was searching for that": Let me find it
14:55:20FromDiscord<Nilts> In reply to @sOkam! "it actually doesn't show": https://nim-lang.org/docs/os.html#fileExists%2Cstring
14:55:37FromDiscord<Nilts> https://nim-lang.org/docs/os.html#dirExists%2Cstring
14:55:45FromDiscord<sOkam!> is that the same thing?
14:56:47FromDiscord<Gumbercules> Yeah
14:56:58FromDiscord<sOkam!> i guess it is, and also checks for existance. misleading name, but kindof makes sense
14:57:00FromDiscord<Nilts> In reply to @sOkam! "is that the same": It checks if the file exists on the system, you would probably have to use a path parsing thing to find out just if it is a dir or not
14:57:07FromDiscord<Gumbercules> On my phone so I couldn't get there
14:57:36*ltriant quit (Ping timeout: 272 seconds)
14:57:46FromDiscord<sOkam!> In reply to @not logged in "It checks if the": in this case, i guess filtering this way could work
14:57:56FromDiscord<Gumbercules> you can also get a `FileInfo` I believe
14:57:57FromDiscord<Gumbercules> and check that way
14:58:05FromDiscord<sOkam!> if the file doesn't exist, just dont add the string to the seq[string] of processing files 🤷‍♂️
14:58:06FromDiscord<Gumbercules> I was getting confused with Odin I guess
15:10:41om3gadjazz, it worked, only little bit differently I did that.. but, here goes another problem, I printed all the symbols from the dylib
15:10:45om3ga00000000000041c8 S _descriptor__correlometer_109
15:11:30om3gaand it should be 0000000000000c00 T _lv2_descriptor
15:13:12om3gaI will try to declare the lv2_descriptor in .emit
15:14:34*PMunch quit (Quit: Leaving)
15:21:51FromDiscord<Gumbercules> In reply to @sOkam! "if the file doesn't": just FYI - `fileExists` will also return `true` for symlinks
15:23:36*ltriant joined #nim
15:28:28*ltriant quit (Ping timeout: 252 seconds)
15:32:04FromDiscord<djazz> PMunch: sent you another PR 😂
15:32:12FromDiscord<djazz> about enums again
15:32:17FromDiscord<sealmove> hey @Arkanoid, codegen is now configurable https://github.com/sealmove/binarylang/blob/main/tests/plugins.nim
15:38:44*Batzy joined #nim
15:40:15*jmdaemon joined #nim
15:55:11*ltriant joined #nim
16:00:18*ltriant quit (Ping timeout: 272 seconds)
16:00:38*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
16:01:27*jmdaemon joined #nim
16:08:32*jmdaemon quit (Ping timeout: 272 seconds)
16:35:52*jmdaemon joined #nim
16:52:22FromDiscord<sOkam!> How can I turn this: `outFiles = inFiles.mapIt($(outDir.joinPath(it)))`↵Into a loop that only gets the basename+extension of the it file, instead of the full path like it does?
16:52:39FromDiscord<sOkam!> (edit) "a loop" => "an iterator"
16:53:04FromDiscord<sOkam!> (edit) "an iterator" => "something" | "does?" => "does now?"
16:55:05*jmdaemon quit (Ping timeout: 268 seconds)
16:55:44FromDiscord<Array in ∀ Matrix> is there ∀ nim library for matrix bots/sdk
17:01:36FromDiscord<sOkam!> vmath ?
17:14:57*jmdaemon joined #nim
17:21:36*jmdaemon quit (Ping timeout: 268 seconds)
17:33:00FromDiscord<Array in ∀ Matrix> no i ment for the matrix protocol lol↵(@sOkam!)
17:35:02FromDiscord<rakgew> @sOkam! iirc a `splitFie` on the path gives you a tuple like\:↵`(dir, name, ext)`
17:35:48FromDiscord<rakgew> sry ^^ meant `splitFile`
17:41:28FromDiscord<deeuu> In reply to @sOkam! "How can I turn": `inFiles.mapIt($(joinPath(outDir, lastPathPart(it))))`
17:42:16FromDiscord<leetnewb> In reply to @Array in ∀ Matrix "is there ∀ nim": Looks like there is an unfinished one: https://github.com/dylhack/matrix-nim-sdk
17:45:01FromDiscord<JeysonFlores> Will the Nim language servers still work in Nim 2?
17:53:24FromDiscord<rakgew> @leetnewb \: seems like that one got forked and continued (?) after being archived \:↵https://github.com/tandy-1000/matrix-nim-sdk
17:53:24FromDiscord<leetnewb> Good catch!
17:53:25FromDiscord<auxym> In reply to @JeysonFlores "Will the Nim language": nimlsp is a wrapper around nimsuggest, so it should continue working as-is unless there are major changes to nimsuggest (which are not planned for 2.0,but maybe later, whenever IC comes)
18:36:37FromDiscord<PMunch> In reply to @auxym "nimlsp is a wrapper": And if something major does happen I'll just update NimLSP
19:06:41*jjido joined #nim
19:06:55om3gadjazz: macro .dynlib. does the __attribute__((visibility("default")))
19:07:10FromDiscord<djazz> aha
19:07:21om3gawell, sucessfully compiled the code
19:07:38om3gait runs, lv2 audio plugin in nim
19:07:49FromDiscord<djazz> ayy nice
19:08:03om3gacorrelometer, calculates correlation of phase between 2 inputs
19:09:00om3gabut it's partially in nim, idk how to avoid using .emit
19:11:44om3gathe structure of lv2_descriptor should be defined as static const LV2_Descriptor descriptor
19:14:04om3gathis is what I was unable to translate to nim. const descriptor = LV2_Descriptor(...) not works
19:15:32om3gaand in case of regular nim default symbol export, the prototype of the lv2_descriptor function should be commented out
19:16:00om3gawhat is not very good, since this is lib code modification
19:16:38om3gaalso plugin "works" but, not really with the real audio data
19:17:18om3gaI should find the way how to read samples from the buffer provided as void* - data: poiner (in nim)
19:18:38om3gaI could have ability to read buff as array - var input: ptr float32
19:20:43om3gaI tried to use UncheckedArray.. but seems it gets address of buff and tries to calculate the correlation of them
19:32:34*ltriant joined #nim
19:37:47*ltriant quit (Ping timeout: 256 seconds)
19:50:50FromDiscord<Daniel> some1 fix this <@&371760044473319454> https://media.discordapp.net/attachments/371759389889003532/1062820903240597504/image.png
19:53:12om3gaI was wrong, Untyped array works. haha. nice..
19:56:54om3gaplugin really works with audio. performance seems good! And all that without GC
19:58:45FromDiscord<@thatrandomperson5-6310e3b26da03> How would i turn an xml entity into its unicode repr using xmltree?
19:58:52FromDiscord<Array in ∀ Matrix> nice il check it out
20:03:44FromDiscord<sOkam!> sent a code paste, see https://paste.rs/fBy
20:05:23FromDiscord<sOkam!> (edit) "https://paste.rs/Tv8" => "https://play.nim-lang.org/#ix=4kVC"
20:50:47FromDiscord<jos> if i do
20:51:14FromDiscord<jos> sent a code paste, see https://play.nim-lang.org/#ix=4kVK
20:51:27FromDiscord<jos> with orc, x should always be the same pointer to a heap allocated object right
20:53:40FromDiscord<jos> or wait, addr x is going to be the address of the pointer itself, right?
20:54:24FromDiscord<MadScientistCarl> Hello, I just want to ask if there are any good embedded scripting options for Nim
20:55:19FromDiscord<sOkam!> In reply to @MadScientistCarl "Hello, I just want": I'd argue nim itself counts as a scripting language, because of HotCodeReloading and its python-like syntax
20:56:16FromDiscord<MadScientistCarl> How to embed it, though
20:56:30FromDiscord<jos> wasm probably?
20:56:36FromDiscord<jos> u can also compile to js i guess
20:56:50FromDiscord<jos> u can also use nimscript
20:57:14FromDiscord<jos> wasm is probably safer + more portable + more features, but also least developed
20:57:18FromDiscord<MadScientistCarl> I will be using the C backend
20:57:35FromDiscord<MadScientistCarl> I mean my main application will be using C backend
20:57:41FromDiscord<jos> i mean building the "plugins" into wasm modules
20:57:51FromDiscord<jos> and then embedding a wasm runtime like wasmtime
20:57:56FromDiscord<jos> i'm not sure if anyone has done this before
20:58:16FromDiscord<MadScientistCarl> OK, but that might be too complicated a workflow
20:58:30FromDiscord<MadScientistCarl> Can nimscript VM be embedded directly into a Nim program?
20:58:36FromDiscord<jos> i think so, yeah
20:58:36FromDiscord<jos> https://github.com/beef331/nimscripter
20:58:41FromDiscord<jos> i agree this is probably the lowest effort
20:58:57FromDiscord<jos> i have no clue what the status of NimScript is
20:59:06FromDiscord<MadScientistCarl> Surprised this isn't in stdlib 🙂
21:10:15FromDiscord<auxym> In reply to @jos "i have no clue": status? nimscript is here to stay, mostly because it is used to evaluate macros
21:12:59FromDiscord<jos> sure, but it doesn't support a lot of features + doesn't have a lot of pedigree for embedding
21:13:06FromDiscord<jos> i think it's safe to say "you're on your own"
21:13:20FromDiscord<MadScientistCarl> Are there anything in stdlib that helps embedding nimscript?
21:13:21FromDiscord<jos> or at least "it's called _Nim_Script but temper your expectations"
21:16:17FromDiscord<ShalokShalom> @MadScientistCarl I know you, just not anymore from where
21:16:21FromDiscord<ShalokShalom> F# or Ruby?
21:16:43FromDiscord<MadScientistCarl> I am everywhere
21:16:47FromDiscord<ShalokShalom> Godot
21:16:52FromDiscord<MadScientistCarl> Probably Ruby, Godot, Rust, eetc...
21:17:03FromDiscord<ShalokShalom> Welcome 😄
21:17:05FromDiscord<MadScientistCarl> (edit) "eetc..." => "etc..."
21:17:21FromDiscord<MadScientistCarl> Getting my hands on the whole pile of new programming languages
21:20:46FromDiscord<ShalokShalom> Kotlin is my newest discovery ^^
21:21:16FromDiscord<MadScientistCarl> I walked through the LWJGL book using Kotlin
21:21:25FromDiscord<MadScientistCarl> Kotlin is quite nice too
21:23:56*ltriant joined #nim
21:24:03FromDiscord<PMunch> In reply to @Daniel "some1 fix this <@&371760044473319454>": Fix it where?
21:26:15FromDiscord<Daniel> In reply to @PMunch "Fix it where?": in #announcements
21:26:25*xet7 quit (Ping timeout: 268 seconds)
21:26:34FromDiscord<Daniel> In reply to @PMunch "Fix it where?": see this:↵https://discord.com/channels/371759389889003530/711675501722337490/1062647162518913134
21:28:44FromDiscord<PMunch> Aha, wasn't even aware we had an announcements channel
21:29:07FromDiscord<ShalokShalom> In reply to @MadScientistCarl "I walked through the": I am interested, since they seem to be ready with Godot 4, once it is stable
21:29:15FromDiscord<ShalokShalom> And its one of the few languages doing so
21:29:27FromDiscord<ShalokShalom> Other than that, we only have GDScript 🤷🏼‍♂️
21:29:49*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
21:29:59FromDiscord<PMunch> Hmm, I apparently can't do much more than delete the message.. Not sure who maintains that bot
21:30:41FromDiscord<ShalokShalom> Can you edit it?
21:31:39FromDiscord<MadScientistCarl> What does Kotlin have to do with Godot?
21:34:22*Lord_Nightmare joined #nim
21:36:47FromDiscord<PMunch> Nope
21:37:43FromDiscord<PMunch> Judging by the bots name though I'm pretty sure it just reads the RSS feed for the website
21:38:13FromDiscord<PMunch> So probably someone messed up the original link there, and once they fixed it it was too late
21:39:21FromDiscord<ShalokShalom> In reply to @MadScientistCarl "What does Kotlin have": They have their binding almost ready
21:39:22FromDiscord<ShalokShalom> https://discord.gg/BJx9vJTAd5
21:40:39FromDiscord<MadScientistCarl> Um, I am going to use C# if I use Godot
21:40:43FromDiscord<MadScientistCarl> Or F#
21:40:51FromDiscord<ShalokShalom> F# would be superb
21:41:04FromDiscord<ShalokShalom> Sadly, it seems like this is less likely to happen comfortably.
21:41:08FromDiscord<MadScientistCarl> But this time I am trying to go spartan mode and start from a Vulkan binding of Nim
21:41:24FromDiscord<ShalokShalom> Vulkan binding?
21:41:37FromDiscord<MadScientistCarl> Yes
21:41:39FromDiscord<ShalokShalom> You mean with no dedicated gaming libraries?
21:41:43FromDiscord<MadScientistCarl> No
21:41:51FromDiscord<ShalokShalom> But?
21:42:11FromDiscord<MadScientistCarl> I do too many crazy stuff with graphics pipeline
21:42:17FromDiscord<MadScientistCarl> A game engine just won't cut it
21:42:23FromDiscord<ShalokShalom> I see 🙂
21:42:30FromDiscord<ShalokShalom> Much fun, then!
21:42:40FromDiscord<ShalokShalom> Nim has many amazing libraries for this
21:42:45FromDiscord<MadScientistCarl> So I am sampling a bunch of languages
21:42:48FromDiscord<ShalokShalom> And Gumber is surely happy to help you 😄
21:43:06FromDiscord<MadScientistCarl> I tried plain C, C++, Rust, Kotlin
21:43:17FromDiscord<MadScientistCarl> I see one Vulkan library
21:43:21FromDiscord<MadScientistCarl> (in Nim)
21:43:49FromDiscord<MadScientistCarl> Is it possible to call C without repeating the function definitions by hand?
21:44:25FromDiscord<Elegantbeef> What?
21:44:41FromDiscord<Elegantbeef> You mean is it possible to call C without manually making bindings?
21:45:17FromDiscord<Elegantbeef> https://github.com/PMunch/futhark if so yes
21:47:06FromDiscord<MadScientistCarl> This is gonna be amazing (or it will blow up my computer)
21:51:16*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
21:52:46*ehmry joined #nim
21:59:31FromDiscord<Phil> Futhark is nice, I am however a pansy when it comes to C so I always shied away from using it.↵I don't think I'm as afraid anymore, but trying to make bindings to libwebp still intimidates me because I literally do not comprehend at all how that API is supposed to work
22:00:26FromDiscord<Elegantbeef> Seems like webp isnt that complex
22:01:24FromDiscord<Phil> I think I'm just missing a fundamental piece somewhere that should make it click, I don't really have much knowledge of image manipulation in general, other than that the raw form of image data is every pixel being a tuple of RGB data
22:02:31FromDiscord<Elegantbeef> https://github.com/webmproject/libwebp/blob/main/doc/api.md↵https://github.com/webmproject/libwebp/tree/main/examples
22:02:37FromDiscord<Elegantbeef> both of those should make life a bit easier
22:04:40FromDiscord<Elegantbeef> The includes for libwebp only seems to be like 3000 loc with comments
22:12:22*xet7 joined #nim
22:14:46FromDiscord<guttural666> can I somehow have that T be either an enum or a seq[string] to loop over and print options? https://media.discordapp.net/attachments/371759389889003532/1062857121370230894/image.png
22:15:01FromDiscord<Elegantbeef> `T: enum or string`
22:15:18FromDiscord<Elegantbeef> sorry `seq[string]`
22:17:13FromDiscord<guttural666> compiler is still mad when I pass this bad boy https://media.discordapp.net/attachments/371759389889003532/1062857739719692339/image.png
22:17:27FromDiscord<guttural666> type mismatch
22:19:23FromDiscord<Elegantbeef> Cool now give me the error instead of saying what the compiler said
22:20:02FromDiscord<guttural666> sent a long message, see http://ix.io/4kW2
22:20:54FromDiscord<Elegantbeef> `T: typedesc[enum] or seq[string]`
22:20:56FromDiscord<Elegantbeef> We did it we read the error message
22:21:10FromDiscord<Elegantbeef> That sass was uncalled for, but cmon, actually help yourself by giving information instead of making people play blues clues
22:23:20FromDiscord<guttural666> no problem haha, but same output
22:24:13FromDiscord<guttural666> I think passing in func_id which is a type func_id = enum is equivalent to the T in proc pls [T: enum]?
22:25:05FromDiscord<guttural666> required type for list: T: typedesc[enum] or seq[string]↵ but expression 'func_id' is of type: typedesc[func_id]
22:25:07FromDiscord<guttural666> both times
22:26:22FromDiscord<guttural666> my goal is to have a generic input that I can iterate over and that should work with values that are either enum types or sequences right
22:26:24FromDiscord<guttural666> think that makes sense
22:28:56FromDiscord<Elegantbeef> `T: typedesc[enum] or seq[string]` does not bind how we want
22:29:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4kW6
22:29:08FromDiscord<Elegantbeef> So we need to use an implicit generic
22:30:15FromDiscord<guttural666> In reply to @Elegantbeef "`T: typedesc[enum] or seq[string]`": what do you mean by that?
22:30:32FromDiscord<scipio> Aloha
22:30:41FromDiscord<Elegantbeef> I mean `T: typedesc[enum] or seq[string]` is the same as `T: enum or seq[string]`
22:31:38FromDiscord<Elegantbeef> Anywho just trust the implicit generic works and carry on
22:31:49FromDiscord<guttural666> In reply to @Elegantbeef "I mean `T: typedesc[enum]": that's what I thought yes
22:32:38FromDiscord<guttural666> don't get what the difference to my solution is, just syntactic sugar no?
22:33:12FromDiscord<Elegantbeef> It's supposed to be, but there is some semantic difference to the compiler
22:36:18FromDiscord<guttural666> that's super confusing
22:36:48FromDiscord<Elegantbeef> I mean it's a bug
22:36:58FromDiscord<guttural666> oh okay 😄
22:37:28FromDiscord<guttural666> then your sass was indeed uncalled for and I am very upset
22:37:39FromDiscord<Elegantbeef> Well then sod off
22:38:05FromDiscord<guttural666> but thanks
22:38:22FromDiscord<Elegantbeef> The sass was still called for since you didnt give any actual insight
22:38:41FromDiscord<Elegantbeef> "It no worky, and it say it no worky" is very much the definition of unhelpful
22:42:23FromDiscord<Elegantbeef> hopefully it's clear i'm joking about it being called for, people just often dont provide enough information and it's like pulling teeth to help
22:44:39*xet7 quit (Remote host closed the connection)
22:46:40*xet7 joined #nim
22:48:27FromDiscord<guttural666> was joking about being upset, I'm not, just thankful that people provide quick help, sorry for not providing a working code sample, didn't think it was relevant, thought I might have missed something fundamental to the languge / stdlib or something
22:51:26FromDiscord<guzba> i noticed the community-events channel isn't getting updated lately. is this a permanent change or just a temporary thing?
22:54:27FromDiscord<ShalokShalom> maybe thats related with the broken URL in the last announcement?
22:54:35FromDiscord<ShalokShalom> very wild guessing
22:54:59FromDiscord<ShalokShalom> In reply to @MadScientistCarl "This is gonna be": probably both
22:55:15FromDiscord<ShalokShalom> you could also be interested in Nimskull
22:55:32FromDiscord<Elegantbeef> Why are you advertising it like it's actively different in that regard
22:55:47FromDiscord<Elegantbeef> It's not significantly different in C interop presently
23:10:05FromDiscord<!!sharpcdf!!> can illwill not init and deinit multiple times within a program?
23:12:40FromDiscord<Elegantbeef> There doesnt seem to be any `once:` inside init
23:14:49FromDiscord<!!sharpcdf!!> i wonder why my tui doesnt show up after i re init it then
23:15:10FromDiscord<ambient> sent a code paste, see https://play.nim-lang.org/#ix=4kWd
23:15:47FromDiscord<ambient> I'm not sure where to search for the documantation for this kind of stuff
23:15:55FromDiscord<ambient> (my google-fu failed)
23:18:04FromDiscord<Elegantbeef> I think it's just `s` but remember `s` is not a cstring
23:18:16FromDiscord<Elegantbeef> Well sorry i mean backticked s
23:18:39FromDiscord<scipio> https://media.discordapp.net/attachments/371759389889003532/1062873201752944660/image.png
23:18:44FromDiscord<ambient> In reply to @Elegantbeef "I think it's just": Thanks, that works
23:19:02FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4kWe
23:19:20FromDiscord<Elegantbeef> I mean why is that even a template
23:19:22FromDiscord<scipio> @ElegantBeef if you were to build something like this Cryptowat.ch/ app using Nim, which UI solution would you go for
23:19:34FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/XdV
23:19:38FromDiscord<Elegantbeef> Well you see scipio i'd never make that
23:20:02FromDiscord<scipio> I was trying to word my question as if you would, but it's actually me
23:20:05FromDiscord<scipio> 😁
23:20:13FromDiscord<Elegantbeef> Dont mistake my 'expertise' as experience
23:20:33FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4kWf
23:20:55FromDiscord<ambient> sent a code paste, see https://play.nim-lang.org/#ix=4kWg
23:21:19FromDiscord<Elegantbeef> See i personally like owlkettle but i doubt it's as feature complete as you'd need
23:21:32FromDiscord<Elegantbeef> Same for fidget/nimx
23:21:42FromDiscord<Elegantbeef> I also dont really write GUI programs
23:21:57FromDiscord<Elegantbeef> I'm a game developer primarily so that's my main focus
23:22:02FromDiscord<ambient> Not sure is --gc:arc is actualy doing anything there
23:22:09FromDiscord<scipio> In reply to @Elegantbeef "Dont mistake my 'expertise'": the JUCE framework on C++, used for audio plugins, also has decent UI capabilities. Would that be somehow usable in NIm?
23:22:21FromDiscord<Elegantbeef> If you wrapped the C++ library likely
23:22:33FromDiscord<Nilts> In reply to @Elegantbeef "I mean why is": because nigui sucks at container traversal and because of nim's type system looping does not and will not ever work
23:22:50FromDiscord<Nilts> (edit) "In reply to @Elegantbeef "I mean why is": because nigui sucks at container traversal and because of nim's type system looping does not and will not ever work ... " added "(in this cse)"
23:22:55FromDiscord<Nilts> (edit) "cse)" => "case)"
23:22:57FromDiscord<Elegantbeef> I dont even know what you mean
23:23:06FromDiscord<Elegantbeef> It being a proc is identical to it being a template except is more proper
23:23:43FromDiscord<Nilts> In reply to @Elegantbeef "It being a proc": i thought one was compile-time and one was not. Was i mistaken
23:23:56FromDiscord<Elegantbeef> templates are code subsitution
23:24:06FromDiscord<Elegantbeef> You're still making a closure procedure regardless
23:25:45FromDiscord<pyolyokh> In reply to @ambient "Not sure is --gc:arc": there's no allocation, but arc would let you use `=destroy` and the like with new types that you come up with
23:25:54FromDiscord<pyolyokh> (edit) "allocation," => "allocation in that code,"
23:25:59FromDiscord<Elegantbeef> There is generally no reason to do `--gc:none`
23:26:42FromDiscord<Elegantbeef> There is no overhead for using arc without using a GC'd type, it allows you to use string/ref and you can as pyolyokh pointed out use hooks
23:27:20FromDiscord<Phil> I'm getting a weird runtime error that an import from the openssl bindings is failing, I'm not quite sure as to why
23:27:35FromDiscord<Phil> One sec
23:28:25FromDiscord<Phil> sent a code paste, see https://paste.rs/I0R
23:29:44FromDiscord<pyolyokh> `could not import: EVP_MD_size`↵yeah, that doesn't exist
23:29:55FromDiscord<Phil> But.... one sec
23:30:20FromDiscord<pyolyokh> ah wait, I checked for that wrong
23:30:22FromDiscord<Phil> It has in the past
23:30:30FromDiscord<Phil> That code compiles and works, or worked in the past
23:30:32FromDiscord<pyolyokh> `proc EVP_MD_size(md: EVP_MD): cint {.lcrypto.}` is indeed there in devel
23:30:35FromDiscord<Phil> I just copy pasted it into a benchy example
23:30:56FromDiscord<Phil> Oh yeah, I'm currently on 1.9.1
23:31:11FromDiscord<Phil> And I think the code originally was developed under 1.7 something
23:31:43FromDiscord<pyolyokh> 1.6.10 has got it. You can confirm by grepping for it if it's there or not
23:32:39FromDiscord<Phil> grep is one of those tools I never learned to deal with. I'm decent generally with the terminal, but I just never learned grep or more complex bash scripting. I basically use sed like once a year for a task I can't do otherwise
23:37:00FromDiscord<Phil> Also not sure where the openssl binding file is to check it out
23:37:03FromDiscord<Phil> (edit) "Also not sure where the openssl binding file is to check it out ... " added "with grep"
23:40:14*ltriant quit (Ping timeout: 268 seconds)
23:45:16FromDiscord<pyolyokh> it's openssl.nim that you're importing from
23:45:34FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4kWm
23:57:29FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4kWt