<< 07-05-2022 >>

00:03:08*noeontheend joined #nim
00:15:33*duuuuuude quit (Ping timeout: 256 seconds)
00:15:49*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
00:19:37FromDiscord<morgan> In reply to @TryAngle "so the best way": you could create a variant type that contains the types it could have and then have a seq of them
00:20:21FromDiscord<morgan> er object variant is what it’s called in the manual
00:20:32FromDiscord<morgan> i always call it a variant type tho
00:28:27FromDiscord<morgan> sent a long message, see http://ix.io/3X9n
00:32:48FromDiscord<Rika> Variant type is also a common name
00:36:25FromDiscord<morgan> ok cool
00:44:59*vicfred quit (Quit: Leaving)
00:45:42FromDiscord<TryAngle> In reply to @MorganAlyssa "you could create a": I want to create types at runtime so this does not work
00:46:19FromDiscord<TryAngle> (edit) "types" => ""types""
00:47:51FromDiscord<Rika> You cannot
00:47:53FromDiscord<Rika> At all
00:48:06FromDiscord<TryAngle> I know, which is why I use "
00:48:11FromDiscord<Rika> It’s either that or you make an ad hoc system that’s basically object variants anyway
00:48:17FromDiscord<Rika> Or you don’t use types like you said
00:48:39FromDiscord<Rika> Whichever system sounds easier to you
00:49:08FromDiscord<TryAngle> I think I will all values as bytes and have something like a bytes + offset to type mapper
00:49:18FromDiscord<Rika> Okay
00:49:20FromDiscord<Rika> Your call
00:49:31FromDiscord<TryAngle> not sure what is a good solution
00:49:32FromDiscord<Rika> The object variant is much better I’d say but you do you
00:49:44FromDiscord<TryAngle> what is object variants?
00:50:45FromDiscord<Rika> What Morgan said
00:51:17FromDiscord<TryAngle> hmm I think I could mix those
00:58:41FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3X9t
00:59:14FromDiscord<Rika> Try except blocks?
01:00:14FromDiscord<huantian> https://nim-lang.org/docs/tut2.html#exceptions-try-statement
01:05:02FromDiscord<morgan> In reply to @TryAngle "what is object variants?": basically an object with a case/of (switch/case in many langs) to switch which member variables exist using an enum
01:05:09FromDiscord<morgan> they can be nested as well
01:05:32FromDiscord<sOkam!> Do I put copyDir inside a `try:` block, and the if/else would become `except:` blocks instead?
01:05:56FromDiscord<Rika> In reply to @sOkam! "Do I put copyDir": No, do this goes under copy in the try
01:05:58FromDiscord<sOkam!> I've never used them ever, so not really understanding what I need to do
01:06:09FromDiscord<Rika> I mean, the failed goes under except
01:06:17FromDiscord<Rika> Then the not failed goes under the copy line
01:06:42FromDiscord<sOkam!> Still not getting it, I believe
01:06:50FromDiscord<morgan> variant types will make more sense what it’s doing to someone looking at your code
01:07:51FromDiscord<morgan> oh and if you had a fixed number of items in the tuples you want, you could have one object that had that many cases if that made more sense for your needs
01:07:56FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3X9w
01:08:01FromDiscord<Elegantbeef> Oh right i's OS error
01:08:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3X9x
01:08:39FromDiscord<sOkam!> I see, tyty
01:09:17FromDiscord<morgan> In reply to @Elegantbeef "`cast[ptr UncheckedArray[byte]](myObj.addr)`": also i remember the manual saying something about addr and ptr being unsafe tho idr the specifics
01:09:40FromDiscord<Rika> yes
01:09:48FromDiscord<Elegantbeef> Yea it's an unsafe operation
01:09:57FromDiscord<Elegantbeef> What they want is explicitly unsafe
01:09:58FromDiscord<Rika> no you're an unsafe operation
01:10:24FromDiscord<morgan> aren’t object variants safe? they should work for this
01:11:01FromDiscord<Rika> they are?
01:11:03FromDiscord<Rika> what are you talking about
01:11:10FromDiscord<Rika> you replied to the cast and stuff
01:11:16FromDiscord<morgan> i was just making sure
01:11:37FromDiscord<Rika> object variants are safe
01:11:44FromDiscord<morgan> that’s what i thought
01:12:12FromDiscord<Elegantbeef> They want to represent arbitrary data as types the way you do that is with unsafe data and allocating primitives
01:12:19FromDiscord<Elegantbeef> But you can do it more sane
01:12:55FromDiscord<morgan> as long as the set of needed types is known at compile time object variants should do what they need just fine
01:13:08FromDiscord<Elegantbeef> You just copy Json Node and you get the arbitrary types they want
01:15:43FromDiscord<Rika> as long as the set of primitives are known at ct, i'd say
01:16:19FromDiscord<Elegantbeef> Yea i mean you do `int, float, string, seq` and you're golden
01:16:29FromDiscord<Elegantbeef> You can represent most types with those
01:16:34FromDiscord<Rika> object too usually
01:16:49FromDiscord<Rika> object being a hash map pretty much
01:17:02FromDiscord<Elegantbeef> Well they want tuples so dont really need the hashmap afaik
01:17:10FromDiscord<Elegantbeef> But yea
01:29:20*lumo_e quit (Ping timeout: 260 seconds)
01:30:00FromDiscord<whee> probably super wacky question: The examples of `quote do` here seem like something that could be done with templates: https://nim-lang.org/docs/tut3.html#introduction-generating-code , and I would either want to use templates or create the AST nodes myself in a macro if I'm doing something templates can't. When would I want `quote do`?
01:30:15FromDiscord<Elegantbeef> Yes it's just an example
01:30:23FromDiscord<Elegantbeef> Quote do is to compose with other macro code
01:30:59FromDiscord<Elegantbeef> https://github.com/beef331/kashae/blob/master/src/kashae.nim#L29-L41 consider this
01:31:29FromDiscord<whee> so I would have to be already doing something a template can't, and then it's a shorthand for creating some of the nodes?
01:31:43FromDiscord<Andreas> In reply to @aboisvert (Alex Boisvert) "(Example is for a": nice nim-trees there and a Ctrie in RS - how about a Ctrie in Nim ? what do you think -?- i try a HAMT in Nim, maybe that can become a Ctrie one day 🙂 thx for the stack-reminder..
01:31:57FromDiscord<Elegantbeef> Yea it's mostly a nice abstraction over generating the AST
01:32:04FromDiscord<Elegantbeef> I'd say use `genasts` instead of `quote do`
01:32:12FromDiscord<Elegantbeef> It's in it's own module but is cleaner imo
01:32:15FromDiscord<whee> this example helps a lot, thanks
01:33:41FromDiscord<Elegantbeef> @TryAngle\: i cannot help myself here is how you'd use tagged unions for your arbitrary types
01:33:41FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3X9D
01:34:35FromDiscord<Elegantbeef> If you want to make types dynamically you'll need to use these data structures or similar ones
01:34:51FromDiscord<Elegantbeef> You can pretty much represent all types with this minus field access
01:35:02FromDiscord<Elegantbeef> You need tables for that
01:35:07FromDiscord<Elegantbeef> As Rika pointed out
01:36:01FromDiscord<Rika> In reply to @Elegantbeef "It's in it's own": how so
01:36:11FromDiscord<sOkam!> Is there such a thing as `existsDir()`, instead of being forced to use `existsOrCreateDir()` instead?
01:36:12FromDiscord<Elegantbeef> No need to manually quote or make variables before
01:36:19FromDiscord<Rika> In reply to @sOkam! "Is there such a": there is?
01:36:22FromDiscord<Elegantbeef> `irExists`
01:36:33FromDiscord<Elegantbeef> you can do \`genast(myIdent = ident"hello
01:36:35FromDiscord<Elegantbeef> fuuuk
01:36:55FromDiscord<sOkam!> ty. order does matter 😄
01:36:58FromDiscord<Elegantbeef> `genast(a, b, c, myIdent = ident"hello)` instead of manually declaring `let myIdent = ident"Hello"`
01:37:06FromDiscord<Rika> oh `existsDir` was removed recently it seems, but it was an alias to `dirExists`
01:37:21FromDiscord<Elegantbeef> Eitherway just try to create the dir and if it errors catch that
01:37:24FromDiscord<Rika> In reply to @Elegantbeef "`genast(a, b, c, myIdent": i still have no idea what it means
01:37:33FromDiscord<Elegantbeef> It's unlikely but this is a race condition
01:37:36FromDiscord<Rika> a b c are
01:38:52FromDiscord<Elegantbeef> Damn it
01:38:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3X9E
01:39:06*noeontheend quit (Ping timeout: 276 seconds)
01:40:11FromDiscord<Rika> i see
01:40:14FromDiscord<Rika> looks nicer yes
01:40:23FromDiscord<ElegantBeef> Yea if only matrix edits propagated 😄
01:40:44FromDiscord<Elegantbeef> Since that edit wont propagate
01:40:44FromDiscord<Elegantbeef> indented properly of course
01:40:44FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/972311993082060800/image.png
01:40:48FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/Y8n
01:40:51FromDiscord<Rika> lmfao
01:40:52FromDiscord<ElegantBeef> Wait it propagates now
01:40:55FromDiscord<ElegantBeef> But as an entire copy
01:40:58FromDiscord<ElegantBeef> Lol
01:41:28FromDiscord<ElegantBeef> I have to contribute to the bridge eventually and take away their license to write it
01:41:54FromDiscord<Rika> lol
01:50:18FromDiscord<sOkam!> Is there a way in nim to get something similar to doing `currentDir=$(pwd)` in bash?↵I've found the constant `CurDir`, but not exactly what I wanted↵Not sure if I should need it, but curious if there is a way
01:51:12FromDiscord<Elegantbeef> `setCurrentDir` and `getCurrentDir`
01:53:12FromDiscord<sOkam!> Also, tips on how to zip files from inside nims?↵Should I call for bash shell command, or is there a better way to do it?
01:53:26FromDiscord<Elegantbeef> Use Zippy
01:53:35FromDiscord<Elegantbeef> Super easy to use though has some documentation issues
01:54:04FromDiscord<Rika> zippy is pure nim right
01:54:09FromDiscord<Elegantbeef> Yea
01:54:16FromDiscord<sOkam!> does that work inside nims?
01:54:48FromDiscord<Elegantbeef> Dont recall if it does i didnt read `nims`
01:54:50FromDiscord<sOkam!> Its a build helper script, so its not compiled code
01:55:14FromDiscord<Elegantbeef> Then yea doubt zippy will work
01:56:02FromDiscord<Rika> it might it might not
01:56:05FromDiscord<Rika> its likely not to
01:56:43FromDiscord<Elegantbeef> Depending on the usage you might consider supersnappy, but yea depends what you're doing
01:58:12FromDiscord<sOkam!> Just simple zipping of a file, at the moment. nothing fancy
01:58:26FromDiscord<sOkam!> (edit) "a file," => "some files/folders,"
01:58:43FromDiscord<Elegantbeef> I more mean if you're shipping the zips or just want to compress some files
01:59:42*ltriant_ joined #nim
01:59:54FromDiscord<sOkam!> It's basically automation for when building the project, to pack some files in a zip without having to do it manually
02:00:19FromDiscord<sOkam!> Those files will be distributed, but how is that different than them not being? Are they different?
02:00:27FromDiscord<Elegantbeef> Yea then probably going to need to use shell and system binaries
02:01:09FromDiscord<sOkam!> I see. Was hoping to get as much os independent behavior as possible, but I guess there is a limit here 🤷‍♂️
02:01:46FromDiscord<Elegantbeef> I dont know if snappy is a widely supported format with archive tools
02:01:51*ltriant quit (Ping timeout: 276 seconds)
02:02:00FromDiscord<Elegantbeef> So you could try using super snappy and `.snappy` as the extension
02:02:36FromDiscord<Elegantbeef> or it seems it's `.sz`
02:02:46FromDiscord<Elegantbeef> I dont know i've never seen one in the wild 😄
02:04:09FromDiscord<Rika> In reply to @Elegantbeef "I dont know if": It is not
02:04:32FromDiscord<sOkam!> Is it better to use `execShellCmd` or `execProcess` instead?↵Use case is just calling a `zip -v ` command, basically. Just asking about the difference between those two calls
02:04:40FromDiscord<morgan> this is the first i’ve heard of snappy
02:04:53FromDiscord<Elegantbeef> You're in nims you use the one inside `nimscript`'s module
02:05:09FromDiscord<Elegantbeef> https://nim-lang.org/docs/nimscript.html#exec%2Cstring
02:05:34FromDiscord<Elegantbeef> Well it's a compresson algo and there is a pure Nim variant that works inside the VM so if you want to embed compressed resources it's the way to go
02:05:37FromDiscord<sOkam!> oh, there is an specific one. tyty
02:06:27FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/p8B
02:11:02FromDiscord<Elegantbeef> With piconim auto linking you should be able to just write the code in Nim and expand the bindings where required
02:11:19FromDiscord<Rika> how the fuck does that work lmao
02:11:27FromDiscord<Elegantbeef> @Rika\: here is the response 😄
02:11:29FromDiscord<Elegantbeef> The autolinking?
02:11:31FromDiscord<Rika> yes
02:11:43FromDiscord<Elegantbeef> I parse C code searching for includes
02:11:48FromDiscord<Elegantbeef> I then add libraries i know that those includes need
02:12:10FromDiscord<Elegantbeef> https://github.com/beef331/picostdlib/blob/master/src/piconim.nim#L18-L72
02:12:11FromDiscord<Rika> how about a library that uses PIO asm
02:12:31FromDiscord<Elegantbeef> I havent looked into it much but should be roughly the same
02:12:40FromDiscord<Rika> i mean, how do i do the header gen
02:12:43FromDiscord<Elegantbeef> Add the module add the LinkableLib to `piconim.nim` and it should just work
02:13:00FromDiscord<Rika> `pico_generate_pio_header` in cmake i mean
02:13:11FromDiscord<Elegantbeef> Oh same thing
02:13:19FromDiscord<Elegantbeef> Though i havent done anything with PIO
02:13:31FromDiscord<Elegantbeef> I'm really really ignorant when it comes to embedded and the like
02:13:42FromDiscord<Rika> this is confusing lmao why cmake why
02:13:57FromDiscord<Elegantbeef> \PRs welcomed to repplace it 😄
02:14:27*cornfeedhobo quit (Ping timeout: 256 seconds)
02:15:05FromDiscord<Elegantbeef> It's the same thing though rika, no auto generating, but you add it to your `csources/CMakeLists.txt`
02:15:38*noeontheend joined #nim
02:15:48FromDiscord<Rika> ok
02:16:04FromDiscord<Elegantbeef> The `CMakeLists.txt` isnt modified by piconim so you can change it manually
02:16:35FromDiscord<Elegantbeef> Also you've built some examples with piconim?
02:16:48FromDiscord<Rika> kinda yes
02:16:51FromDiscord<Rika> the blinky boi
02:16:52FromDiscord<Elegantbeef> I'm the only one i know that's tested the auto linking, so i dont know if it's any good
02:17:50FromDiscord<Elegantbeef> The good thing is with piconim working as it does we can batch compile examples, just need to set it up i guess
02:18:29FromDiscord<Elegantbeef> Oh auxym has an example made for the PIO
02:18:32FromDiscord<Elegantbeef> Dont know if you seen it
02:18:52FromDiscord<Elegantbeef> https://github.com/beef331/picostdlib/tree/master/examples/ws2812_pio
02:19:12FromDiscord<Elegantbeef> I dont have the materials to test the additions by others so i can only say it looks "correct"
02:19:47FromDiscord<Rika> i dont have ws2812s so i cant either
02:20:01FromDiscord<Rika> so how do i make a library for use with picostd
02:20:09FromDiscord<Rika> just like any nim library?
02:20:15FromDiscord<Elegantbeef> Yea
02:20:24FromDiscord<Elegantbeef> https://github.com/beef331/picostdlib/blob/master/src/picostdlib/sevensegdisplay.nim for instance
02:20:35FromDiscord<Elegantbeef> Though i doubt that compiles anymore
02:20:57FromDiscord<Rika> what if the library requires headers gened by pioasm
02:21:20FromDiscord<Elegantbeef> I dont know in that case
02:21:35FromDiscord<Rika> can i run pioasm manually via a shell?
02:21:47FromDiscord<Rika> so it could just be in the nimble file i assume
02:21:48FromDiscord<Elegantbeef> Like i said i dont know
02:22:07FromDiscord<Elegantbeef> I'm very much 100% unclear how to do anything properly for picostdlib
02:23:43FromDiscord<Elegantbeef> The cmake dependancy makes life tedious
02:27:18FromDiscord<Elegantbeef> Plus i dont personally use it so it mostly sits there idle, so it's just in a shitty place
02:28:22FromDiscord<morgan> all this talk about compression algos made me think it would be cool to see if i could make some sorta weird mp3 combined with jpeg 2d audio compression with tempo/repeat detection to figure out how to wrap it for the time axis
02:28:49FromDiscord<morgan> not because it would work great but because it would be interesting to see what happens when i crank the loss value up lol
02:29:37FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3X9J
02:29:51FromDiscord<Elegantbeef> https://nim-lang.org/docs/nimscript.html#withDir.t%2Cstring%2Cuntyped
02:29:52FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=3X9J" => "https://play.nim-lang.org/#ix=3X9K"
02:29:58FromDiscord<Elegantbeef> and a `try except`
02:31:39FromDiscord<sOkam!> why the try block?
02:32:04*noeontheend quit (Ping timeout: 248 seconds)
02:32:34FromDiscord<huantian> In reply to @Elegantbeef "https://nim-lang.org/docs/nimscript.html#withDir.t%": man that missing space 😛
02:32:45FromDiscord<huantian> (edit) "In reply to @Elegantbeef "https://nim-lang.org/docs/nimscript.html#withDir.t%": man that missing space ... 😛" added "in the second comment"
02:32:46FromDiscord<Rika> what space?
02:33:21*cornfeedhobo joined #nim
02:33:21FromDiscord<huantian> https://media.discordapp.net/attachments/371759389889003532/972325235682603068/unknown.png
02:35:36*xet7 quit (Remote host closed the connection)
02:37:54FromDiscord<huantian> brb gonna do a 1 character pr
02:38:07FromDiscord<Elegantbeef> "Fixed a ypto"
02:38:26FromDiscord<huantian> I can't tell if the typo is intentional
02:38:35FromDiscord<Elegantbeef> Perhaps
02:38:42FromDiscord<Elegantbeef> To really sell the joke
02:41:25FromDiscord<xflywind> In reply to @huantian "brb gonna do a": Go for it, I like merging simple stuffs like this.
02:41:31FromDiscord<Rika> "Fix atypo"
02:41:58FromDiscord<morgan> if i write a spell checker library it should be named something like soellhceckre
02:42:06FromDiscord<Rika> do it
02:43:24FromDiscord<morgan> wish it had a contraction so i could use a semicolon like i sometimes do on accident
02:43:55FromDiscord<morgan> sometimes i've typed like don;]]t instead of don't
02:44:42FromDiscord<Rika> sometimes ive done don
02:44:45FromDiscord<Rika> t instead of don;t
02:44:49FromDiscord<Rika> oh hey
02:44:51FromDiscord<Rika> theres one more
02:45:18FromDiscord<morgan> yea that's why i do don;t
02:45:25FromDiscord<morgan> so that i don
02:45:34FromDiscord<morgan> t send a message early
02:45:42FromDiscord<morgan> (that time was on purpose)
02:45:58FromDiscord<Rika> hey its not like i can help it
02:46:07FromDiscord<morgan> if i could have discord take two enters to send a message i'd do that
02:49:00FromDiscord<huantian> does the `curDir` variable in withDir have to be `var`? might just make that a let while I'm at it
02:50:02FromDiscord<Elegantbeef> Doesnt seem so
02:50:22FromDiscord<Elegantbeef> Not marked dirty so cannot change it in body
02:51:37FromDiscord<huantian> if someone changed that they deserve to have their code break
02:52:31FromDiscord<Elegantbeef> Well i mean it isnt dirty so it couldnt be
02:54:41FromDiscord<Rika> > no dma.nim
02:54:43FromDiscord<Rika> trash libr
02:54:44FromDiscord<Rika> (edit) "libr" => "lib"
02:55:48FromDiscord<Elegantbeef> Your welcome
02:55:57FromDiscord<Rika> what about my welcome
02:56:14FromDiscord<Elegantbeef> We still making typo jokes or are those already outdated?
02:56:24FromDiscord<Rika> theyre already outdated indeed
02:57:16*arkurious quit (Quit: Leaving)
03:01:58FromDiscord<Rika> im gonna look into making the dma lib
03:02:22FromDiscord<Elegantbeef> If you dislike the manual wrapping you could probably use futhark
03:02:44FromDiscord<Rika> kinda the reverse tbh
03:04:09FromDiscord<Elegantbeef> I've been using futhark for WasmEdge and it works well but the major complaint i have is that nimble doesnt allow you to have some way to store a flag with install
03:04:43FromDiscord<Elegantbeef> so like you cannot just do `nimble install --store"-d:dontUseFuthark" wasmedge`
03:12:15*noeontheend joined #nim
03:12:18*rockcavera quit (Remote host closed the connection)
03:16:17FromDiscord<sOkam!> Is there a way to get the system's `$HOME` directory from nimscript, without doing an `exec`?
03:16:32FromDiscord<Elegantbeef> `getEnv`
03:18:35FromDiscord<sOkam!> found `getHomeDir` when looking for that. Is there any preference of one vs the other?
03:19:42FromDiscord<Elegantbeef> Depending on the target `os`'s procs dont work properly
03:25:05FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3X9O
03:25:22FromDiscord<Elegantbeef> You can
03:25:23FromDiscord<Elegantbeef> But why do something that silly
03:25:51FromDiscord<sOkam!> Coz that's the way I thought about doing it, no reference of a better way whatsoever 🤷‍♂️
03:25:55FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/zqw
03:26:09FromDiscord<Elegantbeef> String format is for formatting strings not for making paths
03:26:19FromDiscord<sOkam!> ic
03:39:15FromDiscord<Rika> beef (try 2)
03:39:16FromDiscord<Rika> https://github.com/beef331/picostdlib/blob/master/src/picostdlib/pio.nim#L134
03:39:17FromDiscord<Rika> disgusting
03:39:35FromDiscord<Elegantbeef> Did i do that?
03:39:42FromDiscord<Rika> idk prolly not
03:39:43FromDiscord<Elegantbeef> Nah auxym did
03:39:54FromDiscord<Rika> AUXYMMMMMMMMMMM
03:41:33FromDiscord<Elegantbeef> I'll swiftly their abillity to submit PRs and remove their commit history, they'll learn
03:41:39FromDiscord<Elegantbeef> remove their\
03:44:04FromDiscord<Alea> Why do doc comments have to go under the function signature instead of on top :withered:
03:44:15FromDiscord<Alea> (edit) "function" => "proc"
03:44:25FromDiscord<Elegantbeef> How do you document a module otherwise?
03:44:53FromDiscord<huantian> because we do docstrings the python way 😎
03:46:08FromDiscord<Elegantbeef> We do?
03:46:32FromDiscord<huantian> python does
03:46:36FromDiscord<huantian> uh
03:46:47FromDiscord<Elegantbeef> Royal we?
03:47:08FromDiscord<huantian> yeah
03:47:19FromDiscord<huantian> like uh python also puts the docstring under the `def`
03:47:35FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3X9Q
03:48:27FromDiscord<Elegantbeef> The only thing i dislike is that the runnable examples are so easily confused for functional code 😄
03:50:36FromDiscord<Rika> beef whats your naming convention for stuff like `dma_claim_unused_channel` if there is no "main object" to attach to
03:51:02FromDiscord<Elegantbeef> drop the `dma` and carry on
03:51:14FromDiscord<huantian> 🧬
03:51:14FromDiscord<Elegantbeef> Nim is not C if there is ambiguity there are mechanisms to resolve it
03:51:16FromDiscord<Rika> wouldnt that be confusing
03:51:34FromDiscord<Rika> `let channel = claimunusedchannel(true)` means what?
03:51:34FromDiscord<Elegantbeef> Leave it to the user to decide if it's confusing
03:51:39FromDiscord<Rika> okay
03:51:59FromDiscord<Elegantbeef> What does the `true`/`false` mean?
03:52:04FromDiscord<Rika> required
03:52:23FromDiscord<Rika> `panic if true else return -1` if there is no channel to allocate
03:53:27FromDiscord<Elegantbeef> I dont know i'm pretty biased against the C-like code
03:54:17FromDiscord<Rika> i know i am too, but im not sure what i would do here
03:54:38FromDiscord<Rika> in practice you can always `dma.claimUnusedChannel(true)` but its not required ofc
03:54:51FromDiscord<Elegantbeef> Yea that's what i meant about leave it to the programmer
03:55:13FromDiscord<Rika> yes but who would ever think `claimUnusedChannel` by itself isnt confusing
03:55:18FromDiscord<Elegantbeef> The issue isnt really ambiguity but that the procedure name is trash 😛
03:55:45FromDiscord<Elegantbeef> A freestanding `claimUnusedChannel` is jusut ugh
03:55:59FromDiscord<Rika> claim unused dma channel, wdyt?
03:56:11FromDiscord<Elegantbeef> Yea more ideal
03:56:30FromDiscord<Rika> now
03:56:31FromDiscord<Rika> `dma_claim_mask1
03:56:32FromDiscord<Rika> (edit) "`dma_claim_mask1" => "`dma_claim_mask`"
03:56:34FromDiscord<Rika> this is
03:56:38FromDiscord<Rika> fuck me lmfao
03:57:03FromDiscord<Elegantbeef> This is short for direct memory access right?
03:57:05FromDiscord<Rika> yes
03:57:24FromDiscord<Rika> the dma function names are just a mess lmfao
03:57:54FromDiscord<Elegantbeef> Do you want to make it good?
03:57:58FromDiscord<Rika> yes
03:57:59FromDiscord<Rika> no shit
03:57:59FromDiscord<Elegantbeef> We can make it real good
03:58:05FromDiscord<Rika> what
03:58:08FromDiscord<Rika> im scared now
03:58:35FromDiscord<Rika> btw if youre thinking "just make a dma channel distinct type" i am
03:58:47FromDiscord<Rika> its just some of these other types dont depend on it
03:58:50FromDiscord<Rika> types? functions
03:59:11FromDiscord<Rika> like that claim mask one `void dma_claim_mask(uint32_t channel_mask)`
03:59:18FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/z9g
03:59:57FromDiscord<Rika> i dont think thats necessary
04:00:10FromDiscord<Rika> i think `claimunuseddmachannel` is fine
04:00:17FromDiscord<Elegantbeef> Ok
04:00:52FromDiscord<Rika> btw your stance on panics or return -1 and stuff? how do you handle those
04:00:57FromDiscord<Rika> rather
04:01:10FromDiscord<Rika> do you have a low level ver that does normal and a high level ver that excepts?
04:01:15FromDiscord<Rika> or do you never except
04:01:34FromDiscord<Elegantbeef> I presently dont have any code that does exceptions
04:02:05FromDiscord<Elegantbeef> So i'd say have the lowlevel exported and a high level if you want it, the latter can be in it's own module if it makes you happier
04:02:30FromDiscord<Rika> i mean for your library, what do you do for "exceptionals"
04:02:57FromDiscord<Elegantbeef> Presently i dont have any of that handled so just do the same the C does
04:03:00FromDiscord<Rika> return -1, "panic" like the c library, raise, or `Result` possibly?
04:03:03FromDiscord<Rika> okay
04:03:12FromDiscord<Rika> kinda gross
04:03:14FromDiscord<Rika> but okay
04:04:44FromDiscord<Elegantbeef> What's the project you have in mind for your pico anyway?
04:05:14FromDiscord<huantian> rika is gonna make a bomb out of raspberry pis
04:06:02FromDiscord<Rika> btw do i still need to use cuint over uint or is uint == cuint
04:06:41FromDiscord<Rika> In reply to @Elegantbeef "What's the project you": "a keyboard" "why the fuck do you need dma on your keyboard" "because i want to play videos on it"
04:06:41FromDiscord<Rika> dont ask
04:07:19FromDiscord<huantian> my keyboard's microcontroller doesn't have enough memory for a video 😔
04:07:32FromDiscord<Rika> though in reality im just porting something right now to test a module and it uses dma
04:07:51FromDiscord<Elegantbeef> cuint is 32bits
04:07:52FromDiscord<Elegantbeef> Well it's `unsigned int` which is platform specific i think
04:08:17FromDiscord<Elegantbeef> Lol so defensive 😄
04:08:25FromDiscord<Rika> `uint` it says on the pi docs
04:08:28FromDiscord<Elegantbeef> I wouldnt even ask why you need DMA i'm a daft cunt
04:08:31FromDiscord<Rika> is that `cuint` here or `uint`
04:08:35FromDiscord<huantian> i keep reading cuint without the i
04:08:44FromDiscord<Rika> huan you're such a cuint
04:08:51FromDiscord<Rika> a massive cuint
04:08:52FromDiscord<huantian> 😏
04:09:30FromDiscord<huantian> it's funny cus the first result when I google "cuint" is npm, then urban dictionary
04:09:59FromDiscord<Rika> i might go for now, i need to get my glasses lenses changed
04:10:14FromDiscord<huantian> contacts gang
04:11:19FromDiscord<Elegantbeef> I dont remember right now rika, looking into it
04:11:19FromDiscord<Rika> yeah no i fall asleep randomly often so no
04:11:19FromDiscord<Elegantbeef> I use uint32 for it
04:11:39FromDiscord<Elegantbeef> Buh bye then
04:33:14*slowButPresent quit (Quit: leaving)
04:50:55FromDiscord<SirElephant> can we create a discord bot with nim>
04:50:56FromDiscord<SirElephant> ?
04:51:00FromDiscord<SirElephant> (edit) "nim>" => "nim"
04:51:03FromDiscord<Elegantbeef> Yes
04:51:10FromDiscord<Elegantbeef> https://github.com/krisppurg/dimscord
05:08:24*noeontheend quit (Ping timeout: 276 seconds)
05:18:54*Zectbumo joined #nim
05:38:33NimEventerNew question by exp_mb: How to properly read and parse data from Firebase in Nim?, see https://stackoverflow.com/questions/72149771/how-to-properly-read-and-parse-data-from-firebase-in-nim
05:45:14*nsyd joined #nim
05:45:26*nsyd quit (Client Quit)
06:13:52FromDiscord<Zectbumo> is it possible to make the compiler force the developer to catch every exception?
06:14:15FromDiscord<Elegantbeef> annotate the proc with `{.raises: [].}`
06:14:53FromDiscord<Elegantbeef> That doesnt apply to top level statements of course
06:19:52FromDiscord<Zectbumo> do I need to compile with --experimental:strictEffects?
06:20:19FromDiscord<Elegantbeef> I think strict effects is for a unrelated system but i could be wrong
06:22:24FromDiscord<Elegantbeef> Yea seems like you'll want to have `--warningAsError[Effect]: on --experimental:strictEffects`
06:22:29FromDiscord<Zectbumo> I'm going off of this https://nim-lang.org/docs/manual.html#effect-system
06:22:42FromDiscord<arnetheduck> In reply to @Zectbumo "is it possible to": https://status-im.github.io/nim-style-guide/errors.exceptions.html - the way to go about it is to add `{.push raises: [].}` on top of every file (`[Defect]` is for nim 1.2) - this forces every proc in that file (and sometimes others) to be checked for exceptions
06:22:46FromDiscord<Elegantbeef> Yea i got there too i was thinking of the tag system
06:23:25FromDiscord<Elegantbeef> Oh arne i can ask you a question about nlvm, does it support things like `externref` and `funcref` in the wasm backend?
06:23:30FromDiscord<Zectbumo> @arnetheduck is that the same as doing --panics:on?
06:23:43FromDiscord<arnetheduck> In reply to @Elegantbeef "Oh arne i can": I don't know 🙂
06:24:06FromDiscord<Elegantbeef> Ok thanks anyway
06:24:31NimEventerNew Nimble package! taskman - A package that manages background tasks on a schedule, see https://github.com/ire4ever1190/taskman
06:24:45FromDiscord<Elegantbeef> Playing with an embeddable wasm runtime so looking at the options i have for standalone modules
06:24:47FromDiscord<arnetheduck> it's been a few llvm versions since I wrote the wasm backend, haven't had time to play with the newer ones
06:25:07FromDiscord<Elegantbeef> Yea i dont think emcc supports them yet, but i might be wrong
06:25:25FromDiscord<arnetheduck> well, wasi support in the std lib would be a nice step forwards
06:25:33FromDiscord<Elegantbeef> I'm too daft to figure out where to find that out and what the code in Nim has to look like
06:25:52FromDiscord<Elegantbeef> Well i'm presently more looking at wasm for agnostic gameplay scripting
06:25:56FromDiscord<Elegantbeef> So i dont really need wasi there
06:26:03FromDiscord<arnetheduck> In reply to @Zectbumo "<@449019668296892420> is that the": this is the same as typing out `proc xxx() {.raises: [].}` on every proc
06:26:39FromDiscord<arnetheduck> it forces the compiler to put an exception handling barrier so that no unchecked exception can leak out of the proc
06:27:19FromDiscord<arnetheduck> you'll get a compile error every time something raises in the proc that doesn't have try/except around it to neutralise the exception
06:27:20FromDiscord<Zectbumo> I can't get it to work. playground is getting 500 error from ix
06:27:29FromDiscord<Zectbumo> (edit) "ix" => "ix, so I can't share"
06:27:35FromDiscord<Elegantbeef> Just hit share again until it does
06:27:54FromDiscord<Zectbumo> 3rd times the charm! https://play.nim-lang.org/#ix=3Xaf
06:28:09FromDiscord<Elegantbeef> What's the issue?
06:28:14FromDiscord<Elegantbeef> There are no exceptions there
06:28:24FromDiscord<Zectbumo> `Error: unhandled exception: value out of range: 13 notin 1 .. 12 [RangeDefect]`
06:28:31FromDiscord<Elegantbeef> Defects are not exceptions
06:28:45FromDiscord<Zectbumo> so I need --panic:on
06:28:50FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Xah
06:28:57FromDiscord<Zectbumo> (edit) "--panic:on" => "--panics:on"
06:29:19FromDiscord<Elegantbeef> Personally i view defects as a logical error that should be checked, but there is contension on how they're used
06:29:28FromDiscord<Elegantbeef> Well welcome to your own dialect of Nim
06:29:44FromDiscord<Zectbumo> I'll try locally
06:29:46FromDiscord<arnetheduck> yeah, that's not a pretty part of Nim - ie `Defect` is raised throughout, often silently, but there's no way to enforce Defect-free code
06:29:57FromDiscord<arnetheduck> `raises` works only for `CatchableError`
06:32:11FromDiscord<Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3Xai
06:32:42FromDiscord<arnetheduck> however `except` _sometimes_ catches `Defect` - the only way to reason about it is to ensure that `Defect` is never raised, pretty much like any UB construct in C
06:33:04FromDiscord<arnetheduck> (edit) "however `except` _sometimes_ catches `Defect` - the only way to reason about it is to ensure ... that" added "(manually)"
06:33:47FromDiscord<Zectbumo> oh! "Nim Compiler Version 0.17.2"
06:34:05FromDiscord<Zectbumo> is this correct saying that I'm on nim 0.17??
06:34:15FromDiscord<arnetheduck> `raises` checking works for catcahbles only, like so: https://play.nim-lang.org/#ix=3Xag
06:35:43FromDiscord<Elegantbeef> The proper way to handle your original code is like https://play.nim-lang.org/#ix=3Xal
06:35:49FromDiscord<Elegantbeef> Proper is subjective of course
06:36:19FromDiscord<arnetheduck> In reply to @Elegantbeef "Well i'm presently more": interesting - we have a few use cases like that as well .. feel free to ping me if you figure out something nice - right now, the wasm backend in nlvm is pretty bare-bones in that it simply does whatever llvm does by default
06:36:29FromDiscord<Zectbumo> 'nim/bionic,now 0.17.2-1ubuntu2 amd64 [installed]' 😢
06:36:46FromDiscord<Elegantbeef> Zect use choosenim
06:37:06FromDiscord<Zectbumo> is that a package I can install with apt?
06:37:16FromDiscord<Elegantbeef> Dont rely on a system package manager for programming langauges
06:37:17FromDiscord<Elegantbeef> Yea arne right now i'm presently using Nim and it's working ok for my playing around
06:37:17FromDiscord<Elegantbeef> Nah
06:37:51FromDiscord<Elegantbeef> https://github.com/beef331/wasmedge_playground is where my work is posted if you want to peek around, personally i'm quite pleased with how simple it is to expose code to wasm
06:37:58FromDiscord<Elegantbeef> Look in wasmsources to see that
06:38:27FromDiscord<Elegantbeef> hooks is unimplemented maths.nim is used and tested 😄
06:38:41FromDiscord<Zectbumo> k, so why not just have WSL Ubuntu have updated packages? this looks super ancient
06:39:13FromDiscord<Elegantbeef> Cause language distributing fucking sucks
06:39:35FromDiscord<Elegantbeef> Ideally choosenim is easily accessible
06:40:13FromDiscord<Elegantbeef> I've suggested making appimages or a flatpak addition but no clue if my suggestion in this chat will encourage anything
06:40:13FromDiscord<Elegantbeef> It's a lot of work to make choosenim and similar available to every package repo, much saner to use flatpak/appimage imo
06:41:06FromDiscord<Zectbumo> how does choosenim handle upgrades?
06:41:21FromDiscord<Elegantbeef> you download every release you want
06:41:25FromDiscord<Elegantbeef> Then can swap between them
06:41:55FromDiscord<Xzayler> In reply to @sOkam! "Is there something similar": Aren't those just strings? So you could just add the extension string?
06:42:00FromDiscord<Zectbumo> neat! (any reason I would want to do that?)
06:42:15FromDiscord<Zectbumo> (edit) "neat! (any reason ... I" added "why"
06:42:15FromDiscord<Elegantbeef> So you can easily move between versions of Nim if you need
06:42:38FromDiscord<Zectbumo> no, I get that. but why would I need? why would you need?
06:42:39FromDiscord<Rika> Testing maybe
06:42:42FromDiscord<Elegantbeef> Hey X thing needs Y version ok i jusut do `choosenim install Y`
06:42:46FromDiscord<Rika> Across different versions
06:42:48FromDiscord<Elegantbeef> Godot-nim requires 1.4.8 for instance
06:42:59FromDiscord<Zectbumo> I see
06:43:21FromDiscord<Elegantbeef> Or you might want a feature from devel for a specific package or thing you're working on but not another
06:43:55FromDiscord<Elegantbeef> Tools like choosenim are much much better than relying on a package manager for languages
06:45:03FromDiscord<Zectbumo> I use a package manager for automated deployments. at least openbsd has nim-1.6.4
06:45:35FromDiscord<Elegantbeef> Yea it's not great for languages unless it's a rolling release so be warned 😄
06:45:56FromDiscord<Zectbumo> but I will use choosenim on WSL
06:51:00FromDiscord<Elegantbeef> @arnetheduck\: do you recall the equivalent of emscripten's `EMSCRIPTEN_KEEP_ALIVE`(turns dead code elim off for the procedure, meaning it's usable from the wasm runtime) for nlvm?
06:51:28FromDiscord<Elegantbeef> I figured it might just be exportC but want to be certain 😄
06:52:12FromDiscord<Zectbumo> k, I tried my exception experiment on nim 1.6.6 with --panics:on and still no go 😢
06:52:15FromDiscord<arnetheduck> In reply to @Elegantbeef "I figured it might": well, either `` or `exportc` - can't remember which
06:52:47FromDiscord<Xzayler> In reply to @sOkam! "Is there something similar": ah look: https://nim-lang.org/docs/os.html#addFileExt%2Cstring%2Cstring↵check, `proc addFileExt(filename, ext: string) : string`↵not exactly what you're looking for.
06:52:52FromDiscord<Xzayler> (edit) "for." => "for though"
06:53:30FromDiscord<Xzayler> and also `proc joinPath(head, tail: string): string`
06:55:53FromDiscord<Zectbumo> In reply to @Zectbumo "k, I tried my": so would this be a nim bug?
06:56:17*Bager170 joined #nim
06:57:10FromDiscord<deeuu> Hey,↵Let's say I wanna clone a package (library), make some changes, and then import it into a script/app in order to play with those changes. What's the typical workflow? Coming from Python, my thinking was to clone, install in dev-mode and then create a `main.nim` to import the package.
06:57:35FromDiscord<Elegantbeef> Probably would be classified as one zect
06:57:57FromDiscord<Elegantbeef> The way i do it deauu is clone the package do `nimble develop` and modify it
06:58:01FromDiscord<Elegantbeef> Some just modify it in the source
06:58:17Bager170so, about the "discarding futures" thing... would it make sense if the `asyncCheck` was called in the destructor for `Future`?
06:59:53FromDiscord<Elegantbeef> I think the issue with discarding the future is more that it modifies the flow of the program
07:00:00FromDiscord<Elegantbeef> I could be wrong i dont async much
07:00:52FromDiscord<Elegantbeef> Perhaps it could be fine looking at what async dispatch does
07:06:02FromDiscord<deeuu> @ElegantBeef Yeah but how do you then import the package into one or more apps (bins)?↵`git clone repo && cd repo && nimble develop && nimble run testapp` ↵Where `testapp` imports the repo package. Does `testapp` need to be defined in the nimble file?
07:06:29FromDiscord<Elegantbeef> the repo package needs to be in `testapp.nimble`
07:06:55FromDiscord<Rika> In reply to @Bager170 "so, about the "discarding": It’s not necessarily desired?
07:08:17FromDiscord<huantian> Yeah, if you wanted Future to always have asyncCheck’s effects, you would just initialize all futures with the callback that asyncCheck adds
07:08:52FromDiscord<huantian> Also rika I think I can get rid of callbacks with my concurrent downloading thing if I figure out a good async semaphore implementation
07:13:37FromDiscord<Zectbumo> In reply to @Elegantbeef "Probably would be classified": sweet, I'll file the bug
07:15:26FromDiscord<deeuu> In reply to @Elegantbeef "the repo package needs": Got it, thank you!
07:15:39FromDiscord<Elegantbeef> No problem
07:42:06*Bager170 quit (Quit: Client closed)
08:05:46*duuuuuude joined #nim
08:09:58*kenran joined #nim
08:32:16FromDiscord<sOkam!> I'm trying to have a file that contains just an `uint16` in it and nothing else. That number will increase whenever I run the nimscript↵I'm really lost in how I'm supposed to read/write from it↵I'm reading the streams manual, but I don't think I'm understanding how the methods are meant to be used 😔↵Is there any article about it, or do you have any pointers on how to do this?
08:33:29FromDiscord<Rika> You write with the corresponding proc, and read with the associated proc
08:33:36FromDiscord<Rika> What’s wrong? Wrong result?
08:33:39FromDiscord<Elegantbeef> If it's just a integer probablly better of doing `parseUint(myFileString).int16`
08:34:07FromDiscord<Elegantbeef> I assume they're doing `$myUint` to save it
08:34:07FromDiscord<sOkam!> In reply to @Rika "What’s wrong? Wrong result?": Wrong is the understanding on how to use it. I get the rough idea, but not how to actually do it
08:34:30FromDiscord<sOkam!> Not doing anything, because I'm not being able to either read or write from the file
08:35:25FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XaL
08:36:45FromDiscord<Elegantbeef> No clue if that'll work for nimscript
08:38:05FromDiscord<sOkam!> Main issue with understanding might be that I'm super brain-ded atm.↵Will take a look at it tomorrow after sleeping ✍️
08:47:49FromDiscord<Zectbumo> I'm trying to follow these steps but there are no instructions on how to install koch↵https://nim-lang.github.io/Nim/intern.html#bootstrapping-the-compiler
08:48:48FromDiscord<Elegantbeef> I've never once had `koch` in my path, I just follow https://github.com/nim-lang/Nim#compiling
08:49:30FromDiscord<enthus1ast> @Zectbumo\: do you want to compile nim yourself, or just wanna use it?
08:49:54FromDiscord<Zectbumo> want to compile head nim to report bug
08:50:19FromDiscord<Elegantbeef> you can do `choosenim devel` to fetch a nightly build
08:51:34FromDiscord<enthus1ast> for "installing" koch, you must just put it on path (or just call it directly)
08:52:10FromDiscord<enthus1ast> nim c koch↵./koch boot -d\:release ↵↵should do it imho
08:52:21FromDiscord<enthus1ast> should build you a nim
09:02:12*jjido joined #nim
09:09:08*lumo_e joined #nim
09:12:07FromDiscord<dom96> In reply to @huantian "Yeah, if you wanted": Yeah. This has been thrown around as an idea for a while. I think it’s actually a no-brained but not sure what possible breakage it could cause.
09:12:17FromDiscord<dom96> (edit) "no-brained" => "no-brainer"
09:31:59FromDiscord<vindaar> who of you broke `nim doc`? 😜 getting multiple errors on doc strings all over the place now 🫤
09:32:20*xaltsc joined #nim
09:32:37FromDiscord<Rika> “Doc strings”? You mean comments?
09:33:03FromDiscord<vindaar> double `##` strings at the top of function body. documentation
09:33:30FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=3XaU
09:33:49FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=3XaV
09:34:09FromDiscord<sheerluck> bisect it like a pro
09:35:13FromDiscord<vindaar> I could of course, but ugh. Dealing with docs gets me about as excited as dealing with CI↵(@sheerluck)
09:36:05FromDiscord<sheerluck> never bisecting anything in my like is how I got impostor syndrome 😦
09:36:20FromDiscord<sheerluck> (edit) "like" => "life"
09:36:58FromDiscord<vindaar> haha
09:37:10FromDiscord<vindaar> git bisect is really useful to use (and actually pretty damn simple!)
09:45:35FromDiscord<xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3XaW
09:46:46FromDiscord<vindaar> Ah, thanks! And yeah, it's a regression. Worked just fine in the past↵(@xflywind)
09:49:45FromDiscord<d4rckh> what's up with nimskull? what did they not like about nim to make an entire new fork?
09:52:43FromDiscord<Zectbumo> I just heard about it today from that recent whine post
09:56:00FromDiscord<d4rckh> Same
09:56:49FromDiscord<Zectbumo> it sounded interesting until I heard they had little work done and no async
09:58:03FromDiscord<exelotl> This was my take on it a few weeks ago: https://raru.re/@exelotl/107854687758465694
09:59:06FromDiscord<Zectbumo> "while being mindful not to make too many breaking changes" recent post in forum requesting "breaking changes only" feature requests 😛
09:59:24FromDiscord<exelotl> Yeah, that aged poorly 😅
10:01:06FromDiscord<Zectbumo> nimskull could get some good ideas that can be easily imported into nim
10:01:29FromDiscord<willyboar> In reply to @Zectbumo "it sounded interesting until": This is not true. Except from the async part. They have done a lot of work
10:01:51FromDiscord<Zectbumo> it's great because they'll be passionate about their project and free reign which could pull out great ideas
10:02:31FromDiscord<exelotl> Personally I don't like a sync as a paradigm so "no async" is fine by me x)
10:02:38FromDiscord<exelotl> (edit) "a sync" => "async"
10:03:14FromDiscord<Zectbumo> In reply to @willyboar "This is not true.": okay, thanks for the correction. I thought I read that they couldn't get enough people to work on changes
10:04:06FromDiscord<Rika> They removed the current async implementation
10:04:12FromDiscord<Rika> They’re not gonna leave it no async of course
10:04:45FromDiscord<Zectbumo> sometimes you have to go backward to go forward
10:05:51FromDiscord<Rika> I don’t know, I’m not really sure why everyone sounds so against the hard fork
10:05:54FromDiscord<Zectbumo> In reply to @exelotl "Personally I don't like": I'm the opposite. async only for me
10:06:11FromDiscord<Zectbumo> but depends what you need for the project
10:06:42FromDiscord<Zectbumo> I do a lot of IO so tons of async for me
10:08:56*jmdaemon quit (Ping timeout: 248 seconds)
10:09:44FromDiscord<haxscramper> Saem wrote nim vscode extension and it requires async
10:09:54FromDiscord<haxscramper> So we will get to it later on again
10:11:15*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
10:19:07*PMunch joined #nim
10:23:33FromDiscord<willyboar> In reply to @Rika "I don’t know, I’m": Totally agree.
10:24:48FromDiscord<willyboar> And I don't understand why a fidget fork is ok but a Nim fork don't.
10:24:57FromDiscord<Rika> I think it’s half half, there’s disadvantages to a hard fork but also advantages and I can’t really say one outweighs the other
10:30:47*Arrrrrrr joined #nim
10:31:27FromDiscord<willyboar> The main disadvantage is community split. But I don't really agree with that.
10:31:53ArrrrrrrAm i late to the drama?
10:39:52FromDiscord<willyboar> In reply to @Arrrrrrr "Am i late to": What drama?
10:40:43ArrrrrrrI saw the thread about some user leaving nim, and for some reason expected that you were discussing it.
10:41:13FromDiscord<d4rckh> does parseopt provide a way of getting the index of the cmdArgument?
10:42:04FromDiscord<mratsim> In reply to @Arrrrrrr "I saw the thread": In offtopic then since it's not about programming
10:44:20FromDiscord<willyboar> In reply to @Arrrrrrr "I saw the thread": We discussing about Nim fork not the forum thread.
10:45:07ArrrrrrrAh, didn't know there was one.
10:47:06FromDiscord<willyboar> There is. The discussion was about the differences about nimskull and Nim and how a hard fork affect Nim.
10:47:30ArrrrrrrNimskull? lol
10:49:02FromDiscord<willyboar> It is a temporary name. You can visit their repo and read about it.
10:51:40*kenran quit (Ping timeout: 260 seconds)
10:53:13*kenran joined #nim
10:54:00*kenran quit (Client Quit)
10:55:07ArrrrrrrMmmm i've seen a couple of things i don't like. There are some funny patterns that, once you see them, you just know.
10:59:35FromDiscord<Rika> Okay?
10:59:52FromDiscord<Rika> Now try it with Nim and you’ll see that every project has something you don’t like?
11:04:45FromDiscord<willyboar> In reply to @Arrrrrrr "Mmmm i've seen a": Like? I believe nimskull Devs would like to hear them.
11:08:00*lumo_e quit (Quit: Quit)
11:20:32ArrrrrrrOf course, I don't claim nim is perfect, just stated my preference. Hope you understand,
11:24:33FromDiscord<exelotl> oops this surprised me https://play.nim-lang.org/#ix=3Xbe
11:25:42FromDiscord<exelotl> forgot that the array would still compile x)
11:25:54FromDiscord<exelotl> (edit) "forgot that the array would still compile ... x)" added "even though I missed a case"
11:30:08FromDiscord<vindaar> in relation to the style insensitivity stuff. am I the only one annoyed by the fact that the "no init" pragma is called `noinit` and not `noInit`? 😅
11:32:17FromDiscord<Rika> No there’s a lot of weird edge cases like that in the library
11:36:16FromDiscord<haxscramper> In reply to @exelotl "forgot that the array": actually it will only compile if you have a proper slice of the emun values
11:36:28FromDiscord<haxscramper> `a, b, c` from `a..d` is ok, but `a, c` won't compile
11:36:57FromDiscord<exelotl> yeah, makes sense
11:37:47FromDiscord<Zectbumo> In reply to @exelotl "oops this surprised me": that's similar to the bug I just wrote
11:43:22FromDiscord<d4rckh> how can i make parseopt accept spaces between flags and values? for example `-f val` would result in `f` key have `val` value
11:50:14*kenran joined #nim
12:08:38*kenran quit (Quit: WeeChat info:version)
12:22:08FromDiscord<exelotl> I don't think you can unless you add your own logic for it ("if I encounter -f, treat the next param as its value")
12:27:45FromDiscord<d4rckh> i see, thanks
12:28:25FromDiscord<d4rckh> also, is there any cool syntax for using a second value if the first value is does not exist in a table?
12:28:43FromDiscord<d4rckh> sent a code paste, see https://paste.rs/ZtF
12:29:10FromDiscord<d4rckh> (edit) "https://paste.rs/HDO" => "https://play.nim-lang.org/#ix=3Xbu"
12:29:12ArrrrrrrAre you referring to this? https://nim-lang.org/docs/tables.html#getOrDefault%2CTable%5BA%2CB%5D%2CA%2CB
12:29:46FromDiscord<d4rckh> ah yes, thats perfect, but it would be a bit ugly
12:31:30*noeontheend joined #nim
12:31:48FromDiscord<Rika> Nim doesn’t have truthiness so it doesn’t have this “Boolean hack”
12:32:25FromDiscord<d4rckh> i think i will make my own utility proc that uses getOrDefault
12:32:59ArrrrrrrThe `[]` op could be overloaded to accept an 'else' parameter: let v = myTable[key, optVal]
12:33:35*lumo_e joined #nim
12:33:42FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=3Xbw
12:33:51FromDiscord<exelotl> oh lord xD
12:34:01FromDiscord<d4rckh> haha
12:34:01FromDiscord<Rika> Disgusting
12:34:21FromDiscord<vindaar> 😁🚀
12:35:10Arrrrrrrsuch is the life of the nim coder.
12:35:23FromDiscord<exelotl> in my recent project I defined `??` which returns the RHS if the LHS is nil or empty. But in order for it to be helpful I had to define a bunch of `safeGet` procs that return `nil` if the key doesn't exist
12:35:26FromDiscord<exelotl> https://git.sr.ht/~exelotl/forum2irc/tree/master/item/src/forum2irc.nim
12:39:25PMunchThat's not the worst hack I've seen, pretty tame for a Nim meta-programming hack even :P
12:40:11PMunchThis is similar to what I tried to do for option types with optionutils by the way
12:41:36FromDiscord<vindaar> yes, there's way worse. but imo the use case + syntax does not warrant the forced usage of `try/except` here (although I can't think of a similar syntax from the top of my head to be able to check for the keys firs)↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
12:50:36PMunch@vindaar, I mean your could write a macro which looks at the AST of the left-hand side, extracts the table and the key, and then uses `hasKey`
12:50:47PMunchWay uglier as a hack though
12:51:39FromDiscord<vindaar> yup, I had that in mind as an idea as well. Aside from having to write a lot more code, it's easy to run into troubles again where your macro ends up not being properly untyped in some contexts etc. so well↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
12:51:54FromDiscord<vindaar> "a lot" is relative of course
12:53:12PMunchTBH I think the try/except is pretty good. Short and concise, and apart from a little bit of overhead with exceptions (how much is this really?) it's pretty good
12:53:58PMunchFor the positive case (key is in the table) it would probably even be slower to first check with `hasKey` and then access as you have to calculate the hash of the key twice.
12:54:57*slowButPresent joined #nim
12:55:14PMunchThat's not the case with `getOrDefault` though of course
12:57:42FromDiscord<vindaar> also true, yes
13:03:32*mahlon quit (Ping timeout: 248 seconds)
13:06:43*Zectbumo quit (Remote host closed the connection)
13:12:58FromDiscord<federico3> yet there could be a slightly cleaner syntax than `let a = try: 1 except: 2`
13:14:47PMunchI guess if rawGet was exposed this would be easier
13:15:23PMunchOr just something that returns an index and an pointer to the data or something
13:16:14PMunch@federico3, did you have anything particular in mind?
13:43:30*arkurious joined #nim
14:25:53*kenran joined #nim
14:55:40*djanatyn1 joined #nim
14:56:59*kenran quit (*.net *.split)
14:56:59*buster_blue[m] quit (*.net *.split)
14:57:00*Yardanico quit (*.net *.split)
14:57:01*oddish quit (*.net *.split)
14:57:01*arkanoid quit (*.net *.split)
14:57:01*syl quit (*.net *.split)
14:57:01*djanatyn quit (*.net *.split)
14:57:15*kenran joined #nim
14:57:15*buster_blue[m] joined #nim
14:57:15*Yardanico joined #nim
14:57:15*oddish joined #nim
14:57:15*arkanoid joined #nim
14:57:15*syl joined #nim
15:10:15FromDiscord<haxscramper> `import {.all.}`
15:39:06FromDiscord<Rika> beef, updates on the cuint/uint stuff?
15:40:24FromDiscord<haxscramper> I also forgot to mention that style insensitivity RFC is now the most commented one, with ~2.3 times more replies than one in a second place
15:51:23*lumo_e quit (Read error: Connection reset by peer)
15:52:59*lumo_e joined #nim
16:00:46*xet7 joined #nim
16:07:35*vicfred joined #nim
16:09:28NimEventerNew post on r/nim by RoughCalligrapher906: Howdy! I have a YT channel where I teach coding and want some ideas., see https://reddit.com/r/nim/comments/ukghis/howdy_i_have_a_yt_channel_where_i_teach_coding/
16:22:17*duuuuuude quit (Ping timeout: 256 seconds)
16:27:54FromDiscord<federico3> Maybe a 1-line syntax that drops "try" and the columns e.g. `let a = foo() except(SomeError) bar()`↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
16:45:42NimEventerNew thread by Foderking: Wierd behaviour with table, see https://forum.nim-lang.org/t/9146
16:46:07*duuuuuude joined #nim
16:47:41FromDiscord<Rika> huantian yardanico: lol
16:48:20FromDiscord<huantian> double sniping
16:48:43FromDiscord<Rika> i was a second faster
16:50:23FromDiscord<Yardanico> Typing from the phone is hard :((
17:03:37*noeontheend quit (Ping timeout: 246 seconds)
17:17:36FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Xcy
17:18:05FromDiscord<Elegantbeef> You cant use filestreams from nimscript
17:18:36FromDiscord<sOkam!> What's different between them?
17:21:45FromDiscord<Rika> stringstream has a string buffer in memory
17:21:55FromDiscord<Rika> filestream reads from the file
17:22:08FromDiscord<Rika> the thing beef does loads the whole file into memory
17:22:11FromDiscord<Rika> filestream wouldnt
17:22:23FromDiscord<Rika> beef btw cuint vs uint whats it
17:22:49FromDiscord<Elegantbeef> like i said yesterday uint32
17:23:05FromDiscord<Yardanico> In reply to @Rika "beef btw cuint vs": cuint is C uint, so uint32, Nim `uint` is arch-dependent
17:23:09FromDiscord<Yardanico> 32-bit on 32-bit and 64-bit on 64-bit
17:23:26FromDiscord<Yardanico> !eval echo sizeof(cuint), " ", sizeof(uint)
17:23:29NimBot4 8
17:23:44FromDiscord<Rika> yardanico its a different question to what youre thinking
17:23:53FromDiscord<Yardanico> i knew that'd be the case, but I still replied
17:24:01FromDiscord<Yardanico> 👺
17:26:57FromDiscord<sOkam!> Why are filestreams not available in nimscript, btw? Manual doesn't reference, or at least I haven't found it
17:27:23*mahlon joined #nim
17:28:05FromDiscord<Elegantbeef> Relies on CFFI
17:28:33FromDiscord<sOkam!> which unencrypted means...
17:28:47FromDiscord<demotomohiro> filestream uses functions in C standard library that is not available in nimscript
17:28:51FromDiscord<sOkam!> never heard of cffi, so i can't even look for it if I wanted to
17:29:20FromDiscord<demotomohiro> CFFI means Nim uses C libraries.
17:29:24FromDiscord<Elegantbeef> "cffi programming"
17:29:24FromDiscord<Elegantbeef> Does give you explanations
17:29:33FromDiscord<Elegantbeef> Well it means C foreign function interface
17:29:40FromDiscord<sOkam!> ✍️
17:29:55FromDiscord<sOkam!> tyty
17:31:27FromDiscord<Rika> `typedef unsigned int uint;` at src/common/pico_base/include/pico/types.h L18, so `cuint` is more correct no?
17:31:52FromDiscord<Rika> i guess its more unstable than that though
17:33:44FromDiscord<sOkam!> Just found this. But its not using streams 🤔 https://nim-by-example.github.io/files/↵Any reason I should be using streams, instead of writing directly to the file?
17:34:43FromDiscord<Rika> if you prefer the api
17:36:19FromDiscord<demotomohiro> procedures that write to or read from stream can be used to any stream like stringstream, filestream, stdin/stdout/stderrstream, socketstream, etc
17:39:46Amun-Ramemstream…
17:41:44FromDiscord<Yardanico> worldstream
17:46:56FromDiscord<Elegantbeef> streamstream
17:47:07FromDiscord<Elegantbeef> A stream that emits streams of streams, that can stream your streamstream
17:48:08FromDiscord<Rika> the y combinator of streams
17:48:08FromDiscord<Elegantbeef> I still wonder if there is any reason streams use OOP instead of concepts
17:48:30FromDiscord<Rika> because concepts bad
17:48:36FromDiscord<Rika> give me the updoots
17:49:22FromDiscord<Elegantbeef> lol
17:51:21FromDiscord<Yardanico> In reply to @Elegantbeef "I still wonder if": i wonder if proc-style interfaces (just storing procs in an object) are faster than nim method dispatch>
17:51:23FromDiscord<Yardanico> (edit) "dispatch>" => "dispatch?"
17:51:56FromDiscord<Elegantbeef> I havent benchmarked the cached optimizations so cannot say
17:52:07FromDiscord<Elegantbeef> I know flywind recently added the OOP cache mechanism
17:52:51FromDiscord<Elegantbeef> So orc/arc should be closer to refc when it comes to OOP
17:52:55FromDiscord<Elegantbeef> If not equal
17:53:16FromDiscord<Yardanico> it's a bit slower still
17:53:21FromDiscord<Yardanico> but not like before
17:53:38FromDiscord<sOkam!> do you know if this overwrites the file completely, or if it just adds to the content of whatever is there? https://media.discordapp.net/attachments/371759389889003532/972556827092992110/unknown.png
17:53:44FromDiscord<Yardanico> overwrites
18:09:55FromDiscord<d4rckh> how do i handle an any size array from C in nim?
18:10:14FromDiscord<d4rckh> trying to use an UncheckedArray but I don't have a lot of luck
18:10:33FromDiscord<Yardanico> In reply to @d4rckh "trying to use an": this is what you use, yes
18:10:35FromDiscord<d4rckh> `let groupArray: UncheckedArray[SID_AND_ATTRIBUTES] = tokGroups.Groups` results in let `Error: type mismatch: got 'array[0..0, SID_AND_ATTRIBUTES]' for 'tokGroups.Groups' but expected 'UncheckedArray[SID_AND_ATTRIBUTES]'`
18:10:42FromDiscord<d4rckh> (edit) removed "let"
18:10:46FromDiscord<d4rckh> do i have to cast it?
18:10:48FromDiscord<Yardanico> you need to cast it
18:10:53FromDiscord<Elegantbeef> `ptr UncheckedArray[T]`
18:10:55FromDiscord<Rika> `ptr Unchecked...`
18:10:56FromDiscord<Yardanico> also why Groups is an array?
18:11:03FromDiscord<d4rckh> https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-token_groups
18:11:04FromDiscord<Yardanico> got 'array[0..0, SID_AND_ATTRIBUTES]' for 'tokGroups.Groups'
18:11:40FromDiscord<d4rckh> In reply to @Elegantbeef "`ptr UncheckedArray[T]`": oh, i see
18:12:26FromDiscord<d4rckh> wait, but why a pointer?
18:12:34FromDiscord<d4rckh> `tokGroups.Groups` is not even an array
18:12:43FromDiscord<Rika> because "arrays are pointers" in c
18:12:49FromDiscord<Yardanico> it is https://media.discordapp.net/attachments/371759389889003532/972561656687239298/unknown.png
18:12:55FromDiscord<Yardanico> maybe your nim type is wrong then
18:13:05FromDiscord<Rika> theres an if else there yardanico
18:13:09FromDiscord<Rika> ct if else
18:13:12FromDiscord<Yardanico> true
18:13:23FromDiscord<Rika> still applies that its a "pointer" tho
18:13:33FromDiscord<Yardanico> not in the second else
18:14:00FromDiscord<Yardanico> idk, I don't know these weird C shenanigans
18:14:20FromDiscord<Rika> its late for me what the fuck
18:14:22FromDiscord<Rika> i should go
18:17:51FromDiscord<Yardanico> its offtopic, but no on-topic discussion really - https://docs.python.org/3.11/whatsnew/3.11.html#new-modules
18:17:58FromDiscord<Yardanico> python adding TOML to the standard lib is quite cool
18:19:08FromDiscord<d4rckh> and to cast i assume `cast[ptr UncheckedArray[SID_AND_ATTRIBUTES]](tokGroups.Groups)`?
18:19:17FromDiscord<Yardanico> In reply to @d4rckh "and to cast i": yes
18:19:21FromDiscord<d4rckh> `Error: expression cannot be cast to ptr UncheckedArray[SID_AND_ATTRIBUTES]` 🤔
18:19:26FromDiscord<Elegantbeef> the address of it not the vallue
18:20:24FromDiscord<Elegantbeef> I dont understand why you're getting a `array[1, T]`
18:20:24FromDiscord<Elegantbeef> It should be a ptr afaik
18:20:37FromDiscord<d4rckh> okay that worked
18:20:41FromDiscord<d4rckh> now i have to figure out how to iterate it
18:21:08FromDiscord<Elegantbeef> if you know the length `for x in myArray.toOpenArray(0, len - 1)`
18:21:20Amun-Rafor i in 0 ..< groupcount: foo group[i]
18:21:45Amun-Ralength is the first member of the structure
18:26:50Amun-Rad4rckh: btw, there's no need for casting, just define that member as groups: ptr UncheckedArray[ptr SID_AND_ATTRIBUTES]
18:27:48FromDiscord<treeform> do you guys know if you can "mget" from a seq? var a = foo[0] .... I want any change to a to update it inline in the seq?
18:28:00FromDiscord<d4rckh> In reply to @Amun-Ra "<@648552095531663361>: btw, there's no": well then i am getting ↵`Error: type mismatch: got 'ptr array[0..0, SID_AND_ATTRIBUTES]' for 'addr tokGroups.Groups' but expected 'ptr UncheckedArray[SID_AND_ATTRIBUTES]'`
18:28:49FromDiscord<Prestige> I think the seq just needs to be a var, right? @treeform
18:29:01Amun-Rad4rckh: ah, remove the second 'ptr' in my example
18:29:37FromDiscord<d4rckh> In reply to @Amun-Ra "<@648552095531663361>: ah, remove the": i removed that
18:29:51FromDiscord<d4rckh> i got `ptr UncheckedArray[SID_AND_ATTRIBUTES]` if you look at the error
18:30:49Amun-Rad4rckh: what's weird on that msdn page is type *groups[] and type groups[size] are different types
18:31:35Amun-Raif you implement the first that should be with inner ptr
18:33:15FromDiscord<d4rckh> yeah its weird
18:33:29FromDiscord<d4rckh> how do i convert a LPWSTR to a nim string?
18:34:04Amun-Racheck widestrs
18:34:43FromDiscord<Yardanico> In reply to @treeform "do you guys know": there is one way which is a bit hacky
18:34:51FromDiscord<Yardanico> @treeform https://nim-lang.org/docs/decls.html#byaddr.t%2C%2C%2C
18:35:06Amun-Rad4rckh: if you cast it to WideCString `$` should suffice
18:35:08FromDiscord<Yardanico> just access by pointer hidden behind a nice template
18:35:26FromDiscord<d4rckh> Ah, right
18:36:13FromDiscord<treeform> In reply to @Yardanico "there is one way": That does work thanks!
18:36:31FromDiscord<Yardanico> In reply to @treeform "That does work thanks!": it's just 5 lines so if you want your code to work on older versions you can just copy the implementation :D
18:36:40FromDiscord<Elegantbeef> When view types come in you will not need hacks like byaddr, but they're still on their way 😄
18:38:09FromDiscord<treeform> In reply to @Avahe "I think the seq": No var seq gets you a you copy of its member...
18:38:43FromDiscord<Elegantbeef> Thanks to lacking view types any thing that returns `var T` assigned to a variable returns a copy
18:38:44FromDiscord<treeform> So `{.byaddr.}` gives me a 2% speed up, which is great thanks!
18:39:10FromDiscord<Elegantbeef> You can only use `var T` inline otherwise you need byaddr
18:39:12FromDiscord<treeform> I think seq just needs some thing like mget like table has...
18:39:23FromDiscord<treeform> I don't know if we need whole "new types"
18:39:33FromDiscord<Elegantbeef> I mean views are what it needs imo
18:39:38FromDiscord<Elegantbeef> It solves all the problems
18:39:50FromDiscord<Elegantbeef> They're not "new" since they're already in the compiler and experimental
18:39:54FromDiscord<Elegantbeef> It's more we need that finished
18:40:16FromDiscord<d4rckh> In reply to @Amun-Ra "<@648552095531663361>: if you cast": `Error: type mismatch: got 'LPWSTR' for 'groupName' but expected 'WideCString = ref UncheckedArray[Utf16Char]'`
18:40:17FromDiscord<d4rckh> damn
18:40:33FromDiscord<d4rckh> whats wrong?
18:40:39FromDiscord<d4rckh> i did `$WideCString(groupName)`
18:40:53FromDiscord<kiell> in what cases should i use nimscript over regular nim?
18:41:16FromDiscord<treeform> In reply to @Elegantbeef "They're not "new" since": I am looking forward to having them... and speeding up my code
18:41:59FromDiscord<Yardanico> In reply to @kiell "in what cases should": for configuration (.nims files are nimscript), and if you want runtime scripting in your app and want to still have scripts written in Nim
18:42:02FromDiscord<Elegantbeef> You use nimscript when you need to, so nimble tasks/configs mostly
18:42:08Amun-Rad4rckh: hmm… $cast[WideCStringObj](groupName)
18:43:47FromDiscord<kiell> so nimscript does not need to be compiled first? i can just exec it?
18:44:07FromDiscord<Yardanico> In reply to @kiell "so nimscript does not": yes, it runs through the VM
18:44:18FromDiscord<Elegantbeef> It's a interpreted subset of Nim
18:44:19FromDiscord<Yardanico> nim compiler has an embedded VM that runs compile-time code, this is what nimscript uses
18:44:30FromDiscord<Elegantbeef> It's not fully capable of what Nim can do, but it can do a fair bit
18:44:39FromDiscord<kiell> oh i see now
18:44:42FromDiscord<kiell> neaaat
18:45:03FromDiscord<Yardanico> In reply to @Elegantbeef "It's not fully capable": mostly about C FFI and raw memory access, because otherwise everything's more or less the same?
18:45:04FromDiscord<Elegantbeef> It's commonly used for macros/compile time evaluation
18:45:54FromDiscord<Elegantbeef> Yes it doesnt have access to parts of the stdlib(without a libffi built compiler) or low level operations
18:47:36FromDiscord<d4rckh> In reply to @Amun-Ra "<@648552095531663361>: hmm… $cast[WideCStringObj]": thats undeclared
18:47:43*vicfred quit (Quit: Leaving)
18:47:47FromDiscord<Yardanico> In reply to @d4rckh "thats undeclared": formatting got eaten by the bridge or something
18:47:56FromDiscord<Yardanico> it's `$cast[WideCStringObj](yourstr)`
18:48:13Amun-Rad4rckh: I mean $cast[WideCString](…)
18:48:26FromDiscord<d4rckh> i see that as `$castWideCString` haha
18:48:29FromDiscord<d4rckh> i think its the irc bridge
18:48:46Amun-Raah, definitely :>
18:48:52FromDiscord<Yardanico> In reply to @d4rckh "i think its the": :( one more bug to fix
18:49:05Amun-Rad4rckh: I mean `$`cast`[`WideCString`]`(…)
18:49:08FromDiscord<Yardanico> weird that i didn't notice it before, maybe something changed
18:49:08Amun-Rahow about know?
18:49:39FromDiscord<d4rckh> now i get a `SIGSEGV: Illegal storage access. (Attempt to read from nil?)SIGSEGV: Illegal storage access. (Attempt to read from nil?)`
18:49:45FromDiscord<Yardanico> heh
18:50:00FromDiscord<Yardanico> is there some code you can paste for me to try? I'm on Windows now
18:50:03FromDiscord<Yardanico> i mean regarding those tokens
18:50:29FromDiscord<d4rckh> this is the full code
18:50:32FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3XcU
18:50:37FromDiscord<Yardanico> winim or winlean?
18:50:39FromDiscord<d4rckh> import winim
18:50:44Amun-RaI can't run win32 code atm
18:51:14FromDiscord<Yardanico> In reply to @d4rckh "import winim": and convertSidToStringSidA is your proc?
18:51:23FromDiscord<d4rckh> oh sorr
18:51:24FromDiscord<d4rckh> (edit) "sorr" => "sorry"
18:51:33FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3XcV
18:54:52FromDiscord<Yardanico> well, first of all it seems to sigsegv because LookupAccountSidW doesn't actually succeed
18:55:13FromDiscord<Yardanico> and you have that echo outside of the second LookupAccountsSidW if
18:56:01FromDiscord<d4rckh> oh
18:57:42FromDiscord<Yardanico> because you need to preallocate the buffer for the string
18:57:53FromDiscord<Yardanico> which is then passed with cchName for which you just pass cbSize
19:00:04FromDiscord<d4rckh> ah, i see
19:09:20FromDiscord<d4rckh> `LookupAccountSidW` is actually failling with error 87 which means a parameter is incorrect
19:09:34FromDiscord<Yardanico> yeah your code is a bit wrong, I'm changing it but have SIGSEGV rn
19:09:36FromDiscord<Yardanico> a different one
19:10:36FromDiscord<Yardanico> e.g. is there any reason you're passing SID as lpstr ?
19:10:40FromDiscord<d4rckh> ok i think the second call to LookupAccountSidW should get cbSize, not the address of it
19:10:44NimEventerNew thread by Archnim: Var + varargs = 🤯, see https://forum.nim-lang.org/t/9147
19:10:49FromDiscord<Yardanico> when you already have PSID in groupArray[i].Sid
19:10:56FromDiscord<Yardanico> so you can just pass that directly to LookupAccountSidW sid
19:10:56FromDiscord<d4rckh> oh
19:10:58FromDiscord<d4rckh> im blind
19:11:21FromDiscord<d4rckh> https://media.discordapp.net/attachments/371759389889003532/972576387644928010/unknown.png
19:11:24FromDiscord<d4rckh> this is how my code looks in vs code
19:11:42FromDiscord<d4rckh> proc calls dont get highlighted because they start with a capital letter, but thats just how windows api has their naming convention
19:11:44FromDiscord<Yardanico> :P https://media.discordapp.net/attachments/371759389889003532/972576483572846602/unknown.png
19:12:09FromDiscord<Yardanico> I have normal proc calls highlighted as red, but winapi are blue ones because that's the type color
19:12:20FromDiscord<d4rckh> thats cool...
19:12:28FromDiscord<Yardanico> i'm trying to figure out why it SIGSEGVs for me
19:13:02FromDiscord<d4rckh> what editor are you using?
19:13:05FromDiscord<Yardanico> vscode
19:13:13FromDiscord<Yardanico> vscode has customizable color themes
19:13:24FromDiscord<d4rckh> oh, you made your own theme?
19:13:30FromDiscord<Yardanico> nope, just found the one i like
19:13:41FromDiscord<Yardanico> i like vibrant colors, so now I'm using https://marketplace.visualstudio.com/items?itemName=jackjyq.brogrammer-plus , in the past I used https://marketplace.visualstudio.com/items?itemName=s3gf4ult.monokai-vibrant
19:13:49FromDiscord<Yardanico> both are vibrant colors
19:14:05FromDiscord<d4rckh> much better..
19:14:12FromDiscord<d4rckh> thank you
19:14:37FromDiscord<d4rckh> i dont like the amount of nested if's i have
19:14:43FromDiscord<d4rckh> i will have to refactor a bit after i figure out why its erroring
19:16:13FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Xd0
19:16:16FromDiscord<d4rckh> but i still get the sigsegv
19:16:44FromDiscord<Yardanico> yeah same here
19:17:11FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/972577855328378940/unknown.png
19:17:24FromDiscord<Yardanico> maybe something's wrong with the sid? not sure
19:17:31*jjido joined #nim
19:18:07FromDiscord<d4rckh> thats the second call right
19:18:36FromDiscord<Yardanico> no, the first, why?
19:19:44FromDiscord<d4rckh> i found an issue but it didnt get rid of the error
19:19:52FromDiscord<d4rckh> cbSize should be set to 0 before calling it
19:19:58FromDiscord<d4rckh> (edit) "it" => "first lookupsid"
19:20:02FromDiscord<Yardanico> huh, why?
19:20:15FromDiscord<d4rckh> > On input, specifies the size, in TCHARs, of the lpName buffer. If the function fails because the buffer is too small or if cchName is zero, cchName receives the required buffer size, including the terminating null character.
19:20:15FromDiscord<Yardanico> it says "On input, specifies the size, in TCHARs, of the lpName buffer. "
19:20:20FromDiscord<Yardanico> yes
19:20:26FromDiscord<d4rckh> > if cchName is zero, cchName receives the required buffer size
19:20:26FromDiscord<Yardanico> you don't always need two calls
19:20:36FromDiscord<Yardanico> you can already preallocate a buffer and try
19:20:41FromDiscord<Yardanico> and if the buffer is too small, try again
19:20:44FromDiscord<Yardanico> no need to always have two calls
19:20:49FromDiscord<d4rckh> i see
19:20:50FromDiscord<Bubblie> Do nim bindings for skia exist
19:21:39FromDiscord<Yardanico> @d4rckh even then, it shouldn't crash with SIGSEGV like it does in my case
19:21:44FromDiscord<Yardanico> do I need to run this program as admin maybe?
19:21:46FromDiscord<Yardanico> or something
19:21:58FromDiscord<d4rckh> no
19:21:58*Arrrrrrr quit (Quit: Arrrrrrr)
19:22:03FromDiscord<Elegantbeef> Well i just learned iterators can yield tuples with mutable references to data
19:22:07FromDiscord<Bubblie> Btw does anyone know if futhark needs to use mingw instead of clang on windows for the importc portion of implementing it
19:22:26FromDiscord<d4rckh> token groups exist for any process, you shouldnt need to run it as admin
19:22:42FromDiscord<Elegantbeef> No you need clang
19:22:43FromDiscord<Elegantbeef> It uses libclang's parser for reasoning the code
19:22:54FromDiscord<Bubblie> Yeah okay, thought so here, hmmmm
19:23:03FromDiscord<Yardanico> it's not hard to install clang on windows, it's written in futhark readme
19:23:08FromDiscord<Bubblie> It was working a little before, not sure what is causing the issue this time
19:23:13FromDiscord<Bubblie> In reply to @Yardanico "it's not hard to": No I already have it installed
19:23:31FromDiscord<Bubblie> Its more of actually just using the header thats not working but I think I figured out the issue just now
19:23:34FromDiscord<Bubblie> Lightbulb moment
19:23:38FromDiscord<Bubblie> Give me one sec
19:24:20FromDiscord<Yardanico> ah yeah @d4rckh last two arguments aren't optional
19:24:25FromDiscord<Yardanico> in LookupAccountSidW
19:24:41FromDiscord<Bubblie> Btw what does nim mean exactly
19:24:43FromDiscord<Bubblie> Does it mean crown?
19:24:44FromDiscord<Yardanico> nothing
19:24:49FromDiscord<Bubblie> Oh lmao
19:24:50FromDiscord<Yardanico> it doesn't mean anything
19:24:52FromDiscord<Bubblie> Its just
19:24:53FromDiscord<Bubblie> Nim
19:25:02FromDiscord<Elegantbeef> Nim comes from nimrod the biblical first king
19:25:04FromDiscord<Yardanico> but nim's old name "nimrod" was a reference to a biblical king
19:25:13FromDiscord<Bubblie> Isnt nimrod an insult
19:25:15FromDiscord<Bubblie> 💀
19:25:27FromDiscord<Elegantbeef> It is now
19:25:46FromDiscord<d4rckh> i like nim's logo because i can include a crown in any program i made in nim
19:25:53FromDiscord<Bubblie> Same
19:25:55FromDiscord<d4rckh> (edit) "program" => "program's logo"
19:26:04FromDiscord<Yardanico> In reply to @Bubblie "Isnt nimrod an insult": only in some languages
19:26:05FromDiscord<Bubblie> Is the mascot also a crown
19:26:07FromDiscord<d4rckh> and then people will think theres a crown because its the best program, but its actually the nim's logo
19:26:11FromDiscord<Yardanico> i mean in english only
19:26:18FromDiscord<Yardanico> https://en.wikipedia.org/wiki/Nimrod
19:26:37FromDiscord<Yardanico> Nimble was also named Babel correspondingly (and yes, it was named Babel before JS babel existed)
19:26:45FromDiscord<Yardanico> "Later extra-biblical traditions identified Nimrod as the ruler who commissioned the construction of the Tower of Babel, which led to his reputation as a king who was rebellious against God."
19:26:49FromDiscord<Bubblie> Ew javascr- I mean yeah thats cool
19:27:02FromDiscord<Yardanico> ?
19:27:18FromDiscord<Yardanico> yeah @d4rckh that's the main reason it crashes
19:27:29FromDiscord<d4rckh> yup, fixing it now
19:27:38FromDiscord<Bubblie> Joking, a lot of people dislike JS as a language so im memeing
19:27:46FromDiscord<Yardanico> but i'm talking about nim 🤔
19:27:53FromDiscord<Bubblie> You mentioned babel
19:28:37FromDiscord<Yardanico> "and yes, it was named Babel before JS babel existed)"
19:28:48FromDiscord<Yardanico> and nim compiles to js anyway
19:29:29FromDiscord<Bubblie> Yeah, I find that neat
19:29:30FromDiscord<Elegantbeef> Nim doesnt have a mascot it has a logo/icon
19:29:36FromDiscord<Bubblie> Damn
19:29:36FromDiscord<Yardanico> yes
19:29:51FromDiscord<Bubblie> It would be funny to have a mascot thats a crown with arms and legs 💀
19:30:03FromDiscord<d4rckh> yay! no sigserv
19:30:06FromDiscord<Yardanico> In reply to @d4rckh "yay! no sigserv": yep
19:30:15FromDiscord<d4rckh> but an `ERROR_INSUFFICIENT_BUFFER` 😂
19:30:17FromDiscord<d4rckh> forgot an if
19:30:51FromDiscord<d4rckh> so many if's
19:32:43FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Xd3
19:32:45FromDiscord<d4rckh> damn! now it sigserv
19:32:46FromDiscord<d4rckh> (edit) "sigserv" => "sigservs"
19:33:11FromDiscord<d4rckh> (edit) "https://play.nim-lang.org/#ix=3Xd3" => "https://play.nim-lang.org/#ix=3Xd4"
19:33:21FromDiscord<Yardanico> peUse isn't the right one
19:33:36FromDiscord<d4rckh> hm?
19:33:39FromDiscord<Yardanico> "A pointer to a variable that receives a SID_NAME_USE value that indicates the type of the account."
19:33:52FromDiscord<Yardanico> you need to create a variable and then pass its addr to the function
19:33:59FromDiscord<d4rckh> oh
19:34:01FromDiscord<d4rckh> but then
19:34:08FromDiscord<d4rckh> why is there a PSID_NAME_USE
19:34:24FromDiscord<Yardanico> because it is the type?
19:34:28FromDiscord<Yardanico> pointer to SID_NAME_USE
19:34:30FromDiscord<Yardanico> just as the description says
19:35:24FromDiscord<d4rckh> wow this so weird, my program now starts and then instantly stops
19:35:34FromDiscord<Yardanico> it works for me halfway, but then also gets killed, yes
19:35:59FromDiscord<d4rckh> can you check with gdb why its crashing?
19:36:12FromDiscord<d4rckh> i should get gdb set up too
19:36:31*jmdaemon joined #nim
19:36:35FromDiscord<d4rckh> used it few times before but i should get used to using it back because it seems helpful for debugging things liks this
19:36:38FromDiscord<d4rckh> (edit) "liks" => "like"
19:36:52FromDiscord<Yardanico> oh it just works for me without errors now
19:36:54FromDiscord<Yardanico> i think
19:37:27FromDiscord<Yardanico> ah nvm, crashes
19:37:37FromDiscord<Yardanico> in my case https://media.discordapp.net/attachments/371759389889003532/972582996622327889/unknown.png
19:37:49FromDiscord<Yardanico> freeing memory fails :P
19:38:25FromDiscord<d4rckh> what! haha
19:38:47FromDiscord<d4rckh> for what reason??
19:38:55FromDiscord<d4rckh> i never touched that
19:39:26FromDiscord<Yardanico> maybe https://stackoverflow.com/questions/31441149/why-is-this-call-to-localfree-causing-an-error ?
19:39:33FromDiscord<Yardanico> related to psid stuff
19:39:54FromDiscord<d4rckh> hmm
19:40:01FromDiscord<d4rckh> if i remove the localfree call
19:40:01FromDiscord<d4rckh> it works
19:40:12FromDiscord<Yardanico> yes
19:41:07FromDiscord<d4rckh> ok not anymore
19:41:12FromDiscord<d4rckh> if i reopen it, it starts crashing again
19:41:25FromDiscord<d4rckh> i think the memory is corrupted or something because i am not freeing things
19:41:58FromDiscord<Yardanico> full my code btw:
19:42:05FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xd6
19:42:14FromDiscord<Yardanico> i don't have the second LookupAccountSidW call though
19:42:20FromDiscord<Yardanico> and forgot to add a LocalFree for sidName
19:42:43FromDiscord<Yardanico> and yes, allocations are outside of the loop because we can just reuse the same buffer anyway
19:42:50FromDiscord<Yardanico> i mean group/domain name
19:43:40FromDiscord<d4rckh> this is mine
19:43:42FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Xd7
19:43:56FromDiscord<d4rckh> yours is much cleaner haha
19:46:10FromDiscord<Yardanico> but yeah, just follow docs more closely next time :)
19:47:08FromDiscord<Elegantbeef> Bold of you to assume programmers can read yard!
19:47:12FromDiscord<Alea> In reply to @Bubblie "It would be funny": The burger king should be our mascot
19:47:32FromDiscord<Yardanico> In reply to @Alea "The burger king should": ahem
19:47:51FromDiscord<Alea> What :hmmNoted:
19:48:09FromDiscord<Yardanico> nothing..
19:48:36FromDiscord<Yardanico> but yeah, imagine nim getting a sponsorship from burger king
19:48:41FromDiscord<Alea> Lmao
19:48:58FromDiscord<Elegantbeef> Hey they've made games before, why not make games with the king language
19:49:25FromDiscord<Yardanico> yeah, other languages make some polite mascots, and nim just straight up uses a crown as a logo to assert dominance
19:49:45FromDiscord<Yardanico> too sad that badger wasn't adopted as a mascot :))
19:49:48FromDiscord<Elegantbeef> And had a fan made honey badger that kidnaps kids and eats them behind the dumpster
19:49:51FromDiscord<Alea> It wouldn't work so well for nim itself, but I like the idea of nimskull's logo being a skull wearing the Nim crown↵Maybe regular Nim could take it
19:49:54FromDiscord<Yardanico> In reply to @Elegantbeef "And had a fan": yes
19:50:03FromDiscord<Yardanico> you don't like nim? https://media.discordapp.net/attachments/371759389889003532/972586125220778044/unknown.png
19:50:06FromDiscord<Yardanico> how unfortunate
19:50:15FromDiscord<Elegantbeef> Who said i didnt like it?
19:50:19FromDiscord<Yardanico> rawr
19:50:43FromDiscord<Alea> Wait King Nimrod is a mythical figure, so a king would actually make a great mascot
19:51:17FromDiscord<Yardanico> well, that's the actual reason why the logo is a crown
19:51:19FromDiscord<Yardanico> because nimrod was the king
19:51:19FromDiscord<Elegantbeef> I'm sure you triggered someone with "mythical" there
19:53:54FromDiscord<Bubblie> Okay so apparantly futhark is having trouble parsing the opir, why is this issue happening again 😭
19:54:06FromDiscord<Elegantbeef> What's the output i might be able to help
19:54:09FromDiscord<Yardanico> try to run that opir command yourself
19:54:20FromDiscord<Yardanico> futhark shows what opir command it's running
19:54:20FromDiscord<Elegantbeef> Or just post the erroring opir lines
19:54:27FromDiscord<Yardanico> but yeah, i wasn't successful in trying futhark on windows for sciter either
19:54:51FromDiscord<Yardanico> it seems that it somehow tries to use windows C++ STL headers and they have a guard in the STL that errors if it detects that a non-C++ compiler is trying to use C++ STL headers
19:55:40FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3Xd9
19:55:47FromDiscord<Elegantbeef> No there are errors above it
19:55:52FromDiscord<Bubblie> oh shit
19:55:53FromDiscord<Bubblie> LMAO
19:56:02FromDiscord<Elegantbeef> Yea i hit the same thing originally
19:59:50FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3Xda
19:59:58FromDiscord<Yardanico> yes, try running that opir command yourself as I said
20:00:07FromDiscord<Bubblie> ah okay
20:00:43FromDiscord<Elegantbeef> Ah if there isnt anything from opir reported it's an issue with the opir dispatch
20:00:55FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
20:01:41FromDiscord<Bubblie> In reply to @Elegantbeef "Ah if there isnt": oh
20:02:18FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xdc
20:02:19FromDiscord<Yardanico> `opir -ID:\glfw-3.3.6.bin.WIN64\glfw-3.3.6.bin.WIN64\include -ID:\glfw-3.3.6.bin.WIN64\glfw-3.3.6.bin.WIN64\include\GLFW C:\Users\my_username\nimcache\vulkanmain_d\futhark-includes.h` in your case
20:02:23FromDiscord<Yardanico> idk if you replaced the username or if it's actually that
20:03:12FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3Xdd
20:03:21PMunchHmm, that error message has "stack trace" in it. Is that from Opir or from Nim?
20:03:22FromDiscord<d4rckh> @Yardanico i found the problem
20:03:26FromDiscord<Bubblie> the hell why is it looking for the vulkan.h
20:03:28FromDiscord<d4rckh> its a buffer overflow
20:03:34FromDiscord<d4rckh> the buffer is too small
20:03:52FromDiscord<Elegantbeef> What's your imporc block?
20:04:12FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3Xde
20:04:19FromDiscord<Yardanico> you also need to add vulkan include path
20:04:26FromDiscord<Elegantbeef> Yea
20:04:33FromDiscord<Elegantbeef> `path` needs to have all paths to any `.h`s
20:04:41PMunchI really need to make a better example..
20:04:42FromDiscord<Bubblie> so another #include with vulkan right
20:04:47FromDiscord<Elegantbeef> any `.h`s used\
20:04:55FromDiscord<Yardanico> In reply to @Bubblie "so another #include with": no, add it to importc
20:04:59FromDiscord<Bubblie> oh
20:05:16PMunchPeople keep putting the "define" statements in their importc blocks, And doing he silly static-writing thing instead of just using passl with a dynamic library like you're supposed to..
20:05:16FromDiscord<Yardanico> In reply to @PMunch "I really need to": i'm still trying to make it work on windows with sciter, but I also don't have much experience with windows stuff :P
20:05:40PMunchI seem to remember that I got it to work on Sciter on Linux
20:05:44FromDiscord<Elegantbeef> Hey i did it right!
20:05:45PMunchWell, at least it didn't error out
20:05:54FromDiscord<Yardanico> In reply to @PMunch "I seem to remember": yeah that works, I've already told you
20:05:55FromDiscord<Bubblie> like this or
20:05:56FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3Xdf
20:05:59FromDiscord<Yardanico> nsciter uses futhark on linux now, yes
20:06:06FromDiscord<Yardanico> In reply to @Bubblie "like this or": full path
20:06:10FromDiscord<Bubblie> oh
20:06:13FromDiscord<Yardanico> to the directory, not to the file
20:06:26FromDiscord<Bubblie> so do I need two paths in that case
20:06:30FromDiscord<Bubblie> cause vulkan.h is not in that path
20:06:42FromDiscord<Yardanico> yes? you can have as many as you want
20:06:44FromDiscord<Elegantbeef> Pmunch are you proud of me?! https://github.com/beef331/wasmedge_playground/blob/master/src/wasmedge.nim#L39-L46 😛
20:06:59FromDiscord<Yardanico> @PMunch this is what I get on windows with sciter, it's indeed really weird and somehow related to C++ STL https://gist.github.com/Yardanico/60ed0649014a4bfbed8c9d1fa57bee46
20:07:01PMunchOh right, so it's only the Windows part which is the problem.. Futhark is a bit wonky on Windows, I haven't touched Windows in about ten yours myself, so I haven't really been able to test it..
20:07:40FromDiscord<Yardanico> i guess i can try manually editing all headers to remove C++ specific stuff
20:07:44PMunch@Elegantbeef, ooh nice
20:09:08PMunchYardanico, that's super weird
20:09:09FromDiscord<Yardanico> but yeah @PMunch, can it be that opir somehow tries to evaluate #if defined(cplusplus) blocks ?
20:09:26PMunchI mean it kind of has to do something like that
20:09:34PMunchBut I don't see why it would..
20:10:11PMunchOr rather, I don't see why it would on Windows but not on Linux
20:10:42FromDiscord<Yardanico> well, maybe because windows C++ stl specifically errors if you try to use it with the C compiler, but on Linux compilers don't care?
20:10:49FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3Xdh
20:11:25FromDiscord<Elegantbeef> You dont need to include `vulkan.h`
20:11:42FromDiscord<Elegantbeef> Or atleast you shouldnt need to
20:11:42FromDiscord<Elegantbeef> You just need the `path` afaik
20:11:48FromDiscord<Bubblie> ah okay
20:12:04FromDiscord<Elegantbeef> Why are you writing to a file and compiling it anyway?
20:12:17PMunchYeah you just need the path
20:12:28FromDiscord<Bubblie> oh so I don't even need writeFile?
20:12:36PMunch@Elegantbeef, I'm guessing because I do that in the example in the README and people just copy-paste that..
20:12:44FromDiscord<Elegantbeef> Yea probably
20:12:51FromDiscord<Bubblie> well I uh, didn't copy and paste I just assumed I had to
20:12:53FromDiscord<Elegantbeef> No you dont need writefile
20:12:59FromDiscord<Elegantbeef> Pmunch just has a dumb example
20:13:08PMunchSorry :(
20:13:19FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3Xdi
20:13:29FromDiscord<Elegantbeef> Pmunch why dont you use emit instead of that compile statement?
20:13:38PMunchBut yeah, as the comment right above that block of code says, if you have a dynamic library you just use --passL
20:13:54*pro joined #nim
20:14:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Xdj
20:14:27PMunch@Elegantbeef, don't remember, I think it might've had some trouble with reordering or something
20:14:29FromDiscord<Bubblie> I do have vulkan bindings, so I am unsure if glfw does need the vulkan header in order to operate or something
20:14:43FromDiscord<Bubblie> In reply to @PMunch "But yeah, as the": oh 👀
20:14:50PMunchI should find some other simple library I could wrapp
20:15:02FromDiscord<Bubblie> you should try glfw 👀
20:15:07FromDiscord<Elegantbeef> Yea i have noticed pmunch that sometimes emit doesnt do what one expects, had to move my int128s to another file to make it work
20:15:18FromDiscord<Elegantbeef> Wasmedge could be an example 😛
20:15:20FromDiscord<Bubblie> In reply to @Bubblie "you should try glfw": it would help me 👀
20:15:58FromDiscord<Yardanico> oh yeah @PMunch removing cplusplus helped i think
20:16:00FromDiscord<Bubblie> vulkan bindings I found work its a matter of getting glfw to properly work, I was using nimgl before and was trying it but it does not work well at all for glfw
20:16:12FromDiscord<Bubblie> like my goodness
20:16:15FromDiscord<Yardanico> just a little tedious, takes a few mins to remove :)
20:16:41FromDiscord<Elegantbeef> Cant you just `undef "cplusplus"`
20:16:48*Zectbumo joined #nim
20:16:55FromDiscord<Yardanico> will try later :)
20:16:55FromDiscord<Elegantbeef> Or does clang get hung up on the `cplusplus` regardless?
20:17:09FromDiscord<jmgomez> hey guys, how I should use onThreadDestruction? Is it supposed to be called when a thread finishes, right? But not sure how to subscribe to it
20:17:38FromDiscord<Yardanico> you give it a closure proc
20:17:39FromDiscord<Elegantbeef> from inside your thread you do `onThreadDestruction(myKillProc)`
20:17:58FromDiscord<Elegantbeef> It's called on the thread you want to subscribe the action to
20:18:07FromDiscord<Yardanico> wow, opir gives TONS of output, but when i run it with futhark it errors for some reason, hmm
20:18:12FromDiscord<Elegantbeef> Also pmunch how much would it cost to get `undef` turned into `undefine`?
20:18:17FromDiscord<Bubblie> In reply to @PMunch "But yeah, as the": so pmunch can I just use a dll of glfw for this then
20:18:30FromDiscord<jmgomez> but it does run in the main thread or the actual thread that's about to be destroyed?
20:18:44FromDiscord<Yardanico> the actual thread of course
20:18:50FromDiscord<Yardanico> "Registers a thread local handler"
20:18:52FromDiscord<Yardanico> it says explicitly
20:19:08FromDiscord<Elegantbeef> I imagine it calls it on the thread before it's properly killed
20:19:10FromDiscord<Bubblie> https://github.com/johnnovak/nim-glfw wait holy shit WHERE HAS THIS BEEN
20:19:11FromDiscord<Elegantbeef> I could be wrong
20:19:12FromDiscord<jmgomez> hm is there a way to have a function running in the main thread? maybe a signal or something?
20:19:30FromDiscord<Bubblie> In reply to @Bubblie "https://github.com/johnnovak/nim-glfw wait holy shi": ima try this
20:20:07FromDiscord<Elegantbeef> Personally i'd use a channel for this↵(@jmgomez)
20:20:21FromDiscord<Elegantbeef> Have your main thread watch the channel every so often and dispatch whatever is in that
20:21:05PMunch@Bubblie, that's the idea
20:21:40PMunch@Elegantbeef, I mean it would be a sub-one-line change to make it accept both `undef` and `undefine` :P
20:21:40FromDiscord<Elegantbeef> You do also know bubblie https://github.com/treeform/staticglfw this exists?
20:22:23FromDiscord<jmgomez> In reply to @Elegantbeef "Personally i'd use a": thing is I would like to avoid watching, but if there is no way around it.. how would you approach like with asyncSleep or something? Does it allow to keep the regular execution in the main thread?
20:22:33FromDiscord<Elegantbeef> Yea i know i was just jokingly saying "Please add it"
20:22:40FromDiscord<Elegantbeef> I mean even with async you're watching it
20:23:04PMunch@jmgomez, how do you plan to run something on a thread without the threading being made aware that it should run something?
20:23:33PMunchI mean technically it might be possible to swap a threads instruction pointer or something, but it would be the worlds ugliest hack :P
20:23:35FromDiscord<jmgomez> Being the main thread not sure if there was a mechanism in place (In some lang you have it)
20:23:53PMunch@jmgomez, Nim in general doesn't have hidden mechanisms :)
20:24:20PMunchLangs that offer stuff like that basically have some kind of dispatcher lurking in the background
20:24:22FromDiscord<jmgomez> I would say I prefer it nim's way but just wanted to make sure
20:24:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Xdn
20:24:25prokind of difficult question to ask, but is there a way in linux to see which process has taken which percentage of swap?
20:24:38PMunchSo even if you're not aware of it it's doing stuff behind your back
20:24:44FromDiscord<Yardanico> https://www.cyberciti.biz/faq/linux-which-process-is-using-swap/ ?
20:24:49FromDiscord<Yardanico> just googled "check swap usage by process linux" @pro
20:25:02FromDiscord<jmgomez> In reply to @Elegantbeef "But yes you'd do": what poll(0) does?
20:25:11FromDiscord<Elegantbeef> poll gives up the cpu to run the async processes
20:25:12FromDiscord<Yardanico> you can apparently just check /proc/PID/status VmSwap
20:25:49promy issue that I have a difference between what I see is taken, and what is actually taken
20:25:56promeaning some processes didn't release swap
20:26:00proor OS didn't free it up
20:26:00FromDiscord<Elegantbeef> If you dont know how async programming works, your async procedures stop and require you to give up your cpu to continue, in Nim this is explicit with `poll` `await` `waitFor` `runForever`
20:26:42FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3Xdo
20:26:44FromDiscord<jmgomez> In reply to @Elegantbeef "poll gives up the": the problem is that my nim is hosted in another program, I cant just lock the main thread the new thread mechanism (does work as long as my hooked dll is not being read, Im doing a dll swapping if it changes)
20:27:03FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/972595440900001802/unknown.png
20:27:10FromDiscord<Elegantbeef> So run the poll in update
20:27:20FromDiscord<Arathanis> (edit)
20:27:41FromDiscord<Elegantbeef> Arathanis are you using `--mm:arc -d:useMalloc`?
20:27:50FromDiscord<Arathanis> i am not.
20:28:07FromDiscord<Elegantbeef> Run it again with that and look at the stats
20:28:08FromDiscord<Elegantbeef> Jmgomez you do have an update or similar right?
20:29:32FromDiscord<Arathanis> always forget how cpp stuff can cross your eyes when you try to read it
20:29:57FromDiscord<jmgomez> In reply to @Elegantbeef "Jmgomez you do have": Not really, I do a fire and forget thing
20:30:02FromDiscord<Yardanico> In reply to @Arathanis "always forget how cpp": valgrind is useless for Nim unless you compile with ARC/ORC and use -d:useMalloc
20:30:06FromDiscord<Yardanico> because nim has its own allocator
20:30:12FromDiscord<Yardanico> and -d:useMalloc makes Nim use malloc only with ARC/ORC
20:30:26FromDiscord<Arathanis> oh im looking at the output now
20:30:27FromDiscord<jmgomez> Then I keep looking at some file changes and if they do, I perfom a reload
20:30:29FromDiscord<Arathanis> just trying to make sense of it
20:30:42FromDiscord<Arathanis> Is there a way to use `ref` with `importcpp` types and teach the GC how to clean them up? I tried using ``=destroy`` but it does not seem to work
20:30:50FromDiscord<Arathanis> gonna continue looking at this valgrind output though
20:30:55FromDiscord<Arathanis> see if i can make sense of what its complaining about
20:30:59FromDiscord<Yardanico> you can use =destroy for that, yes
20:31:11FromDiscord<Elegantbeef> What i suggest jmgomez doesnt have to lock the main thread
20:31:40PMunchpro since the process of deleting things from swap also takes time it is often still there just not used
20:31:45FromDiscord<Bubblie> In reply to @Elegantbeef "You do also know": 👀👀
20:32:05FromDiscord<Bubblie> In reply to @PMunch "<@415227941408997381>, that's the idea": Whats the idea
20:32:12FromDiscord<Bubblie> In reply to @Bubblie "👀👀": Thank you beef im gonna try this
20:32:33PMunch@Bubblie, to use the DLL
20:32:36FromDiscord<Prestige> Is there an overhead to `float(someInt)` if `someInt` is a const, or is it just essentially a compiler hint?
20:32:46FromDiscord<jmgomez> In reply to @Elegantbeef "What i suggest jmgomez": okay, trying it right now
20:32:59PMunch@Prestige, if someInt is a const it will be turned into a float literal on compile-time
20:33:09FromDiscord<Elegantbeef> Static expressions are evaluated statically prestige
20:33:10FromDiscord<Prestige> Neat, thanks
20:33:16FromDiscord<Bubblie> In reply to @PMunch "<@415227941408997381>, to use the": Ah okay, ill keep that in mind when I use other c libs
20:33:25FromDiscord<Zectbumo> std/db_common has UbTypeKind dbUuid which gives me hope that uuid is available in std but I don't see any uuid functions around anywhere
20:33:25PMunchHowever that might be done by the C compiler, so you might need a mildly competent C compiler
20:33:35FromDiscord<Prestige> Didn't know what casting like that actually does
20:33:35FromDiscord<Yardanico> In reply to @Zectbumo "std/db_common has UbTypeKind dbUuid": it's not available in the stdlib
20:33:39FromDiscord<Yardanico> we only have oids but it's for mongodb
20:33:49FromDiscord<Yardanico> there's https://github.com/pragmagic/uuids though
20:34:20FromDiscord<Zectbumo> it would be nice to have this in std. what are the chances to getting something in there?
20:35:07FromDiscord<Elegantbeef> Write a well thoughtout RFC and see where it goes 😛
20:35:11FromDiscord<Yardanico> also @Arathanis why do you create a ptr to std:vector ?
20:35:22FromDiscord<Yardanico> if std:vector's contents are already heap allocated in C++
20:35:34FromDiscord<Arathanis> In reply to @Yardanico "you can use =destroy": how do you approach using `=destroy` for that? Is there a short tutorial or example I could look at?
20:35:47FromDiscord<Bubblie> Hey beef
20:35:54FromDiscord<Bubblie> For staticglfw, it seems to be on 3.3.2 glfw
20:35:57FromDiscord<Yardanico> In reply to @Arathanis "how do you approach": https://nim-lang.org/docs/destructors.html#lifetimeminustracking-hooks-nimeqdestroy-hook
20:36:07FromDiscord<Yardanico> T must be an `object`
20:36:12FromDiscord<Elegantbeef> Cool bubblie
20:36:13FromDiscord<Yardanico> but you can still have =destroy for ref object, just do it like this
20:36:14FromDiscord<Bubblie> Is it possible for me to use 3.3.7? Should I fork it and add the 3.3.7 glfw files
20:36:19FromDiscord<Elegantbeef> Or a distinct\
20:36:24FromDiscord<Elegantbeef> Fuck if i know
20:36:41FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xds
20:36:43FromDiscord<Yardanico> if you need ref object that is
20:37:25FromDiscord<Elegantbeef> Pmunch when i read your mod forum post today i had a real big chuckle at 'We certainly don't encourage it, but you won't get instantly banned for cursing in the channel.' 😄
20:38:05FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xdt
20:38:19FromDiscord<Elegantbeef> I was half hoping for a reference to me in there
20:38:20PMunch@Elegantbeef, I mean how do you tell people they can curse without sounding like you want people to curse :P
20:38:29FromDiscord<Bubblie> Also is treeform everywhere? i see them in almost every nim repo ive looked at in some shape or form
20:38:30FromDiscord<Zectbumo> In reply to @Yardanico "we only have oids": maybe I use oid? what would be wrong with that for non mongo use
20:38:37FromDiscord<Yardanico> In reply to @Zectbumo "maybe I use oid?": well it would be wrong
20:38:48FromDiscord<Yardanico> because uuids != oids
20:38:48FromDiscord<Arathanis> In reply to @Yardanico "<@136570191038513152> this works for": Yeah I got this far too. I adjusted exactly that code to try and figure out how to use pointers to types I imported with `importcpp` and make sure memory cleanup was good
20:38:53PMunchI mean I curse in this channel from time to time, would have to ban myself
20:39:04FromDiscord<Yardanico> In reply to @Zectbumo "maybe I use oid?": why do you want stdlib specifically? uuids lib is small enough, you can literally just copy it in your project
20:39:09FromDiscord<Arathanis> for practice and knowledge more than anything practical
20:39:22FromDiscord<Yardanico> its two files, but actually it can be changed to use std/sysrand so it would be 1 file only
20:39:31FromDiscord<Elegantbeef> Cursing outlawed now
20:39:39PMunchFuck..
20:39:41FromDiscord<Elegantbeef> I'll see myself out
20:40:01FromDiscord<Zectbumo> @Yardanico ah I see, I am looking for a random timestamped (ala uuid4) and it looks like oid may fit the bill
20:40:10FromDiscord<Yardanico> In reply to @Zectbumo "<@177365113899057152> ah I see,": oids isn't random
20:40:13FromDiscord<Elegantbeef> Zect the path to getting a new library in the stdlib that is specific is an RFC 😄
20:40:14PMunchI mean you kinda set me up for that one @Elegantbeef, it was too good to pass up
20:40:19FromDiscord<Yardanico> it's timestamp + counter + random value
20:40:27FromDiscord<Zectbumo> yeah that
20:40:28FromDiscord<Yardanico> while uuid is fully random
20:40:34FromDiscord<Zectbumo> um, no
20:40:57FromDiscord<Elegantbeef> Just use hashes and hope the avalanche effect has your back
20:41:02FromDiscord<Yardanico> yeah, it has versions and stuff, sorry
20:41:14FromDiscord<Yardanico> but do you want UUID specifically or just some random unique identifier?
20:41:20FromDiscord<Yardanico> if so, can't you just generate some string yourself and be done with it
20:41:37FromDiscord<Elegantbeef> Pmunch i'm reporting you to yard, swearing is bad
20:41:49FromDiscord<Zectbumo> just random yet unique. oid, uuid4, etc
20:42:32FromDiscord<Bubblie> What do you mean I cant fucking curse
20:43:03FromDiscord<Yardanico> @ElegantBeef 1 curse = -5 lurkers :P
20:43:29FromDiscord<Elegantbeef> Then fuck fuck fuck, let's get those lurkers gone
20:43:36FromDiscord<Elegantbeef> I want active people not lurkers
20:44:38FromDiscord<Bubblie> Nim vulkan and glfw is officially working
20:44:43FromDiscord<Bubblie> Im crying finally
20:44:52FromDiscord<Elegantbeef> Congrats you're in the year 2003
20:45:02FromDiscord<Bubblie> Damn 😭
20:47:15PMunch@Bubblie, with Futhark or one of the pre-made ones?
20:48:18FromDiscord<Zectbumo> maybe I stuff the MAC address in there like uuid does. how do I get MAC in nim?
20:49:48FromDiscord<Bubblie> In reply to @PMunch "<@415227941408997381>, with Futhark or": Pre made static one
20:50:07PMunch:(
20:50:14FromDiscord<Bubblie> I think windows hates futhark im sorry 😭
20:50:29FromDiscord<Bubblie> Windows hates everything
20:50:42FromDiscord<Bubblie> I also hate windows though but I use it because majority of the apps I need are on there sadly
20:51:08*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
20:51:16FromDiscord<Bubblie> I might try futhark again though for possible skia bindings
20:51:20FromDiscord<Bubblie> Cause I cant find any for nim
20:51:49FromDiscord<Prestige> What do you need that you can only use on windows? 🤔
20:52:42PMunchWas just about to ask the same thing
20:57:21FromDiscord<Bubblie> this is a bit embarassing
20:57:44FromDiscord<Bubblie> microsoft specific applications, also most games only run on windows so that as well
20:58:33PMunchSteam Proton has become really good
20:58:53FromDiscord<Bubblie> definitely, but a lot of indie games I have don't run well with it
20:59:02FromDiscord<Bubblie> valve games run very well with it though
20:59:30PMunchHmm, it has worked for all the Indie games I've tried to throw at it
20:59:36PMunchI don't game a whole lot though
21:00:30FromDiscord<Prestige> Same
21:00:37PMunchAnd Microsoft specific apps obviously only run on Microsoft, you're going to have to be alittle bit more specific than that :P
21:00:40FromDiscord<Prestige> Coding > gaming anyway
21:02:36FromDiscord<Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3Xdy
21:02:49FromDiscord<Zectbumo> (edit)
21:03:04FromDiscord<sOkam!> How can a `string` be converted to `uint16`?↵I'm trying `uint16(theString)`, but its not working
21:03:15*vicfred joined #nim
21:04:51FromDiscord<sOkam!> (edit) "working" => "working↵_(goal is to have a file that only contains one line, with one number that is meant to be uint16, and increase it from nimscript on each run of the script)_"
21:06:48FromDiscord<Yardanico> how do you write it?
21:06:53FromDiscord<Yardanico> as a number in text format, or in binary?
21:07:41FromDiscord<sOkam!> In reply to @Yardanico "as a number in": https://media.discordapp.net/attachments/371759389889003532/972605662309789757/unknown.png
21:08:09FromDiscord<Yardanico> https://nim-lang.org/docs/strutils.html#parseUInt%2Cstring
21:08:28FromDiscord<Yardanico> have you forgot how to parse numbers in nim? :P
21:08:51FromDiscord<sOkam!> Never parsed anything in nim, so didn't forget, just never learned
21:13:38*duuuuuude quit (Remote host closed the connection)
21:15:19FromDiscord<whee> that looks like a fun excuse to learn `std/marshal`
21:15:31FromDiscord<Elegantbeef> No
21:15:42FromDiscord<Elegantbeef> marshal is just json
21:15:43FromDiscord<Elegantbeef> Dont let it lie to you
21:15:50FromDiscord<Elegantbeef> sokam i showed you how to do this with string streams yesterday
21:15:53FromDiscord<whee> ...I was hoping you'd say to use `genasts` 😉
21:15:55*vicfred quit (Quit: Leaving)
21:16:47FromDiscord<Yardanico> In reply to @whee "that looks like a": marshal is deprecated
21:16:50FromDiscord<Yardanico> we should actually just remove it for v2
21:17:09FromDiscord<whee> In reply to @Yardanico "marshal is deprecated": oi, didn't know that
21:17:23FromDiscord<sOkam!> In reply to @Elegantbeef "sokam i showed you": yes, but I asked later if streams are actually needed for this case, and nimByExample has one fully fledged example of code that just works, so I don't have to figure out the whole streams ordeal to just read one number in a file. so i'm trying that instead
21:17:26FromDiscord<Elegantbeef> It's not deprecated 😄
21:18:09FromDiscord<Elegantbeef> If it was deprecated they would've removed the VM support instead of double downing on it 😄
21:18:10*kayabaNerve quit (Remote host closed the connection)
21:18:20FromDiscord<Yardanico> ah i see you asking in https://github.com/nim-lang/RFCs/issues/437#issuecomment-1015878460
21:18:21FromDiscord<sOkam!> if streams are needed just for compatibility with other things, then streams are overkill for it. specially since I don't understand 1% of how they are supposed to work, the manual is crazy sparse in descriptions in std/streams
21:18:54FromDiscord<sOkam!> (edit) "things," => "stream types,"
21:19:02FromDiscord<Yardanico> In reply to @Elegantbeef "If it was deprecated": also that slowdown was fixed I think
21:19:13FromDiscord<Yardanico> https://github.com/nim-lang/Nim/pull/19578
21:19:59FromDiscord<sOkam!> How can I track what this is complaining about? https://media.discordapp.net/attachments/371759389889003532/972608758184300604/unknown.png
21:20:11FromDiscord<Yardanico> show us the code
21:20:23FromDiscord<Yardanico> but really you're trying to use some proc that uses stuff from C land
21:20:24FromDiscord<sOkam!> I did, its the same thing but with the uint typing fixed
21:20:35FromDiscord<Yardanico> In reply to @sOkam! "I did, its the": you can't have file.open etc in nimscriptr
21:20:36FromDiscord<Yardanico> (edit) "nimscriptr" => "nimscript"
21:20:54FromDiscord<Yardanico> just copy paste your code here in a code block and i'll rewrite it so it works in nims
21:22:18FromDiscord<sOkam!> sent a code paste, see https://paste.rs/sFF
21:23:28FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xf3
21:23:30*jjido joined #nim
21:24:17FromDiscord<Yardanico> also @sOkam! what do you need this for?
21:24:34FromDiscord<sOkam!> writing a number into a file, to keep track of the number of compilations
21:24:47FromDiscord<Yardanico> but what for :D
21:24:56FromDiscord<sOkam!> because that number is then added by the script to the file, so it doesn't need to be incremented manually
21:25:16FromDiscord<Yardanico> revisions are usually code changes, so you use git commit hashes for that
21:25:30*kayabaNerve joined #nim
21:26:14FromDiscord<sOkam!> In reply to @Yardanico "but what for :D": because the engine reads zipped files that are alphabetically later in the order as the only file to read, so that means i can just have the zip filename contain a rev number, and the user wont need to overwrite anything (dumbest option wins, current non-rev-numbered versions are already giving me issues)
21:27:15FromDiscord<sOkam!> In reply to @Yardanico "revisions are usually code": except these don't track git commits, these track compilation amounts for each specific version
21:27:22FromDiscord<sOkam!> (edit) "amounts" => "count"
21:27:43FromDiscord<sOkam!> rename `rev` to `compilationCount` and the code would be equal
21:28:51FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3Xft
21:30:54FromDiscord<Zectbumo> does `$ myProc()` parse as `$(myProc)()` ?
21:35:31FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Xfv
21:35:41FromDiscord<Yardanico> because your file has a newline
21:35:46FromDiscord<Yardanico> remove it
21:35:59FromDiscord<sOkam!> i personally didn't create any files
21:36:19FromDiscord<sOkam!> but will try, in case it was error from previous runs
21:37:22FromDiscord<sOkam!> seems to have worked, ty ✍️
21:46:58FromDiscord<!Patitotective> why is `0.1.62` greater than `0.1.7` :[[[
21:47:07FromDiscord<!Patitotective> can i rename a version? :[
21:47:17FromDiscord<!Patitotective> (edit) "can i rename a ... version?" added "nimble's pkg"
21:47:48FromDiscord<!Patitotective> will i need to do `0.1.70`?
21:54:19FromDiscord<Zectbumo> 0.1.7 is lexicographically greater
21:55:30FromDiscord<Zectbumo> but 0.1.70 should never be shortened to 0.1.7. is that the case?
21:56:25*pro quit (Quit: pro)
21:56:36FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=3Xfy
21:56:37FromDiscord<spoon> why do these do different things
21:57:19FromDiscord<!Patitotective> In reply to @Zectbumo "but 0.1.70 should never": i mean, nimble treats `0.1.62` as greater than `0.1.7` (the `0` shouldn't matter) when `0.1.7` is _lexicographically_ greater, right?
21:57:48FromDiscord<!Patitotective> (edit) "In reply to @Zectbumo "but 0.1.70 should never": i mean, nimble treats `0.1.62` as greater than `0.1.7` (the `0` shouldn't matter) when `0.1.7` is _lexicographically_ greater, right? ... " added "is that a bug or its just silly me?"
21:57:50FromDiscord<spoon> is the `r` in `write` somehow making this a string literal?
21:58:12FromDiscord<Zectbumo> In reply to @Patitotective "i mean, nimble treats": depends how the program is written. I don't know. but I think you are on to something
21:58:34FromDiscord<spoon> actually, no, couldn't be that because for a code golf i'm doing i have `proc p(s:string) = stdout.write s`
21:58:52FromDiscord<spoon> (edit) "actually, no, couldn't be that because for a code golf i'm doing i have `proc p(s:string) = stdout.write s` ... " added "and i use that"
21:59:20PMunch!Patiotective, it's bigger because 62 > 7
21:59:23FromDiscord<!Patitotective> `0.1.62` is meant to be a small upgrade of `0.1.6`, while `0.1.7` is an upgrade of `0.1`↵https://github.com/Patitotective/niprefs/releases
22:00:22FromDiscord<!Patitotective> In reply to @PMunch "!Patiotective, it's bigger because": but shouldn't it treat the version as a float, where `7` is greater than `6`, ignoring the `2`? 😕
22:00:28PMunchWell that's not how version numbers work..
22:00:34FromDiscord<!Patitotective> :[
22:00:43FromDiscord<Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3XfB
22:00:49PMunchWhat do you do if you to more than ten bugfixes for a version?
22:01:22FromDiscord<!Patitotective> `0.1.691` lol idk
22:01:26FromDiscord<!Patitotective> you've got reason
22:01:28FromDiscord<spoon> In reply to @Zectbumo "I tried this and": i tested that on play.nim-lang
22:01:39PMunchHere, read this: https://semver.org/
22:01:47FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XfC
22:01:56FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3XfD
22:02:00FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#lexical-analysis-generalized-raw-string-literals
22:02:04FromDiscord<Yardanico> "The construct identifier"string literal" (without whitespace between the identifier and the opening quotation mark) is a generalized raw string literal. It is a shortcut for the construct identifier(r"string literal"), so it denotes a routine call with a raw string literal as its only argument. Generalized raw string literals are especially convenient for embedding mini languages directly into Nim (for example regular expressions)."
22:02:41FromDiscord<Zectbumo> In reply to @PMunch "What do you do": 0.1.69.99999999
22:02:57FromDiscord<spoon> so just no space means string literal?
22:03:01FromDiscord<Yardanico> In reply to @spoon "so just no space": raw string literal
22:03:14FromDiscord<Yardanico> the one that's usually written with the `r` prefix
22:03:18*kenran quit (Quit: WeeChat info:version)
22:03:22FromDiscord<!Patitotective> then @PMunch can i rename a nimble pkg's version? 🤨
22:03:29PMunch!Patiodetective, just do version numbers the same way everyone else does them. It will be much less confusing to your users
22:03:35PMunchWhat do you mean rename?
22:03:54PMunchOne that is already out and downloaded onto peoples machines?
22:04:04FromDiscord<spoon> odd
22:04:13FromDiscord<!Patitotective> In reply to @PMunch "One that is already": ye :[
22:04:27FromDiscord<spoon> i don't see the utility in that tbh, it seems like it just makes things confusing
22:04:46FromDiscord<Yardanico> In reply to @spoon "i don't see the": unless you experience things like `sql` and `re`
22:04:58PMunch!Patiotective, nope, just increase you minor version and chalk this up as a learning experience
22:05:06FromDiscord<Yardanico> https://nim-lang.org/docs/re.html#re%2Cstring
22:05:14FromDiscord<Yardanico> https://nim-lang.org/docs/db_mysql.html#parameter-substitution
22:05:33FromDiscord<!Patitotective> thanks pmunch :]
22:05:52FromDiscord<Zectbumo> In reply to @spoon "is the `r` in": https://nim-lang.org/docs/manual.html#lexical-analysis-generalized-raw-string-literals
22:06:09FromDiscord<Yardanico> In reply to @Zectbumo "https://nim-lang.org/docs/manual.html#lexical-analy": you're late :P
22:06:29FromDiscord<Zectbumo> 🙂
22:06:45FromDiscord<Zectbumo> hey! the docs says something wrong. this doesn't work:↵`stdout.write"""test\ntest"""`
22:06:58FromDiscord<Zectbumo> docs say: The construct identifier"""string literal""" exists too. It is a shortcut for identifier("""string literal""").
22:07:10FromDiscord<Zectbumo> but that doesn't seem true
22:07:12FromDiscord<Yardanico> works here
22:07:18FromDiscord<Yardanico> maybe you have some weird nim version?
22:07:18FromDiscord<spoon> only reason i caught the error was because i went to nim playground to see if stdout.write turned strings into literals
22:07:28FromDiscord<spoon> if i was developing idk if i would've caught it
22:07:38FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/972620751201005568/unknown.png
22:07:38FromDiscord<Zectbumo> In reply to @Yardanico "works here": https://play.nim-lang.org/#ix=3XfE
22:07:40FromDiscord<Yardanico> @Zectbumo
22:07:48FromDiscord<spoon> code golf developing
22:07:53FromDiscord<Yardanico> In reply to @Zectbumo "https://play.nim-lang.org/#ix=3XfE": works there too
22:07:54FromDiscord<Yardanico> correctly
22:07:59FromDiscord<Yardanico> I don't get your question
22:08:02FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/972620852300484648/unknown.png
22:08:05FromDiscord<Zectbumo> no, it says identifier("""string literal"""). no r
22:08:12FromDiscord<Yardanico> ???
22:08:18FromDiscord<Zectbumo> in the docs
22:08:23FromDiscord<Yardanico> again, there are raw string literals in nim that have the `r` prefix
22:08:35FromDiscord<Zectbumo> oh """ in r too
22:08:40FromDiscord<Zectbumo> (edit) "in" => "is"
22:08:41FromDiscord<Yardanico> then you also have sugar that if you call some proc with a string without a space, it's converted into a raw string literal
22:08:49FromDiscord<Yardanico> doesn't matter if single quoted or triple quoted
22:08:54FromDiscord<!Patitotective> and @PMunch for the github tag/release↵should i delete it? and release a new one or release a new one without deleting the other?
22:09:01FromDiscord<Yardanico> ah I get what you mean @Zectbumo , yeah just a typo in docs
22:09:14FromDiscord<Yardanico> nice first PR :)
22:09:25PMunch!Patiotective, just create a new one
22:09:40FromDiscord<Zectbumo> In reply to @Yardanico "ah I get what": is it though? I just saw in docs that: r""" is the same as """
22:10:02FromDiscord<Yardanico> ah no it's not right
22:10:06FromDiscord<Zectbumo> heh
22:10:07FromDiscord<Yardanico> it's just that """ works the same as r"
22:10:20FromDiscord<Zectbumo> that confused me
22:11:04FromDiscord<Zectbumo> so what PR change are you going to make?
22:11:10FromDiscord<Yardanico> no PR
22:11:18FromDiscord<Yardanico> i got a bit confused by the flow of messages as well
22:11:23FromDiscord<Zectbumo> okay
22:11:29FromDiscord<sOkam!> Isn't this supposed to be the way to catch IOError exceptions? https://media.discordapp.net/attachments/371759389889003532/972621719930036244/unknown.png https://media.discordapp.net/attachments/371759389889003532/972621720160706590/unknown.png
22:12:02FromDiscord<Zectbumo> _going to bbq. thx guys for all the lessons today. until later_
22:14:02FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3XfG
22:14:21FromDiscord<Yardanico> don't think so, you're allocating buffers after all
22:14:29FromDiscord<Yardanico> i mean you can do it in less characters (maybe) with fieldPairs, but just don't
22:14:33FromDiscord<Yardanico> it's not worth using fieldPairs here
22:14:45FromDiscord<!Patitotective> thanks :]
22:14:57FromDiscord<Elegantbeef> Nah it'd be more characters
22:15:00*lumo_e quit (Remote host closed the connection)
22:15:09FromDiscord<Elegantbeef> He lied
22:15:12FromDiscord<Yardanico> @ElegantBeef well i mean if you have the same buffer size, then it'd be less
22:15:32FromDiscord<Elegantbeef> patitot are any of them capable of being resized?
22:15:53*lumo_e joined #nim
22:16:05FromDiscord<!Patitotective> In reply to @Elegantbeef "patitot are any of": nope
22:16:08FromDiscord<Elegantbeef> If this is for imgui then you can just do `buffer, hintBuffer: array[128, char]` and `celsius, fahrenhiet, startData, returnDate: array[32, char]`
22:16:35FromDiscord<Elegantbeef> I guess it'd actually be `129` and `33`
22:16:48FromDiscord<!Patitotective> In reply to @Elegantbeef "If this is for": how do you know -_- lol
22:16:49FromDiscord<!Patitotective> thanks :]
22:16:49FromDiscord<Elegantbeef> then you do not need to intialize them
22:17:09FromDiscord<!Patitotective> In reply to @Elegantbeef "then you do not": but i couldn't treat them as strings, or could i? :[
22:17:11FromDiscord<Elegantbeef> Cause they're arrays?
22:17:18FromDiscord<Yardanico> In reply to @Patitotective "but i couldn't treat": exactly, that's a bit of a problem
22:17:23FromDiscord<Elegantbeef> Why does it matter if you could or not?
22:17:29FromDiscord<Elegantbeef> You're using them for imgui it takes cstrings
22:17:32FromDiscord<Yardanico> In reply to @Elegantbeef "Why does it matter": because he wants to use them in Nim
22:17:37FromDiscord<Yardanico> to get input
22:17:53FromDiscord<Elegantbeef> use `openarray[char]`
22:18:12FromDiscord<Elegantbeef> If the api doesnt work with `openarray[char]` complain until it does
22:18:26FromDiscord<Yardanico> @!Patitotective just use strings for now :)
22:18:26FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3XfH
22:18:32*duuuuuude joined #nim
22:18:38FromDiscord<Elegantbeef> Why the fuck are you spliting
22:18:39FromDiscord<Elegantbeef> I hate you
22:18:52FromDiscord<Yardanico> In reply to @Elegantbeef "I hate you": are you joking or not? 🤔
22:18:55FromDiscord<Elegantbeef> `parseUtils`
22:18:57FromDiscord<!Patitotective> i dont know how to do it otherwise :[
22:19:15FromDiscord<Elegantbeef> I'm obviously joking i dont insult people for ignorance it doesnt encourage learning
22:19:31FromDiscord<!Patitotective> In reply to @Elegantbeef "I'm obviously joking i": :]
22:19:31FromDiscord<Yardanico> hm mMM
22:20:32FromDiscord<Elegantbeef> You got to be shitting me parseutils doesnt work with `openarray[char]`
22:21:00FromDiscord<!Patitotective> In reply to @Elegantbeef "`parseUtils`": but id still need to check if its a valid integer, right?
22:21:09FromDiscord<Yardanico> what do you mean?
22:21:19FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/972624195135631432/IMG_2043.png
22:21:32FromDiscord<retkid> Is there a similar disgusting way to estancia class and then
22:21:40FromDiscord<retkid> (edit) "and then" => "in Nim"
22:21:49FromDiscord<retkid> (edit) "estancia" => "instantiate"
22:21:51FromDiscord<Yardanico> In reply to @Patitotective "but id still need": https://nim-lang.org/docs/parseutils.html#parseBiggestInt%2Cstring%2CBiggestInt%2Cint will fail (return 0) if the number is too big
22:22:05FromDiscord<Yardanico> so you just use that and check the new returned index
22:22:27FromDiscord<Elegantbeef> Splitting is silly since it allocates again
22:22:56FromDiscord<Yardanico> In reply to @Elegantbeef "Splitting is silly since": some people make regexes that do horrible stuff that can be easily done with text parsing, this is nothing compared to that :)
22:23:02FromDiscord<Elegantbeef> Well copy pasting `parseutils` and replacing all `string` with `openarray[char]` is a PR ready
22:23:13FromDiscord<Yardanico> like today in another chat
22:23:24FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XfJ
22:23:42FromDiscord<Elegantbeef> Yea i dont get people
22:24:02FromDiscord<Elegantbeef> Have you seen the xml replace done without parsing to Xml nodes someone wrote?
22:24:10FromDiscord<Yardanico> yes
22:24:18FromDiscord<Yardanico> man-made horrors beyond comprehension
22:24:27FromDiscord<Yardanico> In reply to @Elegantbeef "Have you seen the": you're referring to the nim one, right?
22:24:33FromDiscord<Elegantbeef> Yea
22:24:38FromDiscord<Yardanico> yeah
22:24:42FromDiscord<Yardanico> 😔
22:25:05FromDiscord<!Patitotective> i just realize it can work with `parseInt` lol↵silly me
22:26:24FromDiscord<Elegantbeef> Here's hoping other people want code reuse for Nim 2.0 and we get concepts + openarrays everywhere 😄
22:26:31FromDiscord<!Patitotective> is there a helper proc that returns a tuple instead of asking for `var number`? https://nim-lang.org/docs/parseutils.html#parseInt%2Cstring%2Cint%2Cint
22:26:47FromDiscord<Elegantbeef> No
22:26:48FromDiscord<Yardanico> no
22:26:52FromDiscord<sOkam!> How does one handle IOError exceptions from readFile in nimscript?↵Is it something not allowed because its nims, instead of compiled?
22:27:02FromDiscord<Yardanico> you can use scanf instead
22:27:12FromDiscord<Yardanico> maybe 🤔
22:27:22FromDiscord<Yardanico> if you really don't want to have `var mynum: int` on a separate line
22:27:26FromDiscord<Yardanico> ah nvm, scanf is the same in this regard
22:27:31FromDiscord<Elegantbeef> @retkid\: stack allocation is the scariest thing you can do 😄
22:27:41FromDiscord<Elegantbeef> `scantuple` goes brrr
22:28:22FromDiscord<Elegantbeef> `let (success, myInt) = str.scanTuple("$i")`
22:28:35FromDiscord<Elegantbeef> It's in `std/strscans`
22:28:45PMunchWelp, I've just wasted a whole day trying to get async to work with coap. But it seems like it might just be a bug in the libcoap library..
22:28:45FromDiscord<Yardanico> yeah i remembered it
22:29:35FromDiscord<!Patitotective> In reply to @Elegantbeef "`scantuple` goes brrr": oooooooooo so coooool :]
22:29:48FromDiscord<Yardanico> 0ooo0oо
22:29:49FromDiscord<Elegantbeef> And after you use scan tuple you can say "Thanks beef you're a genius"
22:29:58FromDiscord<Yardanico> In reply to @Elegantbeef "And after you use": but why would i thank a piece of meat
22:30:14FromDiscord<Elegantbeef> Hey i'm not just a piece of meat, i'm also ugly
22:30:23FromDiscord<!Patitotective> In reply to @Elegantbeef "And after you use": i will :]
22:30:33FromDiscord<Yardanico> robot smile :]
22:30:36FromDiscord<!Patitotective> In reply to @Elegantbeef "Hey i'm not just": how does a piece of meat has dogs
22:30:38FromDiscord<Elegantbeef> Scantuple is my favourite hidden gem addition i've added 😄
22:31:16FromDiscord<!Patitotective> In reply to @Yardanico "robot smile :]": yea, its so nice, its even better than 🙃
22:31:21FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XfK
22:31:25FromDiscord<Elegantbeef> Nimscript exceptions are weird
22:31:29FromDiscord<Yardanico> In reply to @sOkam! "I'm trying this code.": yeah I've seen you ask, but I simply don't know :(
22:31:31FromDiscord<Elegantbeef> Use nimscript procs instead of os
22:31:35FromDiscord<Yardanico> as beef said, exception handling in nimscript can be weird
22:33:01FromDiscord<Elegantbeef> You need to use `fileExists` and fight TOCTOU race conditions
22:34:31*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:34:51FromDiscord<!Patitotective> sorry for asking this beef but is there a way to make `scanTuple("1a", "$i")` ends with no success hehe
22:35:27FromDiscord<Elegantbeef> `$i$+` should work but then you need ` let (success, myInt, _)`
22:36:14FromDiscord<Yardanico> but won't that make a useless allocation each time?
22:36:28FromDiscord<Yardanico> although I guess the C compiler should be smart enough to optimize it away
22:36:58*lumo_e quit (Quit: Quit)
22:37:11FromDiscord<!Patitotective> In reply to @Elegantbeef "`$i$+` should work but": it returns `(true, 1, "a")` 🤨
22:37:26FromDiscord<Yardanico> try $i$s
22:37:34FromDiscord<Yardanico> ah wait
22:37:42FromDiscord<Elegantbeef> Isnt that what you wanted?
22:37:57FromDiscord<Yardanico> $i$s$.
22:38:04FromDiscord<Yardanico> @beef he wants it to _not_ match
22:38:05FromDiscord<!Patitotective> i meant, return false if there is something rather than a valid integer
22:38:18FromDiscord<Yardanico> @!Patitotective `let (ok, myInt) = scanTuple("1a", "$i$s$.")` if i understood you correctly
22:38:25FromDiscord<Yardanico> this also handles the case if you have "1 " string
22:38:30FromDiscord<Yardanico> if you don't want that, just remove $s
22:38:39FromDiscord<Yardanico> $. checks that the end of the string was reached
22:38:52FromDiscord<!Patitotective> smart
22:38:53FromDiscord<!Patitotective> thanks :]
22:39:34FromDiscord<!Patitotective> In reply to @Patitotective "smart": or should i say "Thanks yard you're a genius"
22:39:49FromDiscord<Yardanico> don't forget to thank beef too, or he'll do something !11
22:40:18FromDiscord<Elegantbeef> Eh i'm contemplating a PR to make parseutils use openarray[char] so that something isnt extreme
22:40:24FromDiscord<!Patitotective> he knows that my projects are 50% made by him lol
22:40:37FromDiscord<Yardanico> In reply to @Elegantbeef "Eh i'm contemplating a": if it's backwards compatible, then why not
22:40:46FromDiscord<Yardanico> but there might be some weird bug that shows up :D
22:40:52FromDiscord<Yardanico> classic
22:41:35FromDiscord<Yardanico> also don't forget, `openArray[char]`, or styleCheck:usages will eat you
22:41:39FromDiscord<Elegantbeef> Eh i dont see it happening the issue is with `openarray[char or byte]`
22:41:53FromDiscord<Yardanico> usage
22:42:11FromDiscord<!Patitotective> c'mon, you're using discord edit the message lol
22:42:22FromDiscord<Yardanico> i do sometimes
22:42:47FromDiscord<Yardanico> but years of Nim IRC still show their impact on me...
22:43:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XfM
22:43:53FromDiscord<Elegantbeef> Especially given some people write `openarray[openarray[T]]` when they really need/want `openArray[OpenArray[T]]`
22:48:54PMunchBy the way !Patiotective, my IRC client really doesn't like the exclamation point it from of your name :P
22:49:17FromDiscord<Yardanico> yeah @!Patitotective did you perhaps add it just to appear first in discord member list? 👀
22:49:31FromDiscord<Yardanico> since your actual discord handle is just "Patitotective"
22:49:31PMunchThat's why I sometimes call you Patiodetective, because the tab-completion doesn't work and I have to type it out every time :P
22:50:13FromDiscord<!Patitotective> In reply to @Yardanico "yeah <@762008715162419261> did you": what are you saying 👀 i did for, ..., visual purposes, yeah
22:50:22FromDiscord<Yardanico> sure :forsenNOIDONTTHINKSO:
22:50:35FromDiscord<Yardanico> i mean @!Patitotective we don't have any rules regarding that (some discord servers do), so you can keep it
22:50:45FromDiscord<!Patitotective> hehe
22:50:50PMunchJust realised that when I type out your name you don't even get pinged..
22:50:56PMunchSo that was a waste of time
22:51:10FromDiscord<!Patitotective> In reply to @PMunch "That's why I sometimes": you should call me patitotective, not patitodetective lol
22:51:17FromDiscord<!Patitotective> In reply to @PMunch "Just realised that when": haha
22:51:23FromDiscord<huantian> Pale detective
22:51:30FromDiscord<Yardanico> patito
22:51:31FromDiscord<Yardanico> simple
22:51:38FromDiscord<!Patitotective> In reply to @huantian "Pale detective": :[
22:51:40FromDiscord<Yardanico> they call me yard and i just live with it
22:51:51FromDiscord<!Patitotective> ill call you anico
22:52:41Yardanicocast[test](testingdiscordbridge)
22:52:45FromDiscord<Yardanico> yeah weird stuff
22:52:52FromDiscord<Yardanico> ah it's due to markdown probably, silly me
22:52:58Yardanico[link](https://google.com)
22:53:01FromDiscord<Yardanico> yeah lol
22:53:10Yardaniconot sure how to solve that the clean way :D
22:53:15Yardanicoescape all markdown things probably
22:53:22PMunchI know, but my brain keeps reading it as that and when I don't have tab completion this is what you get :P
22:53:28Yardanicobut then people use ` in IRC as well, hmm
22:53:32Yardanico`hello`
22:53:44Yardanico(just checking because i want to try to fix a few more bugs in ircord and maybe clean up the code)
22:53:48FromDiscord<!Patitotective> why irc people dont have pfp↵its so confusing
22:53:58Yardanicobecause IRC doesn't have that
22:54:03PMunchWell, I do it so the fine folk over on Discord gets to see my messages all pretty like
22:54:10PMunchpfp?
22:54:19Yardanicomodern way of saying profile picture
22:54:20Yardanicoavatar
22:54:20PMunchPay For Participation
22:54:26PMunchAh
22:54:30PMunchProFile Picture
22:54:37Yardanicoyeah :D
22:54:51FromDiscord<!Patitotective> pmunch aint modern
22:54:53Yardanicodamn I wonder how big is my quassel DB now
22:54:57PMunchWhy would we have those? IRC is just multiplayer notepad
22:55:00Yardanicoit's been logging nim channels for like 5 years
22:55:09Yardanicoor maybe actually less, hm
22:55:53FromDiscord<Bubblie> Should I make a vulkan triangle example and put on my github so others can use it as reference?
22:56:16FromDiscord<Bubblie> I think I should lol
22:56:19FromDiscord<!Patitotective> you can create a gist :]
22:56:30FromDiscord<Bubblie> Oh good idea
22:56:33PMunchMy hexchat folder is apparently 393Mb
22:56:35FromDiscord<Yardanico> sure if you want, but there are examples already
22:56:43FromDiscord<Bubblie> In reply to @Yardanico "sure if you want,": I couldnt find any
22:56:51FromDiscord<Yardanico> https://github.com/nimgl/vulkan/blob/master/tests/triangle.nim
22:56:53FromDiscord<Bubblie> I found some on nimgl but nimgl vulkan doesnt really work
22:56:57FromDiscord<Bubblie> For me at least
22:57:01FromDiscord<Bubblie> I ran into many problems with it
22:57:05FromDiscord<Yardanico> oh okay
22:57:08FromDiscord<Bubblie> Its why im using different bindings
22:57:14FromDiscord<Yardanico> but then make sure that your example also works on linux :)
22:57:20FromDiscord<Bubblie> 👍
22:57:24*Zectbumo quit (Remote host closed the connection)
22:57:25PMunchThat is apparently going back to 2016 it seems
22:57:29*noeontheend joined #nim
22:58:41FromDiscord<Bubblie> Also another thing I found out with nimgl vulkan is the fact that they kinda changed the names of a lot of vulkan methods, instead of putting them in the regular nim format they like changed their names which made it a hassle to do much too
22:58:52FromDiscord<Bubblie> That too initializing vulkan is definitely not the same either
22:58:52FromDiscord<!Patitotective> hey beeeeeeeeef, how should i _validate_ (and parse) a date(time)?↵this just crashes if its not valid `parse(returnDate, "dd'.'mm'.'yyyy")`
22:59:13FromDiscord<Yardanico> define "crasheS"
22:59:14FromDiscord<Yardanico> (edit) ""crasheS"" => ""crashes""
22:59:18FromDiscord<Yardanico> you can just catch exceptions
22:59:23FromDiscord<Elegantbeef> `parseTime`
22:59:45FromDiscord<Bubblie> Also do you know what that nim Ai Library is called again? I am actually planning to do something with it soon
22:59:55FromDiscord<Bubblie> Forgot the name and ive been trying to find it
22:59:56FromDiscord<!Patitotective> In reply to @Yardanico "you can just catch": but :[
23:00:00FromDiscord<Yardanico> but what
23:00:03FromDiscord<!Patitotective> :[
23:00:09FromDiscord<Yardanico> it's [:
23:00:12FromDiscord<Bubblie> Whats wrong with catching exceptions lol
23:00:17FromDiscord<Yardanico> doCall[:Type]()
23:00:24FromDiscord<Yardanico> a.doCall[:Type]()
23:00:26FromDiscord<Yardanico> [:
23:00:50FromDiscord<!Patitotective> `me:["sad"]`
23:00:53FromDiscord<!Patitotective> :[
23:00:55FromDiscord<Yardanico> 1.7G quassel-storage.sqlite
23:00:56FromDiscord<Bubblie> lol
23:01:01FromDiscord<Bubblie> In reply to @Yardanico "1.7G ": Woah
23:01:12FromDiscord<Bubblie> I thought it was called sqlite not sqlbig
23:01:19FromDiscord<!Patitotective> lmfao
23:01:34PMunchI'm scared to ask, but what is stored in that database?
23:01:37FromDiscord<Yardanico> In reply to @Bubblie "I thought it was": sqlite can handle databases in TBs
23:01:42YardanicoPMunch: a lot of logs :P
23:01:43FromDiscord<Bubblie> In reply to @Yardanico "sqlite can handle databases": My goodness
23:01:43FromDiscord<!Patitotective> omg i can call the proc `valiDate`
23:01:45PMunchIs each message it's own entry?
23:01:46FromDiscord<Bubblie> Why would someone want that
23:01:48FromDiscord<Bubblie> 😭
23:01:49Yardanicoi've also been in some very talkative IRC chats
23:01:55Yardanicobut yeah it's mainly just all the logs
23:01:58PMunch@Bubblie, why not?
23:02:01Yardanicolemme see when it starts
23:02:06PMunchBut all your files in a sqlite database :P
23:02:22FromDiscord<Bubblie> You would think that for something storing that much data you would use something like mongo or postgres
23:02:44Yardanicoyeah it's not as old as I thought
23:02:47FromDiscord<Bubblie> Sqlite is very small and capable but ive never used it for storing that much data
23:02:48Yardanico1566403404000 is the first entry in the backlog
23:02:53FromDiscord<Bubblie> But I mean, it works so you do you
23:02:54Yardanicoaugust 2019
23:03:16Yardanico13_094_906 entries
23:03:36FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/972634832716824606/unknown.png
23:03:41FromDiscord<Bubblie> Okay using nim instead of c++ is insane when it comes to the change in verbosity holy shit
23:03:51FromDiscord<Bubblie> Its so much less verbose and easier wtf
23:04:03PMunchHmm, interesting
23:04:18PMunch@Bubblie, indeed
23:04:29PMunchYardanico, hexchat just stores logs in textfiles
23:04:37Yardanicoyeah that's fine too
23:04:47Yardanicoquassel is kind of a znc bouncer, but with its own protocol, so it needs a DB
23:04:55Yardanicoyou can connect to the same quassel instance from multiple devices at the same time
23:05:04FromDiscord<Bubblie> A lot of people dislike compiled languages but I dont think having an interpreted language automatically means its better, here its clearly a big strong point for nim
23:05:07Yardanicoand it's always connected to IRC itself, so you keep all the logs
23:05:12PMunchI have 295288 messages in my freenode/nim log
23:05:26Yardanico@Bubblie I don't think a lot of people dislike them, it's just that traditionally "compiled language" meaned C or something close
23:05:30FromDiscord<Bubblie> In reply to @Yardanico "": Hey im famous
23:05:46FromDiscord<Bubblie> Yeah thats true Yard
23:06:02FromDiscord<Bubblie> Whenever I mention compiled language people usually say “so its like assembly or C?”
23:06:04FromDiscord<Bubblie> And im like
23:06:07FromDiscord<Bubblie> bruh
23:06:11YardanicoPMunch: I doubt quassel can do the thing you do with your hexchat settings to show fromdiscord users as IRC users :P
23:06:12PMunchAbout 6 million lines in total
23:06:28PMunchYardanico, yeah that is actually pretty neat
23:06:32FromDiscord<Bubblie> Still tryna find that nim ai library
23:06:39FromDiscord<Yardanico> check #science
23:06:44FromDiscord<Bubblie> Thanks
23:07:32PMunchOh right, this is only the logs for this specific machine
23:16:29FromDiscord<sOkam!> Is this also not allowed in nimscript either?↵_code is loaded as a module, if that changes anything_ https://media.discordapp.net/attachments/371759389889003532/972638073756188692/unknown.png https://media.discordapp.net/attachments/371759389889003532/972638073965936650/unknown.png
23:16:54FromDiscord<Elegantbeef> Did you import os?
23:17:15FromDiscord<sOkam!> not on the module, thought that was from parseopt
23:17:17FromDiscord<Elegantbeef> You may want `paramStr` and paramCount\`
23:17:18FromDiscord<sOkam!> will check ✍️
23:17:47FromDiscord<sOkam!> In reply to @Elegantbeef "You may want `paramStr`": is this not tied to position? https://media.discordapp.net/attachments/371759389889003532/972638401423613992/unknown.png
23:18:10FromDiscord<sOkam!> I just want whatever order, would rather not deal with position in the parameters
23:18:29FromDiscord<Yardanico> just make a proper nim program for the stuff you want already :P
23:18:32FromDiscord<!Patitotective> `"
23:18:34FromDiscord<Yardanico> just compile it on the first run
23:18:37FromDiscord<Yardanico> and then run usually
23:18:50FromDiscord<sOkam!> In reply to @Yardanico "just make a proper": Would be worth it, if that didn't mean cross compiling 😄
23:18:57FromDiscord<Elegantbeef> `myStr.setLen(myString.find('\0') - 1)`
23:19:04FromDiscord<Yardanico> no, on the machine of the end-user or someone like that
23:19:16FromDiscord<Elegantbeef> You can install binaries with nimble packages
23:19:20FromDiscord<sOkam!> Ah, like calling the compiling in the script. Might be interesting
23:19:37FromDiscord<Elegantbeef> Picostdlib, Ratel, Nico, Karax all install binaries with source code
23:19:42FromDiscord<Elegantbeef> It's a hybrid package
23:21:21PMunchBy the way @Elegantbeef I was thinking about ways to solve our shared `compiler` package gripes
23:21:51FromDiscord<Andreas> hi, is the a template or facility that takes care for debugging-msg, making sure they get not compiled ?
23:21:59FromDiscord<Elegantbeef> We just need nimble to use the config file for us
23:22:16FromDiscord<Elegantbeef> What do you mean andreas
23:22:40PMunchYou can use `when defined(debugLogging): echo "Debug message"` or something similar
23:22:52PMunchOr use an actual logging library which has this kind of stuff built in
23:23:10FromDiscord<Andreas> having debugEcho-msg during devel & test, but the compiler taking care that these echos are not compiled ?
23:23:38FromDiscord<Yardanico> nonono, debugEcho is for func
23:23:46FromDiscord<Elegantbeef> `debugecho` is a silly named sideeffect free echo meant for debugging in no side effect procedures
23:23:52FromDiscord<Yardanico> it's marked as having no side effects while in fact it does, just so you can test stuff in funcs
23:24:05FromDiscord<Yardanico> func = noSideEffect proc
23:24:37FromDiscord<Elegantbeef> So pmunc what are the ways?
23:24:45FromDiscord<Elegantbeef> Or are you also up shit creek without a paddle?
23:24:58FromDiscord<Andreas> @Yardanico sure, be it echo or debugEcho 🙂
23:25:19FromDiscord<Elegantbeef> you can template your own echo
23:26:40PMunchI mean first of the compiler package needs to be actually able to build the compiler
23:26:49FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=3XfY
23:26:51FromDiscord<Elegantbeef> Yea
23:27:05PMunchAnd not like my most recent fun where it was missing some documentation files that where supposed to be read in as strings
23:27:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XfZ
23:28:10FromDiscord<Elegantbeef> Eh pmunch the compiler package is the wrong way about it i think
23:28:35FromDiscord<Elegantbeef> The compiler package is not usable for anything ime
23:28:58FromDiscord<Elegantbeef> The compiler sources with your present compiler is the way
23:28:59PMunchThen I was thinking, could we potentially use `requires "compiler == " & NimVersion`
23:29:42PMunchThe problem with the compiler sources with your present compiler is that people keep using Nim from a package manager that doesn't include sources
23:29:55PMunchI swear that's like 95% of the issues in the NimLSP repo..
23:29:57FromDiscord<Elegantbeef> That doesnt work cause if you're using devel and update you do not get recent packages
23:30:38PMunchNot sure what you mean
23:30:53FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Xg1
23:31:21FromDiscord<Yardanico> In reply to @Patitotective "is there a shorter": it's already short?
23:31:30FromDiscord<Yardanico> why do you want to convert everything into a single line :D
23:31:33FromDiscord<!Patitotective> i meant, so i dont have to specify `0..10`
23:31:35FromDiscord<Elegantbeef> Say you're on devel and you install compiler your version is 1.7.1 but you update to the next nightly and it changes something with the compiler, you now build and nimble goes "Yep this is 1.7.1 installed already, we can use this"
23:31:39FromDiscord<Elegantbeef> your compiler sources are now outdated
23:32:04FromDiscord<!Patitotective> i want it to guess `Hello World`'s lenght
23:32:13FromDiscord<Elegantbeef> `str[0..myRightHand.len) = myRightHand`
23:32:26FromDiscord<Elegantbeef> Hopefully that makes sense pmunch
23:32:31FromDiscord<Elegantbeef> I had that issue with nimscripter and 1.5.1
23:32:38FromDiscord<Yardanico> ) ?
23:32:43FromDiscord<!Patitotective> In reply to @Elegantbeef "`str[0..myRightHand.len) = myRightHand`": without a variable?
23:32:46FromDiscord<Elegantbeef> Mis type
23:32:53FromDiscord<Yardanico> wait beef to you have ] bound as shift + ) somehow?
23:33:00FromDiscord<Yardanico> otherwise why'd you type that as a typo
23:33:16FromDiscord<Elegantbeef> Nah just my brain is wired like a first time PC builder's wire management
23:33:25FromDiscord<Yardanico> hey, it works!
23:33:33PMunch@Elegantbeef, ah yeah that's true
23:33:33FromDiscord<Yardanico> cables be damned as long as it works!
23:33:38FromDiscord<Andreas> sent a code paste, see https://paste.rs/2kG
23:33:46PMunchBut there is a way to get the git tag version isn't there?
23:33:49PMunchFor a compiler
23:33:51FromDiscord<Elegantbeef> No problem
23:34:02FromDiscord<Elegantbeef> With the shell yea
23:34:02PMunchThe number that nim -v shows
23:34:13PMunchThat's not exposed as a constant?
23:34:16FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/G1p
23:34:25FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xg3
23:34:25FromDiscord<!Patitotective> :[
23:34:34FromDiscord<Yardanico> or not, i'm not sure about CoW on ARC
23:34:36FromDiscord<Elegantbeef> I dont think so pmunch
23:34:48FromDiscord<Elegantbeef> It probably prepares mutation on regrowth
23:34:53FromDiscord<Yardanico> sent a code paste, see https://paste.rs/cKE
23:35:00FromDiscord<Yardanico> it's not shorter, but you don't have to manually calculate the length
23:35:02FromDiscord<!Patitotective> i dont want to create a variable :[
23:35:05FromDiscord<Yardanico> ???
23:35:18FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xg4
23:35:31FromDiscord<Yardanico> ah wait what
23:35:33FromDiscord<Yardanico> lol
23:35:38FromDiscord<Yardanico> yeah I get it now :DDD
23:36:07FromDiscord<!Patitotective> In reply to @Yardanico "???": i need to do it with multiple strings and i wont use the variable again :[
23:36:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Xg5
23:36:17FromDiscord<Elegantbeef> make it a template
23:36:20FromDiscord<Elegantbeef> or proc
23:36:22FromDiscord<!Patitotective> :o
23:36:24FromDiscord<!Patitotective> smart
23:36:47PMunchI guess we should make an RFC @Elegantbeef
23:36:48FromDiscord<Yardanico> how about this
23:36:56FromDiscord<Yardanico> ah yeah, beef's will work as well
23:37:08FromDiscord<Yardanico> sent a code paste, see https://paste.rs/byq
23:37:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Xg6
23:37:42FromDiscord<Elegantbeef> Yea pmunch the issue is to where
23:37:59FromDiscord<Elegantbeef> The issue is a Nimble issue if you ask me
23:38:00FromDiscord<Elegantbeef> It cannot load configs
23:38:11PMunchThe RFC repo is probably a good start
23:38:12FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Xg8
23:38:27FromDiscord<Elegantbeef> I guess
23:38:39PMunchWhat do you mean it cannot load configs?
23:38:42FromDiscord<Elegantbeef> It's just prohibitively difficult to assign blame here 😄
23:39:43FromDiscord<Elegantbeef> That atleast solves my problem with nimscripter
23:40:50PMunchWhat does?
23:41:36FromDiscord<Elegantbeef> Nimble/nim using config files at used nimble package root directories
23:41:57FromDiscord<Elegantbeef> Like my nimscripter package has a `config.nims` with `--path:"$nim"` at it's root, why this isnt considered is beyond me
23:43:00FromDiscord<Elegantbeef> That solves my issue atleast, but it doesnt solve yours
23:43:19FromDiscord<Elegantbeef> I guess being able to pin to the active nim version does solve both
23:43:42PMunch$nim isn't typically set though
23:43:55FromDiscord<Elegantbeef> And technically we can run `staticExec("nim -v")` and parse that then pin `compiler == ` to that
23:44:12FromDiscord<Elegantbeef> I know that's why i have the config
23:44:53PMunchBut `--path:"$nim"` would just set an empty path..
23:45:03FromDiscord<Elegantbeef> So i guess that's the solution for now is to manually parse `nim -v` and pin compiler hash to that?
23:45:14FromDiscord<Elegantbeef> What do you mean
23:45:27FromDiscord<Elegantbeef> `$nim` isnt an environmental variable, it's an internal nim variable
23:45:34PMunchOooh
23:46:44FromDiscord<Elegantbeef> And it now all makes sense to pmunch 😄
23:47:46FromDiscord<Elegantbeef> that path adds the present compiler's path to the import path, so it makes our compiler module importable, just issue is as you noted it requires the package to ship with the compiler folder
23:48:02FromDiscord<Elegantbeef> And also nim/nimble to consider our configs inside nimble packages
23:48:25PMunchAnyways, I'm off to bed
23:48:36FromDiscord<Elegantbeef> Though i dont know about the latter since it's pretty at a distance
23:48:37PMunchI'll probably create an issue for it tomorrow
23:48:37FromDiscord<Elegantbeef> Well buh bye
23:49:00*PMunch quit (Quit: leaving)