<< 02-03-2024 >>

00:47:49*proaxis quit (Ping timeout: 264 seconds)
00:55:00*proaxis joined #nim
01:13:12*proaxis_ joined #nim
01:15:05*proaxis quit (Ping timeout: 268 seconds)
01:34:55*proaxis_ quit (Remote host closed the connection)
01:34:57*proaxis__ joined #nim
02:05:36*azimut quit (Remote host closed the connection)
02:06:23*azimut joined #nim
02:48:42*azimut quit (Ping timeout: 260 seconds)
02:49:00*azimut joined #nim
02:49:26*Jjp137 quit (Quit: Leaving)
02:52:34*Jjp137 joined #nim
03:14:59*azimut quit (Remote host closed the connection)
03:15:22*azimut joined #nim
03:58:35*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
03:58:59*SchweinDeBurg joined #nim
04:46:32*krux02 quit (Remote host closed the connection)
04:46:55*krux02 joined #nim
05:02:28*krux02 quit (Remote host closed the connection)
05:50:21*rockcavera quit (Remote host closed the connection)
06:10:46*azimut quit (Ping timeout: 260 seconds)
06:54:42FromDiscord<sOkam! 🫐> In reply to @toma400 "I'm sorry if this": `let data = readFile("file.exe")`
06:55:23FromDiscord<sOkam! 🫐> you can use streams or strings, but if you use strings you get access to `treeform/binny` which is made to handle those things
06:56:11FromDiscord<Elegantbeef> You can just do `open("path")` and `File`s have a bunch of operations on them
07:42:17*ntat joined #nim
07:47:59*pmp-p joined #nim
08:10:48*al1ranger joined #nim
08:17:51*al1ranger quit (Quit: Leaving)
08:37:47*advesperacit joined #nim
08:48:00FromDiscord<viixzuu> hm
09:00:46FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=FpoLibXIJLtC
09:11:45FromDiscord<intellij_gamer> sent a code paste, see https://play.nim-lang.org/#pasty=SgPIlwOOicDM
09:15:35FromDiscord<whisperecean> Does anybody know how I can configure nph globally for all Nim files in vscode?
09:18:07FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=xVUBqHEzcAoX
09:18:14FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#pasty=MgeuHSfVkLxc" => "https://play.nim-lang.org/#pasty=pZRgFKQVDnDS"
09:42:49FromDiscord<intellij_gamer> sent a code paste, see https://play.nim-lang.org/#pasty=CoEKHAgxsLLV
09:56:21FromDiscord<sOkam! 🫐> interesting solution
09:57:47FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=CLNLjxXYTruN
09:58:32FromDiscord<Elegantbeef> `var` I assume
10:02:59FromDiscord<sOkam! 🫐> do ref objects need var when passing them?
10:03:14FromDiscord<sOkam! 🫐> also, that didn't fix it for some reason 🤔
10:03:23FromDiscord<sOkam! 🫐> (edit) "them?" => "them as arguments to functions?"
10:03:51FromDiscord<Elegantbeef> If you want to change where the ref points yes
10:03:56FromDiscord<Elegantbeef> If you just want to change the data no
10:04:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=mbBawTbmkRve
10:10:56FromDiscord<sOkam! 🫐> might be that the generic is not accessible in the file? 🤔
10:11:07FromDiscord<sOkam! 🫐> but its `` though...
10:15:18FromDiscord<Elegantbeef> https://wandbox.org/permlink/EYpv6QfPpK86QVJy that also works
10:15:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=suwRdnvPMKlr
10:16:04FromDiscord<Elegantbeef> well fuck
10:24:18FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "The only case this": which one is the intermediate generic? 🤔
10:25:05NimEventerNew Nimble package! selfpipe - Easy safe signal handling, see https://github.com/tdely/selfpipe
10:25:06FromDiscord<Elegantbeef> It'd be the one that calls `height=` if it exists
10:26:07FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "It'd be the one": its not a generic, though. its just a function 🤔
10:27:11FromDiscord<Elegantbeef> You wouldn't lie to me would you?
10:32:55FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=AOvWCPPHnvvz
10:36:09FromDiscord<Elegantbeef> This module has the `height=` in it?
10:36:31FromDiscord<sOkam! 🫐> it imports the file, yeah. but don't know why its not resolving it 🤔
10:36:46FromDiscord<Elegantbeef> `size` is the type you declared?
10:37:37FromDiscord<sOkam! 🫐> oh...↵`draw.nim(27, 37) Error: type mismatch: got 'int32' for 'height(wm.font) + 2' but expected 'u32 = uint32'`
10:37:43FromDiscord<sOkam! 🫐> so... the template was hiding the type error
10:37:53FromDiscord<sOkam! 🫐> changed all to func, and it showed this up
10:38:05FromDiscord<Elegantbeef> Yea stop using template where procs should be 😄
10:38:07FromDiscord<sOkam! 🫐> and this is how I get remembered why I stopped using templates 🙈
10:38:27FromDiscord<Elegantbeef> And with that I go
10:38:36FromDiscord<sOkam! 🫐> why would treeform use templates on vmath for this same usecase?
10:38:49FromDiscord<sOkam! 🫐> I was basically copying his setup
11:56:49*smlckz left #nim (WeeChat 4.1.1)
12:43:53FromDiscord<nikita4437> sent a code paste, see https://play.nim-lang.org/#pasty=AgMHrJcUUybw
12:44:59FromDiscord<djazz> bitsize pragma
12:45:17FromDiscord<djazz> <https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-bitsize-pragma>
12:45:26FromDiscord<nikita4437> thanks!
13:37:09*azimut joined #nim
13:41:09*deadmarshal_ quit (Ping timeout: 272 seconds)
13:47:08*xet7 joined #nim
15:12:55*deadmarshal_ joined #nim
15:27:30*azimut quit (Ping timeout: 260 seconds)
16:06:12*azimut joined #nim
16:08:05*ntat quit (Ping timeout: 272 seconds)
16:10:39*ntat joined #nim
16:28:12FromDiscord<Robyn [She/Her]> Trying to figure out the best way to implement functions on a variety of types that provide the same interface but may have differing functionality
16:28:51FromDiscord<Robyn [She/Her]> Like, some may be implemented as async, some may be implemented using cps
16:28:57FromDiscord<Robyn [She/Her]> Maybe a template?
16:30:04FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=lwCtEVtfxLRv
16:30:40FromDiscord<odexine> "a uint32 rgba color" depends on what format we're talking about?
16:30:51FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=UDzhKgrgPBQg
16:30:56FromDiscord<sOkam! 🫐> In reply to @odexine ""a uint32 rgba color"": whatever X11 uses
16:31:20FromDiscord<sOkam! 🫐> i know color formats make this different, but I just don't know exactly the type expected
16:31:35*disso-peach quit (Quit: Leaving)
16:33:39FromDiscord<odexine> In reply to @heysokam "whatever X11 uses": https://stackoverflow.com/questions/2434511/what-pixel-format-does-x-server-use
16:34:19FromDiscord<odexine> what part of x11 are you interfacing with
16:35:23FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=GJlPCnlIeBiJ
16:36:47FromDiscord<odexine> likely your format should be ARGB -> A shl 24 + R shl 16 + G shl 8 + B
16:38:35FromDiscord<sOkam! 🫐> In reply to @odexine "what part of x11": xcb, currently initalizing the data so I can't see anything on the screen yet
16:38:38FromDiscord<odexine> if youre writing raw bytes, this would be BGRA on little endian and ARGB on big endian
16:39:38FromDiscord<odexine> what part of xcb
16:40:51FromDiscord<sOkam! 🫐> In reply to @odexine "what part of xcb": https://github.com/julian-goldsmith/dwm-xcb/blob/4515e6a70d49c506f6a6547bbcea951d7d40f807/dwm.c#L208
16:41:16FromDiscord<sOkam! 🫐> that is an `uint32_t` value that is listed as `TODO: NOT YET DOCUMENTED` in the xcb docs
16:41:57FromDiscord<sOkam! 🫐> as we have `treeform/chroma` in Nim, I'm just skipping that function altogether, but I still need to produce an `uint32` that is compatible with it
16:48:02FromDiscord<sOkam! 🫐> In reply to @demotomohiro "How about to just": "just display" assumes I have code that renders anything on the screen↵this is before any of that, so very hard to render a color when you don't have anything rendering at all yet
16:50:46FromDiscord<sOkam! 🫐> will trial+error eventually I guess. seems like the only real option 😔
16:53:01FromDiscord<odexine> seems like the case due to the underdocumented api
16:56:40FromDiscord<sOkam! 🫐> yep
17:01:35FromDiscord<sOkam! 🫐> is the address of an array the same as `arr[0].addr`?↵or does it happen like with sequences, that the data has more than the values?
17:21:36*cnx quit (Remote host closed the connection)
17:22:26*cnx joined #nim
17:22:36FromDiscord<m4ul3r> In reply to @heysokam "is the address of": Yeah, the address is described like that
17:23:48FromDiscord<odexine> In reply to @heysokam "is the address of": technically no. arr[0] can be the middle of the array because of custom indexing, so use arr[arr.low].addr
17:25:14FromDiscord<sOkam! 🫐> what i mean is if `arr.addr` is the same as `arr[arr.low].addr`
17:25:51*junaid_ joined #nim
17:26:25FromDiscord<odexine> i believe so yes
17:31:47FromDiscord<sOkam! 🫐> ty
17:37:18FromDiscord<m4ul3r> In reply to @odexine "technically no. arr[0] can": Wait, a[0] could be in the middle with custom indexing?
17:37:35FromDiscord<odexine> `array[-14..15, int]`
17:38:49FromDiscord<m4ul3r> That’s valid? It wouldn’t just make an array with 30 values and index at 0?
17:40:01FromDiscord<odexine> https://media.discordapp.net/attachments/371759389889003532/1213541334590160957/image.png?ex=65f5d970&is=65e36470&hm=57d8803be1b95dbf69f040b8194090891b0ab1df1e9856d8e1346a3425600b3c&
17:40:25FromDiscord<odexine> also why nim uses `^1` for backwards indexing instead of `-1` like some languages do
17:40:40FromDiscord<odexine> well not exactly, but yeah
17:41:19*junaid_ quit (Remote host closed the connection)
17:44:18FromDiscord<fosster> folks, anyone has been using atlas over nimble recently?
17:45:23FromDiscord<graveflo> In reply to @fosster "folks, anyone has been": ya
17:46:08FromDiscord<demotomohiro> In reply to @m4ul3r "That’s valid? It wouldn’t": It is the feature documented on Nim manual:↵https://nim-lang.org/docs/manual.html#types-array-and-sequence-types↵But I dont use array not starting from 0.
17:48:57ehmryfosster: I use atlas as a library over nimble as a library
17:58:59*rockcavera joined #nim
18:01:18*KhazAkar joined #nim
18:08:18FromDiscord<fosster> how is your experience so far↵(@graveflo)
18:11:32FromDiscord<fosster> I'm looking for documentation about the root file, but it seems it doesn't exist
18:11:44FromDiscord<fosster> something like "package.nimble" for nimble
18:12:15FromDiscord<nnsee> In reply to @odexine "": low key cursed
18:12:47FromDiscord<graveflo> In reply to @fosster "how is your experience": It does what it is supposed to do. There have been a few minor quirks, but nothing major. I prefer to use it whenever possible. Nimble is still coupled with several aspects of Nim so it's not easy to just pretend it doesn't exist, but I think that nimscript and some other changes could do away with it in theory. Overall I think it is worth using. I would use atlas and nimscript over nimble
18:15:39FromDiscord<sOkam! 🫐> sent a long message, see https://pasty.ee/VbiudpqjrEbA
18:15:41FromDiscord<graveflo> In reply to @fosster "something like "package.nimble" for": https://github.com/nim-lang/nimble?tab=readme-ov-file#nimble-reference↵Nimble has a nonsensical constraint on how .nimble files work, where the nimble file has to have the correct name, but you are also not allowed to have more than one .nimble file in the directory where it belongs.
18:15:46FromDiscord<sOkam! 🫐> (edit) "https://pasty.ee/OHNFaMBiLCbm" => "https://pasty.ee/RHwykHyHLtdW"
18:15:47FromDiscord<graveflo> but there is the documentation anyway
18:16:16FromDiscord<sOkam! 🫐> yeah, nimble restrictions make little sense, tbh
18:18:24FromDiscord<nnsee> shat about nimph
18:18:29FromDiscord<nnsee> what
18:18:41FromDiscord<graveflo> In reply to @heysokam "@fosster atlas has its": what does nimble make easier than nimscript?
18:18:49FromDiscord<fosster> what you mean by "as a library"↵(<@709044657232936960_ehmry=5b=49=52=43=5d>)
18:18:50FromDiscord<fosster> btw I'm saying this because nimble is giving me an error when it tries to fetch git libraries
18:18:51FromDiscord<fosster> sent a code paste, see https://play.nim-lang.org/#pasty=eKRuEDCZTwYT
18:18:51FromDiscord<fosster> git works fine on my machine, if I do `git clone https://github.com/planetis-m/naylib` works fine
18:19:34FromDiscord<sOkam! 🫐> In reply to @graveflo "what does nimble make": the implicit nimble tasks
18:19:56FromDiscord<fosster> what even is nimscript 😅
18:20:13FromDiscord<sOkam! 🫐> In reply to @fosster "what even is nimscript": the language you have been using inside nimble files!
18:20:23FromDiscord<nnsee> nim, but at runtime
18:20:34FromDiscord<sOkam! 🫐> nimble files are just `.nims` files in disguise
18:21:40FromDiscord<fosster> owww really↵(@sOkam! 🫐)
18:21:45FromDiscord<fosster> so it isn't a nimble config file
18:22:04FromDiscord<sOkam! 🫐> nope, its a programming language
18:22:13FromDiscord<fosster> alright, but so how are you supposed to build packages with atlas?
18:22:27FromDiscord<sOkam! 🫐> `nim c yourfile`
18:22:27FromDiscord<fosster> so I suppose it is also used for other purposes↵(@sOkam! 🫐)
18:22:44FromDiscord<sOkam! 🫐> In reply to @fosster "so I suppose it": any purpose you would use `bash` for, or similar
18:23:28FromDiscord<sOkam! 🫐> but its very limited, there is very little effort put into good and useful tools for it, so it lacks a ton of features and needs to rely on `exec "someNativeCommand"`, which makes it really non-portable
18:24:19FromDiscord<sOkam! 🫐> for simple stuff is amazing, though. anything to get rid of bash syntax
18:24:38FromDiscord<sOkam! 🫐> bash or powershell. they are both equally guilty
18:24:51FromDiscord<nnsee> some background on how .nimble files work in the context of nimscript is detailed here https://peterme.net/how-to-embed-nimscript-into-a-nim-program-embedding-nimscript-pt-2.html
18:25:00FromDiscord<fosster> so basically there is this language called nimscript that runs on top of some sort of vm, and nimble uses it internally with .nimble files
18:25:11FromDiscord<sOkam! 🫐> In reply to @fosster "so basically there is": pretty much
18:25:30FromDiscord<nnsee> "internally" is a bit of a strech but yeah
18:25:38FromDiscord<sOkam! 🫐> it uses the nimvm, which is the same that the compiler uses at compiletime for `static` code
18:25:47FromDiscord<nnsee> stretch, even
18:25:57FromDiscord<nnsee> god i hate the ios keyboard
18:26:03FromDiscord<nnsee> keep making typos
18:26:45FromDiscord<fosster> mh so I suppose this lang was around before nimble
18:26:54FromDiscord<leorize> it didn't come before nimble
18:27:05FromDiscord<sOkam! 🫐> @odexine did anything come out of the nimpretty exploration you did a while back? 🤔
18:27:15FromDiscord<leorize> nimscript come sometimes after and then nimble was modified to use it
18:27:19FromDiscord<leorize> (it's not a good fit, really)
18:27:29FromDiscord<graveflo> I wondered that too. The overall look of things suggested that it didn't. I guess that's suspicion confirmed
18:27:38FromDiscord<odexine> the formatter? not really, its likely better to look into extending nph
18:27:52FromDiscord<sOkam! 🫐> kk ty
18:28:11FromDiscord<fosster> mh interesting
18:28:15FromDiscord<odexine> i'm still going to look into formatting but i dont know, rn my opinion is to look into nph
18:28:57FromDiscord<fosster> so does astlas also use nimscript or something else?
18:29:10FromDiscord<leorize> atlas doesn't use nimscript
18:29:44FromDiscord<nnsee> doesn't atlas just call out nimble for some subcommands
18:29:45FromDiscord<graveflo> imo nimscript, atlas and nimble all need to grow up. Nimscript isn't going anywhere I don't think and I would want atlas to set the heading moving forward not nimble. I like the way atlas does things
18:30:35FromDiscord<graveflo> and by not going anywhere I mean that it's not going to be conceptually replaced anytime soon, I think
18:31:13FromDiscord<leorize> I'd be more interested in nimble moving away from nimscript
18:32:08FromDiscord<graveflo> so the environment constraints should just be structural or are you suggesting a more declarative style configuration?
18:32:26FromDiscord<leorize> yea, something declarative
18:33:10FromDiscord<leorize> it's dumb to require running the compiler just to get some metadata
18:33:25FromDiscord<leorize> fwiw nimble actually supports an ini form
18:33:39FromDiscord<graveflo> I feel like that would just have people using the declarative syntax to bootstrap something like nimscript. In the simple cases not so much, but you can easily get declarative-like syntax with Nim. I'm not sure what the point of dropping the capability would be
18:33:48FromDiscord<leorize> which is the original nimble file form and is what the nimble script produces
18:34:09FromDiscord<leorize> it's not about the syntax
18:34:28FromDiscord<leorize> it's about what tools have to do to consume nimble files
18:34:45FromDiscord<graveflo> actually that does make sense. I guess if you really wanted to avoid that there could be something like an .ini. Almost like how python has it's two styles of setup files
18:35:12FromDiscord<graveflo> I get it. I'll never worry about something my CPU will blast through in a couple microseconds, but that does make sense
18:35:17FromDiscord<sOkam! 🫐> declarative syntax makes buildsystems and their related files a ton more complicated than they need to be
18:35:54FromDiscord<graveflo> I'm exaggerating a bit 😛
18:36:37FromDiscord<graveflo> In reply to @heysokam "declarative syntax makes buildsystems": That's exactly how I feel. I think it would be a mistake to limit the build system to that kind of config, but as long as it's just a simple case there is an argument for it
18:36:48FromDiscord<sOkam! 🫐> I dealt with declarative a lot with scons+cmake+make for an extremely complicated buildsystem that output 70+ different target files↵Moved to imperative, and the complexity went down dramatically
18:37:01FromDiscord<leorize> you know that cmake is nothing declarative, right?
18:37:13FromDiscord<graveflo> cmake is disgustingly awful
18:37:37FromDiscord<sOkam! 🫐> make is not better, and then scons tries to solve that by making the thing declarative... and it does not solve the problem
18:37:48FromDiscord<odexine> tbf something like what, nix, is still kinda complicated, but ig thats just because nix has some... questionable syntax choice
18:37:57FromDiscord<sOkam! 🫐> if anything it makes it more difficult to reason about what the hell will happen and when
18:38:13FromDiscord<sOkam! 🫐> In reply to @odexine "tbf something like what,": whats nix?
18:38:25FromDiscord<odexine> id say both imperative and declarative systems have difficulties in reasoning
18:38:38FromDiscord<odexine> in different ways
18:38:48FromDiscord<leorize> build systems are just hard in general
18:38:52FromDiscord<graveflo> I absolutely love it when CMake generates another CMake file that runs a python script that generates C code and then calls make. It's a beautiful thing
18:39:03FromDiscord<sOkam! 🫐> In reply to @graveflo "I absolutely love it": ⚰️
18:39:24FromDiscord<odexine> In reply to @heysokam "whats nix?": https://nixos.org/ this 😛
18:39:51FromDiscord<sOkam! 🫐> reading that sentence makes me so happy that I wrote confy and I don't have to deal with any of that garbo ever again in my life
18:40:13FromDiscord<sOkam! 🫐> make+cmake literally gave me ptsd lol
18:40:42FromDiscord<odexine> i dont think thats because of it being declarative
18:40:47FromDiscord<odexine> i think thats just cmake
18:40:56FromDiscord<graveflo> yes
18:40:57FromDiscord<sOkam! 🫐> In reply to @odexine "https://nixos.org/ this 😛": oh the OS? i know it, but since we are talking about buildsystems I didn't get how its realted
18:41:01FromDiscord<sOkam! 🫐> (edit) "realted" => "related"
18:41:02FromDiscord<leorize> make is also not that great of a language
18:41:03FromDiscord<odexine> In reply to @heysokam "oh the OS? i": not really
18:41:09FromDiscord<leorize> nix is a build system
18:41:11FromDiscord<odexine> its not just an os
18:41:14FromDiscord<leorize> nixos is an os built with that build system
18:41:29FromDiscord<sOkam! 🫐> huh? you just broke my brain
18:41:32FromDiscord<leorize> nixos is just an application, the real money is in nix
18:41:35FromDiscord<sOkam! 🫐> i guess i have some study to do
18:41:48FromDiscord<odexine> ok so theres a name problem with nix
18:42:14FromDiscord<odexine> nix can refer to the build system, the language, or a third thing i forgot whats mention
18:42:18FromDiscord<odexine> ed mentioned
18:42:26FromDiscord<leorize> build system, language or OS
18:42:29FromDiscord<odexine> so it can get confusing to refer to
18:42:30FromDiscord<leorize> there's like a diagram for it
18:43:10FromDiscord<sOkam! 🫐> i didn't know about this. ty for sharing. looks interesting
18:43:42FromDiscord<odexine> kinda fell out of it because of the language honestly
18:43:53FromDiscord<odexine> not really into guix either
18:44:00FromDiscord<odexine> (another similar syste)
18:44:01FromDiscord<odexine> (edit) "syste)" => "system)"
18:44:11FromDiscord<sOkam! 🫐> In reply to @leorize "make is also not": > ~~make~~ bash is also not a great language↵fixed that for you. every make problem comes from bash, and they just make the problem even worse
18:44:24FromDiscord<odexine> when the shellcheck
18:44:24FromDiscord<leorize> nix is like haskell but with rust syntax \:p
18:44:29FromDiscord<leorize> eh, `.PHONY` is nothing good either
18:44:48FromDiscord<odexine> In reply to @leorize "nix is like haskell": not reallyyyyyyyyyyyy i wouldnt say so
18:44:50FromDiscord<leorize> and don't get me started on deps files
18:45:09FromDiscord<odexine> its more like some weird haskell lisp amalgamation or smth
18:45:12FromDiscord<sOkam! 🫐> thankfully `zig cc` removes the need to ever deal with deps files forever
18:45:31FromDiscord<leorize> these days I use meson + ninja if I could
18:46:27FromDiscord<sOkam! 🫐> i looked into them, but they looked like the same issues are creeping in there too
18:46:36FromDiscord<sOkam! 🫐> better managed, but same issues
18:47:21FromDiscord<leorize> meson doesn't do extensions, at all
18:47:27FromDiscord<graveflo> I just don't understand where it all went wrong. All these languages and bloated tools. Can't we just use general purpose programming languages for general purpose and not do all this overly complicated shit
18:47:41FromDiscord<sOkam! 🫐> scons does a good job at simplifying all of that, but the rigidity of their system and the crappy python stdlib drove me away from them. but they got good ideas
18:47:44FromDiscord<leorize> so it avoided becoming a (bad) scripting language
18:48:06FromDiscord<sOkam! 🫐> In reply to @graveflo "I just don't understand": pretty much
18:48:12FromDiscord<odexine> In reply to @graveflo "I just don't understand": id say its a "general purpose languages may work but arent ideal" kinda things
18:48:14FromDiscord<odexine> (edit) "things" => "thing"
18:48:25FromDiscord<leorize> ninja is really good at building things, and that's what it's for
18:48:54FromDiscord<graveflo> and to make it ideal you get a bloated framework instead of just taking 10% more typing time.. not thinking time.. typing to get this "ideal"
18:49:06FromDiscord<graveflo> just use the general language.. it's easier
18:49:08FromDiscord<sOkam! 🫐> to be fair, I almost fell into the exact same trap myself recently. so i can relate to the problem somewhat↵I was trying to support multiple compilers... and confy was getting bloated by the minute↵remove them all, except for zigcc, and it all went down to normal again
18:50:04FromDiscord<sOkam! 🫐> I figure trying to solve so many compilers and tools in an abstract way is what makes them bloated and over-engineered
18:50:08FromDiscord<odexine> the problem with that is thats how you lose users
18:50:12FromDiscord<leorize> different tools for different problems, really
18:50:20FromDiscord<sOkam! 🫐> as they try to support every potential workflow in existence... and -that- is the issue imo
18:50:21FromDiscord<graveflo> I say ditch the losers
18:50:31FromDiscord<odexine> no comment, up to you
18:50:48FromDiscord<sOkam! 🫐> In reply to @graveflo "I say ditch the": that's just bad UX
18:51:22FromDiscord<sOkam! 🫐> "my users can use my tool, bad for them" is the worst ux mentality possible for making something usable
18:51:29FromDiscord<sOkam! 🫐> (edit) ""my users can use my tool, ... bad" added "too"
18:51:51FromDiscord<sOkam! 🫐> (edit) "can" => "cant"
18:52:01FromDiscord<sOkam! 🫐> fixed typos, sry
18:52:06FromDiscord<graveflo> well if the user is a programmer and the tool is a programming language I would have to discard that principal
18:52:17FromDiscord<leorize> it's not different
18:52:39FromDiscord<sOkam! 🫐> In reply to @graveflo "well if the user": buildsystems surface hits more than programmers
18:52:39FromDiscord<leorize> they might have more knowledge but they're still users
18:53:28FromDiscord<graveflo> well I'm not trying to say that you all are wrong, but always targeting the bottom line of competence is a disaster imo
18:53:39FromDiscord<leorize> users are not this generic group, you shape them according to your actual users
18:53:53FromDiscord<graveflo> plus it's not that hard to imagine that if you are using the language to write the code you can use it to do something else
18:54:05FromDiscord<odexine> i think its just that build systems go too specific and general prog languages are too general, that we havent exactly found the sweet spot between perhaps
18:54:16FromDiscord<graveflo> In reply to @leorize "users are not this": come on. be brave
18:54:28FromDiscord<sOkam! 🫐> In reply to @graveflo "well I'm not trying": its not about a bottom line of competence, its about making something usable↵usability has nothing to do with competence, and everything to do with ergonomics and intuitiveness
18:54:50FromDiscord<leorize> I know who my users are, that's why my vision for build system and package management is the way it is ;)
18:54:56FromDiscord<graveflo> so make the general purpose language usable and ergonomic. To birds one stone.
18:55:08FromDiscord<sOkam! 🫐> that's what nim is
18:55:24FromDiscord<graveflo> I know that's why I'm here
18:55:27FromDiscord<graveflo> 😛
18:55:50FromDiscord<sOkam! 🫐> except then every nim buildsystem insists on using nimscript... and the usability goes out of the window because of nimscript lack of capabilities
18:56:08FromDiscord<graveflo> agreed. Nimscript needs attention
18:56:18FromDiscord<leorize> nimscript is not a configuration language
18:56:20FromDiscord<leorize> and it sure isn't a scripting language
18:56:44FromDiscord<graveflo> I think scripting language doesn't really have a good def... but I can see what you mean
18:57:00FromDiscord<leorize> it has not evolved at all since it's conception (which is to be a configuration language), which tells you how much everyone actually care about it \:p
18:57:25FromDiscord<leorize> actually, it wasn't even meant for configuration, it just happened to fit in as Araq played with making running only the VM a thing
18:58:16FromDiscord<graveflo> I think there is just a lot to do. It's not lack of caring. The fact that nimble is propped up by it is reason enough to assume that it is not forgotten. I imagine it would be better to address nimscript after other things are looked at
18:58:50FromDiscord<leorize> nimble using nimscript is not anything new
18:58:56FromDiscord<sOkam! 🫐> tooling in general is lacking. nimscript just happens to be one more in the list
18:59:05FromDiscord<leorize> it happens around the time nimscript was added
18:59:07FromDiscord<graveflo> that is not discounting the fact that additions could be made to the nimscript module that would be beneficial before then too
18:59:11FromDiscord<leorize> as a form of dogfooding
19:01:18FromDiscord<leorize> and btw if you want a build system, `nake` exists and is actually capable of doing things that only a real program could do
19:01:42FromDiscord<leorize> not that I endorse it, it basically got phased out once nimble gained nimscript
19:01:58FromDiscord<Robyn [She/Her]> I'm debating on if I should try building my chat app using cps rather than async hm...
19:02:05FromDiscord<graveflo> nake looks ugly
19:02:11FromDiscord<Robyn [She/Her]> `Confy` is a buildscript library if wanted
19:02:39FromDiscord<leorize> Robyn\: just build it \:p
19:02:51FromDiscord<Robyn [She/Her]> You import it and then use the tools it provides to do what you need, also means you aren't limited by Nimscript
19:02:56FromDiscord<leorize> but if you want cps help, you'd have to go to cps room because cps devs are not in here
19:03:23FromDiscord<Robyn [She/Her]> In reply to @leorize "Robyn\: just build it": That's what I did multiple times, then I kept restarting because I went in mostly blind-
19:03:29FromDiscord<Robyn [She/Her]> In reply to @leorize "but if you want": Makes sense
19:04:06FromDiscord<leorize> unless you didn't learn a thing everytime you restart, I'd say that it's a normal thing to do
19:05:59FromDiscord<Robyn [She/Her]> Fair enough
19:08:27FromDiscord<leorize> the nice thing about nim syntax is that it won't get in your way, so you can write and throw things away with ease
19:08:30FromDiscord<leorize> putting my cps dev hat on, I'd say write it with cps and keep us updated at https://matrix.to/#/#cps:matrix.org
19:10:04FromDiscord<Chronos& [She/Her]> Exactly why I thought I'd consider cps \:)
19:10:09FromDiscord<sOkam! 🫐> In reply to @leorize "and btw if you": nake is mandatory their rules, or get lost. its the same problem
19:10:27FromDiscord<leorize> that's just what build systems do \:p
19:10:32FromDiscord<sOkam! 🫐> no
19:10:42FromDiscord<sOkam! 🫐> buildsystems should be -libraries- not -binaries-
19:10:47FromDiscord<leorize> personally zig build caught my eye and I'm looking to implement a nim version of it
19:11:01FromDiscord<leorize> it's just semantics, really
19:11:12FromDiscord<sOkam! 🫐> is more than that
19:11:21FromDiscord<graveflo> It's not to me. I agree is sOkam on this one
19:11:33FromDiscord<graveflo> or at least I prefer that mentality
19:11:49FromDiscord<leorize> my vision splits this into two\: the graph and the runner
19:12:00FromDiscord<leorize> have those two pieces and it can be a library or a binary, however you want
19:12:09FromDiscord<sOkam! 🫐> In reply to @leorize "personally zig build caught": it has some really neat ideas. their language is really overcomplicated for buildsystems, so I didn't got with it. but their ideas are super good
19:13:24FromDiscord<leorize> I like my metadata declarative, but build code should be something like zig build
19:14:22FromDiscord<graveflo> that's fair. Once the metadata needs computation to be viable things start to get really messed up anyways
19:14:50FromDiscord<graveflo> or at least you can treat that computation on the other side of the boundary I would hope
19:15:09FromDiscord<leorize> fwiw nake is a library
19:15:16FromDiscord<leorize> the nake executable is nothing but a fancy wrapper for `nim c`
19:15:27FromDiscord<Robyn [She/Her]> > After Nim's update to 0.19.0, the check for NULL values was removed due to the removal of nil.↵Huh...
19:17:27FromDiscord<leorize> what a weird sentence \:p
19:18:16FromDiscord<Robyn [She/Her]> Nim removed `nil` at one point?
19:18:46FromDiscord<leorize> never
19:18:54FromDiscord<leorize> where did you find that one?
19:18:57FromDiscord<Robyn [She/Her]> Then that makes no sense at all
19:19:06FromDiscord<Robyn [She/Her]> https://nimble.directory/pkg/sqlbuilder
19:19:35FromDiscord<leorize> ah, they meant the `seq` and `string` change
19:19:42FromDiscord<leorize> those used to be nil-able
19:19:46FromDiscord<Robyn [She/Her]> Aah
19:20:39FromDiscord<leorize> I'm still sad that ormin is dead
19:22:14FromDiscord<Robyn [She/Her]> Fair, I did see that
19:26:04FromDiscord<m4ul3r> In reply to @demotomohiro "It is the feature": I am the same way, i've never not started an array at 0 ↵↵I don't program in matlab 😂
19:26:19FromDiscord<m4ul3r> But it's cool that there's flexibility for that
19:45:25*deadmarshal_ quit (Ping timeout: 264 seconds)
19:48:59FromDiscord<morgan> so im wrapping the clap api headers, and i have ptr openarray of cstring in a struct i'm declaring. how do i declare all the cstrings to pass into it? i've tried stuff with casting and keep getting errors
19:53:12FromDiscord<demotomohiro> In reply to @morganalyssa "so im wrapping the": https://nim-lang.org/docs/system.html#allocCStringArray%2CopenArray%5Bstring%5D↵I don't know if this proc works for your case.
19:53:21FromDiscord<morgan> thanks ill take a look
19:54:59FromDiscord<morgan> ok i think that should work
19:55:34FromDiscord<morgan> cstringarray becomes `char`, and the header uses `const char const `
20:13:07*deadmarshal_ joined #nim
20:22:16*tc424 quit (Ping timeout: 246 seconds)
20:30:08FromDiscord<Robyn [She/Her]> Struggling on figuring out how to better structure my code, since there's an async variation (and a cps variation when I implement it)
20:30:18FromDiscord<Robyn [She/Her]> Painful, honestly
20:30:28FromDiscord<Robyn [She/Her]> Wait actually, not an issue I think
20:30:46FromDiscord<Robyn [She/Her]> Probably not an issue, at least
20:31:00FromDiscord<Robyn [She/Her]> Async functions must return futures, and cps functions return `Continuations` so
20:41:31FromDiscord<Robyn [She/Her]> Is `testRequires` a thing for Nimble?
20:43:04FromDiscord<Robyn [She/Her]> Also, would it be a good idea to use concepts for representing a future and continuation?
20:44:39*ntat quit (Quit: Leaving)
20:52:44*tc424 joined #nim
21:00:25*tc424 quit (Ping timeout: 264 seconds)
21:09:48*tc424 joined #nim
21:15:16FromDiscord<morgan> In reply to @morganalyssa "ok i think that": seems to work, i can set it and echo it back out, tho hopefully that means other stuff will work with it fine
21:21:17FromDiscord<aintea> Are there already implemented data structures in nim ? For example if I want to use a Stack ?
21:23:50Zevvfor a stack a seq is sufficient
21:24:26FromDiscord<leorize> Robyn\: cps functions return the return type
21:24:39FromDiscord<leorize> we don't have async's future return requirement
21:24:51FromDiscord<aintea> But I need to pop and push frequently, isn't a seq comparable to a vector in c++ or a list in python?
21:25:37FromDiscord<Robyn [She/Her]> In reply to @leorize "Robyn\: cps functions return": Ah
21:25:52FromDiscord<Robyn [She/Her]> Might be an issue for me then
21:26:24FromDiscord<leorize> cps is nowhere close to asyncdispatch
21:26:28FromDiscord<Robyn [She/Her]> Eh, might just duplicate the code then
21:26:33FromDiscord<leorize> you won't be able to shim in a way that it works with both \:p
21:26:46FromDiscord<nnsee> isn't it just conceptually different
21:26:58FromDiscord<leorize> you can invent an asyncdispatch shim for cps, though
21:27:15Zevvaintea: well what do you expect from a stack, alloc wise. i do it like this to avoid resizing the underlying storage too often, but this will not free popped element memory: https://github.com/zevv/npeg/blob/master/src/npeg/stack.nim
21:27:34FromDiscord<Robyn [She/Her]> In reply to @leorize "you won't be able": Yeah I know, I was gonna make multiple concepts for async, cps and sync
21:28:05FromDiscord<leorize> you can try to separate i/o from your protocol state machine
21:28:10FromDiscord<leorize> then it doesn't matter what do IO
21:28:30FromDiscord<leorize> basically something in the spirit of https://sans-io.readthedocs.io/
21:30:35FromDiscord<Robyn [She/Her]> I was trying to do that, but I wanted to implement the functions on a type so it'd be cleaner, but I guess I could avoid that
21:30:47FromDiscord<Robyn [She/Her]> To be fair, my library is already very suited for that
21:31:43FromDiscord<Robyn [She/Her]> Since I use a `Buffer` type for everything (excluding the initial packet data, which I why I wanted to implement the bare minimum for that)
21:31:54Zevvthats a nice fit for the cps stream stuff we're working on. protocols just read and write from and to the lower and higher level streams and dont do io themselves
21:32:26FromDiscord<Robyn [She/Her]> cps stream?
21:32:59FromDiscord<leorize> if your type emits Future anywhere, it's not I/O independent \:p
21:33:55FromDiscord<leorize> if you want a `sans-io` thing, it must not touch any I/O related structures \:p
21:34:02Zevvyeah some toy experiments im working on. abstrct stream type that implements your baisc read and write, that composes very nicely. the poc has some stuff like http chunked, tls, websocket. you stack em like legos
21:35:42Zevvthats the idea, anyway
22:01:06*krux02 joined #nim
22:06:32FromDiscord<Robyn [She/Her]> Reading through the sans-io site rn, but struggling to see how I'd do that in a way compatible with the VarInt type since it's not doable without being able to read from the socket
22:16:01FromDiscord<Elegantbeef> Well my brief reading seems to imply it just reads the data into a buffer and you operate from that
22:16:19FromDiscord<Elegantbeef> https://sans-io.readthedocs.io/how-to-sans-io.html#how-to-write-i-o-free-protocol-implementations
22:16:44FromDiscord<Robyn [She/Her]> You can't read the data into a buffer if you don't know how much of it you need, though?
22:16:50FromDiscord<Elegantbeef> You peek
22:17:10FromDiscord<Elegantbeef> You peek the amount of data you most need
22:17:24FromDiscord<Robyn [She/Her]> Wdym?
22:17:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=OQDmeXQXIjtg
22:17:44FromDiscord<Elegantbeef> Here is an implementation I recently wrote for leb128 var ints
22:18:02FromDiscord<Elegantbeef> Under the condition of `Peek` I peek 10 bytes off the buffer
22:18:29FromDiscord<Elegantbeef> But otherwise I just read the bytes sequentially as it's a buffer that knows it's position
22:18:49FromDiscord<Robyn [She/Her]> I already have an implementation, but how am I supposed to get the data from the socket without knowing how much data I'm reading from the socket
22:18:54FromDiscord<Elegantbeef> I could be wrong but sans-io seems not too disimilar to having a string stream inbetween your IO and your user code
22:19:05FromDiscord<Robyn [She/Her]> Unless you're suggesting to make a custom stream for socket ops
22:19:49FromDiscord<Elegantbeef> sent a long message, see https://pasty.ee/QmGnKogCppRy
22:21:26FromDiscord<Robyn [She/Her]> `receive_bytes` seems like it'd work weirdly, unless in Nim I'd make that using a callback or something that the user would supply?
22:23:40FromDiscord<Elegantbeef> > The major abstraction used by most of the sans-IO protocol stacks is to translate the bytes received from the network into “events”. Essentially, this abstraction defines a network protocol as a serialization mechanism for a sequence of semantic “events” that can occur on that protocol.
22:24:13FromDiscord<Elegantbeef> So in Nim that'd actually be better represented as a `array[EventEnum, proc(bytes: seq[int]): int]`
22:24:54FromDiscord<Elegantbeef> Where you grab the event ID then call the corresponding proc
22:25:31FromDiscord<Robyn [She/Her]> Huh?
22:25:48FromDiscord<Robyn [She/Her]> That makes no sense to me
22:26:10FromDiscord<Elegantbeef> Ok let's imagine a small chat client
22:26:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=sysicKjjiVvs
22:28:56FromDiscord<Robyn [She/Her]> Okay
22:33:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=AgaZmiSEOdNI
22:33:17FromDiscord<Elegantbeef> There we go we just made a sans-io chat client to the best of my understanding of it
22:34:10FromDiscord<Robyn [She/Her]> `.extract` is a thing??
22:34:15FromDiscord<Elegantbeef> No
22:34:18FromDiscord<leorize> look at their http 1.1 library to see how data could flow
22:34:25FromDiscord<Elegantbeef> Draw the rest of the owl
22:34:43FromDiscord<Elegantbeef> I'd be better to use a stringstream instead of `openArray[byte]` probably
22:34:44FromDiscord<leorize> the idea with sans io is inversion of control
22:34:48FromDiscord<Elegantbeef> It'd\
22:35:05FromDiscord<leorize> you don't control data going in, the user does
22:36:02FromDiscord<Elegantbeef> Is my example sufficiently sans-io'd? 😄
22:38:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=YSEuGaDJqPJs
22:39:55FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=LaUzOmCBHMqV
22:40:21FromDiscord<sOkam! 🫐> never done vtables before in Nim, so its probably something silly/simple
22:40:39FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Also robyn it's quite": Ah sweet, will keep for future reference :P
22:41:33FromDiscord<Elegantbeef> Or import constchar and use that instead of `cstring`
22:41:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=LorvInZUukoY
22:41:40FromDiscord<Elegantbeef> What is it again `type ConstChar {.importc: "const char".} = char`?
22:42:10FromDiscord<sOkam! 🫐> the proc is what confused me
22:42:27FromDiscord<sOkam! 🫐> the cstring can be just string and converted oinly when passing it to C
22:42:37FromDiscord<sOkam! 🫐> ty
22:44:04FromDiscord<sOkam! 🫐> is the `cdecl` needed for nim procs?
22:44:27FromDiscord<Elegantbeef> It's needed for C interop if you want to ensure compatibillity
22:44:30FromDiscord<sOkam! 🫐> I figure its only required for passing the proc to C for interop, or when mapping C procs, and its not needed for native proc?
22:44:41FromDiscord<Elegantbeef> I'd use `{.nimcall.}` otherwise
22:44:44FromDiscord<Elegantbeef> Unless you want a closure
22:44:51FromDiscord<sOkam! 🫐> is nimcall default?
22:45:09FromDiscord<Elegantbeef> For top level procedures but not for type definitions
22:45:18FromDiscord<sOkam! 🫐> kk ty
22:46:32FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=HhAESIIKYFVz
22:47:14FromDiscord<Elegantbeef> Sure
22:57:13FromDiscord<TӨMΛ ☠> In reply to @heysokam "you can use streams": `treeform/binny` is repo? Couldn't find it unfortunately :<
22:57:29FromDiscord<Elegantbeef> It's in flatty iirc
22:59:10FromDiscord<TӨMΛ ☠> Oh, I see. Still does feel pretty hard to parse for my brain, but should be helpful, thank you ✨
23:00:25*advesperacit quit ()
23:00:40FromDiscord<Elegantbeef> Eh you generally will want something more like `std/streams`' stringstream
23:02:37FromDiscord<sOkam! 🫐> In reply to @toma400 "`treeform/binny` is repo? Couldn't": its part of flatty, yep
23:02:58FromDiscord<sOkam! 🫐> what are you trying to do exactly, toma?
23:03:07FromDiscord<TӨMΛ ☠> In reply to @Elegantbeef "Eh you generally will": Yeah, this I have already, it's just me trying to consider how to make parser procedure and segment all bytes into respective portions↵I'm like, learning whole new topic from praxis and failing
23:03:41FromDiscord<TӨMΛ ☠> In reply to @heysokam "what are you trying": I wanted to make parser for binary files used for Morrowind modding, but in the same time I realised I need to learn about binary files in general 😄
23:04:10FromDiscord<Elegantbeef> Heh coincidentally I just designed my own silly binary format
23:04:12FromDiscord<TӨMΛ ☠> Can't find good resources that would tell me anything more but basics though
23:04:19FromDiscord<TӨMΛ ☠> (edit) "Can't find good resources that would tell me anything more but ... basics" added "extreme"
23:05:19FromDiscord<sOkam! 🫐> In reply to @toma400 "Can't find good resources": that's because binary files are wildly different depending on the file
23:05:25FromDiscord<sOkam! 🫐> you need to find the spec of that file format
23:05:57FromDiscord<sOkam! 🫐> @TӨMΛ ☠ example: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#glb-file-format-specification-structure
23:06:17FromDiscord<sOkam! 🫐> without a spec, you are pretty much blind on what the 00010010 represent
23:06:26FromDiscord<sOkam! 🫐> which is essentially reverse engineering
23:06:29*om3ga quit (Ping timeout: 240 seconds)
23:06:33FromDiscord<sOkam! 🫐> (edit) "which is essentially ... reverse" added "the definition of"
23:07:09FromDiscord<Elegantbeef> Mod communities generally are nice and will write down their breakdown of binary formats
23:07:34FromDiscord<sOkam! 🫐> so, in short, find the spec of the file and then read it with binny or any other method whatever. the important part is knowing the structure of the file, otherwise there is no way to interpret it
23:09:05FromDiscord<TӨMΛ ☠> sent a long message, see https://pasty.ee/MWaceZNFecEu
23:09:21FromDiscord<TӨMΛ ☠> In reply to @heysokam "without a spec, you": As for spec, yeah, I think (?) I found it, it's very neatly written on UESP page
23:10:03FromDiscord<TӨMΛ ☠> (edit) "very" => "[very" | "page" => "page](<https://en.uesp.net/wiki/Morrowind_Mod:Mod_File_Format>)"
23:11:54FromDiscord<TӨMΛ ☠> In reply to @heysokam "<@656540400546480128> example: https://registry.khr": This looks very promising, thank you for the link ❤️
23:12:34FromDiscord<sOkam! 🫐> In reply to @toma400 "This looks very promising,": you have a reference on how I implemented that `glb` format in `ngltf` if you need it
23:12:43FromDiscord<sOkam! 🫐> but the essence is what that gltf represents
23:13:19FromDiscord<sOkam! 🫐> they give you a header structure, with sizes and types contained in those bytes, and then you write a converter to turn the bytebufffer (aka string) into proper nim types
23:13:24FromDiscord<Elegantbeef> I do have that aforementioned binary format as well if you want something that is spec less 😄
23:15:18FromDiscord<sOkam! 🫐> In reply to @toma400 "Yeah, I understood that": as for `'this is how you parse`.... you don't parse binaries at all. parsing is a very different concept↵what you do is you cast a certain number of `char` bytes into their respective `uint32` or whatever other type, based on the size that the spec tells you they represent
23:15:41FromDiscord<sOkam! 🫐> (edit) "cast" => "`cast[T]` or `memcpy`"
23:15:51FromDiscord<Elegantbeef> I mean that's wrongish
23:16:00FromDiscord<Elegantbeef> Converting a binary format to something usable is parsing
23:16:15FromDiscord<sOkam! 🫐> want me to go again into the "complicate it as much as you want, but it wont make it easier for him to first grasp simply"?
23:16:22FromDiscord<sOkam! 🫐> im using simple language, beef
23:18:04FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "Converting a binary format": technically yes. but parsing, in simple terms, is going character by character and doing something different based on what that character contains. but that's not how you handle binary files in practice, even if the technical result is the same, as you would memcpy instead of interpreting char by char (each char isolated is nothing, as you know)
23:18:23FromDiscord<sOkam! 🫐> (edit) "In reply to @Elegantbeef "Converting a binary format": technically yes. but parsing, in simple terms, is going character by character and doing something different based on what that character contains. but that's not how you handle binary files in practice, even if the technical result is the same, as you would memcpy ... instead" added "a chunk of chars"
23:18:47FromDiscord<Elegantbeef> Depends on the binary format many are pretty much state machines that you then extract data from
23:23:35FromDiscord<TӨMΛ ☠> I think I understand the subtle difference, may be the cause of me trying to first save all the file, convert its entire string to bytes and then going few bytes each to distribute it along struct I would fill data in... which begs the question, I do not necessarily need to cast during stream, I just need to know how many bytes I need to use and to what type I want to cast them into?
23:24:05FromDiscord<TӨMΛ ☠> sent a code paste, see https://play.nim-lang.org/#pasty=JmTBcMfaHYPo
23:24:11FromDiscord<Elegantbeef> It wholly depends on the binary format
23:24:11FromDiscord<Elegantbeef> There are many different ways to encode an integer in binary
23:24:25FromDiscord<Elegantbeef> A Nim string is a `seq[byte]`
23:24:33FromDiscord<Elegantbeef> In Nim `char` is a distinct `uint8`
23:25:58FromDiscord<TӨMΛ ☠> Oh, so I should treat each `char` of that string as `byte`? (sorry if I understood it wrongly)
23:26:08FromDiscord<TӨMΛ ☠> (edit) "Oh, so ... I" added "should" | removed "should"
23:26:45FromDiscord<Elegantbeef> They're the same thing
23:26:47FromDiscord<Elegantbeef> Both are 8bit data types
23:27:02FromDiscord<Elegantbeef> They're only different to the type system
23:27:28FromDiscord<sOkam! 🫐> In reply to @toma400 "I think I understand": a string is made of bytes
23:27:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=WcwFnJAVKJxU
23:27:37FromDiscord<sOkam! 🫐> (edit) "bytes" => "bytes↵you don't need to convert anything"
23:27:44FromDiscord<Elegantbeef> Whoops
23:27:55FromDiscord<Elegantbeef> `[1u8, 2, 3, 4]`\
23:29:12FromDiscord<sOkam! 🫐> In reply to @toma400 "If the above is": `string is seq[byte] and string is seq[char] and string is seq[uint8]`
23:29:35FromDiscord<sOkam! 🫐> (edit) "In reply to @toma400 "If the above is": `string is seq[byte] and string is seq[char] and string is seq[uint8]`" => "sent a code paste, see https://play.nim-lang.org/#pasty=cvLBCNSOwJIi"
23:29:51FromDiscord<Elegantbeef> Uhhh
23:29:51FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#pasty=xIRvaeyYzEcq" => "https://play.nim-lang.org/#pasty=uKxexIYiTrMs"
23:30:07FromDiscord<sOkam! 🫐> well it probably wont because of types
23:30:18FromDiscord<sOkam! 🫐> but hopefully you get the idea
23:30:49FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#pasty=jmcQbIUukLDb" => "https://play.nim-lang.org/#pasty=EMcfzISQZKEB"
23:34:50FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=ebBXRLExVXRd
23:35:10FromDiscord<morgan> sent a long message, see https://pasty.ee/DacsRNBYYvwC
23:35:41FromDiscord<morgan> (edit) "https://pasty.ee/PpaGctsSrmWI" => "https://pasty.ee/byoLRqkOpdmd"
23:35:57FromDiscord<sOkam! 🫐> In reply to @morganalyssa "i decided to not": yeah wrappers are always work-in-progress, sadly. but imagine the work if you did all of that manually ⚰️
23:36:19FromDiscord<morgan> yeah im really glad futhark exists
23:37:43FromDiscord<morgan> the thing that made me decide to not bother with cplug, is it uses objc for au and mac standalone, and i'm pretty sure that's not necessary, but im not smart enough on that to figure out how to work around it. so im gonna rely on the official clap wrappers to handle au and vst3. i don't have a need for standalone builds other than it would be nice to have for testing
23:38:30FromDiscord<sOkam! 🫐> In reply to @morganalyssa "the thing that made": if the mac code deals with mac system functions directly, then it probably is necessary
23:38:37FromDiscord<morgan> eventually it would be cool to figure out direct api stuff for auv2/3 and vst3 and write a library over clap and those and maybe even standalone, but that
23:38:44FromDiscord<morgan> (edit) "that" => "that's for future me lol"
23:38:50FromDiscord<sOkam! 🫐> I had to do some objc crap too when wrapping wgpu because it had to get some objc-exclusive data from metal
23:39:10FromDiscord<TӨMΛ ☠> I'm beyond thankful to you guys, @sOkam! 🫐 and @ElegantBeef, I actually "parsed" first four bytes (/chars) into working data 🥳
23:39:21FromDiscord<TӨMΛ ☠> Thanks once again for help, you are amazing ❤️
23:39:49FromDiscord<sOkam! 🫐> big recommend treeform/binny. itsreally invaluable for that stuff
23:40:12FromDiscord<sOkam! 🫐> eventually you can probably get the couple of functions that you actually use, but in the meantime its really useful to have
23:40:17FromDiscord<morgan> In reply to @heysokam "if the mac code": i didn't go looking but sokol could make a standalone window just fine, and it really seems like the daw should handle opening the window and just give the plugin the handle, and thus the daw would have that direct objc interaction, but again im not smart enough on that stuff so i decided it was easier to just avoid that
23:40:29FromDiscord<morgan> (edit) "In reply to @heysokam "if the mac code": i didn't go looking but sokol ... could" added "(just c headers)"
23:41:25FromDiscord<Elegantbeef> Toma you should get comfortable with bitwise operations and thinking at that level it'll help quite a bit
23:41:40FromDiscord<sOkam! 🫐> In reply to @morganalyssa "i didn't go looking": reference: https://github.com/heysokam/nglfw/blob/776101ea2979444b57ea0c8320d23d67f23cf73a/src/nglfw/metal_glue.m#L13-L20
23:41:48FromDiscord<morgan> In reply to @morganalyssa "eventually it would be": the only like abstraction layer thing i do have planned is something to handle a tree of callbacks and info to decide which branch, to process mouse and keyboard interactions into doing stuff
23:41:51FromDiscord<sOkam! 🫐> I had to do objc for opening a window
23:41:56FromDiscord<sOkam! 🫐> (edit) "I had to do objc for opening a ... window" added "native"
23:41:56FromDiscord<Elegantbeef> I challenge you to extract the sign of any signed integer only using bitwise ops
23:43:04FromDiscord<TӨMΛ ☠> In reply to @Elegantbeef "Toma you should get": If you'd have any helpful resources, I'd love to read them! I will happily learn more about that, I always wanted to eventually learn all those basics and dive deeper ^^
23:43:35FromDiscord<TӨMΛ ☠> In reply to @heysokam "big recommend treeform/binny. itsreally": Yeah, I used exactly its `readStr`! It's indeed great, as everything from our dear treeform ❤️
23:44:54FromDiscord<morgan> In reply to @heysokam "reference: https://github.com/heysokam/nglfw/blob/7": i looked into it a little and it seems like there's something with objc_msgsend that miiiiiight be possible to do from plain c but i didnt get very far on that
23:45:25FromDiscord<Elegantbeef> Pretty much any documentation about bitwise will suffice
23:45:42FromDiscord<Elegantbeef> I've mostly learned everything through pressure to my face to screen
23:45:57FromDiscord<Elegantbeef> So I don't have many good resources on anything
23:47:34FromDiscord<sOkam! 🫐> In reply to @toma400 "If you'd have any": sent a really handy link on dm
23:52:34FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=kslDgzUOscvM As I cleaned it up and documented it here's that aforementioned binary format you can also use as a reference 😄
23:53:22FromDiscord<TӨMΛ ☠> Thank you! Will give it a look tomorrow as well ^^
23:53:54FromDiscord<Elegantbeef> It's a bit much so might not be the easiest toconsume
23:54:04FromDiscord<Elegantbeef> But you can always run it then use `hexdump -C` on the files it makes 😄
23:54:31FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1213635583860019220/image.png?ex=65f63137&is=65e3bc37&hm=4dd3d5e1c24dd4fd492820723fed305e82cb6d124cfbb938c69c214fe35a1965&
23:54:33FromDiscord<Elegantbeef> How hard could it be to understand! 😄