01:03:00 | * | beholders_eye quit (Ping timeout: 272 seconds) |
03:13:39 | FromDiscord | <m4ul3r> Is there a way to make directories withouth calling `execCmdEx(&"mkdir -p {targetDir}")` ? |
03:15:35 | FromDiscord | <leorize> https://nim-lang.org/docs/dirs.html#createDir%2CPath↵(@m4ul3r) |
03:17:49 | FromDiscord | <m4ul3r> In reply to @leorize "https://nim-lang.org/docs/dirs.html#createDir%2CPat": hmm yeah that works, must have gotten skill diffed the first time i tried it and named it a dir that exists. thanks |
04:30:07 | FromDiscord | <janakali> In reply to @aintea "no idea what that": According to wikipedia it's some functionial thing where you turn expressions inside out by having argument that is a function, that will be called with result of the function. My head hurts just reading this, how do people come up with this stuff? 🙂 |
04:31:10 | FromDiscord | <janakali> sent a code paste, see https://play.nim-lang.org/#pasty=NKHBPyyT |
05:15:48 | * | ntat joined #nim |
05:41:46 | * | SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev) |
06:26:50 | * | SchweinDeBurg joined #nim |
06:52:19 | FromDiscord | <nnsee> the nimskull nim fork has a pretty good infographic explaining how cps works https://github.com/nim-works/cps?tab=readme-ov-file#what-is-cps |
06:52:43 | FromDiscord | <Elegantbeef> Hey that's not the nimskull fork that's just y'know CPS |
06:53:41 | FromDiscord | <nnsee> i thought their implementation did some magic that made it not regular cps |
06:53:56 | FromDiscord | <Elegantbeef> I mean that's just the repository for the Nimcps package |
06:53:59 | FromDiscord | <nnsee> also I literally just woke up 2 minutes ago so maybe my brain hasn't woken up yet |
06:54:01 | FromDiscord | <nnsee> oh |
06:54:02 | FromDiscord | <nnsee> yes |
07:43:46 | * | MauGal joined #nim |
07:54:46 | FromDiscord | <pmunch> sent a code paste, see https://play.nim-lang.org/#pasty=uFhWrmfw |
07:56:05 | FromDiscord | <.tokyovigilante> Can I import something like this struct from the xdg-shell Wayland etension in nim easily? It's defined in a compiled C file, but only forward declared in the public header as `extern const struct wl_interface xdg_wm_base_interface;` I need to pass its address to the protocol binding call |
08:03:43 | FromDiscord | <.tokyovigilante> hmmm, compiler seems to be happy with `let xdg_wm_base_interface {.importc, nodecl.}: struct_wl_interface` |
08:04:11 | FromDiscord | <.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=TFBAactn |
08:09:28 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=IFkLlQZe |
08:09:48 | FromDiscord | <demotomohiro> So use `header` pragma instead of `nodecl`. |
08:10:46 | * | derpydoo joined #nim |
08:11:05 | FromDiscord | <.tokyovigilante> Thanks, I had just cheated and looked at what Futhark did for the system wayland headers, and the core interface structs are just using` .importc`, and it works for me now just dropping `.nodecl.` |
08:24:48 | * | ntat quit (Quit: Leaving) |
08:47:29 | * | Jjp137 quit (Ping timeout: 245 seconds) |
09:05:30 | * | MauGal quit (Ping timeout: 252 seconds) |
09:05:40 | * | MauGal joined #nim |
09:13:18 | * | SchweinDeBurg quit (Read error: Connection reset by peer) |
09:18:37 | * | SchweinDeBurg joined #nim |
10:14:42 | * | Jjp137 joined #nim |
10:21:45 | * | beholders_eye joined #nim |
10:27:21 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=HqPOLgZQ |
10:27:42 | FromDiscord | <nocturn9x> `var` parameters are not valid return types |
10:28:43 | FromDiscord | <nocturn9x> I know there's `{.bycopy.}` and `{.byref.}` but I'm not sure if they apply here |
10:29:08 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=zLxCJuyC |
10:29:35 | FromDiscord | <nocturn9x> the object size is on the order of ~340 bytes, and I generate many millions of them per second, so copying them around is not an option |
10:47:34 | * | derpydoo quit (Ping timeout: 268 seconds) |
11:07:29 | Amun-Ra | I finally found the issue causing "Error: internal error: genTypeInfo(tyNil)" on JS target - I have const object with function members and I haven't had "nimcall" pragma in among pragmas defining function type |
11:07:32 | Amun-Ra | https://play.nim-lang.org/#pasty=gWmPCeWD |
11:07:53 | Amun-Ra | s/in// |
11:08:52 | Amun-Ra | what's weird it works fine on 2.0.x |
12:19:00 | * | MauGal quit (Ping timeout: 252 seconds) |
12:46:44 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=cFzMmHRl |
12:46:45 | FromDiscord | <nocturn9x> very cool™️ |
13:09:17 | * | rockcavera joined #nim |
13:17:48 | * | MauGal joined #nim |
13:26:17 | * | tiorock joined #nim |
13:26:17 | * | tiorock quit (Changing host) |
13:26:17 | * | tiorock joined #nim |
13:26:17 | * | rockcavera quit (Killed (silver.libera.chat (Nickname regained by services))) |
13:26:17 | * | tiorock is now known as rockcavera |
13:28:24 | * | tiorock joined #nim |
13:28:24 | * | tiorock quit (Changing host) |
13:28:24 | * | tiorock joined #nim |
13:28:24 | * | rockcavera is now known as Guest308 |
13:28:24 | * | tiorock is now known as rockcavera |
13:31:44 | * | Guest308 quit (Ping timeout: 260 seconds) |
13:31:47 | * | miccim joined #nim |
14:07:04 | * | MauGal quit (Ping timeout: 245 seconds) |
14:11:09 | * | ntat joined #nim |
14:11:44 | * | rockcavera quit (Remote host closed the connection) |
14:12:39 | * | MauGal joined #nim |
15:04:54 | * | xet7 joined #nim |
15:09:18 | * | SchweinDeBurg quit (Ping timeout: 244 seconds) |
15:13:41 | * | miccim quit (Quit: Client closed) |
15:18:45 | * | SchweinDeBurg joined #nim |
15:36:57 | * | termer_ joined #nim |
15:37:29 | * | termer quit (Ping timeout: 245 seconds) |
16:28:37 | FromDiscord | <r_pink47> I am trying to load in Json into Nim as a structure made of Tables and Sequences. I was using `std/json` till now, but I really don't want to deal with nodes. If this is stupid, please tell me so, and if not, help is welcome. |
16:32:06 | * | MauGal quit (Ping timeout: 272 seconds) |
16:35:24 | FromDiscord | <solitudesf> you can use jsony or nim-json-serialization to parse directly into object. or you can use jsonutils.jsonTo, to convert JsonNode into your type, if you don't want external deps. |
17:04:27 | FromDiscord | <nervecenter> Yeah, `JsonNode` is a thing precisely because JSON represents a dynamic heterogenous hash map. There's no way to do that in Nim without nodes of a variant type. Deserializing them into a set object for final use is the best approach if the goal of your program is clear. |
17:04:42 | FromDiscord | <nervecenter> (edit) "Yeah, `JsonNode` is a thing precisely because JSON represents a dynamic heterogenous hash map. There's no way to do that in Nim ... without" added "(which is statically typed)" |
17:04:55 | FromDiscord | <nervecenter> (edit) "Yeah, `JsonNode` is a thing precisely because JSON represents a dynamic heterogenous hash map. There's no way to do that in Nim (which is statically typed) without nodes of a variant type. Deserializing them into a set object ... for" added "type" |
17:06:04 | FromDiscord | <nervecenter> (edit) "Yeah, `JsonNode` is a thing precisely because JSON represents a dynamic heterogenous hash map. There's no way to do that in Nim (which is statically typed) without nodes of a variant type. Deserializing them into a ... settypes" added "hierarchy of" | "type" => "types" |
17:06:13 | FromDiscord | <nervecenter> (edit) removed "set" |
17:52:12 | * | coldfeet joined #nim |
17:56:28 | * | ntat_ joined #nim |
18:15:37 | FromDiscord | <nocturn9x> In reply to @r_pink47 "I am trying to": jsony ftw |
18:15:39 | FromDiscord | <nocturn9x> it's lovely |
18:17:23 | FromDiscord | <r_pink47> Ok, I am going to give Jsony a try. I have now also determined that Nim isn't the perfect language for me, but still the best I found. |
18:21:41 | * | coldfeet quit (Quit: Lost terminal) |
18:26:31 | FromDiscord | <djazz> second time this week nimsuggest/nim vscode extension takes down my pc 🙃 out of memory |
18:28:17 | FromDiscord | <kiloneie> In reply to @djazz "second time this week": It's either that or github desktop for me, i don't know whats happening, but nothing responds for forever |
18:28:46 | FromDiscord | <djazz> so many nimsuggest processes, fills up memory |
18:28:47 | FromDiscord | <kiloneie> HELP PLS:↵How do i hash frames ? https://media.discordapp.net/attachments/371759389889003532/1346912342176305172/image.png?ex=67c9e95e&is=67c897de&hm=27670e1ba1aa2c0cada9a2b1af5ecf7713e8fcbf751dfe06c41b078e7e5e1653& |
18:45:32 | * | ntat_ quit (Quit: leaving) |
18:45:42 | FromDiscord | <kiloneie> sent a long message, see https://pasty.ee/lrONpCxl |
18:47:03 | FromDiscord | <kiloneie> https://media.discordapp.net/attachments/371759389889003532/1346916940085465189/image.png?ex=67c9eda7&is=67c89c27&hm=18e8fa7c0245deab3f75965e4c81e42a309ffaf2c457c12d90a8cd76ec8b5c25& |
18:55:21 | FromDiscord | <leorize> I'm not sure if hashing everything is what you want |
18:56:10 | FromDiscord | <Elegantbeef> Your hash function needs to behave like your `==` |
18:56:25 | FromDiscord | <leorize> think of hashing as a way to create a generalized identity for the object |
18:56:43 | FromDiscord | <leorize> do you actually distinguish your objects by what inside? |
18:57:45 | FromDiscord | <Elegantbeef> @nocturn9x I'd suggest making `=copy` and `=dup` errors then you can make a `clone` or w/e to actually copy it when you want |
18:58:00 | FromDiscord | <nocturn9x> oh |
18:58:01 | FromDiscord | <Elegantbeef> You also want a `lent` return value |
18:58:04 | FromDiscord | <nocturn9x> actually not a bad idea |
18:58:10 | FromDiscord | <nocturn9x> In reply to @Elegantbeef "You also want a": uu |
18:58:12 | FromDiscord | <nocturn9x> I will try this |
18:58:19 | FromDiscord | <nocturn9x> maybe it's the secret to speed I've been missing |
18:58:27 | FromDiscord | <nocturn9x> but doesn't that apply to refs only |
18:58:36 | FromDiscord | <Elegantbeef> Nope |
18:58:39 | FromDiscord | <nocturn9x> I see |
18:58:51 | FromDiscord | <Elegantbeef> `lent T` is a immutable `ptr T` under the hood |
18:58:59 | FromDiscord | <Elegantbeef> It works just like how you can have a proc return `var T` |
18:59:20 | FromDiscord | <Elegantbeef> With the hooks disabled it'll be required |
18:59:48 | FromDiscord | <leorize> if it's a search problem, it's worth optimizing your structure to speed that process up |
19:00:25 | FromDiscord | <kiloneie> Hmm maybe i am trying to a dumb thing here, i didn't ask myself if i actually need this part... le me see... |
19:00:34 | FromDiscord | <leorize> your object is gigantic, so frequent movement/copy isn't gonna be fast |
19:00:49 | FromDiscord | <Elegantbeef> For the future there is a `fields` iterator 😄 |
19:01:20 | FromDiscord | <Elegantbeef> Oh yea it's massive without any pointer indirection |
19:01:27 | FromDiscord | <Elegantbeef> Cannot really move that |
19:02:15 | FromDiscord | <Elegantbeef> I also wonder if the field order could be moved to make it a bit smaller |
19:08:53 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=DxnbdjCc |
19:08:57 | FromDiscord | <nocturn9x> this just errors out immediately |
19:09:01 | FromDiscord | <Elegantbeef> Ni |
19:09:03 | FromDiscord | <nocturn9x> how would I do it exactly? |
19:09:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=sJiVCbaQ |
19:09:47 | FromDiscord | <Elegantbeef> Error/fatal pragmas in bodies are there to stop compilation at the point they're hit |
19:09:53 | FromDiscord | <nocturn9x> `/home/nocturn9x/heimdall/src/heimdall/movegen.nim(804, 38) Error: '=copy' is not available for type <Position>; requires a copy because it's not the last read of 'board.positions[1]'; routine: basicTests` |
19:09:58 | FromDiscord | <nocturn9x> now I know when copies occur |
19:09:59 | FromDiscord | <nocturn9x> neat! |
19:10:00 | FromDiscord | <Elegantbeef> Error pragma on a procedure causes it to error on call(good for deprications) |
19:10:10 | FromDiscord | <nocturn9x> In reply to @Elegantbeef "Error pragma on a": got it |
19:10:18 | FromDiscord | <Elegantbeef> deprecation even 😄 |
19:10:34 | FromDiscord | <Elegantbeef> Though there is also a deprecate pragma if memory serves |
19:11:24 | FromDiscord | <nocturn9x> okay so |
19:11:32 | FromDiscord | <nocturn9x> if I did want to implement `clone()` |
19:11:34 | FromDiscord | <nocturn9x> how would I do it |
19:11:54 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=hrnQhBbG |
19:12:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=dZsuTqCf |
19:13:20 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=QvpZUzOX |
19:13:22 | FromDiscord | <nocturn9x> this is the object |
19:13:28 | FromDiscord | <nocturn9x> `Bitboard` is just a `distinct uint64` |
19:13:32 | FromDiscord | <nocturn9x> `Piece` is a simple `object` |
19:13:34 | FromDiscord | <Elegantbeef> Right are there any references? |
19:13:38 | FromDiscord | <nocturn9x> nopes |
19:13:49 | FromDiscord | <Elegantbeef> Then you're probably fine to do `copyMem` or the above |
19:13:54 | FromDiscord | <nocturn9x> okok |
19:14:10 | FromDiscord | <Elegantbeef> Why is bitboard not `set[0..63]`? |
19:19:46 | FromDiscord | <nocturn9x> because I need them to be integers |
19:19:53 | FromDiscord | <nocturn9x> it could be, ig, but it wouldn't be any faster |
19:20:23 | FromDiscord | <nocturn9x> it's basically a bitset anyway |
19:20:28 | FromDiscord | <Elegantbeef> Didn't realise you needed the numeric property of it |
19:23:15 | FromDiscord | <nocturn9x> yep |
19:23:29 | FromDiscord | <nocturn9x> I treat it as a set in 99% of cases |
19:23:40 | FromDiscord | <nocturn9x> but there's a few edge cases where I need to do like exclusion using XORs |
19:23:43 | FromDiscord | <nocturn9x> which is really fast |
19:23:44 | FromDiscord | <nocturn9x> so yeah |
19:24:16 | FromDiscord | <Elegantbeef> The bitset operations would be the same |
19:24:22 | FromDiscord | <Elegantbeef> But carry on anyway |
19:26:26 | FromDiscord | <nocturn9x> In reply to @Elegantbeef "The bitset operations would": hmm probably |
19:26:32 | FromDiscord | <nocturn9x> but it already works and is pretty elegant so 🤷 |
19:41:52 | FromDiscord | <kiloneie> I want set functionality(probably dedup) and auto ordering. Maybe i am trying to do too much here... i don't know, but i have no clue on how to hash a container, everything else i have done b4... https://media.discordapp.net/attachments/371759389889003532/1346930734887211018/image.png?ex=67c9fa7f&is=67c8a8ff&hm=22664ea9d03ee8071cc0f33e27d271f900584122d6f19b1b7e21d56873b62763& |
19:45:00 | FromDiscord | <Elegantbeef> I mean what is `Image`? |
19:46:36 | FromDiscord | <Elegantbeef> Oh wait, this is different |
19:46:40 | FromDiscord | <Elegantbeef> What is `Object` |
19:49:33 | FromDiscord | <kiloneie> https://media.discordapp.net/attachments/371759389889003532/1346932667408715878/image.png?ex=67c9fc4c&is=67c8aacc&hm=2da73cf6f8e17220b15fb3b82eaa33d6c1adeccf4bb495ccfdafb4d4190042de& |
19:50:36 | FromDiscord | <Elegantbeef> So your hash should just `hash(cast[uint](obj))` or y'know `-d:nimPreviewHashRef` |
19:51:43 | * | jjido joined #nim |
19:54:29 | FromDiscord | <kiloneie> So this would only hash the front of that instead of all the data inside ? |
19:56:11 | FromDiscord | <Elegantbeef> It hashes the pointer so it matches `==` |
19:56:20 | FromDiscord | <kiloneie> omg... |
19:56:53 | FromDiscord | <kiloneie> https://kiloneie.github.io/Nim%20for%20Beginners/4%20hashSets,%20more%20on%20hashTables%20and%20Hashing/hashSetsMoreOnHashTablesAndHashing.html↵↵https://kiloneie.github.io/Extra%20Content/extraMakingFakeTable.html |
19:57:09 | FromDiscord | <kiloneie> That's what i get for skimming the crab out of my own tutorial |
19:59:55 | FromDiscord | <kiloneie> imma bury myself in peanuts now |
21:05:32 | * | pmp-p quit (Ping timeout: 252 seconds) |
21:08:01 | * | pmp-p joined #nim |
21:29:42 | * | GnuYawk6733 quit (Quit: The Lounge - https://thelounge.chat) |
21:30:07 | * | GnuYawk6733 joined #nim |
21:54:48 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
22:08:57 | * | ntat quit (Quit: Leaving) |
22:23:33 | * | rockcavera joined #nim |