<< 12-06-2024 >>

00:12:00*derpydoo joined #nim
00:13:45FromDiscord<threefour> In reply to @riku5543 "Honestly the only problem": The home key returns you to the top
00:15:00FromDiscord<riku5543> That's good to know lmao
01:29:55FromDiscord<double_spiral> uhm https://media.discordapp.net/attachments/371759389889003532/1250260760660283492/Untitled.png?ex=666a4b92&is=6668fa12&hm=a9553c2c8f13cdc73258a2b04f236a50513457d1b2af1ae512336c9b11b0aa9f&
01:40:16*rockcavera quit (Remote host closed the connection)
01:40:40FromDiscord<riku5543> If you're using vscode extensions it likes to spawn 1000 copies of nimsuggest
01:43:02*rockcavera joined #nim
01:58:39FromDiscord<kots> If you're using choosenim and nimlangserver, it's probably this: https://github.com/dom96/choosenim/issues/339
02:26:39FromDiscord<albassort> When did we destroy tainted strings and why
02:27:00FromDiscord<ElegantBeef> Years ago, bad UX
02:27:13FromDiscord<albassort> I know we did years ago but I just don't know exactly when I stopped having to deal with them
02:27:33FromDiscord<albassort> I do agree though, more than two different kinds of strings is a bit silly because you never know the context
02:30:11FromDiscord<ElegantBeef> Well it was more of a noob trap
02:33:17*beholders_eye quit (Read error: Connection reset by peer)
02:38:46*beholders_eye joined #nim
02:51:41*beholders_eye quit (Read error: Connection reset by peer)
03:00:59*krux02 quit (Ping timeout: 268 seconds)
04:46:49FromDiscord<Phil> What a kind way to say that it'd absolutely screw me over
04:46:56FromDiscord<Phil> (edit) "What" => "That is"
05:02:28FromDiscord<albassort> internally they're refereed to as "Phil traps"
05:33:09*redj quit (Quit: No Ping reply in 180 seconds.)
05:33:17*ntat joined #nim
05:35:02*redj joined #nim
05:57:41*PMunch joined #nim
05:58:31*tiorock joined #nim
05:58:31*rockcavera is now known as Guest5394
05:58:31*Guest5394 quit (Killed (iridium.libera.chat (Nickname regained by services)))
05:58:31*tiorock is now known as rockcavera
06:02:09FromDiscord<nnsee> In reply to @riku5543 "Honestly the only problem": 🥲 when did we stop teaching people what the buttons on keyboards do
06:02:42FromDiscord<nnsee> (no offense to you personally)
06:03:21FromDiscord<riku5543> Eh I mostly only use the mouse in a web browser so I didn't really know the shortcuts besides tab for navigation and space for selection. (And stuff like open tab, close tab, close browser)
06:03:33FromDiscord<nnsee> well it's not really a shortcut
06:03:41FromDiscord<nnsee> it's a dedicated button with a single purpose
06:03:57FromDiscord<nnsee> there's actually two of those buttons on your keyboard! (if you use a full size keyboard)
06:04:15FromDiscord<nnsee> numpad 7 with numlock off also acts as `home`
06:04:20FromDiscord<riku5543> Also the home and end keys are a little inaccessible on this laptop \:P They're on the keypad at least but it's unlabelled so I haven't developed the muscle memory for them yet
06:04:31FromDiscord<nnsee> that's fair
06:05:44FromDiscord<riku5543> (It's normally on the same row as the function keys which is atrocious) So I had to unlearn using them for programming and stuff but now I wanna get the muscle memory back using the keypad cause I really miss it haha. Oh and also, page up and page down are right next to the up arrow key 🥲
06:06:04FromDiscord<riku5543> (((Really funny in a terminal)))
06:07:51FromDiscord<nnsee> i had a laptop with that layout, i low-key kind of preferred it actually
06:16:26FromDiscord<odexine> “Haha, low key”
06:32:41FromDiscord<nnsee> damn it Rika
06:32:45FromDiscord<nnsee> stop being funny
06:36:52*rockcavera quit (Remote host closed the connection)
06:42:28*jjido joined #nim
07:09:53FromDiscord<wannabelokesh> what are the possible values for `nim -d` and what exactly does it do?
07:10:07*ntat quit (Quit: Leaving)
07:17:32FromDiscord<riku5543> You can control specific nim features with it, like compiling the binary in release mode or including ssl support. I don't know every option for it though
07:21:24FromDiscord<riku5543> https://media.discordapp.net/attachments/371759389889003532/1250349218489434152/image.png?ex=666a9df4&is=66694c74&hm=3832b86d0644c06405166485af12ef518b2ea665f4a4eb4d1dbaec53f3341fd7&
07:21:38FromDiscord<riku5543> I found this table [here](https://nim-lang.org/docs/nimc.html) that shows them
07:30:27*derpydoo quit (Ping timeout: 252 seconds)
07:33:32FromDiscord<wannabelokesh> Thanks.
07:40:08*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
07:46:18*sadome joined #nim
07:46:18*sadome quit (Changing host)
07:46:18*sadome joined #nim
07:46:19*sadome quit (Excess Flood)
07:50:02FromDiscord<albassort> What happens if segfault while -d:noSignalHandler
07:51:21FromDiscord<albassort> In reply to @wannabelokesh "Thanks.": there are infinite options. -d: is not compiler implemented, so they can be arbitrary. You can detect them using if defined("")
07:51:38FromDiscord<albassort> (edit) "In reply to @wannabelokesh "Thanks.": there are infinite options. -d: is not compiler implemented, so they can be arbitrary. You can detect them using if defined("")" => "sent a code paste, see https://play.nim-lang.org/#pasty=GYcRjaFf"
07:52:24FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=OoBbjPhK
07:52:31FromDiscord<albassort> (edit) "https://play.nim-lang.org/#pasty=OQeTFanG" => "https://play.nim-lang.org/#pasty=bkDTjEGq"
07:52:39FromDiscord<albassort> (edit) "https://play.nim-lang.org/#pasty=CHFUzAPX" => "https://play.nim-lang.org/#pasty=ziMSkyvd"
07:53:37FromDiscord<albassort> sorry it doesn't take a string variable
07:53:46FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=ckKCOqgM
07:53:52FromDiscord<albassort> this is how you do it properly
07:54:06FromDiscord<albassort> and this would check if you compiled with↵-d:js
07:54:46FromDiscord<zumi.dxy> In reply to @albassort "What happens if segfault": well you get the default signal handler↵instead of `(Attempt to read from nil?)` you get `(Core dumped)`
08:17:09*spine-o-saurus joined #nim
08:19:20FromDiscord<pmunch> For some reason the IRC bridge sent your message to the #offtopic room @wannabelokesh, so I answered with some more details there
08:21:04*gst joined #nim
08:21:27FromDiscord<albassort> sent a long message, see https://pasty.ee/iePMoRKr
08:28:31FromDiscord<wannabelokesh> In reply to @pmunch "For some reason the": Hey, sorry my previous question was a little misguiding. I apologize, didn't mean to waste your time. ↵I just wanted to see if it doesn't do something global with the flag -d. ↵I'm not learning tooling thing. Before that (detailed in off-topic) I was only doing `compile -r` .
08:28:44FromDiscord<wannabelokesh> (edit) "thing." => "thing for now."
08:29:23FromDiscord<albassort> well, i figured. I just thought more context would help
08:29:38FromDiscord<wannabelokesh> In reply to @albassort "there are infinite options.": i don't understand "inifite options" thing
08:30:03FromDiscord<albassort> its arbitrary, you can put anything in -d: and you can check for it yourself
08:30:15FromDiscord<albassort> meaning, if your code calls for a compile time options, you can use -d: for it
08:30:35FromDiscord<albassort> so getting a table of options might appear useful, but its a case by case basis for each module
08:31:27*spine-o-saurus quit (Ping timeout: 264 seconds)
08:32:40FromDiscord<wannabelokesh> In reply to @albassort "its arbitrary, you can": is it something like ↵ifdef and ifndef in c?
08:33:00FromDiscord<albassort> I've never worked with large C projects so idk
08:33:03FromDiscord<albassort> i assume so
08:33:16FromDiscord<wannabelokesh> no it's basic c, frankly saying.
08:33:42FromDiscord<albassort> by which i meant, my c has only ever been a part of another language's code
08:36:13FromDiscord<nnsee> In reply to @wannabelokesh "is it something like": nim's ifdef is `when defined(whatever): echo "i'm defined!"`
08:36:31FromDiscord<nnsee> and yeah `-d` functions with that
08:38:40FromDiscord<wannabelokesh> sorry I'm personally a C lover, but I don't wanna write C yet. I am too much amazed by systems programming. That's why I wanted to try out Nim. Rust is overhyped, no, I'll definitely do rust, but not currently. I wanna independent kernel things but not in c/cpp, idk it can be stupid idea.
08:39:01FromDiscord<wannabelokesh> (edit) "sorry I'm personally a C lover, but I don't wanna write ... C" added "(professional)"
08:39:29FromDiscord<wannabelokesh> In reply to @nnsee "nim's ifdef is `when": okay, I guess I guessed right..
08:40:43FromDiscord<albassort> In reply to @wannabelokesh "sorry I'm personally a": Hmm. Well. C will get you as far as your knowledge of engineering will take you, generally speaking. I do like C but I feel if you cost benefit the time you spend making sure everything is alright then it doesn't make much sense to use compared to Rust/Nim
08:41:25FromDiscord<albassort> C also I feel gives you the illusion of infinite support dating back 50 years but in reality code can be so archaic its not worth using.
08:41:38FromDiscord<albassort> (edit) "C also I feel gives you the illusion of infinite support dating back 50 years but in reality code can be so archaic ... its" added "/ dangerous (because C is very easy to mess up)"
08:42:56FromDiscord<albassort> I like C conceptually more than rust I think though.
08:43:14*spine-o-saurus joined #nim
08:43:16FromDiscord<wannabelokesh> with great powers, come great responsibilities (which not everyone can handle.. I guess)
08:43:34FromDiscord<wannabelokesh> In reply to @albassort "I like C conceptually": conceptually...
08:43:48FromDiscord<albassort> It's a matter of practicality and productivity and eventually this becomes important to you lol
08:43:55FromDiscord<albassort> I'm not sure when it happened though for me
08:44:42FromDiscord<albassort> It's why things like C++ beat out C in the professional world, even though it's a mess it's a less dangerous mess and slightly more productive
10:05:25*spine-o-saurus quit (Quit: snakeeyes!)
10:10:41*gst quit (Quit: Client closed)
10:27:32NimEventerNew Nimble package! libcapstone - Futhark generated wrapper around libcapstone, see https://github.com/m4ul3r/libcapstone-nim
10:28:18*beholders_eye joined #nim
10:31:09FromDiscord<fabric.input_output> how do I set flags for nimble in a project?
10:31:34FromDiscord<fabric.input_output> doing `--define:"mingw"` in the `config.nims` doesn't make `nimble build` use mingw
10:40:53FromDiscord<Robyn [She/Her]> You could do `{.define: "mingw"}` at the top of your main file?
10:44:09FromDiscord<fabric.input_output> I guess I could
10:54:15*beholders_eye quit (Ping timeout: 264 seconds)
10:57:24FromDiscord<albassort> @Robyn [She/Her] how u
11:05:33Amun-Rawhy not just do it a proper way: nimble -d=mingw build
11:08:08FromDiscord<Robyn [She/Her]> In reply to @albassort "<@524288464422830095> how u": Dead inside xD
11:08:15FromDiscord<Robyn [She/Her]> Sick with a horrid migraine, hbu?
11:08:26Amun-Rahmm, define in nim.cfg works
11:08:27FromDiscord<fabric.input_output> In reply to @Amun-Ra "why not just do": that's how I have been doing it until now
11:08:32FromDiscord<albassort> somewhat productive, figuring out how to pass error-codes between rust and nim
11:08:40FromDiscord<albassort> im settling on a enum passed via pointer
11:09:06Amun-Rafabric: try nim.cfg
11:09:43FromDiscord<fabric.input_output> I tried, it used `gcc` and linker errors occurred. I think it overrides the default `nim.cfg` or something
11:09:46Amun-RaI redefine mingw compilers in my local setup, perhaps that's why it works but it may work also for global settings
11:09:47FromDiscord<albassort> in nim you can passl and passc
11:09:52FromDiscord<albassort> why cant you passd in a .nims
11:10:11FromDiscord<albassort> although, im not really sure the use case for -d:mingw?
11:10:15FromDiscord<albassort> (edit) "-d:mingw?" => "-d:mingw in the .nims?"
11:10:43Amun-RaI'm compiling my nim projects via make, I don't have to manually add defines
11:12:29FromDiscord<albassort> i... well... ok then
11:13:22FromDiscord<fabric.input_output> the name of the `.nims` file is `config.nims`? or is it `$project.nims`?
11:13:42FromDiscord<Robyn [She/Her]> In reply to @albassort "somewhat productive, figuring out": Oooh
11:13:48Amun-Raconfig.nims
11:14:03FromDiscord<Robyn [She/Her]> In reply to @albassort "im settling on a": Why not just return an int? It's basically free to copy
11:14:21FromDiscord<albassort> well I'd rather use that for the intended return type
11:14:47FromDiscord<albassort> i've seen c libraries doing it both ways
11:15:07Amun-Raalbassort: -d=mingw is used for crosscompiling for windows
11:15:29FromDiscord<albassort> yeah but you'd never want it defined in your .nims
11:15:34FromDiscord<fabric.input_output> In reply to @albassort "why cant you passd": passd doesn't exist, I think you mean `--define:`
11:15:48FromDiscord<albassort> and that hasn't worked?
11:15:53FromDiscord<fabric.input_output> nope
11:16:48FromDiscord<Robyn [She/Her]> In reply to @albassort "i've seen c libraries": Fair enough
11:28:30*acidsys quit (Ping timeout: 268 seconds)
11:44:04*ntat joined #nim
11:46:02*acidsys joined #nim
11:49:28*krux02 joined #nim
11:50:17FromDiscord<sOkam! 🫐> what does the latest version of `{.pure.}` for enums do exactly?
12:02:07FromDiscord<odexine> nothing iirc
12:03:01FromDiscord<Robyn [She/Her]> In reply to @albassort "well I'd rather use": I don't get it :derp:
12:03:09FromDiscord<Robyn [She/Her]> In reply to @heysokam "what does the latest": Pure does nothing
12:03:28FromDiscord<Robyn [She/Her]> But iirc it used to enforce accessing the enum via a dot expr
12:03:47FromDiscord<Robyn [She/Her]> (So `Foo.Bar` to access `Bar`)
12:04:00FromDiscord<sOkam! 🫐> it did do that yeah
12:04:14FromDiscord<sOkam! 🫐> that's why I was asking for the new version's behavior
12:04:47FromDiscord<sOkam! 🫐> well, that's dumb. because it was a useful feature 😦
12:13:11FromDiscord<sOkam! 🫐> does anyone know what `nnkEnumTy()[0]` is used for?↵The macros manual only lists them as `nnkEmpty` with no other examples
12:13:17FromDiscord<Robyn [She/Her]> In reply to @heysokam "well, that's dumb. because": Was it? How so?
12:13:42FromDiscord<Robyn [She/Her]> In reply to @heysokam "does anyone know what": I can't think of any reason tbh
12:14:00FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Was it? How so?": same way `var one: Type = 1` is useful. explicitness↵there is also some edge cases I don't remember, that were very very useful for binding generation
12:14:07FromDiscord<Robyn [She/Her]> In reply to @chronos.vitaqua "Was it? How so?": You can still fully qualify your access it
12:14:22FromDiscord<Robyn [She/Her]> (edit) "In reply to @chronos.vitaqua "Was it? How so?": You can still fully qualify your access ... it" added "to"
12:14:26FromDiscord<sOkam! 🫐> But you don't get name collisions if you use Pure
12:14:58FromDiscord<Robyn [She/Her]> If the names collide I'm pretty sure you're forced to fully qualify access anyway
12:14:58FromDiscord<sOkam! 🫐> literally the field was not listed, but they were still found correctly when implying the type in an argument, etc
12:15:13FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "If the names collide": you were not
12:15:15FromDiscord<sOkam! 🫐> now you are
12:15:29FromDiscord<Robyn [She/Her]> Yeah I'm talking about now
12:15:47FromDiscord<Robyn [She/Her]> I'd say that's a fine reason to remove functionality from `pure`
12:16:11FromDiscord<sOkam! 🫐> i don't see it as a good reason
12:16:21FromDiscord<sOkam! 🫐> what damage was it causing?
12:17:19FromDiscord<Robyn [She/Her]> The loss of a developer's choice to write code how they want to? 🤷‍♀️
12:17:44FromDiscord<Robyn [She/Her]> I don't see any harm for pure existing or not, but also I'm a newer Nim user than most active Nimians here
12:18:13FromDiscord<sOkam! 🫐> well that's what I was doing before, now its not allowed to do `Thing.one` and `one = 1` because both `one` are considered a valid symbol that collides and must be name-qualified
12:18:44FromDiscord<sOkam! 🫐> which wasn't happening when you marked the enum as pure before
12:19:58FromDiscord<sOkam! 🫐> with pure before, enum values didn't exist in the namespace at all, unless qualified↵if you wanted them to exist without qualifying, you could just not mark them as pure
12:20:31FromDiscord<sOkam! 🫐> now both Pure and non-pure both exist in the namespace and collide 🤦 which basically makes no sense to me why pure even exists now
12:21:02FromDiscord<Robyn [She/Her]> Yeah but other developers besides you using your libraries may prefer not to qualify enum access :P
12:21:12FromDiscord<sOkam! 🫐> overloadable enums i understand. removing pure? i don't 🤷‍♂️
12:21:12FromDiscord<Robyn [She/Her]> In reply to @heysokam "now both Pure and": Pure exists purely for backwards compatibility, I'd imagine
12:21:46FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Yeah but other developers": then you would have used type inference
12:21:52FromDiscord<sOkam! 🫐> which also worked for pure enums
12:21:57FromDiscord<Robyn [She/Her]> Wdym?
12:22:38FromDiscord<sOkam! 🫐> afair, `one` would resolve to `Thing.one` if you were assigning to a `Thing` argument or variable
12:23:02FromDiscord<sOkam! 🫐> (in the context of `Thing {.pure.}` of course
12:23:05FromDiscord<sOkam! 🫐> (edit) "course" => "course)"
12:24:04FromDiscord<sOkam! 🫐> now you are -forced- to qualify, which you were not before, when multiple enums have the same field name for whatever reason, even if the enums are pure 😔
12:24:18FromDiscord<sOkam! 🫐> so the "more options" point I don't see at all.. if anything I see less options
12:24:24FromDiscord<nnsee> i'm constantly being forced to qualify :(
12:25:00FromDiscord<Robyn [She/Her]> In reply to @heysokam "afair, `one` would resolve": Ah
12:25:16FromDiscord<Robyn [She/Her]> Yeah I don't know why the change was made then
12:25:42FromDiscord<sOkam! 🫐> exactly why I was asking how it works, in order to maybe understand the why 🙈
12:26:10FromDiscord<sOkam! 🫐> it just makes no sense to me. feels like a "lost in overloadable enums implemenation" issue, tbh 🤷
12:26:52FromDiscord<Robyn [She/Her]> What are overloadable enums anyway?
12:28:17FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "What are overloadable enums": https://nim-lang.org/blog/2023/08/01/nim-v20-released.html
12:28:26FromDiscord<sOkam! 🫐> search for `overload` in there
12:29:33FromDiscord<sOkam! 🫐> there was a better example than that one, but can't find it atm
12:29:59FromDiscord<Robyn [She/Her]> Aaah okay thanks!
12:53:59FromDiscord<mratsim> In reply to @albassort "somewhat productive, figuring out": - https://github.com/mratsim/constantine/blob/master/include/constantine/core/serialization.h#L18-L35↵- https://github.com/mratsim/constantine/blob/master/scripts/gen_rust_bindings.sh#L21↵- https://github.com/mratsim/constantine/blob/master/constantine-rust/constantine-sys/src/bindings64.rs#L6-L22
13:03:23*ntat quit (Remote host closed the connection)
13:04:36*ntat joined #nim
13:32:01*PMunch quit (Remote host closed the connection)
13:57:23*PMunch joined #nim
14:01:10*beholders_eye joined #nim
14:09:01*lucasta joined #nim
14:24:03*rockcavera joined #nim
14:38:00*PMunch quit (Quit: Leaving)
15:01:10*ntat quit (Quit: Leaving)
15:03:40FromDiscord<fabric.input_output> I don't think you have to fully qualify?
15:07:30FromDiscord<la_wea> What is this cursed thing, https://media.discordapp.net/attachments/371759389889003532/1250466514038034503/image.png?ex=666b0b31&is=6669b9b1&hm=a73bc3c300f4cda5886a8e5d0a7551ecd108d6c58945dfc0f9fc221ee1c9a97a&
15:08:05NimEventerNew thread by basow53698: Nimqt compile error, see https://forum.nim-lang.org/t/11751
15:08:29FromDiscord<Phil> Looks like a bug in the generated c code
15:15:45*lucasta quit (Ping timeout: 255 seconds)
15:16:10FromDiscord<la_wea> This is the thing: https://media.discordapp.net/attachments/371759389889003532/1250468695550201967/image.png?ex=666b0d39&is=6669bbb9&hm=7d3605c35041c9f3436099f6e361c5d066f8438e88a437e36cc060f2ca0fd4a5&
15:17:11FromDiscord<la_wea> Where arr is a `openArray[T]`.
15:19:22FromDiscord<odexine> likely a bug because you used gcc 14
15:19:32FromDiscord<odexine> think you need to update nim
15:21:40FromDiscord<la_wea> https://media.discordapp.net/attachments/371759389889003532/1250470078361899193/image.png?ex=666b0e83&is=6669bd03&hm=278491beff71f967a9495b46b84e94755081bab11c4bb125ed325636380b5d2b&
15:22:15*ntat joined #nim
15:25:39FromDiscord<la_wea> And Mr.McAfee treats choosenim bin as a virus.
15:27:38FromDiscord<albassort> im using nimAES and using decryptCBC and the first 16 bytes are getting corrupted
15:27:57FromDiscord<albassort> is this expected behavior?
15:30:11FromDiscord<albassort> im padding it to the nearest 16 bytes, but its loosing the first block?
15:32:23FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=AqUgVuxe
15:50:27FromDiscord<solitudesf> aint reading that, but `collect(for x in 0 .. add-1: "X").join("")` goes crazy
15:50:56FromDiscord<albassort> Well, I just wanted to create padding and I didn't want to look up how to create a string of a fixed length because I'm very tired
15:51:07FromDiscord<albassort> I also needed to see it so it couldn't be random
15:58:13*beholders_eye quit (Ping timeout: 256 seconds)
15:58:40FromDiscord<la_wea> I think I better learn Rust and stop hopping between langs.
15:58:48FromDiscord<la_wea> (edit) "I" => "I'd"
15:59:49FromDiscord<nocturn9x> has anyone ever tried statically compiling musl with nim using gcc?
16:00:03FromDiscord<nocturn9x> I'd like to have portable binaries that don't depend on glibc and don't do dynamic loading
16:07:14*beholders_eye joined #nim
16:07:44FromDiscord<nocturn9x> although that seems incompatible with nimpy
16:08:08Amun-Rayou mean nim project with musl-gcc?
16:08:22FromDiscord<nocturn9x> I'd prefer clang if possible
16:08:28FromDiscord<nocturn9x> but musl-gcc is fine too
16:08:40FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=TPOCoPIl
16:09:29FromDiscord<nocturn9x> and `-fuse-ld=lld` seems to fix that
16:10:31FromDiscord<nervecenter> In reply to @nocturn9x "has anyone ever tried": Yes, I do this daily and have a set process for it
16:10:45FromDiscord<nervecenter> Let me double check some of my compiler flags
16:10:49FromDiscord<nocturn9x> thanks!
16:14:35FromDiscord<nervecenter> sent a long message, see https://pasty.ee/ePWYJKZw
16:15:11FromDiscord<nocturn9x> the only thing I include is (optionally) mimalloc
16:15:15FromDiscord<nocturn9x> do I need to compile that manually?
16:15:28FromDiscord<nervecenter> Is it a header or a compiled library?
16:15:48FromDiscord<nocturn9x> I'm not entirely sure actually
16:15:53FromDiscord<nervecenter> If it's a header you just need to place it sensibly and use the correct calling convention in your FFI proc.
16:15:54FromDiscord<nocturn9x> I installed it from the AUR, could be anything really
16:16:02FromDiscord<nocturn9x> In reply to @nervecenter "If it's a header": oh I don't use it directly
16:16:06FromDiscord<nocturn9x> it's a drop-in malloc replacement
16:16:11FromDiscord<nocturn9x> so Nim would be the one doing the work
16:17:15FromDiscord<nervecenter> Ah. So long as it's either a header or a static lib, you can include it. Either way I think you'd need to use a `--passL:` flag to make sure the Nim compiler gives it to `musl-gcc`. If it's dynamic in your AUR package, you may need to visit the project's repo and compile it statically yourself or just pull out the source files.
16:18:01FromDiscord<nervecenter> ALSO:
16:18:33FromDiscord<nervecenter> Any libraries you compile into `.a` files NEED to be compiled with `musl-gcc`, so if you fetch a project online to compile it yourself, you'll need to fiddle with the makefiles.
16:18:45FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=fsFJWgfb
16:19:11FromDiscord<nocturn9x> In reply to @nervecenter "Any libraries you compile": if the makefile isn't garbage, all I really need is `CC=musl-gcc`
16:19:15FromDiscord<nocturn9x> _hopefully_
16:19:49FromDiscord<nervecenter> yeah that has worked for me with some pretty big projects so it's thankfully pretty simple in most cases
16:20:01FromDiscord<nocturn9x> I'm getting some weird errors
16:20:05FromDiscord<nocturn9x> which I think are `nimpy` related
16:20:39FromDiscord<nervecenter> Most likely, god I can't imagine linking into Python with a musl binary, you're probably gonna hit so many errors
16:20:55FromDiscord<nervecenter> Might need a musl-compiled Python
16:21:01FromDiscord<nocturn9x> O_o
16:21:13FromDiscord<nocturn9x> also holy shit is musl slow as heck
16:21:17FromDiscord<nervecenter> That's spitballing, I don't know that but it's my hunch
16:21:22FromDiscord<nervecenter> Not for me
16:21:49FromDiscord<nocturn9x> the generated code compared to clang is like
16:21:51FromDiscord<nocturn9x> a good 2x slower
16:21:58FromDiscord<nocturn9x> fuck that lol
16:22:17FromDiscord<nervecenter> And you're using `danger`? That doesn't seem right
16:22:23FromDiscord<nervecenter> Musl shouldn't be inherently slower
16:22:32FromDiscord<nervecenter> Try `release`
16:23:42FromDiscord<nocturn9x> I can _probably_ separate the nimpy part out of the main codebase
16:23:44FromDiscord<nocturn9x> let me try
16:24:58FromDiscord<nocturn9x> ahh nvm there's too many dependencies
16:24:59FromDiscord<nocturn9x> rip
16:25:21FromDiscord<nervecenter> Yeah plugging into Python may as well be pluggin into nodejs
16:25:28FromDiscord<nervecenter> (edit) "pluggin" => "plugging"
16:25:33FromDiscord<nocturn9x> that's what my tuner script is written in
16:25:34FromDiscord<nocturn9x> cuz pytorch
16:25:35FromDiscord<nervecenter> That's gonna have a wild dependency tree
16:25:47FromDiscord<nocturn9x> also it's still slow as heck
16:26:24FromDiscord<nervecenter> Are you translating back and forth between Nim objects/dataframes and Numpy matrices? Could be all the copying work
16:26:37FromDiscord<nocturn9x> oh no the python part is not running at all right now
16:26:37FromDiscord<nocturn9x> it's all nim
16:26:47FromDiscord<nocturn9x> release is much slower than danger too
16:26:57FromDiscord<nocturn9x> from ~31 to almost 60 to now 71 seconds
16:27:12FromDiscord<nervecenter> Make a compile option for regular gcc and glibc just to be sure
16:27:55FromDiscord<nervecenter> I won't be able to help you with nimble or Atlas, I just use Makefiles lol
16:28:49FromDiscord<nocturn9x> ah okay it seems like clang is just slow
16:28:54FromDiscord<nocturn9x> (edit) "slow" => "faster"
16:28:59FromDiscord<nocturn9x> how is gcc so slow wtf
16:29:12FromDiscord<nocturn9x> does `-Ofast` somehow mean something different in gcc vs clang?
16:29:38FromDiscord<nocturn9x> ye it's gcc that's generating slow code
16:29:50FromDiscord<nervecenter> In gcc that's `-O2` or `-O3`
16:30:01FromDiscord<nocturn9x> how is clang so much faster wtf
16:30:06Amun-Rathere is no well defined optimization standard in C
16:31:22FromDiscord<nocturn9x> like 27 vs 54 seconds
16:31:25FromDiscord<nocturn9x> is no laughing matter
16:31:29FromDiscord<nocturn9x> is llvm just better now? lol
16:31:42FromDiscord<nervecenter> Did you try `-O2` or `-O3`?
16:31:54FromDiscord<nocturn9x> doesn't `-d:danger` already do that
16:32:01Amun-Rano
16:32:11FromDiscord<nocturn9x> wat
16:32:14FromDiscord<nocturn9x> seriously
16:32:20FromDiscord<nocturn9x> it certainly does for clang
16:32:24FromDiscord<nervecenter> I thought `-d:release` used `-O2`
16:32:26FromDiscord<nocturn9x> or maybe it's -Ofast
16:32:37Amun-Rawait, I'm not so sure now
16:32:54FromDiscord<nocturn9x> yeah no -O3 makes no difference
16:33:16FromDiscord<nervecenter> `-O3` is not guaranteed to be better than `-O2` but it's always worth a shot
16:33:22Amun-Rabut the 27 vs 54 second difference might be a result of something else
16:33:23FromDiscord<nervecenter> Most people use `-O2` everywhere
16:34:10FromDiscord<nocturn9x> like what
16:34:45Amun-Raadd --listcmd and check what compiler flags are used in both cases
16:35:57FromDiscord<nocturn9x> lol it's dupliating all options
16:35:58FromDiscord<nocturn9x> `-pthread -pthread -lm -lm -lrt -lm -lm -flto -ldl`
16:37:31FromDiscord<nocturn9x> `gcc -c -w -fmax-errors=3 -pthread -flto -Ofast -march=native -mtune=native -mbmi2 -mpopcnt -O3 -fno-strict-aliasing -fno-ident -fno-math-errno`
16:37:33FromDiscord<nocturn9x> this is the command
16:38:16Amun-Raand clang?
16:38:31FromDiscord<nocturn9x> it doesn't print anything, just the final link command
16:38:36Amun-Rahmm
16:38:47FromDiscord<nocturn9x> ah nvm
16:39:09FromDiscord<nocturn9x> `clang -c -w -ferror-limit=3 -pthread -flto -Ofast -march=native -mtune=native -mbmi2 -mpopcnt -O3 `
16:39:23FromDiscord<nocturn9x> so literally the exact same
16:40:54Amun-Ra-O3 in both cases
16:41:51FromDiscord<nocturn9x> yes
16:56:13rockcaveraclang has presented some better optimizations than gcc
16:57:20rockcaverabut everything is a matter of testing and more testing. Remembering that compiling ocm -march=native and -mpopcnt may make the binary not very portable.
16:58:00rockcaverabut if it's for your own use, there's no problem.
17:23:12NimEventerNew Nimble package! libunicorn - Futhark generated wrapper around unicorn-engine, see https://github.com/m4ul3r/libunicorn-nim
17:51:59*tiorock joined #nim
17:51:59*rockcavera quit (Killed (zinc.libera.chat (Nickname regained by services)))
17:51:59*tiorock is now known as rockcavera
18:13:42*oddish quit (Ping timeout: 256 seconds)
18:13:54*oddish joined #nim
18:20:56*tiorock joined #nim
18:20:56*rockcavera quit (Killed (zirconium.libera.chat (Nickname regained by services)))
18:20:56*tiorock is now known as rockcavera
18:38:26*rockcavera quit (Killed (erbium.libera.chat (Nickname regained by services)))
18:41:25*xaltsc joined #nim
18:52:13FromDiscord<fabric.input_output> if a function has overloads, how can I select the one with the signature I want, besides doing `let fn: signature = functionName`
18:58:40FromDiscord<Robyn [She/Her]> In reply to @fabric.input_output "if a function has": How about (signature)(functionName)`? :P
18:58:48FromDiscord<Robyn [She/Her]> Think you'll need to specify the signature either way
19:01:34Amun-Ra'https://play.nim-lang.org/#pasty=dwulfHAD'
19:01:53Amun-Ra(my terminal is adding that apostrophes)
19:01:57Amun-Rathese*
19:03:13FromDiscord<Robyn [She/Her]> In reply to @Amun-Ra "'https://play.nim-lang.org/#pasty=dwulfHAD'": Fabrico said besides that
19:03:27Amun-Raah, I've missed it
19:03:56FromDiscord<Robyn [She/Her]> No sweat
19:04:00FromDiscord<fabric.input_output> In reply to @chronos.vitaqua "How about (signature)(functionName)`? :P": yeah that works thanks
19:04:28FromDiscord<Robyn [She/Her]> No problem o7
19:04:51Amun-Rahttps://play.nim-lang.org/#pasty=OUpnmBQV
19:04:54Amun-Rathat works,too
19:05:02FromDiscord<Robyn [She/Her]> In reply to @chronos.vitaqua "How about (signature)(functionName)`? :P": I do like how Nim usually just works how you expect it to
19:05:44FromDiscord<Robyn [She/Her]> Amun-Ra, could I interest you in a simple Nim program I made for uploading piped content to the Nim playground via Pasty's API? :>
19:06:25Amun-RaRobyn: I can look at it :)
19:07:19FromDiscord<Robyn [She/Her]> https://play.nim-lang.org/#pasty=CDXLMdNT
19:07:45FromDiscord<Robyn [She/Her]> Pretty simple ✨
19:08:49Amun-Ranice
19:10:05FromDiscord<Robyn [She/Her]> Indeed :]
19:11:07Amun-Rait's very concise
19:19:49FromDiscord<Robyn [She/Her]> I didn't see a reason for it to be more complex aha
19:20:41FromDiscord<Robyn [She/Her]> Also random question for anyone here, but is there any alternative to the httpclient library in Nim that supports streaming HTTP responses?
19:21:33*rockcavera joined #nim
19:22:28*Batzy quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
19:22:52*Batzy joined #nim
19:26:00FromDiscord<Robyn [She/Her]> And also if anyone knows how I'd handle chunks of JSON returned from a request at a time, that'd be useful too
19:28:16*Batzy quit (Ping timeout: 268 seconds)
19:31:05FromDiscord<fabric.input_output> In reply to @chronos.vitaqua "And also if anyone": streaming json?
19:34:39FromDiscord<Robyn [She/Her]> In reply to @fabric.input_output "streaming json?": Yeah, I'm interacting with Ollama's APIs and they have a streaming API which I'd like to support for my own bot
19:42:13*ntat quit (Quit: Leaving)
19:44:35FromDiscord<Robyn [She/Her]> Also wondering whether it's worth prefixing all my types with `Ollama`, I was doing it before but it seems a tad redundant now
19:55:28FromDiscord<fabric.input_output> maybe just `o` or `ol`
19:57:37FromDiscord<ElegantBeef> I personally try to avoid prefixing any type and just use modules in case of ambiguity
19:58:15FromDiscord<Robyn [She/Her]> Fair enough
20:15:21FromDiscord<bosinski2023> sent a code paste, see https://play.nim-lang.org/#pasty=kCjzjyuU
20:30:15FromDiscord<ElegantBeef> What's the QF macro and QFi Macor?
20:30:18FromDiscord<ElegantBeef> (edit) "Macor?" => "Macro?"
20:31:42*Batzy joined #nim
20:39:05FromDiscord<bosinski2023> sent a code paste, see https://play.nim-lang.org/#pasty=SQQYYSDv
20:39:32FromDiscord<ElegantBeef> Ah they're structs
20:39:33FromDiscord<bosinski2023> (edit) "https://play.nim-lang.org/#pasty=dJuNrvod" => "https://play.nim-lang.org/#pasty=gDxvaePc"
20:39:40FromDiscord<ElegantBeef> QF is a terrible name for a struct, down with the aliases
20:40:46FromDiscord<Robyn [She/Her]> Hey Beef, do you have any idea on any other HTTP libraries that support streaming responses?
20:40:58FromDiscord<ElegantBeef> stdlib? 😄
20:41:46FromDiscord<Robyn [She/Her]> Besides the stdlib
20:43:21FromDiscord<ElegantBeef> In reply to @bosinski2023 "from a example when": Yea this API makes 0 sense withwhat is given
20:43:53FromDiscord<ElegantBeef> `QF` is an empty struct but they do `qf_malloc(filter.addr, ...)`
20:44:51*xaltsc quit (Quit: WeeChat 4.1.3)
20:46:43FromDiscord<bosinski2023> In reply to @elegantbeef "`QF` is an empty": agree - `gqf_wrapper.h` is not too helpful and makes little sense. In init they malloc the QF-thing, but don't return it ?
20:46:55FromDiscord<ElegantBeef> Well they're initing a global variable it seems
20:47:59FromDiscord<bosinski2023> In reply to @elegantbeef "Well they're initing a": so, then i just grab that global QF-thing, work with it and call `destroy()` when i'm done ?
20:48:15FromDiscord<ElegantBeef> Seems t obe
20:48:18FromDiscord<ElegantBeef> (edit) "t obe" => "to be"
20:51:57FromDiscord<bosinski2023> In reply to @elegantbeef "Seems to be": thx, regarding the `uint128_t` in `insert( uint128_t val)` can i use `stint.nim` for that ?
20:58:54FromDiscord<ElegantBeef> Only if it wraps the system's uint128
21:00:06FromDiscord<ElegantBeef> You likely want https://github.com/rockcavera/nim-nint128 instead
21:04:05FromDiscord<nocturn9x> is it possible to only link certain libraries statically?
21:04:10FromDiscord<nocturn9x> like for example mimalloc
21:04:33FromDiscord<nocturn9x> would like to be my engine as dependency free as possible
21:04:50FromDiscord<nocturn9x> and glibc is already a pretty undesirable burden, but one I can't currently get rid of
21:04:53FromDiscord<nocturn9x> (edit) "and ... glibc" added "runtime"
21:05:02FromDiscord<nocturn9x> (edit) "and runtime glibc is already a pretty undesirable burden, but one I can't currently get rid of ... " added "cuz I need dlopen for nimpy"
21:05:39FromDiscord<ElegantBeef> You should be able to link specific libraries statically just by doing `-static -lname`
21:07:10Amun-Ra--passl=/path/to/libname.a
21:07:33Amun-Rawith eventual dynliboveride
21:08:12FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=SfmhMlod
21:08:18FromDiscord<nocturn9x> I only have .so files
21:08:29FromDiscord<ElegantBeef> Well you cannot statically link .so
21:08:33FromDiscord<ElegantBeef> So build the static libraries
21:08:37FromDiscord<nocturn9x> hm
21:08:43FromDiscord<ElegantBeef> Using the same toolchain as you want to compile your project with
21:08:45FromDiscord<nocturn9x> gonna have to clone the repo for mimalloc ig
21:08:56FromDiscord<ElegantBeef> Also doesn't `ldconfig` only search for .so and not .a
21:09:50Amun-Ra'https://github.com/microsoft/mimalloc?tab=readme-ov-file#static-override'
21:10:09Amun-Rabuild an object and pass it to the linker
21:10:19FromDiscord<ElegantBeef> Also I highly suggest using pkg-config for generally linking needs
21:10:36FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#pasty=HnQhoWpS
21:10:45FromDiscord<nocturn9x> In reply to @Amun-Ra "build an object and": hm, so like
21:11:09FromDiscord<nocturn9x> `clang -c mimalloc` or something?
21:11:28Amun-Rayes, you can do that with pragma
21:11:54FromDiscord<nocturn9x> uh, how?
21:12:33Amun-Rahttps://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-pragma
21:13:36FromDiscord<nocturn9x> so I can do like
21:13:51FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=tmZBslkl
21:13:57FromDiscord<nocturn9x> or should that rather be in a nim script file?
21:14:22FromDiscord<nocturn9x> (edit) "https://play.nim-lang.org/#pasty=zgvhatas" => "https://play.nim-lang.org/#pasty=nQJUuRNz"
21:14:44FromDiscord<ElegantBeef> That's fine
21:17:53*xaltsc joined #nim
21:17:53FromDiscord<nocturn9x> is there a pragma for dyn lib override as well?
21:18:00FromDiscord<nocturn9x> ldd shows it's still linked dynamically
21:20:33Amun-Rayou don't need it in this case, mimalloc is not linked by default during the build process
21:20:39FromDiscord<nocturn9x> hm
21:20:46FromDiscord<nocturn9x> why is it still linked dynamically then
21:22:00Amun-Rawhat's the outputof --listcmd?
21:23:14FromDiscord<nocturn9x> `clang -o /home/nocturn9x/heimdall/bin/heimdall /home/nocturn9x/heimdall/mimalloc.o [...]`
21:23:35Amun-Rathat
21:23:40Amun-Rathat's static linking
21:23:48FromDiscord<nocturn9x> it's not finding it tho
21:23:58FromDiscord<nocturn9x> the linker
21:24:15FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=kOcyCMqY
21:24:30FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=poiaPKaj
21:24:34FromDiscord<nocturn9x> my nim.cfg
21:24:43FromDiscord<bousilleur> hello, does anyone know what happened to yardanico, i was trying to find an old library he had for reference but his github account vanished
21:24:58Amun-Ranocturn9x: remove "-lmimalloc"
21:25:21Amun-Ra-l is used for dynamic linking only
21:25:22FromDiscord<nocturn9x> ding!
21:25:23FromDiscord<nocturn9x> works
21:25:24FromDiscord<nocturn9x> thx
21:26:34Amun-Ra:)
21:35:16FromDiscord<bousilleur> is there a reason as to why packedjson no longer works?
21:43:24FromDiscord<ElegantBeef> -l is not only used for dynamic linking
21:44:22FromDiscord<ElegantBeef> https://play.nim-lang.org/#pasty=OSSiSRRD just to prove it
21:44:39FromDiscord<ElegantBeef> Shit I forgot to cat test.nim
21:44:41FromDiscord<ElegantBeef> I'm a failure
21:46:11Amun-Ranow do that without -static ;)
21:47:35FromDiscord<ElegantBeef> Why?
21:48:58Amun-Ra-static links whole program statically
21:49:10FromDiscord<ElegantBeef> Right but you can also do `-Bstatic` I believe
21:50:59Amun-Radidn't -B just add dir to search path?
21:51:03FromDiscord<ElegantBeef> Ah seems like you can actually do `--push-state -static -lname --pop-state`
21:51:34Amun-Rahmm
21:52:11FromDiscord<ElegantBeef> https://sourceware.org/binutils/docs/ld/Options.html hmm maybe not
21:55:07FromDiscord<ElegantBeef> `nim c --passL: "-Bstatic -L/tmp -lexpose -Bdynamic $(pkg-config --libs gtk4)" --verbosity:0 ./test.nim` does compile and link gtk4
21:58:38*beholders_eye quit (Read error: Connection reset by peer)
22:00:02Amun-Rahmm, so "-Bstatic -L/tmp -lexpose -Bdynamic" == "/tmp/libexpose.a"
22:00:11FromDiscord<ElegantBeef> Actually that's just cause it searches for the single one
22:00:21FromDiscord<ElegantBeef> since `libexpose.a` is the only existent library
22:01:15Amun-Raright, bc of static
22:01:38FromDiscord<ElegantBeef> No
22:01:47FromDiscord<ElegantBeef> Cause ld searches for `.so` then `.a`
22:01:57FromDiscord<ElegantBeef> Removing `-Bstatic` it still gets the static
22:02:02Amun-Rahmm
22:02:03FromDiscord<ElegantBeef> Adding in a `.so` means it cannot find the `.a`
22:02:29Amun-RaI've to test it, interesting
22:03:08Amun-RaI wonder whether it worked always that way or not
22:03:44FromDiscord<ElegantBeef> It is documented to work that way, I cannot figure out how to toggle on static preference then disable it
22:04:17*beholders_eye joined #nim
22:10:11FromDiscord<ElegantBeef> https://stackoverflow.com/a/6578558 does seem to indicate you can do them in lists, but no avail here
22:11:46FromDiscord<ElegantBeef> Though I am trying `--passL` with Nim so that could be the issue
22:17:15*beholders_eye quit (Read error: Connection reset by peer)
22:21:06strogon14Why not use the -l:libexpose.a syntax shown in the first answer to the SO question?
22:22:49*beholders_eye joined #nim
22:24:50FromDiscord<ElegantBeef> Cause that relies on the library being at a specific location and is not portable
22:27:05FromDiscord<ElegantBeef> Oh wait am I daft, it still searches the path 😄
22:27:51FromDiscord<ElegantBeef> But yea it does not compose with the king of linking `pkg-config`
22:41:00*beholders_eye quit (Read error: Connection reset by peer)
22:41:26*beholders_eye joined #nim
22:41:30FromDiscord<Robyn [She/Her]> When storing an LLM's messages in a database, how would guys handle sessions and then memory recall?
22:42:52FromDiscord<ElegantBeef> Me personally? I'd nuke the LLM and not require a database any further
22:47:27FromDiscord<Robyn [She/Her]> Lmao
22:47:45FromDiscord<Robyn [She/Her]> I'm making a personal assistant so I can't nuke the LLM :P
22:57:49FromDiscord<sOkam! 🫐> nuke the project, llm+db gone :smart:
22:58:49FromDiscord<Robyn [She/Her]> I want a personal assistant though :P
23:57:23*xet7 joined #nim