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