<< 03-10-2023 >>

00:05:36FromDiscord<sOkam! 🫐> In reply to @.aingel. "Idk if there's a": mostly preference
00:05:51FromDiscord<sOkam! 🫐> i personally really dislike being tied to a cpp compiler, given how slow they are
00:06:04FromDiscord<sOkam! 🫐> but that would change per person, i can imagine
00:07:12FromDiscord<sOkam! 🫐> @.aingel. how does your C api look like? and how does your bindings for that api look like too?
00:07:26FromDiscord<sOkam! 🫐> (edit) "does" => "do"
00:09:34FromDiscord<sOkam! 🫐> also, you might find this bit of code useful:↵https://github.com/DanielBelmes/vulkan/blob/7d24715dffb42895f69c4c9376f52b640372bbaa/src/vulkan.nim#L11-L25
00:13:27FromDiscord<.aingel.> In reply to @heysokam "<@1152336447467163790> how does your": It's nothing complicated pretty basic
00:16:37FromDiscord<.aingel.> Soo I should be able to use dylib to create a link between my cpp wrapped library and another nim project which is using the c backend right
00:19:10FromDiscord<.aingel.> Idk if that even makes sense
00:19:18FromDiscord<.aingel.> I think I should just staticly link the shared library
00:36:05*lumo_e quit (Quit: Quit)
00:45:13FromDiscord<sOkam! 🫐> yeah, its one way
00:45:24FromDiscord<sOkam! 🫐> you can also link statically, but the setup is different
00:45:39FromDiscord<sOkam! 🫐> and since you were having issues with that, i figured you should know that it is not the only option
00:51:47FromDiscord<.aingel.> In reply to @heysokam "you can also link": People are saying that macOS doesn't really support statically linking executables
00:51:57FromDiscord<.aingel.> But I am not sure if that applies here
00:52:10FromDiscord<.aingel.> I'm getting confused
00:52:35FromDiscord<.aingel.> In reply to @heysokam "and since you were": What is the other option?
00:53:59FromDiscord<sOkam! 🫐> In reply to @.aingel. "People are saying that": what? how does that work?
00:55:27FromDiscord<sOkam! 🫐> In reply to @.aingel. "What is the other": 1. dynamic link and distribute the cpp library as a dylib/so/dll↵2. static link and create a C api that wraps the cpp code, and create a nim wrapper for that C code↵3. static link and create an importcpp wrapper directly, but be tied to the cpp backend
00:57:58FromDiscord<odexine> https://developer.apple.com/forums/thread/706419?answerId=714469022#714469022
00:58:16FromDiscord<odexine> In macOS there is no static library for kernel access
00:58:32FromDiscord<odexine> And system calls are not guaranteed to be stable
00:59:07FromDiscord<odexine> So there is at least 1 dynamic library to be linked at all times
01:01:43FromDiscord<sOkam! 🫐> i don't understand the details of that, but im 100% static linking on mac (and building -from- mac) with nglfw and with wgpu, and it works↵so im not quite sure how much that applies to aingel's case
01:01:57FromDiscord<odexine> Basically you can static link libraries
01:02:08FromDiscord<sOkam! 🫐> but his code is a library, isn't it
01:02:08FromDiscord<odexine> You just can’t have a completely statically linked binary
01:02:12FromDiscord<odexine> Yes
01:02:19FromDiscord<odexine> I’m just explaining what they said
01:02:31FromDiscord<sOkam! 🫐> ah kk
01:03:09FromDiscord<my.narco> hmm should i have my parser walk through a BinOp node and calculate it before interpretation? Or have my vm do it?
01:09:39FromDiscord<raynei486> optimization is not really the parser's job
01:10:25FromDiscord<.aingel.> In reply to @heysokam "1. dynamic link and": So what I need to static or dynamic link against is just the c++ stl
01:10:32FromDiscord<.aingel.> The other code is just cpp
01:11:32FromDiscord<.aingel.> I already have a c api for the cpp code and nim wrapper for the C code, the issue is that the cpp code needs the cpp stl
01:16:37FromDiscord<sOkam! 🫐> In reply to @.aingel. "I already have a": then link to the stl when building that part of the code
01:20:50FromDiscord<.aingel.> In reply to @heysokam "then link to the": Ya thats what I'm doing but having issues
01:21:01FromDiscord<.aingel.> g++-13 -fPIC -shared -o libjson.so cysimdjsonc.cpp simdjson.cpp -static-libstdc++ -static-libgcc
01:21:18FromDiscord<.aingel.> I'm doing this and it seems to build the dynamic library properly
01:21:23FromDiscord<.aingel.> It's large
01:21:28FromDiscord<.aingel.> Maybe i'll write some c just to test it
01:30:17FromDiscord<sOkam! 🫐> In reply to @.aingel. "Maybe i'll write some": definitely do that
01:32:00FromDiscord<sOkam! 🫐> also, are you sure you need to static-link to stdcpp, and not just `-lstdc++`? 🤔↵don't know about that one, but personally I would first go for dynamic linking, since its gonna be rare to find a system that doesn't provide that, afaik
01:33:06FromDiscord<.aingel.> My c isn't working either trying to use just a basic lib that I make and dym linking it
01:33:11FromDiscord<sOkam! 🫐> _(btw, this fkery is why I avoid cpp stuff like the plague, its always a mess)_
01:33:14FromDiscord<.aingel.> I can't use -lstdc++ with the c compiler
01:33:39FromDiscord<.aingel.> Thats why I'm statically linking stdc++
01:33:48FromDiscord<sOkam! 🫐> ic
01:33:49FromDiscord<.aingel.> Otherwise any nim I use will have to be with the cpp backend
01:34:11FromDiscord<sOkam! 🫐> makes sense
01:46:11FromDiscord<.aingel.> Oh i think it has somehting to do with extern "c"
01:47:48FromDiscord<.aingel.> Yooooo
01:47:52FromDiscord<.aingel.> I think it wokred
01:48:08FromDiscord<.aingel.> (edit) "wokred" => "worked"
01:48:11FromDiscord<.aingel.> Well at least it built
01:48:23FromDiscord<.aingel.> Or linked rather
01:51:05Amun-Rathat disables name mangling for the function
01:54:28FromDiscord<my.narco> In reply to @raynei486 "optimization is not really": fair
01:54:44FromDiscord<.aingel.> In reply to @Amun-Ra "that disables name mangling": Yeah
03:46:23*qwestion joined #nim
05:22:45*rockcavera quit (Remote host closed the connection)
05:56:39FromDiscord<Chronos [She/Her]> https://github.com/Nimberite-Development/ModernNet woot woot finally got docs deployed
05:56:47FromDiscord<Chronos [She/Her]> I also modified the Action a bit :p
06:02:10*disso-peach joined #nim
06:11:14*disso-peach quit (Quit: Leaving)
06:13:06FromDiscord<nnsee> In reply to @chronos.vitaqua "https://github.com/Nimberite-Development/ModernNet ": heh, you might find this interesting, i've been working on a server for minecraft classic (0.30) https://git.dog/xx/fastcube
06:13:32FromDiscord<nnsee> currently quite spaghetti, will clean it up and then start implementing the Classic Protocol Extensions
06:18:56*junaid_ joined #nim
06:19:00FromDiscord<nnsee> all 36 of them: https://git.dog/xx/fastcube/milestone/1
06:19:58*junaid__ joined #nim
06:20:00*junaid__ quit (Client Quit)
06:28:28*blop_ quit (Remote host closed the connection)
06:29:05*blop_ joined #nim
06:30:14FromDiscord<Chronos [She/Her]> Oh epic!
06:33:32FromDiscord<Chronos [She/Her]> I didn't implement any support for the classic protocol mostly because I saw no reason to, tbh
06:33:53*azimut quit (Ping timeout: 252 seconds)
06:34:20FromDiscord<Chronos [She/Her]> I originally wanted to implement a 1.19 server, and now someone is using the unpolished library for a 1.7 server which is nice :)
06:39:47*advesperacit joined #nim
06:43:56madpropshow would you remove all empty strings in a seq[string] from the start and end of the array, like a sort of strip ?
06:44:26madpropssimilarly, how would you remove multiple empty strings into a single one
06:46:06termervar res = newSeq[string]()
06:46:14termerfor str in sourceSeq:
06:46:21termer if str != "":
06:46:26termer res.add(str)
06:46:44madpropsthere can be empty lines in the middle
06:46:46madpropsbut not multiple of them
06:47:18termerhttps://nim-lang.org/docs/strutils.html#isEmptyOrWhitespace%2Cstring
06:47:31termerNot sure if I understand what you need, but this module will probably be helpful to you
07:03:14FromDiscord<dissolved.girl> madprops: You can probably more or less copy the logic from strutils.strip: https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/strutils.nim#L2889
07:03:58madpropsended up doing this https://i.imgur.com/HFlV7a3.jpg
07:04:05madpropsi didn't want to turn it into a string and applying regex or similar
07:04:11madpropsi think it's faster in the array directly
07:04:55madpropsthat's code basically generated by chatgpt
07:05:08FromDiscord<dissolved.girl> That looks an awful lot like the link I posted
07:05:16FromDiscord<dissolved.girl> Except with some extra logic
07:06:32FromDiscord<nnsee> In reply to @chronos.vitaqua "I didn't implement any": classic has a very special place in my heart, it's where i made my first actual friends on the internet (some of whom I'm still in contact with)
07:06:52FromDiscord<nnsee> i was an admin on Minecraft Forums back then as well
07:07:06FromDiscord<nnsee> and hosted a Classic server
07:07:41FromDiscord<nnsee> i was playing minecraft and hosting servers wayyy before it ever got popular, I remember when the server list had like 30 servers or so
07:09:19FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "I originally wanted to": 1.7 best version for me
07:11:11FromDiscord<nnsee> In reply to @nnsee "i was playing minecraft": okay, maybe like a hundred
07:12:01FromDiscord<nnsee> https://web.archive.org/web/20090711155805/http://www.minecraft.net:80/servers.jsp this is very, very nostalgic for me (and includes my server :) )
07:18:52FromDiscord<Chronos [She/Her]> In reply to @nnsee "classic has a very": Understandable, for me I was literally 6 when MC first released lmao, and I got spoiled with newer versions, I used to swear by 1.12.2 aha
07:19:02FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "1.7 best version for": Fair
07:19:24FromDiscord<Chronos [She/Her]> I am old enough to remember pocket edition on the iPhone tho
07:19:28FromDiscord<Chronos [She/Her]> That was so great
07:31:34FromDiscord<griffith1deadly> i start playing minecraft in 1.5.2 release for java edition aha
07:40:46FromDiscord<Chronos [She/Her]> Oh nice! I never even had a computer as a kid either lol
07:58:01*dza quit (Quit: )
07:59:35*dza joined #nim
08:00:11*PMunch joined #nim
08:57:53*junaid_ quit (Remote host closed the connection)
09:20:10*PMunch_ joined #nim
09:23:09*PMunch quit (Ping timeout: 258 seconds)
09:25:33*dza quit (Quit: )
09:45:21*dza joined #nim
09:51:02*dza quit (Quit: )
10:05:52*PMunch_ is now known as PMunch
10:10:39*Guest24 joined #nim
10:12:19*Guest24 quit (Client Quit)
10:23:34NimEventerNew Nimble package! modernnet - ModernNet is a barebones library to interact with the Minecraft Java Edition protocol!, see https://github.com/Nimberite-Development/ModernNet
10:48:16FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4I39
10:59:00FromDiscord<demotomohiro> I cannot read these error message.
11:02:56FromDiscord<Phil> Je ne parles pas francais
11:03:24FromDiscord<demotomohiro> I guess, if you compile some program that uses some library or windows API but you didn't add correct libraries to link option, it is normal to get errors like "`foobar` is undefined reference."
11:07:52PMunchSystem64_~_Flandre_Scarlet, yeah that's a normal error stemming from linking issues
11:08:32PMunchBasically you tell your program that some symbol like `imp_DragQueryFileW` should be available, but nothing during your linking step actually introduces said symbol.
11:18:52FromDiscord<kcvinker5420> sent a code paste, see https://play.nim-lang.org/#ix=4I3c
11:19:48FromDiscord<xtrayambak> How can you disable compiler warnings for a specific proc?
11:20:00FromDiscord<dissolved.girl> Probably the push and pop pragmas
11:20:17FromDiscord<xtrayambak> Oh yeah, those exist
11:20:18FromDiscord<xtrayambak> Thanks
11:23:51*krux02 joined #nim
11:59:09FromDiscord<.aingel.> Can i get nim to use g++ instead of clang++
11:59:33FromDiscord<.aingel.> Or rather gcc instead of the clnag
11:59:35FromDiscord<.aingel.> (edit) "clnag" => "clang"
12:00:26FromDiscord<odexine> It uses GCC by default though?
12:05:27FromDiscord<.aingel.> @odexine on macos it uses the mac "Gcc"
12:05:44FromDiscord<.aingel.> Which is clnag
12:05:46FromDiscord<.aingel.> (edit) "clnag" => "clang"
12:16:12FromDiscord<sOkam! 🫐> @.aingel. https://nim-lang.org/docs/nimc.html#compiler-selection
12:17:15FromDiscord<sOkam! 🫐> a more involved case of that functionality being used can be found here https://github.com/enthus1ast/zigcc
12:18:24FromDiscord<sOkam! 🫐> tldr: `--cc:thecompiler` and all its relevant options must be configured for your alternate compiler
12:20:18FromDiscord<dissolved.girl> In reply to @.aingel. "<@259277943275126785> on macos it": Can't you just set the `gcc` binary to just point to (the actual) `gcc`?
12:20:37FromDiscord<dissolved.girl> I think Nim simply takes it from the PATH
12:21:09FromDiscord<dissolved.girl> So you can create a `gcc` -> [the real gcc] symlink somewhere and prepend that directory to your PATH variable
12:21:26FromDiscord<sOkam! 🫐> that might break other parts of their system, if they rely on gcc being clang
12:21:45FromDiscord<dissolved.girl> I'm not suggesting they change the system PATH
12:21:50FromDiscord<dissolved.girl> Just for their use case
12:21:58FromDiscord<dissolved.girl> A wrapper script that calls Nim or whatever
12:22:14FromDiscord<sOkam! 🫐> yeah i know, just saying that "my-computer-specific" changes are brittle to say the least
12:22:43FromDiscord<sOkam! 🫐> `nim.cfg` can be setup for compiler selection config, which is part of what is made for
12:23:40FromDiscord<dissolved.girl> _Where_ is the real gcc anyways on a macOS system?
12:23:53FromDiscord<dissolved.girl> It's GNU, so you probably have to install it via brew?
12:25:23FromDiscord<.aingel.> In reply to @dissolved.girl "Can't you just set": Yeah I tried doing this well... I set an alias but I don't think it really worked
12:25:33FromDiscord<.aingel.> In reply to @dissolved.girl "_Where_ is the real": yeah it's like gcc-13
12:25:38FromDiscord<.aingel.> That's the name it's installed under
12:25:44FromDiscord<sOkam! 🫐> seems to go to `/usr/bin/gcc-10` and similars
12:25:50FromDiscord<.aingel.> Maybe the alias in my zshrc doesn't pick up for nim?
12:26:03FromDiscord<dissolved.girl> In reply to @.aingel. "Yeah I tried doing": Alias is a shell-only construct
12:26:11FromDiscord<dissolved.girl> It doesn't propagate to spawned child processes
12:26:12FromDiscord<sOkam! 🫐> @.aingel. or its just nameclashing with the clang version, and not accepting it
12:26:19FromDiscord<dissolved.girl> Only the shell is aware of it
12:26:20FromDiscord<.aingel.> Right @dissolved.girl thought so
12:26:51FromDiscord<sOkam! 🫐> oh you aliased it? yeah that would be it
12:26:53FromDiscord<.aingel.> So @sOkam! 🫐 .. right now I was able to build a shared library with clang++ (mac) and get it to dynamically link with nim's c compiler (clang mac)
12:27:26FromDiscord<.aingel.> Without even doing static.. I got some sort of static thing to work but doesn't seem to actually increase the shared library file, it also seems to indicate it's still being linked to libc++
12:27:35FromDiscord<.aingel.> But somehow it works with the c compiler now..
12:27:43FromDiscord<.aingel.> Is this a sustainable way of doing things?
12:27:46FromDiscord<sOkam! 🫐> neat!
12:28:13FromDiscord<.aingel.> My other alternative is to try and force everything to use gcc and see if it works
12:28:16FromDiscord<sOkam! 🫐> In reply to @.aingel. "Is this a sustainable": yeah, just that you need to distribute the dynamic library alongside your project
12:28:37FromDiscord<.aingel.> I thought i have to get nimble to build it
12:28:38FromDiscord<sOkam! 🫐> i find that annoying, so I try to static-link all i can
12:28:41FromDiscord<dissolved.girl> sent a code paste, see https://play.nim-lang.org/#ix=4I3H
12:28:47FromDiscord<sOkam! 🫐> but your usecase might be different
12:28:51FromDiscord<leorize> fwiw you shouldn't statically link system libraries like libc++ on macOS
12:28:52FromDiscord<sOkam! 🫐> nothing wrong with dynamic-link
12:29:08FromDiscord<.aingel.> In reply to @leorize "fwiw you shouldn't statically": Right
12:29:15FromDiscord<sOkam! 🫐> ah yeah, i never staticlink to the stdlib, great to mention
12:29:29FromDiscord<leorize> macOS is kinda similar to Windows in that they don't have a stable kernel-userspace ABI
12:29:30FromDiscord<.aingel.> So I have to get nimble to build before install right
12:29:36FromDiscord<.aingel.> Cause I figure it will be different for different systems
12:30:20FromDiscord<sOkam! 🫐> In reply to @.aingel. "So I have to": you are building a library that will use that code?
12:30:28FromDiscord<sOkam! 🫐> i thought it was for your project only
12:30:47FromDiscord<.aingel.> If it was just for my project I wouldn't mind using the nim cc compiler
12:30:53FromDiscord<sOkam! 🫐> i see
12:30:55FromDiscord<.aingel.> I am wrapping a c++ json library
12:31:09FromDiscord<.aingel.> And so I want people to be able to use it without having to be forced to use cc for their backend
12:31:16FromDiscord<.aingel.> Cause I think that would mess up a lot of things
12:31:19FromDiscord<.aingel.> Including myself
12:31:26FromDiscord<sOkam! 🫐> I found this very same issue with my wgpu bindings↵the only real solution, after trying everything (including nimble tasks, and all) was to just build it inside a `static: ...` block
12:31:30FromDiscord<.aingel.> I just want to be able to drop this into any proect I'm using
12:32:05FromDiscord<sOkam! 🫐> @.aingel. https://github.com/heysokam/wgpu/blob/master/src/wgpu/compile.nim this file, in a nutshell, its solving what you mention
12:32:14FromDiscord<sOkam! 🫐> but instead of using gcc is using rust compiler. same idea
12:33:10FromDiscord<.aingel.> Right I think that is similar
12:33:17FromDiscord<.aingel.> Is this a dynamic link though?
12:33:18FromDiscord<sOkam! 🫐> the essence of that is that it builds it from a static block, so it only happens once during compilation of your project↵aka the same as you would do with a nimble task, but instead of being brittle it works across systems
12:33:32FromDiscord<sOkam! 🫐> In reply to @.aingel. "Is this a dynamic": no, but dynamic-vs-static is just a matter of configuration options
12:33:34FromDiscord<.aingel.> Oh it's static, cause of -I
12:33:36FromDiscord<.aingel.> Yeah
12:33:44FromDiscord<.aingel.> I would be doing the same thing but dynamic I guess
12:33:47FromDiscord<sOkam! 🫐> yeah
12:33:51FromDiscord<.aingel.> How do I grab the shared library from nimble though
12:34:00FromDiscord<sOkam! 🫐> you don't
12:34:05FromDiscord<sOkam! 🫐> you build it, and link it from that file
12:34:22FromDiscord<.aingel.> I mean I want people to be able to use this library by using nimble
12:34:32FromDiscord<.aingel.> Like nimble install newJson and then be able to use that in their project
12:34:36FromDiscord<sOkam! 🫐> if you are not building it, then you just `link: ...` or `passL: -l...` etc
12:34:40FromDiscord<.aingel.> Not just import this for a one time thing for my project
12:34:48FromDiscord<sOkam! 🫐> In reply to @.aingel. "I mean I want": you can use my wgpu bindings using nimble
12:35:05FromDiscord<.aingel.> Which is what?
12:35:12FromDiscord<sOkam! 🫐> that file i linked
12:35:57FromDiscord<sOkam! 🫐> https://github.com/heysokam/wgpu/blob/45121038b0786ef00f764d5e72ff07343fb82b2c/src/wgpu.nim#L5-L6↵This makes it so that the user will compile the library with the external process whenever they `import wgpu`
12:36:27FromDiscord<.aingel.> Ah I see
12:36:34FromDiscord<sOkam! 🫐> that way they don't need to set it up all themselves, they just `import thelib`
12:37:06FromDiscord<sOkam! 🫐> the trick on your side is building into `nimcache`, instead of to the project's folder
12:37:28FromDiscord<sOkam! 🫐> https://github.com/heysokam/wgpu/blob/45121038b0786ef00f764d5e72ff07343fb82b2c/src/wgpu/compile.nim#L36 which is what this line is doing
12:37:31FromDiscord<.aingel.> nimcache of the lib's folder?
12:37:46FromDiscord<sOkam! 🫐> In reply to @.aingel. "nimcache of the lib's": nimcache is a global folder, and it is configurable by the user
12:37:51FromDiscord<.aingel.> Oh okay
12:38:01FromDiscord<.aingel.> Aren't there separate proj folders for nimcache
12:38:09FromDiscord<sOkam! 🫐> its where all of the `.c` and `.o` files from the nim compiler go
12:38:12FromDiscord<.aingel.> Where u see your generated c code
12:38:16FromDiscord<.aingel.> It's in folders per project no?
12:38:23FromDiscord<sOkam! 🫐> yeah, basically
12:39:02FromDiscord<sOkam! 🫐> but that's what you want, afaik. you want the user to output that library you are building into somewhere they can find easily
12:39:19FromDiscord<.aingel.> Ah okay
12:39:24FromDiscord<.aingel.> Will it have to build each time
12:39:25FromDiscord<sOkam! 🫐> and that works across systems. so thats what nimcache is
12:39:28FromDiscord<.aingel.> Or does it get cached
12:39:41FromDiscord<sOkam! 🫐> its cached, unless you erase the folder
12:39:46FromDiscord<.aingel.> Nice
12:39:49FromDiscord<.aingel.> That works perfectly
12:39:50*junaid_ joined #nim
12:39:56FromDiscord<.aingel.> I am glad this library is super cool
12:40:02FromDiscord<.aingel.> simdjson it's super fast json parsing
12:40:12FromDiscord<.aingel.> There are rust bindings but no nim
12:40:42FromDiscord<.aingel.> And python of course too but I feel like the python bindings are easier, cause they dont have to worry about two compilers
12:40:46FromDiscord<.aingel.> (c and c++ in this case)
12:40:54FromDiscord<.aingel.> I think rust is probably the same way
12:42:54FromDiscord<Chronos [She/Her]> Simdjson?
12:43:33FromDiscord<Chronos [She/Her]> When would you even need gigabytes of JSON data at a second's notice
12:43:37FromDiscord<sOkam! 🫐> @Chronos [She/Her] #neat https://media.discordapp.net/attachments/371759389889003532/1158746178318499941/image.png?ex=651d5df9&is=651c0c79&hm=184aeade22b5ece5cbb957b7e7fef00c9cbe50c824a3c928c06e9223a51ddbfe&
12:44:44FromDiscord<Chronos [She/Her]> Thanks :D↵I did make a few issues aha but I can fix them when home
12:45:56FromDiscord<sOkam! 🫐> need to get my docs ready too. i have the tasks setup and all, but i didn't figure out how to create the github page
12:45:59FromDiscord<.aingel.> In reply to @chronos.vitaqua "When would you even": Processing reddit logs
12:46:09FromDiscord<.aingel.> I have all the reddit logs from 2005-2023 it's like
12:46:11FromDiscord<Chronos [She/Her]> Hm
12:46:22FromDiscord<.aingel.> 10tb of data
12:46:28FromDiscord<sOkam! 🫐> jeez
12:46:29FromDiscord<.aingel.> simdjson makes a massive difference
12:46:35FromDiscord<Chronos [She/Her]> In reply to @heysokam "need to get my": You could check the workflow I'm using? Or the one treeform uses, mine modifies theirs slightly tho
12:46:45FromDiscord<Chronos [She/Her]> In reply to @.aingel. "simdjson makes a massive": Ah okay that makes much more sense aha
12:46:53FromDiscord<.aingel.> Ya haha
12:47:13FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "You could check the": thats part of why its not done 🙈↵i don't want to be near github workflows and/or ci ⚰️
12:47:16FromDiscord<Chronos [She/Her]> https://github.com/Nimberite-Development/ModernNet/blob/master/.github/workflows/docs.yml
12:47:28FromDiscord<Chronos [She/Her]> In reply to @heysokam "thats part of why": Rip
12:47:34FromDiscord<.aingel.> Also native c++ works a lot faster than the simdjson python bindings if oyu use -O3
12:47:46FromDiscord<.aingel.> But thinking about it it's probably cause the bindings are not compiled iwth -O3
12:47:52FromDiscord<sOkam! 🫐> will eventually figure it out, i just didn't find the mental energy for it i guess 😄
12:47:53FromDiscord<.aingel.> But I bet it will be just as fast with nim
12:48:29FromDiscord<.aingel.> I think this should be faster than treeform's jsony which is the fastest json parser we have for nim right now
12:48:42FromDiscord<.aingel.> Although that is pure nim implementation
12:48:49FromDiscord<.aingel.> (edit) "Although that is ... pure" added "a"
12:58:13FromDiscord<dissolved.girl> In reply to @chronos.vitaqua "When would you even": Slightly unrelated, but this discussion reminded me of this blog post: https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times-by-70/
12:58:18FromDiscord<dissolved.girl> About now _not_ to do JSON parsing
13:05:32FromDiscord<Chronos [She/Her]> That sounds hilarious xD
13:06:01FromDiscord<Chronos [She/Her]> Let us just port it to Nim /j
13:30:05FromDiscord<sOkam! 🫐> In reply to @dissolved.girl "Slightly unrelated, but this": really fun read
13:32:35*Mister_Magister quit (Ping timeout: 240 seconds)
13:40:02*junaid_ quit (Remote host closed the connection)
13:46:31FromDiscord<fowl.mouth> It used to take like 10 minutes to load the game
13:53:22FromDiscord<Chronos [She/Her]> This is GTA 5, right?
13:53:47FromDiscord<Chronos [She/Her]> I swear when I was younger, on PS4, singleplayer took multiple minutes to load
14:00:28NimEventerNew post on r/nim by fyzic: Nim vs Rust vs Go vs Zig vs Crystal for data processing, see https://reddit.com/r/nim/comments/16ysox5/nim_vs_rust_vs_go_vs_zig_vs_crystal_for_data/
14:12:59PMunchAnyone wants to go golfing?
14:19:48FromDiscord<Phil> Want is a strong word
14:20:09PMunchNot sure how they got 200ms, must be running on a super slow machine
14:20:40PMunchI compiled it and got ~70ms
14:20:52PMunchWith LTO it dropped to ~50ms
14:25:13FromDiscord<Phil> What was the fastest way to read in a file again?
14:25:37PMunchIt reads in the file before it starts the timer
14:25:38FromDiscord<Phil> I tend to just use open but I recall beef starting beef about that
14:25:56FromDiscord<nervecenter> KISS
14:25:58FromDiscord<Phil> In reply to @PMunch "It reads in the": Yeah I'm about to throw the book at this
14:26:32FromDiscord<nervecenter> I'd say try not to do anything magical, show that Nim can be fast while being easy to read and easy to use
14:26:43FromDiscord<nervecenter> That's my biggest problem with a lot of these exercises
14:26:44FromDiscord<Phil> Yeah but I recall open not being the greatest
14:26:52FromDiscord<nervecenter> the sources start to become write-only
14:26:52FromDiscord<Phil> In reply to @nervecenter "That's my biggest problem": These exercises are worthless by default
14:26:57FromDiscord<Phil> Literally always worthless
14:27:03FromDiscord<Phil> This is basically just about who can cheat the hardest imo
14:27:40PMunchThis is the fastest I have so far: http://ix.io/4I47
14:27:48PMunchSub 50ms on my machine
14:28:07FromDiscord<Phil> I mean I just added -d:danger and -d:lto and already got under 50
14:28:10PMunchOops, that nimcall doesn't have to be there, it didn't make a difference
14:28:18FromDiscord<Phil> And that is without even jumping to jsony
14:28:24PMunchWell -d:danger isn't allowed as it says to not disable bounds checks
14:28:38PMunchJson parsing is also done before the timer starts, so that doesn't matter
14:29:51FromDiscord<Phil> Where does it say bounds checks are necessary?
14:30:15PMunchIn the "Rules" section of the README: https://github.com/jinyus/related_post_gen/tree/main
14:34:11PMunchTBH I think this mostly just benchmarks the built in table implementation
14:35:52*PMunch quit (Quit: Leaving)
14:40:01FromDiscord<Phil> In reply to @PMunch "This is the fastest": You can get slightly faster if you use ref seq[int] instead of seq[int] to reduce some copies
14:41:13FromDiscord<jviega> Hey, I was thinking of wrapping my lock-free data structures in the not-too distant future. Two questions: 1) Is there any sort of static max on # of threads, etc. 2) Is incref atomic in refc (and orc I suppose)? Because if not, then I'm not sure it's worth doing at all, as it would require unnatural work to use anyway.
14:43:00FromDiscord<leorize> 1. no
14:43:01FromDiscord<leorize> 2. no
14:43:04FromDiscord<Phil> Given that all that benchmarks do is annoy me I'll leave that one overall to you Pmunch
14:43:07FromDiscord<ringabout> > Is incref atomic in refc (and orc I suppose)Is incref atomic in refc (and orc I suppose)↵It's not. You are supposed to use `shared pointer` or `--mm:atomicArc`
14:44:17FromDiscord<leorize> 2. no
14:44:47FromDiscord<odexine> why'd you send that 2nd one twice
14:47:12NimEventerNew thread by ITwrx: Related_post_gen benchmark, see https://forum.nim-lang.org/t/10525
14:47:30*Mister_Magister joined #nim
14:52:14FromDiscord<Chronos [She/Her]> In reply to @NimEventer "New post on r/nim": https://github.com/simdjson/simdjson#bindings-and-ports-of-simdjson imagine porting/binding this in Nim just for the challenge-
14:52:46FromDiscord<saint._._.> In reply to @PMunch "It reads in the": Do we have to use the standard json lib?
14:52:54FromDiscord<saint._._.> I’m sure using another json lib will get it faster
14:53:05FromDiscord<saint._._.> In reply to @chronos.vitaqua "https://github.com/simdjson/simdjson#bindings-and-p": That’s literally what i’ve done haha
14:53:19FromDiscord<saint._._.> Oh on my other account
14:53:28FromDiscord<Chronos [She/Her]> Pmunch just said that the JSON Nim doesn't matter at all here
14:53:34FromDiscord<saint._._.> Oh ok
14:54:01FromDiscord<Chronos [She/Her]> Json parsing
14:55:59*arkanoid joined #nim
15:04:00*Mister_Magister quit (Ping timeout: 272 seconds)
15:16:58*def- quit (Quit: -)
15:18:32*def- joined #nim
15:29:27*Mister_Magister joined #nim
15:40:13*Mister_Magister quit (Ping timeout: 252 seconds)
15:41:35*azimut joined #nim
15:41:37*Mister_Magister joined #nim
16:01:58*Mister_Magister quit (Ping timeout: 255 seconds)
16:08:39*Mister_Magister joined #nim
16:11:01FromDiscord<diogenesoftoronto> In reply to @ringabout "> Is incref atomic": I was about to say woah nim has shared pointers but then again nim has almost everything so maybe I shouldn't be surprised
16:11:45NimEventerNew post on r/nim by Kiloneie: Nim for Beginners Sets, see https://reddit.com/r/nim/comments/16yw157/nim_for_beginners_sets/
16:41:18FromDiscord<ezquerra> In reply to @NimEventer "New post on r/nim": Are they compiling with the default options? If so they are compiling in debug mode, aren't they?
16:52:03FromDiscord<michaelb.eth> In reply to @ezquerra "Are they compiling with": nah, it's compiled with `-d:release`
16:58:49FromDiscord<my.narco> hooray! https://media.discordapp.net/attachments/371759389889003532/1158810400452771840/image.png?ex=651d99c9&is=651c4849&hm=7541743b03b4ca869a8f73739c88877156a84e2afd6126a04f2449597f9cb9dd&
17:00:03FromDiscord<.aingel.> What is this syntax? ↵`sh &"cargo build --target-dir {trgDir}", wgpuDir`
17:00:14FromDiscord<.aingel.> `proc sh (cmd :string; dir :string= "") :void=`
17:00:40FromDiscord<.aingel.> you can pass arguments without brackets?
17:00:47FromDiscord<.aingel.> What does the & at the beginning of the string do?
17:00:57FromDiscord<nervecenter> `&` is string interpolation
17:01:09FromDiscord<nervecenter> `{trgDir}` gets stringified and dropped in
17:01:49FromDiscord<nervecenter> The function signature is just weird spacing, I'd do `proc sh (cmd: string, dir: string = ""): void =`
17:01:57FromDiscord<nervecenter> (edit) "sh (cmd:" => "sh(cmd:"
17:02:07FromDiscord<.aingel.> Oh right thanks
17:02:18FromDiscord<nervecenter> The first line is a call to sh, yes you can forego brackets
17:02:30FromDiscord<nervecenter> Same as `sh(&"cargo build --target-dir {trgDir}", wgpuDir)`
17:02:43FromDiscord<.aingel.> I have been using fmt so I didnt recognize the &
17:02:52FromDiscord<nervecenter> `&` is generally better
17:02:58FromDiscord<.aingel.> u can do ; instead of , for parameters?
17:03:02FromDiscord<.aingel.> In a proc definition?
17:03:05FromDiscord<.aingel.> In reply to @nervecenter "`&` is generally better": gotcha
17:03:58FromDiscord<nervecenter> In reply to @.aingel. "u can do ;": Yes and sometimes you need to if you want to define multiple parameters of one type, for example↵`proc sample(string1, string2, string3: string; int1, int2: int)`
17:04:11FromDiscord<.aingel.> Gotcha
17:04:14FromDiscord<nervecenter> `;` is the safest parameter separator if you ever run into issues
17:04:19FromDiscord<.aingel.> Interesting
17:04:35FromDiscord<.aingel.> Is there a diff between gorgeEx and execshellcmd
17:05:16FromDiscord<nervecenter> `gorgeEx` docs say:↵> This is an alias for staticExec.
17:05:28FromDiscord<nervecenter> https://nim-lang.org/docs/system.html#gorgeEx%2Cstring%2Cstring%2Cstring
17:05:39FromDiscord<nervecenter> Sorry, Ex includes the exit code
17:05:41FromDiscord<.aingel.> Yeah
17:05:51FromDiscord<.aingel.> I guess I dont get what it means by the compile time stuff
17:06:03FromDiscord<.aingel.> can execshellcmd do it during compile time too?
17:06:13FromDiscord<.aingel.> If I'm running it in a static block
17:06:16FromDiscord<nervecenter> In a `static:` block it can
17:06:27FromDiscord<.aingel.> Right, so then whats the diff
17:06:31FromDiscord<.aingel.> Why do u need gorge
17:06:32FromDiscord<nervecenter> Much of the language can run in a `static:` block, very little can't
17:06:55FromDiscord<nervecenter> Uh...more explicit? I guess you'd need to ask someone who uses it
17:07:22FromDiscord<.aingel.> Gotcha
17:07:43FromDiscord<nervecenter> Also `const` defines compile-time constants, anything assigned to `const` will be evaluated at compile time
17:07:58FromDiscord<nervecenter> you can for example slurp the contents of a file at compile time and assign them to a `const` string
17:08:08FromDiscord<.aingel.> Right
17:08:16FromDiscord<.aingel.> Thats kinda cool actually
17:08:18FromDiscord<nervecenter> `const my_file = read_file("example.txt")`
17:08:30FromDiscord<.aingel.> Does cpp have that feature?
17:08:43FromDiscord<.aingel.> I'm sure it does somehow but doesn't seem that easy
17:08:58FromDiscord<nervecenter> I think it does but as far as I know, yeah it's pretty convoluted
17:08:58FromDiscord<.aingel.> Sounds like some preproc thing you'd have to do
17:09:02FromDiscord<.aingel.> Ya
17:09:05FromDiscord<.aingel.> Very cool
17:09:18FromDiscord<.aingel.> I like that nim has a lot of styles of writing code, it's more like ruby in that sense
17:09:39FromDiscord<nervecenter> I definitely recommend picking one for your own code and sticking to it, try not to mix
17:09:39FromDiscord<.aingel.> I wonder if it's more flexible in that regard than crystal
17:10:28FromDiscord<.aingel.> Yea I agre
17:10:34FromDiscord<.aingel.> I meant more like that you can pick your own style
17:10:49FromDiscord<.aingel.> Like, I prefer appending functino calls rather than prepending them like you have to do in python
17:11:02FromDiscord<.aingel.> I like how you have that option in nim
17:11:13FromDiscord<.aingel.> (edit) "functino" => "function"
17:11:33FromDiscord<nervecenter> sent a code paste, see https://play.nim-lang.org/#ix=4I4U
17:11:39FromDiscord<nervecenter> (edit) "https://play.nim-lang.org/#ix=4I4U" => "https://play.nim-lang.org/#ix=4I4V"
17:12:08FromDiscord<nervecenter> Working really well so far
17:12:49FromDiscord<nervecenter> And yes being able to chain procs with UFCS is quite nice
17:13:23FromDiscord<.aingel.> Oh cool, I thought the 4 spaces was against the nim standard formatting
17:13:27FromDiscord<nervecenter> You can design class-like modules that are just objects (structs) plus some procs that take the struct as the first `var` paramater
17:13:29FromDiscord<nervecenter> bam, a class
17:13:31FromDiscord<.aingel.> I find the 2 spaces kinda hard to read tbh
17:13:52FromDiscord<nervecenter> In reply to @.aingel. "Oh cool, I thought": You can do what you want really, just be clean and consistent
17:14:10FromDiscord<.aingel.> Gotcha
17:14:11FromDiscord<nervecenter> (edit) "struct" => "object"
17:14:15FromDiscord<.aingel.> Doesn't go have UFCS
17:14:20FromDiscord<.aingel.> (edit) "go" => "Go"
17:14:21FromDiscord<nervecenter> I dunno, D does
17:16:23FromDiscord<.aingel.> In reply to @nervecenter "bam, a class": Yeah this is nice
17:16:33FromDiscord<.aingel.> U don't really have to 'think' about oop
17:18:05FromDiscord<Phil> Just to make sure I'm not being an idiot:↵When I wrap a C enum it basically doesn't matter what name I give it all because in the end its all just ints, right?
17:19:33FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4I4Y
17:22:51FromDiscord<stoneface86> that's what I do for wrapping C enums, I also use `{.size: sizeof(cint).}` as well
17:23:42FromDiscord<stoneface86> and if there's two members with the same value I make one of them a const
17:30:46FromDiscord<.aingel.> once I do nimble develop, do I need to do anything else for myself to be able to import that somewhere else?
17:31:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Basically you tell your": It happens with Confy (ZigCC) but not with default build system
17:37:33FromDiscord<Chronos [She/Her]> https://github.com/ee7/pragmagic-uuids/tree/urandom-CryptAcquireContext how would I use this lib as a nimble dep?
17:41:29FromDiscord<.aingel.> After I do nimble develop I still can't import the package
17:41:37FromDiscord<.aingel.> It works if i do nimble install though
18:01:04FromDiscord<.aingel.> What do I do with a header file I use importc with if I want to put that in a nimble package
18:02:45FromDiscord<.aingel.> When I import that nimble package it doesn't copy over the header files in the nimble package dir
18:03:28FromDiscord<mantielero> Hi all. I'd like to learn a little bit of OpenGL. I found [this](https://github.com/johnnovak/learnopengl-nim/tree/master), but seems outdated. Any recommendation? I also saw: nimgl, easygl, shady, ... Not sure about where to start.
18:08:30FromDiscord<Elegantbeef> I'd suggest using https://github.com/nim-lang/opengl and the learnopengl.com C++ code
18:09:00FromDiscord<Elegantbeef> It doesnt really matter where you go opengl is the same
18:11:47FromDiscord<vindaar> I agree with Elegantbeef.↵Just be aware of the difference between OpenGL 2 and modern OpenGL. Learn about the difference and then decide what it actually is you want to learn.Other resources\:↵● https://www.labri.fr/perso/nrougier/python-opengl/↵● https://www.opengl-tutorial.org/beginners-tutorials/
18:12:39FromDiscord<mantielero> Thanks guys. I'll take a look.
18:12:43FromDiscord<.aingel.> @ElegantBeouf Do you know of a standard way to do importc with the header file for a nimble package?
18:13:29FromDiscord<.aingel.> I'm looking at the way it's done here, and was wondering if this is a standard or good way or if there's a simpler way https://github.com/wltsmrz/nim_zstd/blob/develop/zstd/common.nim
18:17:06*LuxuryMode quit (Quit: Connection closed for inactivity)
18:22:24*dza joined #nim
18:33:04NimEventerNew thread by jmgomez: Pattern Matching , see https://forum.nim-lang.org/t/10526
18:33:15FromDiscord<jmgomez> People, can you vote here if you want to see PM on the STD https://github.com/nim-lang/RFCs/issues/537
18:38:32FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4I5b
18:45:38FromDiscord<sOkam! 🫐> In reply to @.aingel. "u can do ;": yes, in fact its less errorprone, because you are forced to use a different type
18:46:43FromDiscord<sOkam! 🫐> In reply to @.aingel. "Is there a diff": yes, gorgeEx doesn't open a shell, it just eats the data and then gives it back to you↵execShellCmd outputs the data to the console, which is what I want but the vm has no support for shell execution
18:47:04FromDiscord<sOkam! 🫐> `when nimvm` does not support `exec` nor `execShellCmd` either
18:47:18FromDiscord<sOkam! 🫐> so you are forced to gorgeEx inside `static: ...` blocks
18:47:37FromDiscord<sOkam! 🫐> (edit) "blocks" => "blocks, even if the most desirable option is a shell"
18:48:27FromDiscord<sOkam! 🫐> In reply to @nervecenter "In a `static:` block": static does not allow non-vm commands
18:50:04FromDiscord<sOkam! 🫐> In reply to @.aingel. "once I do nimble": nimble develop is broken in a big way, been like that for months. so don't be suprised if it just doesn't do what you expect it to do
18:56:02FromDiscord<.aingel.> In reply to @heysokam "nimble develop is broken": Oh okay gotcha
18:56:26FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4I5g
18:56:30FromDiscord<.aingel.> @sOkam! 🫐 I'm having an issue getting the importc: header include to work in a nimble package
18:56:49FromDiscord<sOkam! 🫐> In reply to @.aingel. "<@186489007247589376> I'm having an": how are you resolving the lib path?
18:56:54FromDiscord<.aingel.> When I import something from nimble, it just copies over the nim file itself?
18:57:11FromDiscord<.aingel.> Well it builds normally if I'm just building it and not importing from nimble in another project
18:57:20FromDiscord<.aingel.> I'm just using the header file as local
18:57:26FromDiscord<.aingel.> like next to the nim file
18:57:44FromDiscord<sOkam! 🫐> whats your exact setup? there are a lot of moving pieces that I'm missing info about
18:57:50FromDiscord<sOkam! 🫐> (edit) "whats your exact setup? there are a lot of moving pieces ... that" added "there"
18:58:34FromDiscord<.aingel.> Right so, I have a package with nimble.. it's gemmaJSON/src/gemmaJSON.nim and some header file
18:58:35FromDiscord<.aingel.> {.importc: "cysimdjson_element_get_type", header: "gemmaJSON/cysimdjsonc.h".}
18:58:40FromDiscord<.aingel.> Importing it this way
18:58:43FromDiscord<sOkam! 🫐> also, are you configuring the nimble file so it adds `.h` files, not just `.nim`? just in case
18:58:59FromDiscord<.aingel.> In reply to @heysokam "also, are you configuring": No, how do I do that
18:59:04FromDiscord<.aingel.> Right now it's just copying the nim to the new proj cahce file
18:59:06FromDiscord<.aingel.> Which is the issue
18:59:08FromDiscord<sOkam! 🫐> i never remember the syntax, let me search
18:59:17FromDiscord<sOkam! 🫐> yeah then thats the probl probably
18:59:56FromDiscord<sOkam! 🫐> @.aingel. https://nim-lang.org/docs/nimscript.html#installFiles
19:00:13FromDiscord<sOkam! 🫐> sorry, this one https://nim-lang.org/docs/nimscript.html#installExt
19:00:29FromDiscord<sOkam! 🫐> `installExt = @[".nim", ".h"]` in your nimble file
19:00:46FromDiscord<.aingel.> Ah
19:00:47FromDiscord<sOkam! 🫐> if you have C files that you need, also remember to add that ext, or whatever else is required
19:01:09FromDiscord<.aingel.> So https://github.com/wltsmrz/nim_zstd/blob/develop/zstd/common.nim
19:01:20FromDiscord<.aingel.> This project also is a nimble package and it wraps a c lib
19:01:26FromDiscord<.aingel.> But I dont see it using installext or something
19:01:28FromDiscord<.aingel.> How does it work?
19:02:12FromDiscord<sOkam! 🫐> idk 🤷‍♂️
19:02:20FromDiscord<sOkam! 🫐> but i always add them, and they work for me
19:02:25FromDiscord<.aingel.> gotcha
19:03:29FromDiscord<sOkam! 🫐> actually, you are right. i don't have them here either 🤔↵https://github.com/heysokam/nglfw/blob/master/nglfw.nimble↵maybe its because it is a submodule? 🧩
19:05:27*rockcavera joined #nim
19:05:49FromDiscord<.aingel.> That breaks the nimble package too
19:05:56FromDiscord<.aingel.> It lets me install, but can't import it then
19:06:01FromDiscord<.aingel.> If I take out installExt = @[".nim", ".h"], then it works
19:06:12FromDiscord<.aingel.> Well lets me import, doesn't work cause fails on the header file
19:06:28FromDiscord<sOkam! 🫐> ic
19:06:45FromDiscord<.aingel.> I have the same structure as your proj there
19:07:27FromDiscord<.aingel.> Oh well nto eactly the same
19:07:33FromDiscord<.aingel.> cause yeah the procs are not in a submodule
19:07:39FromDiscord<.aingel.> Your main nim just has compile
19:07:46FromDiscord<.aingel.> And the procs are in the submodule
19:07:50FromDiscord<.aingel.> Idk if that changes anything
19:08:26FromDiscord<sOkam! 🫐> something is off, though. because this is not in a submodule and its added↵https://github.com/heysokam/nglfw/blob/master/src/nglfw/metal_glue.h
19:08:35FromDiscord<.aingel.> ` passC: &"-I{nglfwDir}", # Include nglfw/ for the metal_glue.h file`
19:08:40FromDiscord<.aingel.> I think this is it but
19:08:50FromDiscord<sOkam! 🫐> yeah but that's not for nimble
19:09:02FromDiscord<sOkam! 🫐> nimble doesn't know that line exists
19:10:06FromDiscord<.aingel.> When you import that package via nimble, the h files get copied over to the cache dir?
19:10:15FromDiscord<sOkam! 🫐> yeah afaik 🤔
19:10:24FromDiscord<sOkam! 🫐> let me double check, just in case
19:11:07FromDiscord<sOkam! 🫐> yeah there they are https://media.discordapp.net/attachments/371759389889003532/1158843690115154001/image.png?ex=651db8c9&is=651c6749&hm=c9c7dc4bc90070a8a26093db48015ffa28122fd7d533ba31cb9b9781814998f2&
19:11:16FromDiscord<sOkam! 🫐> is your package a hybrid, maybe?
19:11:22FromDiscord<.aingel.> Nope
19:11:38FromDiscord<.aingel.> Wait
19:11:46FromDiscord<.aingel.> I'm not sure how to check but didnt select that
19:11:52FromDiscord<sOkam! 🫐> it would be a hybrid them moment is has `bin = ...`
19:12:01FromDiscord<sOkam! 🫐> (edit) "is" => "it"
19:12:05FromDiscord<.aingel.> Okay there's no nbin
19:12:19FromDiscord<.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4I5s
19:12:27FromDiscord<sOkam! 🫐> ah nah, thats a normal lib yea
19:12:49FromDiscord<sOkam! 🫐> confused why that's skipping the header, though. makes no sense. maybe someone else knows why, never happened to me so far
19:12:55FromDiscord<.aingel.> the .h files are ther ein the .nimble area
19:13:08FromDiscord<.aingel.> That's not the issue, I guess I don't really know how nimble imports things to a new project
19:13:19FromDiscord<.aingel.> But I have a new project like test.nim, and I do import myLibrary
19:13:20FromDiscord<sOkam! 🫐> can you sshot your project tree?
19:13:25FromDiscord<.aingel.> Which one
19:13:53FromDiscord<sOkam! 🫐> well the one that has the .h, but is skipping it when turning into a package
19:14:02FromDiscord<.aingel.> Nah that's not exactly what's happening
19:14:07FromDiscord<.aingel.> the .h goes into the nimble package
19:14:17FromDiscord<.aingel.> When I have a new proj, test, and I do import myNimblePack
19:14:23FromDiscord<.aingel.> I can see in the .test/cache
19:14:30FromDiscord<.aingel.> It pulls mynimblepack.nim
19:14:37FromDiscord<.aingel.> (edit) "mynimblepack.nim" => "mynimblepack.nim.c"
19:14:50FromDiscord<.aingel.> But no header files into the cache of my new test project
19:14:51FromDiscord<sOkam! 🫐> so the header is not copied over to the nimcache, but its inside the package?
19:14:56FromDiscord<.aingel.> Yeah
19:15:03FromDiscord<sOkam! 🫐> yeah thats not happening automatically
19:15:26FromDiscord<.aingel.> I'm not sure if ithe header is supposed to be copied to the cache
19:15:31FromDiscord<sOkam! 🫐> why do you think i have all those `thisDir` crap there 🙈↵you need to pass the paths absolute to the ocmpiler, so it doesn't choke
19:16:09FromDiscord<sOkam! 🫐> In reply to @.aingel. "I'm not sure if": its not, you just `-Ipath/to/header/` and then `header.h` in the import calls
19:16:23FromDiscord<.aingel.> okay but whats the path/to/header
19:16:27FromDiscord<.aingel.> the nimble path?
19:16:45FromDiscord<.aingel.> I guess that would maek sense lol
19:16:50FromDiscord<sOkam! 🫐> no, the absolute path where the header file is stored, but from the perspective of the compiler at compile time
19:17:06FromDiscord<.aingel.> Yeah, so the absolute path to the nimble installation
19:17:12FromDiscord<sOkam! 🫐> thats what that `-I{glfwDir}` is there fore
19:17:18FromDiscord<.aingel.> right
19:18:03FromDiscord<sOkam! 🫐> you need to take the path from the `thisDir` constant... and then feed it to the compiler with a `passC: "-Ithe/absolute/path/`
19:19:17FromDiscord<sOkam! 🫐> this turns into the correct absolute path at compiletime, from the perspective of the compiler↵https://github.com/heysokam/nglfw/blob/6484b0499d3e8c850baf6b7c287ead445b2e8a83/src/nglfw/compile.nim#L9↵That way you don't need to move the files, you just `-I{yourDir}`
19:19:59FromDiscord<.aingel.> gothc
19:20:01FromDiscord<.aingel.> (edit) "gothc" => "gotcha"
19:25:29FromDiscord<.aingel.> @sOkam! 🫐 how do I trigger the compile to run always
19:25:35FromDiscord<.aingel.> I feel it's not running if it's cached or something
19:27:26FromDiscord<.aingel.> It's okay actually
19:28:29FromDiscord<sOkam! 🫐> it runs whenever the files change, afaik
19:29:03FromDiscord<.aingel.> I got the header file to find but now just need to link the shared lib correctly
19:38:39FromDiscord<.aingel.> @sOkam! 🫐 so it's building the shared lib to the cache folder, but it's not linking
19:38:51FromDiscord<.aingel.> Even though I have `{.passL: &"-L{trgDir} -lgemmaJSON".}` in the compile.nim
19:39:15FromDiscord<.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4I5D
19:40:17FromDiscord<sOkam! 🫐> what does "not linking" mean exactly?
19:40:42FromDiscord<sOkam! 🫐> is it erroring on the file not being found?
19:42:03FromDiscord<.aingel.> sent a code paste, see https://paste.rs/LETYb
19:42:07FromDiscord<.aingel.> Yeah
19:42:17FromDiscord<.aingel.> ` nim c -r -f --passL:="-L/Users/saint/.cache/nim/test_d/" test.nim↵`
19:42:25FromDiscord<.aingel.> This is even after I explicitly do the passL again
19:42:45FromDiscord<.aingel.> sent a code paste, see https://paste.rs/kRLS0
19:42:52FromDiscord<.aingel.> And the shared lib is there in the cache file
19:42:53FromDiscord<.aingel.> It gets built
19:44:58FromDiscord<sOkam! 🫐> In reply to @.aingel. "` nim c -r": is the `:=` a typo?
19:51:12FromDiscord<.aingel.> Ya sorry
19:51:30FromDiscord<.aingel.> No =
19:52:08FromDiscord<.aingel.> Yeah basically my issue is with the passL path now
19:52:24FromDiscord<.aingel.> Do you know how I can print during the compile stage?
19:52:32FromDiscord<.aingel.> my echos dont seem to show up anywher
19:54:04FromDiscord<.aingel.> Oh right it would only print on after running, which it isn't
19:54:07FromDiscord<sOkam! 🫐> In reply to @.aingel. "Do you know how": echo inside a static block will
19:54:11FromDiscord<.aingel.> Ah
19:54:28FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4I5G
19:55:54FromDiscord<.aingel.> Yup
19:55:57FromDiscord<.aingel.> Thanks!
19:56:34FromDiscord<.aingel.> Okay so...the shared lib builds in the cache dir, I am doing `{.passL: &"-L{trgDir}/ -lgemmaJSON".}` and trgDir is the cache dir, confirmed with a printout too
19:57:47FromDiscord<.aingel.> So it builds and links fine
19:57:48FromDiscord<.aingel.> But cannot run it
19:57:54FromDiscord<.aingel.> sent a long message, see http://ix.io/4I5I
19:58:08FromDiscord<.aingel.> (edit) "long message," => "code paste," | "http://ix.io/4I5I" => "https://play.nim-lang.org/#ix=4I5J"
19:58:23FromDiscord<sOkam! 🫐> ah because it wants access to it at runtime, maybe?
19:58:28FromDiscord<.aingel.> Yeah
19:59:32FromDiscord<sOkam! 🫐> seems to be searching for `./libgemmaJSON.so`, so you could help the user at compiletime by moving the .so file right next to the binary they output https://media.discordapp.net/attachments/371759389889003532/1158855879932772372/image.png?ex=651dc424&is=651c72a4&hm=5aac20ae0682fbbbb1eb8bd01dcdfddbde8a79b474d24f2fa11262f8e1568d20&
19:59:46*rez joined #nim
19:59:54FromDiscord<.aingel.> Yea
20:00:16FromDiscord<.aingel.> That makes sense, I guess it should be outputted next to the binary anyways for like
20:00:19FromDiscord<.aingel.> portability
20:00:24FromDiscord<.aingel.> Does that make sense?
20:00:36FromDiscord<sOkam! 🫐> probably, because they will need to distribute the file to the users too
20:00:46FromDiscord<sOkam! 🫐> so better to give it to them right away
20:01:25FromDiscord<.aingel.> Right
20:06:32FromDiscord<.aingel.> @sOkam! 🫐 Do you know how I get the current path of like where the compiler is going to output the binary?
20:06:35FromDiscord<.aingel.> Not the current source path
20:06:37FromDiscord<.aingel.> Or cache path
20:08:44FromDiscord<sOkam! 🫐> In reply to @.aingel. "<@186489007247589376> Do you know": maybe something in here https://nim-lang.org/docs/compilesettings.html
20:09:39FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4I5N
20:10:13FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4I5N" => "https://paste.rs/jEiYU"
20:11:59FromDiscord<.aingel.> Worked! Thanks a lot @sOkam! 🫐
20:12:05FromDiscord<.aingel.> 🤗
20:15:27FromDiscord<sOkam! 🫐> no worries. i feel like this sort of "buildsystem with compile pragmas and static blocks" should be a guide somewhere↵i struggled a lot to make it work too, just because I had no idea all these things existed
20:15:55FromDiscord<sOkam! 🫐> (edit) removed "feel like this sort of "buildsystem with compile pragmas and static blocks" should be a guide somewhere↵i" | "existed" => "existed↵i feel like this sort of "buildsystem with compile pragmas and static blocks" should be a guide somewhere"
20:22:55FromDiscord<.aingel.> Yeah definitely
20:23:34*rez quit (Quit: much snoozes...)
20:54:23FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4I5R
20:54:42FromDiscord<user2m> (edit) "https://play.nim-lang.org/#ix=4I5R" => "https://play.nim-lang.org/#ix=4I5S"
20:57:15FromDiscord<user2m> ok I see here that parseJson closes the stream after it's done (https://nim-lang.org/docs/json.html#parseJson%2CStream%2Cstring)
21:06:31FromDiscord<.aingel.> In reply to @user2m "ok I see here": Yeah this is right I think
21:06:50FromDiscord<.aingel.> Also can someone tell me what the diff between static linking is an including a .o file to the compiler?
21:11:58FromDiscord<raynei486> In reply to @.aingel. "Also can someone tell": There isn't much difference other than the fact that a library is a collection of object files (inb4 "acktually")
21:12:12FromDiscord<.aingel.> Hmm
21:12:28FromDiscord<.aingel.> Why does macOS say it doesn't support staticly linked binaries then?
21:12:32FromDiscord<.aingel.> https://developer.apple.com/library/archive/qa/qa1118/_index.html
21:12:38FromDiscord<.aingel.> "A statically linked binary is one that does not import system libraries and frameworks dynamically, but instead makes direct system calls into the kernel."
21:12:44FromDiscord<.aingel.> I guess this means system libraries
21:14:24FromDiscord<raynei486> hmm
21:15:20FromDiscord<raynei486> I guess it's saying that it doesn't provide the C runtime for you to make statically linked binaries in macos
21:15:27FromDiscord<raynei486> since it specifically mentions `crt0.o`
21:16:11FromDiscord<raynei486> nvm
21:16:15FromDiscord<raynei486> that's exactly what the title is 💀
21:16:46FromDiscord<.aingel.> Right
21:16:58FromDiscord<.aingel.> How do I include some .o files in the nim compiler?
21:17:01FromDiscord<.aingel.> is it passC?
21:17:31FromDiscord<raynei486> you just link it with `-l`
21:18:32*advesperacit quit ()
21:18:40FromDiscord<raynei486> should be passing a flag to the linker
21:18:53FromDiscord<.aingel.> okay passL
21:19:25*oprypin quit (Quit: Bye)
21:19:34*oprypin joined #nim
21:20:42FromDiscord<.aingel.> Do you know how to do it @raynei486
21:20:48FromDiscord<.aingel.> I think I've done it before but I've forgotten now
21:21:49FromDiscord<.aingel.> Oh, it's using the compile pragma I guess
21:23:37FromDiscord<.aingel.> (edit) "compile" => "link"
21:24:10FromDiscord<raynei486> Or you could do that
21:27:42FromDiscord<.aingel.> Soo you can compile c++ code and include it in C (for nim)
21:28:06FromDiscord<.aingel.> As longa s you have a a c header and do extern C, and you can dynamically link the C++ stl
21:28:12FromDiscord<.aingel.> Which is kinda wild I didn't know you could do that
21:28:27FromDiscord<.aingel.> I'm sure it's common knowledge but I didn't know, this would have saved me a lot of hassle
21:31:22FromDiscord<raynei486> pretty sure yes
21:35:37FromDiscord<raynei486> https://media.discordapp.net/attachments/371759389889003532/1158880058950299689/image.png?ex=651ddaa9&is=651c8929&hm=cdf729811dc06f5064ee2f0b668c4be81491486b5ee577d73515d5a8d5c31981&
21:39:27FromDiscord<.aingel.> What editor is that?
21:39:49FromDiscord<.aingel.> @raynei486 I think the main thing is using the c++ stl
21:39:59FromDiscord<.aingel.> I can link it with c using -lc++ on macos
21:40:05FromDiscord<.aingel.> Not sure what the lib name is for linux
21:40:39FromDiscord<.aingel.> Whats the command line equivalent of the link pragma?
21:40:49FromDiscord<raynei486> so you're trying to link the C++ stl on macos?
21:41:28FromDiscord<.aingel.> Ya
21:41:33FromDiscord<.aingel.> It works though @raynei486
21:41:49FromDiscord<.aingel.> Everything is good, just wondering what the command line equiv of the link pragma is
21:41:50FromDiscord<raynei486> In reply to @.aingel. "What editor is that?": it's (black-box)[https://gitlab.gnome.org/raggesilver/blackbox] with solarized-dark theme
21:41:59FromDiscord<raynei486> yeah i'm also trying to figure it out
21:42:05FromDiscord<raynei486> nim docs are sometimes a bit scuffed
21:42:10FromDiscord<.aingel.> In reply to @raynei486 "nim docs are sometimes": Haha ya
21:42:17FromDiscord<.aingel.> In reply to @raynei486 "it's (black-box)[https://gitlab.gnome.org/raggesilv": What editor though?
21:42:28FromDiscord<.aingel.> Or is that just your compiler output?
21:42:38FromDiscord<raynei486> It's just a terminal emulator
21:43:07FromDiscord<.aingel.> No I got that
21:43:31FromDiscord<.aingel.> But it's printing out your source file too
21:43:37FromDiscord<.aingel.> Was that some sort of cat
21:43:39FromDiscord<raynei486> ohh
21:44:05FromDiscord<raynei486> yeah it's basically enhanced cat called [bat](https://github.com/sharkdp/bat)
21:45:14FromDiscord<.aingel.> Gotcha!
21:49:43FromDiscord<Chronos [She/Her]> Do y'all think it's worth making bindings to Rust libs in Nim?
21:50:11FromDiscord<Chronos [She/Her]> Out of pure curiosity here too, I don't have much knowledge of Rust besides the times I've touched it and went "nope"
21:50:47FromDiscord<.aingel.> We need to make rust less popular lol
21:50:58NimEventerNew post on r/nim by angel__-__-: Command line equivalent of link pragma?, see https://reddit.com/r/nim/comments/16z4nf1/command_line_equivalent_of_link_pragma/
21:51:33FromDiscord<Chronos [She/Her]> Wouldn't that just be `--passl:"-lLIBRARY"`?
21:51:41FromDiscord<raynei486> @.aingel. I got this working https://media.discordapp.net/attachments/371759389889003532/1158884099910553670/image.png?ex=651dde6c&is=651c8cec&hm=0c87bf31b0544f671d558cb2a4a99ebe7d42974ff55cf15533453d00b20d0459&
21:51:45FromDiscord<Chronos [She/Her]> Since `-l` on the C compiler is for linking?
21:52:01FromDiscord<Chronos [She/Her]> In reply to @.aingel. "We need to make": Yeah that's fair
21:52:33FromDiscord<Chronos [She/Her]> What if we made it so Rust's IR gets translated to Nim's IR /hj
21:52:42FromDiscord<Chronos [She/Her]> Or ig to Nim's AST
21:53:16FromDiscord<raynei486> good luck going through the rust compiler 💀
21:53:37FromDiscord<Chronos [She/Her]> MIR
21:55:01FromDiscord<Chronos [She/Her]> https://github.com/rust-lang/miri there's an interpreter for it here, that's probably a start
21:55:27FromDiscord<raynei486> hmm
21:55:37FromDiscord<raynei486> I know Nim IR was announced but is there like any documents
21:56:25FromDiscord<Chronos [She/Her]> There's the RFC
21:56:41FromDiscord<Chronos [She/Her]> But also could just translate it to the AST
21:58:01FromDiscord<Chronos [She/Her]> https://github.com/nim-lang/Nim/pull/22777
21:58:38FromDiscord<raynei486> thanks
22:11:38*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
22:14:53*Lord_Nightmare joined #nim
22:18:52FromDiscord<Chronos [She/Her]> Of course aha
22:41:53*tiorock joined #nim
22:41:53*tiorock quit (Changing host)
22:41:53*tiorock joined #nim
22:41:53*rockcavera is now known as Guest9932
22:41:53*Guest9932 quit (Killed (copper.libera.chat (Nickname regained by services)))
22:41:53*tiorock is now known as rockcavera
22:56:55*azimut quit (Ping timeout: 252 seconds)
23:12:22FromDiscord<.aingel.> Awesome! thanks
23:13:23FromDiscord<.aingel.> In reply to @raynei486 "<@1152336447467163790> I got this": Awesome, thanks! It works
23:16:51FromDiscord<.aingel.> seems like passL and link are the same then
23:21:50*alphacentauri quit (Quit: WeeChat 4.0.5)
23:22:20FromDiscord<_gumbercules> They're not - `link` allows you to specify a library or object file to be linked while `passL` passes arguments to the linker
23:22:45FromDiscord<_gumbercules> but I don't believe you can pass linker arguments to `link` - only paths to library files / object files
23:23:28FromDiscord<_gumbercules> I could also be wrong but I don't ever recall seeing `link` being used for such a purpose nor have I ever used it for such
23:24:12*alphacentauri joined #nim
23:25:02FromDiscord<.aingel.> In reply to @_gumbercules "I could also be": Right you seem to be right
23:25:13FromDiscord<.aingel.> Or rather passL can do what link does, link is more restrictive
23:52:41*krux02 quit (Remote host closed the connection)