00:09:02 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Xpz |
00:14:43 | * | duuuuuude joined #nim |
00:31:15 | * | Zectbumo quit (Remote host closed the connection) |
00:55:40 | * | Gustavo6046 quit (Ping timeout: 260 seconds) |
01:16:38 | * | vicfred quit (Quit: Leaving) |
01:16:52 | FromDiscord | <!Patitotective> @rockcavera @confus |
01:16:58 | FromDiscord | <!Patitotective> (edit) "@confus" => "😕" |
01:18:13 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XpG |
01:18:27 | FromDiscord | <Yardanico> if you want to keep using the posix model, you'll have to ship your binary with winpthread or statically link it |
01:18:36 | FromDiscord | <Yardanico> also why gcc 8 🤔 |
01:18:45 | FromDiscord | <Yardanico> https://jmeubank.github.io/tdm-gcc/articles/2021-05/10.3.0-release |
01:19:25 | FromDiscord | <Yardanico> "It’s not quite like other compilers in a few ways. Most importantly, it changes the default GCC runtime libraries to be statically linked and use a shared memory region for handling exceptions." |
01:20:22 | FromDiscord | <!Patitotective> In reply to @Yardanico "if you install mingw/tdm": but win32 not compatible with win64, right? |
01:20:31 | FromDiscord | <Yardanico> nonono |
01:20:38 | FromDiscord | <Yardanico> win32 is the general name for basic native Windows APIs |
01:20:50 | FromDiscord | <!Patitotective> :o |
01:20:51 | FromDiscord | <Yardanico> https://en.wikipedia.org/wiki/Windows_API |
01:20:59 | FromDiscord | <!Patitotective> w-why win32 lol |
01:21:14 | FromDiscord | <Yardanico> "The modern 64-bit versions of Windows implement a native 64-bit API, and it is called "Win32". It keeps the same name because it is compatible with the 32-bit API, but it's a native 64-bit implementation, and it would make perfect sense for a 64-bit library to call itself "Win32"." |
01:21:20 | FromDiscord | <!Patitotective> In reply to @Yardanico "if you install mingw/tdm": and can i do that with choosenim? or how would i do it manually |
01:21:21 | FromDiscord | <!Patitotective> (edit) "manually" => "manually?" |
01:21:25 | FromDiscord | <Yardanico> the latter part is sarcastic |
01:21:34 | FromDiscord | <Yardanico> In reply to @Patitotective "and can i do": just install tdm gcc manually, remove old mingw from the path, add tdm-gcc to path |
01:21:38 | FromDiscord | <Yardanico> tdm gcc installer is really easy |
01:21:42 | * | Gustavo6046 joined #nim |
01:21:42 | FromDiscord | <Yardanico> i think it can actually add itself to path |
01:21:58 | FromDiscord | <Yardanico> In reply to @Yardanico ""The modern 64-bit versions": And even MS calls it that - https://docs.microsoft.com/en-us/windows/win32/ |
01:22:21 | FromDiscord | <!Patitotective> In reply to @Yardanico "just install tdm gcc": this https://jmeubank.github.io/tdm-gcc/download/ ? |
01:22:36 | FromDiscord | <Yardanico> yes, it's literally the same download as the link I gave you above |
01:22:45 | FromDiscord | <Yardanico> "tdm64-gcc-10.3.0-2.exe" |
01:23:16 | FromDiscord | <spoon> what's tdm? |
01:23:29 | FromDiscord | <Yardanico> "It combines the most recent stable release of the GCC compiler, a few patches for Windows-friendliness, and the free and open-source MinGW.org or MinGW-w64 runtime APIs, to create a more lightweight open-source alternative to Microsoft’s compiler and platform SDK." |
01:23:32 | FromDiscord | <Elegantbeef> \~\~Team deathmatch\~\~ |
01:24:39 | FromDiscord | <spoon> hmm, i've never had a problem with mingw/gcc on windows |
01:24:59 | FromDiscord | <!Patitotective> do you use windows :oo? |
01:25:09 | FromDiscord | <Yardanico> if you use the win32 thread versions, then yeah, won't be much difference regarding the DLLs |
01:25:10 | FromDiscord | <spoon> yeah, my warranty hasn't expired yet |
01:25:20 | FromDiscord | <Yardanico> In reply to @spoon "yeah, my warranty hasn't": warranty doesn't work like that |
01:25:24 | FromDiscord | <Yardanico> just fyi |
01:25:30 | FromDiscord | <Elegantbeef> Any ideas why emcc compiles `proc doThing: MyType` to `proc doThing(i: int32)`? |
01:25:32 | FromDiscord | <spoon> In reply to @Yardanico "warranty doesn't work like": for broken drives it does |
01:25:38 | FromDiscord | <spoon> drivers |
01:25:40 | * | ltriant quit (Ping timeout: 246 seconds) |
01:25:51 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Any ideas why emcc": you have a code to reproduce it of course? :) |
01:26:02 | FromDiscord | <!Patitotective> c-could you pls try to install https://github.com/xmonader/nimassets, run `nimassets` and see if it works :]]]]]]]]]]]]]]]]]]]]]]]]]↵t. hanks (tom hanks) |
01:26:18 | FromDiscord | <spoon> i had to have a support agent do diagnostics and they found a hardware issue so |
01:26:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XpI |
01:26:33 | FromDiscord | <!Patitotective> (edit) "c-could you pls try to install https://github.com/xmonader/nimassets, run `nimassets` and see if it works :]]]]]]]]]]]]]]]]]]]]]]]]]↵t. hanks (tom hanks) ... " added "@spoon" |
01:27:09 | FromDiscord | <spoon> In reply to @Patitotective "c-could you pls try": what's that for? |
01:27:30 | FromDiscord | <Elegantbeef> Compiling the above code with https://github.com/beef331/wasmedge_playground/blob/master/wasmsources/config.nims and then inspecting it with my wasm runtime shows a `proc getMyType(i: int32)` |
01:28:09 | FromDiscord | <Elegantbeef> I'm guessing it expects a pointer to the type, or it just doesnt work with structs |
01:28:35 | FromDiscord | <Yardanico> emscripten works for really complex projects, so the problem must be somewhere else :) |
01:28:50 | FromDiscord | <!Patitotective> In reply to @spoon "what's that for?": nimassets just encodes files in nim module so you can use "bundle" them onto the compiled binary↵and im using it for https://github.com/Patitotective/ImTemplate, i created a github action to build the exe for windows but nimassets says `missing libwinpthread-1.dll` |
01:28:59 | FromDiscord | <!Patitotective> (edit) "In reply to @spoon "what's that for?": nimassets just encodes files in nim module so you can use "bundle" them onto the compiled binary↵and im using it for https://github.com/Patitotective/ImTemplate, i created a github action to build the exe for windows but nimassets says `missing libwinpthread-1.dll` ... " added ":[" |
01:29:02 | FromDiscord | <Elegantbeef> I mean i'm exporting this procedure to the runtime interface |
01:29:18 | FromDiscord | <Yardanico> btw, why emscripten? |
01:29:24 | FromDiscord | <Yardanico> I think for your thing you really only need WASI SDK |
01:29:29 | FromDiscord | <Elegantbeef> Cause it's' the first tool i had at hand |
01:30:00 | FromDiscord | <Elegantbeef> It's standalone wasm i dont think it really matters |
01:30:00 | FromDiscord | <spoon> In reply to @Patitotective "nimassets just encodes files": what's the difference between that and slush()/staticLoad()? |
01:30:08 | FromDiscord | <!Patitotective> slush? |
01:30:17 | FromDiscord | <Yardanico> In reply to @Elegantbeef "It's standalone wasm i": WASI SDK is more "pure" |
01:30:18 | FromDiscord | <spoon> just a shortcut for staticload |
01:30:24 | FromDiscord | <Elegantbeef> I do want to try nlvm aswell but it's not compiling |
01:30:28 | FromDiscord | <spoon> or staticread() |
01:30:30 | FromDiscord | <spoon> forget which |
01:30:41 | * | ltriant joined #nim |
01:31:02 | FromDiscord | <!Patitotective> isnt it slurp? |
01:31:15 | FromDiscord | <Elegantbeef> I mean it doesnt matter right now yard I half want to support the compiles I can |
01:31:24 | FromDiscord | <Elegantbeef> I need to test to see which is the most friendly to use |
01:31:44 | FromDiscord | <spoon> yeah! |
01:31:48 | FromDiscord | <spoon> it's slurp |
01:31:55 | FromDiscord | <!Patitotective> staticRead https://nim-lang.org/docs/system.html#staticRead%2Cstring↵and slurp https://nim-lang.org/docs/system.html#slurp%2Cstring lol |
01:32:06 | FromDiscord | <spoon> got two names wrong in one go |
01:32:41 | FromDiscord | <Yardanico> works here @beef |
01:32:44 | FromDiscord | <Elegantbeef> But like i said yard i expected it to mangle the type but didnt expect it to add a parameter 😄 |
01:32:47 | FromDiscord | <Yardanico> ` (func (;1;) (type 3) (param i32)` |
01:33:02 | FromDiscord | <Elegantbeef> `param i32` |
01:33:05 | FromDiscord | <Elegantbeef> Did the same thing ok |
01:33:29 | FromDiscord | <Yardanico> oh this |
01:33:32 | FromDiscord | <Elegantbeef> I dont know how one is supposed to interact with the procedure then |
01:34:01 | FromDiscord | <Elegantbeef> I'm assuming i'm supposed to allocate some wasm memory and pass it as a parameter |
01:34:22 | FromDiscord | <Yardanico> and have you actually checked if the C code is correct? |
01:34:24 | FromDiscord | <Elegantbeef> Then it uses that as a ptr to the data to write to |
01:34:38 | FromDiscord | <Yardanico> although looks like it is |
01:35:16 | FromDiscord | <Yardanico> @beef https://github.com/WebAssembly/design/issues/1099 "there are no plans for "struct" support for wasm programs that use linear memory; the compiler is supposed to lower structs and struct operations to primitive operations" |
01:35:24 | FromDiscord | <Elegantbeef> Yea the C code is fine |
01:35:27 | FromDiscord | <!Patitotective> sooo yard, i think this is default gcc path `COLLECT_GCC=C:\ProgramData\Chocolatey\lib\mingw\tools\install\mingw64\bin\gcc.exe`↵then i should `curl` gcc inside `lib/mingw/tools/install/mingw64/bin`? |
01:35:35 | FromDiscord | <!Patitotective> (edit) "sooo yard, i think this is default gcc path `COLLECT_GCC=C:\ProgramData\Chocolatey\lib\mingw\tools\install\mingw64\bin\gcc.exe`↵then i should `curl` ... gcc" added "the new" |
01:35:50 | FromDiscord | <Yardanico> it would be better if you actually install it to another place and change to that, but if you want to replace, fine |
01:36:03 | FromDiscord | <Elegantbeef> Yea that's what i thought yard |
01:36:12 | FromDiscord | <Elegantbeef> Though there is an issue |
01:36:25 | FromDiscord | <!Patitotective> In reply to @Yardanico "it would be better": what could be that "other place"? where are windows bins stored 🤨 |
01:36:39 | * | ltriant_ joined #nim |
01:36:42 | FromDiscord | <Elegantbeef> Ah nevermind i'm dumb |
01:36:42 | FromDiscord | <!Patitotective> (edit) ""other" => ""another" |
01:36:55 | FromDiscord | <Elegantbeef> Allocate into the runtime's linear memory and it uses teh result as a ptr to that i think |
01:37:02 | FromDiscord | <Elegantbeef> Then i just cast that to the type i want |
01:37:08 | FromDiscord | <Elegantbeef> It's pretty much what i expected |
01:37:20 | FromDiscord | <Elegantbeef> Just a bit more elaborate since sandboxing exists 😄 |
01:37:44 | FromDiscord | <spoon> hold on nimassets just got blocked by my AV lol |
01:38:14 | FromDiscord | <Yardanico> you can also check https://wasdk.github.io/WasmFiddle/ @ElegantBeef |
01:38:27 | FromDiscord | <Yardanico> (func $other (; 0 ;) (param $0 i32) |
01:38:28 | FromDiscord | <Yardanico> for similar code |
01:38:33 | * | ltriant quit (Ping timeout: 256 seconds) |
01:38:40 | FromDiscord | <spoon> looks like it worked perfectly fine with no issue |
01:38:51 | FromDiscord | <spoon> `nimassets -d:.\Screenshots\ -o:.\test.nim` |
01:39:00 | FromDiscord | <!Patitotective> what windows version are you using? :[ |
01:39:04 | FromDiscord | <spoon> just copied a screenshot folder over to test |
01:39:06 | FromDiscord | <spoon> windows 11 |
01:39:19 | FromDiscord | <!Patitotective> :[ |
01:39:22 | FromDiscord | <Yardanico> In reply to @Patitotective "what windows version are": maybe you can show the error you're having? |
01:39:28 | * | Zectbumo joined #nim |
01:39:30 | FromDiscord | <Elegantbeef> Luckily we have macros yard so i can always expand complex types to a tuple 😄 |
01:39:51 | FromDiscord | <spoon> so what's the advantage of nimassets over staticload anyway? |
01:39:59 | FromDiscord | <spoon> staticREAD* |
01:40:04 | FromDiscord | <Elegantbeef> Self abuse |
01:40:09 | FromDiscord | <!Patitotective> In reply to @Yardanico "maybe you can show": its just a popup window (not even a message in the terminal) saying `missing libwinpthread-1.dll` |
01:40:15 | FromDiscord | <spoon> i think i have dementia |
01:40:27 | FromDiscord | <Elegantbeef> spoon just write `template staticLoad(s: static string): string = staticRead(s)` 😛 |
01:40:29 | FromDiscord | <Yardanico> In reply to @Patitotective "its just a popup": again, as I said, you either need to have that or install another C compiler that either statically links this or uses win32 thread model |
01:40:32 | FromDiscord | <Elegantbeef> Then you can play it off like you're using your own api |
01:40:59 | FromDiscord | <!Patitotective> In reply to @spoon "so what's the advantage": staticRead requires a static string↵and i have my resources paths not statically defined so nimassets works for me hehe |
01:41:21 | FromDiscord | <Yardanico> I also found this @beef https://stackoverflow.com/a/56405899/5476128 |
01:41:47 | FromDiscord | <Yardanico> so yeah, pass by value = pass by pointer in wasm apparently |
01:42:06 | FromDiscord | <Yardanico> wait, weird though, "When C structure is returned by value, then it is expected to be passed as a first function parameter!" |
01:42:07 | FromDiscord | <Elegantbeef> Yea it makes sense |
01:42:13 | FromDiscord | <Yardanico> ah right |
01:42:16 | FromDiscord | <Yardanico> yeah |
01:42:32 | FromDiscord | <spoon> In reply to @Patitotective "staticRead requires a static": wait so like, it's for stuff defined after compiletime? |
01:42:46 | FromDiscord | <!Patitotective> sort of |
01:42:50 | FromDiscord | <Yardanico> In reply to @Patitotective "staticRead requires a static": but if you can use nimassets then you know what to save at compile time |
01:43:06 | FromDiscord | <Yardanico> because nimassets resulting file must be used in the compilation process anyway |
01:43:22 | FromDiscord | <Yardanico> its not some runtime thing |
01:43:45 | FromDiscord | <!Patitotective> w-what |
01:43:48 | FromDiscord | <Yardanico> ?? |
01:43:54 | FromDiscord | <Yardanico> it's a compile time bundler |
01:44:02 | FromDiscord | <!Patitotective> how can i be so stupid |
01:44:03 | FromDiscord | <Yardanico> it creates a nim file that you then import and compile along with your project |
01:44:28 | FromDiscord | <Yardanico> also @beef are you making wasmedge nim stuff to allow extending nim programs with wasm plugins? |
01:44:29 | FromDiscord | <!Patitotective> then nimassets is for fun lol |
01:44:32 | FromDiscord | <!Patitotective> (edit) "fun" => "fun?" |
01:44:47 | * | duuuuuude quit (Ping timeout: 256 seconds) |
01:44:52 | FromDiscord | <Yardanico> it's just needed if you're too lazy and want a tool to preserve all paths and stuff |
01:45:06 | FromDiscord | <Yardanico> I've seen this approach used in some projects, e.g. Microsoft Flight Simulator uses WASM for its plugins, and you can really do a lot of stuff with them |
01:45:14 | FromDiscord | <Yardanico> and of course wasm = easy sandboxing |
01:45:48 | FromDiscord | <!Patitotective> anyways thank youuuuu @spoon :] |
01:45:57 | FromDiscord | <sOkam!> Any idea how this is even possible? https://media.discordapp.net/attachments/371759389889003532/973400467717640213/unknown.png |
01:46:43 | FromDiscord | <Yardanico> In reply to @sOkam! "Any idea how this": what is the problem here? |
01:47:31 | FromDiscord | <sOkam!> How is the relative path of the file being spit out as relative to the folder the script is run from... when the same getCurrentDir function spits out the subfolder instead? |
01:47:41 | FromDiscord | <sOkam!> I'm calling the same function in both |
01:49:05 | FromDiscord | <sOkam!> Its almost like relativePath line is ignoring the `withDir` call altogether. But how does that make sense, if the next line just works normally? |
01:52:41 | FromDiscord | <Yardanico> In reply to @sOkam! "Any idea how this": what "file1" do you pass in? just "tstfile1.txt" ? |
01:53:48 | FromDiscord | <sOkam!> In reply to @Yardanico "what "file1" do you": https://media.discordapp.net/attachments/371759389889003532/973402447169085470/unknown.png |
01:55:07 | * | gsalazar joined #nim |
01:55:16 | FromDiscord | <sOkam!> sry, was cut https://media.discordapp.net/attachments/371759389889003532/973402815479304233/unknown.png |
01:55:25 | FromDiscord | <Yardanico> and yeah, please post code as text in the future (Discord has code blocks :P) |
01:55:57 | FromDiscord | <Yardanico> bridges handle code pastes correctly, and it's much easier as then you can immediately copy the code |
01:56:03 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpL |
01:56:04 | FromDiscord | <Yardanico> instead of having to type it by hand |
01:56:35 | FromDiscord | <sOkam!> using nvim, so i usually don't copy paste because it brings line numbers with it |
01:57:02 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XpM |
01:57:02 | FromDiscord | <Yardanico> your file1 isn't an absolute path |
01:57:04 | FromDiscord | <Yardanico> I think that's the reason |
01:57:24 | FromDiscord | <sOkam!> lets try |
01:57:35 | FromDiscord | <Yardanico> In reply to @sOkam! "using nvim, so i": are you sure there's no way in nvim to copy the whole buffer? |
01:57:41 | FromDiscord | <sOkam!> Trying to isolate the bug from the other day, doubt thats the reason. but doesn't hurt to try it |
01:57:47 | FromDiscord | <Yardanico> https://stackoverflow.com/questions/1620018/copy-all-the-lines-to-clipboard |
01:58:00 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/973403497431199794/unknown.png |
01:58:08 | FromDiscord | <sOkam!> In reply to @Yardanico "are you sure there's": there is, but it requires some setup that I haven't looked into yet. I just need it to use the clipboard, instead of the buffer |
01:58:26 | FromDiscord | <sOkam!> Which I haven't configured yet, so i'm just copying the terminal text |
01:58:55 | FromDiscord | <sOkam!> oh, didn't know about the `+` thing. handy. ty |
01:59:17 | FromDiscord | <Yardanico> so easy fix for your code is to just have `let dir = getCurrentDir() / "tstdir"` |
01:59:21 | FromDiscord | <Yardanico> instead of just `let dir = "tstdir"` |
01:59:24 | FromDiscord | <Yardanico> so your `dir` is absolute |
02:01:43 | FromDiscord | <sOkam!> I see the point. I'm passing an already relative path to the function. so it just outputs the same input literally |
02:01:52 | FromDiscord | <Yardanico> yes |
02:02:25 | FromDiscord | <sOkam!> Maybe that's what I was doing before in my build system. And that's why it was giving the ../../../../../ crazyness 🤔 |
02:02:52 | FromDiscord | <sOkam!> Will dig into that, might be some issue there |
02:06:59 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpQ |
02:07:03 | FromDiscord | <sOkam!> Those are absolute folders |
02:08:13 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpR |
02:08:59 | FromDiscord | <Yardanico> are you trying to codegolf :D |
02:09:26 | FromDiscord | <sOkam!> Whats codegolf? |
02:09:27 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpS |
02:09:33 | FromDiscord | <Yardanico> trying to minimize code size as much as possible |
02:09:43 | FromDiscord | <Yardanico> no spaces, arg names like `s` and `d` :) |
02:10:00 | FromDiscord | <sOkam!> I just like writing that way, it makes more sense to me for some reason 🤷♂️ |
02:10:14 | FromDiscord | <Yardanico> also, `s:seq` isn't what you think exactly, it makes your proc an implicit generic |
02:10:15 | FromDiscord | <Yardanico> just to let you know |
02:10:16 | FromDiscord | <sOkam!> Verbose syntax tires me a lot |
02:10:31 | FromDiscord | <Yardanico> In reply to @sOkam! "Verbose syntax tires me": you mean spaces tire you? everyone has different tastes i guess.. |
02:10:57 | FromDiscord | <sOkam!> i mean full words that are extremely obvious implied meanings |
02:11:09 | FromDiscord | <sOkam!> (edit) "are" => "have" |
02:11:35 | FromDiscord | <sOkam!> In reply to @Yardanico "also, `s:seq` isn't what": what do you mean generic? |
02:11:43 | FromDiscord | <Yardanico> a generic type |
02:11:46 | FromDiscord | <sOkam!> because seq can have any type in them? |
02:11:49 | FromDiscord | <Yardanico> s:seq will also match for seq[int] |
02:11:55 | FromDiscord | <sOkam!> ah i see |
02:11:57 | FromDiscord | <Yardanico> you really want to have seq[string] here specifically |
02:12:05 | FromDiscord | <sOkam!> good catch ✍️ |
02:12:07 | FromDiscord | <Yardanico> it's kind of weird otherwise :) |
02:13:26 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XpT |
02:13:37 | FromDiscord | <Yardanico> `it = it.relativePath(d)` |
02:14:39 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpU |
02:14:40 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/7bk |
02:16:52 | FromDiscord | <Yardanico> but yeah, your code works for me fine |
02:17:05 | FromDiscord | <Yardanico> for @["/home/dian/IBNIZ/test.nim", "/home/dian/IBNIZ/test.wasm"] if I'm in /home/dian/IBNIZ it gets relative paths |
02:17:56 | FromDiscord | <sOkam!> In reply to @Yardanico "for @["/home/dian/IBNIZ/test.nim", "/home/dian/IBNI": are you in that folder from the root of the script, or from a `withDir`? |
02:18:42 | FromDiscord | <Yardanico> can you maybe show your getCurrentDir() when you call that zip ? |
02:18:50 | FromDiscord | <Yardanico> the code is a bit hard to follow, but I get what you want to do |
02:19:29 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/PTi |
02:19:35 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/Vz0 |
02:20:01 | FromDiscord | <Yardanico> idk, it should work just fine |
02:20:03 | FromDiscord | <sOkam!> sorry, i thought I had included that. it was right before the splitting |
02:20:04 | FromDiscord | <Yardanico> `echo relativePath("/home/sokam/gd/osdf/bin/release-linux-x86_64/osdf/cgamex86_64.so", "/home/sokam/gd/osdf/bin/release-linux-x86_64/osdf")` |
02:20:18 | FromDiscord | <Yardanico> just shows cgamex86_64.so |
02:21:24 | FromDiscord | <Yardanico> In reply to @sOkam! "Dunno what you mean": also, unrelated, but isn't it supposed to be ` let t = tseq.join(" ")` and not ` let t = s.join(" ")` ? |
02:21:30 | FromDiscord | <Yardanico> since you want to pass relative paths to `zip` in this case |
02:21:33 | FromDiscord | <Yardanico> otherwise your `tseq` is just unused |
02:22:30 | FromDiscord | <sOkam!> maybe that's the reason? |
02:22:36 | FromDiscord | <Yardanico> i don't know? |
02:22:45 | FromDiscord | <Yardanico> but then it shouldn't output `../../../../../../../home/sokam/gd/osdf/bin/release-linux-x86_64/osdf/cgamex86_64.so` |
02:22:48 | FromDiscord | <sOkam!> the problem I had was that it was trying to zip absolute paths, which wasn't intended |
02:22:49 | FromDiscord | <Yardanico> doesn't matter if tseq is used or not |
02:23:12 | FromDiscord | <sOkam!> zipping absolutes just zips the whole path from root |
02:23:22 | FromDiscord | <sOkam!> (edit) "zipping absolutes just zips the whole path from ... root" added "system" |
02:25:04 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpX |
02:25:38 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpY |
02:25:41 | FromDiscord | <Yardanico> well see |
02:25:55 | FromDiscord | <Yardanico> and let me guess - compileDir wasn't absolute or something? |
02:27:06 | FromDiscord | <sOkam!> should be absolute, i think? 🤔 https://media.discordapp.net/attachments/371759389889003532/973410823710068806/unknown.png |
02:28:12 | FromDiscord | <Yardanico> 🤔 |
02:31:52 | FromDiscord | <sOkam!> good catch on the tseq thing. Next issue right after this was that line exactly 🙂 |
02:32:16 | FromDiscord | <Yardanico> that's why you should use more verbose variable names :) |
02:32:45 | FromDiscord | <sOkam!> i was just trying to solve the previous probl, didn't notice the next until I realized I was joining the input |
02:33:16 | FromDiscord | <sOkam!> verbose names wouldn't help much, i knew s was an input. just was so immersed in the mindF of the other issue 😄 |
02:53:20 | FromDiscord | <sOkam!> is there a way to decide if a string contains a file or a directory? |
02:54:53 | FromDiscord | <Elegantbeef> `fileExists` `dirExists` |
02:55:35 | FromDiscord | <Yardanico> In reply to @sOkam! "is there a way": not really |
02:55:40 | FromDiscord | <sOkam!> how would you check for both? just some conditionals with those, I guess? |
02:55:47 | FromDiscord | <Yardanico> i mean fileExists and dirExists works, but only if your string doesn't have anything extra |
02:56:00 | FromDiscord | <Yardanico> your question sounded like if the string "contains" a path, like if it can something else as well |
02:56:05 | FromDiscord | <Yardanico> In reply to @sOkam! "how would you check": yes |
02:56:16 | FromDiscord | <sOkam!> yeah, that's not an issue. they are meant to only contain paths |
02:56:51 | FromDiscord | <sOkam!> In reply to @Yardanico "your question sounded like": oh, should have said `is`. true |
02:57:01 | FromDiscord | <sOkam!> (edit) "`is`." => "`is`, not contains." |
02:57:57 | FromDiscord | <sOkam!> what about the situation where the file/dir does not exist yet, and will be created? |
02:58:24 | FromDiscord | <sOkam!> that's the current usecase, since I'm creating aliases for mkDir, cpDir, cpFile, etc |
02:59:00 | FromDiscord | <sOkam!> (edit) "etc" => "etc. aiming to target the functionality of bash's `cp`" |
03:00:17 | FromDiscord | <sOkam!> I could add a third input, like `cp this, there, "file"`. But wondered if there is something cleaner |
03:01:28 | FromDiscord | <Yardanico> In reply to @sOkam! "what about the situation": what about it? |
03:01:40 | FromDiscord | <Yardanico> you can't differentiate dir from a file on nix if it's not created yet |
03:01:48 | FromDiscord | <Yardanico> "/home/user/path" can be a file or a directory |
03:08:29 | FromDiscord | <Yardanico> i mean it's the same on windows, but extension-less files are quite rare on windows |
03:16:45 | FromDiscord | <sOkam!> True that. Makes sense |
03:16:52 | FromDiscord | <sOkam!> Didn't realize that |
03:16:53 | * | arkurious quit (Quit: Leaving) |
03:17:00 | FromDiscord | <Yardanico> but if you have the slash as the last symbol, then it should be easy to distiniguish |
03:17:04 | FromDiscord | <Yardanico> (edit) "distiniguish" => "distinguish" |
03:19:23 | * | vicfred joined #nim |
03:23:39 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/tFm |
03:24:00 | FromDiscord | <sOkam!> Or does that imply both having the exact same type? |
03:25:14 | FromDiscord | <Yardanico> the latter of course |
03:25:22 | FromDiscord | <Yardanico> `source, dest: string;` clearly says "for both source and dest have the type as string" |
03:25:32 | FromDiscord | <Yardanico> there's even a semicolon to help differentiate even more |
03:25:43 | FromDiscord | <sOkam!> ic |
03:25:50 | FromDiscord | <Yardanico> you can use semicolon instead of a comma in argument list, they're effectively equivalent |
03:26:00 | FromDiscord | <Yardanico> except some special cases (that's why ; was made) |
03:26:34 | FromDiscord | <sOkam!> Does `source; dest:string` also mean that both are strings? |
03:26:55 | FromDiscord | <Yardanico> no |
03:26:58 | FromDiscord | <Yardanico> this won't compile |
03:26:59 | FromDiscord | <Elegantbeef> No |
03:27:07 | FromDiscord | <Elegantbeef> Source has no type there |
03:27:08 | FromDiscord | <Elegantbeef> So it's an error unless it's in a macro/template |
03:27:13 | FromDiscord | <sOkam!> ✍️ |
03:27:20 | FromDiscord | <Yardanico> ✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️ |
03:27:36 | FromDiscord | <Yardanico> no |
03:30:44 | FromDiscord | <!Patitotective> you wont take the crown of the emojiest person 😑 |
03:30:48 | FromDiscord | <!Patitotective> and good night everyone 🙃 |
03:30:51 | FromDiscord | <!Patitotective> 🌃 |
03:31:03 | FromDiscord | <Yardanico> 6:30 AM here 🤔 |
03:31:22 | FromDiscord | <!Patitotective> here its 22:31 lol |
03:34:26 | FromDiscord | <kiell> is switch not a valid function for config.nims? am i losing it? https://media.discordapp.net/attachments/371759389889003532/973427764873027674/Screen_Shot_2022-05-09_at_10.31.17_PM.png |
03:34:36 | FromDiscord | <Yardanico> it is valid, it's just that nim check didn't work for .nims by default |
03:34:38 | FromDiscord | <Yardanico> it was fixed in 1.6.6 |
03:34:39 | FromDiscord | <!Patitotective> ~~(so you live in romania eh yard https://24timezones.com/Bucharest/time)~~ |
03:34:47 | FromDiscord | <Yardanico> not romania |
03:34:50 | FromDiscord | <Yardanico> more to the east |
03:34:56 | FromDiscord | <Elegantbeef> The russian part of romania 😄 |
03:39:32 | FromDiscord | <Yardanico> https://upload.wikimedia.org/wikipedia/commons/4/43/Timezones2008_UTC%2B3_gray.png a lot of countries to choose from |
04:14:27 | * | slowButPresent quit (Quit: leaving) |
04:23:01 | * | piapiac joined #nim |
04:31:57 | * | noeontheend quit (Ping timeout: 256 seconds) |
04:40:07 | * | tiorock joined #nim |
04:40:07 | * | tiorock quit (Changing host) |
04:40:07 | * | tiorock joined #nim |
04:40:07 | * | rockcavera quit (Killed (osmium.libera.chat (Nickname regained by services))) |
04:40:07 | * | tiorock is now known as rockcavera |
04:49:53 | FromDiscord | <huantian> how do I make a new db with db_sqlite |
04:49:57 | FromDiscord | <huantian> couldn't find it in the docs |
04:59:48 | FromDiscord | <huantian> wait no I'm a dummy |
05:25:57 | FromDiscord | <d4rckh> It's 8:25am here 🤔 |
05:26:02 | FromDiscord | <d4rckh> good morning yardanico |
05:36:56 | FromDiscord | <congusbongus> is there a nim library for reading animated gifs? Preferably one that works well with SDL (gonna render them as SDL_Textures eventually) |
05:44:29 | FromDiscord | <Zectbumo> "Error: defer statement not supported at top level"↵huh? why not? just execute the block before exiting. |
05:45:49 | FromDiscord | <Zectbumo> In reply to @huantian "how do I make": https://nim-lang.org/docs/db_sqlite.html#basic-usage-opening-a-connection-to-a-database |
05:59:04 | Amun-Ra | morning |
05:59:08 | Amun-Ra | (http://www.total-knowledge.com/~ilya/mips/ugt.html) |
06:30:49 | * | PMunch joined #nim |
06:38:57 | * | jjido joined #nim |
06:44:35 | * | rockcavera quit (Remote host closed the connection) |
06:48:13 | FromDiscord | <sheerluck> personally I like it when time is japanese |
07:05:41 | FromDiscord | <Prestige> Is there a way to define a type as a set of ints?↵like type Foo = 1 | 3 | 5 |
07:05:49 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
07:05:54 | FromDiscord | <enthus1ast> enum? |
07:06:30 | FromDiscord | <Prestige> Perhaps.. it's using consts that already exist in another library I'm using, so maybe I should just wrap them in an enum |
07:06:55 | FromDiscord | <Elegantbeef> Yea just use an enum + set |
07:07:15 | FromDiscord | <Elegantbeef> Depending on what you're doing though you may need some bodging |
07:07:22 | FromDiscord | <Rika> Take the set pill |
07:37:33 | * | jmdaemon quit (Ping timeout: 252 seconds) |
08:16:47 | * | Arrrrrrr joined #nim |
08:46:25 | * | kayabaNerve_ quit (Ping timeout: 260 seconds) |
08:47:59 | PMunch | Hmm, is there a way to define stuff in code |
08:48:07 | PMunch | As if it was done with `--define` |
08:48:42 | FromDiscord | <Elegantbeef> I dont think so |
08:51:56 | PMunch | Hmm |
08:52:25 | PMunch | Basically I want to import a variant of a library |
08:54:15 | PMunch | This particular library is a i2c library that either uses a built-in i2c chip, or a USI chip, but shares common abstractions |
08:55:21 | FromDiscord | <mratsim> In reply to @PMunch "Basically I want to": welcome to my issues with std/bitops |
08:57:07 | FromDiscord | <Rika> In reply to @mratsim "welcome to my issues": ? |
09:05:06 | FromDiscord | <mratsim> In reply to @Rika "?": https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/bitops.nim#L577-L579 |
09:06:18 | * | firq quit (Ping timeout: 260 seconds) |
09:08:00 | * | firq joined #nim |
09:17:49 | PMunch | I guess I'll have to do something similar to what is done with tables/tableimpl and have two different libraries to import, with their own logic/templates and then `include` the common stuff (which can also depend on the specific templates) |
09:18:09 | PMunch | Problem with `include` files is that the editor hates them.. |
09:18:42 | Arrrrrrr | lsp? |
09:23:18 | PMunch | Yup |
09:23:27 | PMunch | I guess it might be fine if it was opened with a project file |
09:23:57 | PMunch | It's a bit strange though, it should be able to find the project file |
09:40:25 | * | xet7 quit (Remote host closed the connection) |
10:11:22 | FromDiscord | <jmgomez> hey guys, is there any json formatter package for nim? |
10:14:15 | FromDiscord | <Rika> std/json has a toPretty i believe? |
10:20:20 | FromDiscord | <tandy> is there a nim repl thing? |
10:20:34 | FromDiscord | <tandy> something where i can conveniently do stuff like `1000 div 2` |
10:21:18 | FromDiscord | <Rika> inim? |
10:23:15 | FromDiscord | <tandy> ok this is epic |
10:23:16 | FromDiscord | <tandy> thanks |
10:25:49 | FromDiscord | <jmgomez> In reply to @Rika "std/json has a toPretty": it does! Thanks! FYI toPretty is priv, pretty is the one public |
10:26:09 | FromDiscord | <Zoom> Why does not compiler track the usage of exported variables? |
10:26:30 | FromDiscord | <Rika> why should it? |
10:27:06 | FromDiscord | <Rika> its not sure if its going to be used or not by other packages you're currently not using |
10:28:17 | FromDiscord | <Zoom> Why shouldn't it? The current state of the code at hand is known, why not hint unused stuff on compilation? |
10:29:35 | FromDiscord | <Rika> its going to be annoying when you are making a library with obviously-exported-for-a-reason procs and you compile it for testing |
10:29:39 | FromDiscord | <Forest> sent a code paste, see https://paste.rs/qnU |
10:30:00 | Arrrrrrr | Yeah, would be a good idea to have a hint for that case. |
10:33:26 | FromDiscord | <Zoom> I can understand it with types, but I'm talking about a global var, unused in the module.↵(@Rika) |
10:34:00 | FromDiscord | <Rika> well its the same idea no? |
10:34:13 | FromDiscord | <Rika> exporting a var means its public api |
10:35:19 | FromDiscord | <Zoom> Eh, only variable declaration possibly entails runtime init, while type/proc doesn't. |
10:35:45 | FromDiscord | <Rika> ? so what? |
10:36:11 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/yPP |
10:36:12 | FromDiscord | <Zoom> So it would be nice to see a dead weight. |
10:36:37 | FromDiscord | <Rika> idk then its prolly "an oversight" or w/e |
10:36:52 | FromDiscord | <Rika> if you want more opinions perhaps a pr/issue |
10:37:47 | FromDiscord | <tandy> just do $jsonnode↵(@jmgomez) |
10:37:59 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3XqV |
10:38:03 | FromDiscord | <Rika> In reply to @tandy "just do $jsonnode (<@726017160115126333>)": thats not equivalent to getting the string value |
10:38:18 | FromDiscord | <tandy> o yeah its getStr or something |
10:38:28 | FromDiscord | <Zoom> Well, I prefer to ask stupid questions in IRC first.↵(@Rika) |
10:38:37 | FromDiscord | <Rika> okay |
10:40:01 | * | PMunch quit (Quit: Leaving) |
10:40:17 | * | duuuuuude joined #nim |
10:43:14 | FromDiscord | <Zoom> I don't really think your answers were really helpful, tbh. Sorry. |
10:43:21 | FromDiscord | <Rika> i dont care' |
10:44:57 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3XqW |
10:44:59 | FromDiscord | <Zoom> Well, this lessens the chance of a question getting an answer from the other folk here.↵(@Rika) |
10:45:22 | FromDiscord | <Rika> thats your problem |
10:45:43 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3XqX |
10:45:48 | FromDiscord | <Rika> are you compiling with flags |
10:45:56 | FromDiscord | <Rika> or rather how is this run |
10:45:58 | FromDiscord | <Rika> looks like its from ue |
10:46:03 | FromDiscord | <Rika> unreal engine i mean |
10:46:29 | FromDiscord | <jmgomez> Yes, but not even UE this is being called from their .NET build tool (UBT) |
10:47:16 | FromDiscord | <jmgomez> It may be how dot net treats cstrings? |
10:47:33 | * | xet7 joined #nim |
10:47:34 | FromDiscord | <Rika> i dont see how thats relevant |
10:47:58 | FromDiscord | <Rika> theres no cstring in sight so i dont know what you mean |
10:48:09 | FromDiscord | <Rika> JsonNodes dont store cstrings either |
10:48:24 | FromDiscord | <Zoom> Not really. It's always best to answer "idk/ins" or just leave the question for others, than just answer with what basically equals "not a problem".↵(@Rika) |
10:48:25 | FromDiscord | <jmgomez> whell, Im interoping with a function that uses CStrings. Then I convert those cstrings to strings |
10:48:59 | FromDiscord | <Rika> In reply to @Zoom "Not really. It's always": well, heres the thing, i was pretty sure it wasnt added for the reasons i listed |
10:49:03 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3XqZ |
10:49:04 | FromDiscord | <Rika> i will not reply back |
10:49:20 | FromDiscord | <Rika> go stop wasting your time if you really think my answers werent helpful |
10:50:15 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3Xr1 |
10:50:37 | FromDiscord | <Zoom> I just provided some feedback for you. Thanks for telling me what to do. Anyway, I don't want to fight, peace.↵(@Rika) |
10:51:23 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Xr3 |
10:51:33 | Arrrrrrr | I don't understand the 'new' ordering of the manual. Why is 'concept' exactly an experimental feature? https://nim-lang.org/docs/manual_experimental.html#concepts |
10:51:51 | FromDiscord | <Rika> because its deemed as such |
10:52:02 | FromDiscord | <Rika> its not "stable" according to the devs |
10:52:17 | Arrrrrrr | Really? It's been there since as far as I can remember |
10:52:19 | Arrrrrrr | more than 5 years |
10:52:22 | FromDiscord | <Rika> what's new wrt. the ordering? its been like this for a long time |
10:52:32 | FromDiscord | <Rika> yeah its still not stable |
10:52:53 | FromDiscord | <Rika> according to the devs, i'd say it isnt either but its "good enough" if |
10:52:54 | FromDiscord | <Rika> (edit) "if" => "ig" |
10:52:59 | Arrrrrrr | How is not stable? You don't even need compile time switches to active them |
10:53:38 | FromDiscord | <Rika> In reply to @jmgomez "that it was I": can you `echo` with `repr`? `echo repr thejson` or smth |
10:53:44 | FromDiscord | <Rika> thejson in string form |
10:54:11 | FromDiscord | <Rika> In reply to @Arrrrrrr "How is not stable?": there;s two versions of concepts, one is the old and more buggy version and the other is the not finished new implementation |
10:54:18 | FromDiscord | <Rika> thats prolly why |
10:54:28 | FromDiscord | <Rika> the new impl is even still an rfc |
10:54:47 | Arrrrrrr | Situations like this one are no good. |
10:56:14 | FromDiscord | <jmgomez> In reply to @Rika "can you `echo` with": cant directly because it's a blackbox but will try to debug it further making another callback. Just wanted to make sure that I was pulling the jsNode str correctly. Thanks! |
10:56:24 | Arrrrrrr | I think that for 2.0 Araq kills half of these unfinished features. |
10:56:27 | Arrrrrrr | *Hope |
10:56:51 | FromDiscord | <Rika> yeah actually instead of the thing you wrote what about `jsonNode.getStr` that was eluded to above |
10:57:17 | FromDiscord | <Rika> In reply to @Arrrrrrr "I think that for": well we'll see |
11:01:22 | FromDiscord | <Rika> though i do have to add that concepts are very useful and powerfuk |
11:01:25 | FromDiscord | <Rika> (edit) "powerfuk" => "powerful" |
11:02:49 | FromDiscord | <jmgomez> In reply to @Rika "yeah actually instead of": yes, that was it! |
11:03:05 | FromDiscord | <Rika> my bad, i thought you tried it already |
11:03:14 | FromDiscord | <Rika> or rather maybe i got thoughts mixed |
11:03:19 | FromDiscord | <Rika> but good to know |
11:03:27 | FromDiscord | <jmgomez> Np thank you for your help! |
11:04:37 | FromDiscord | <Forest> In reply to @Forest "main.nim: https://play.nim-lang.org/#ix=3XqR interp": bump |
11:08:11 | FromDiscord | <Rika> ill look |
11:08:54 | FromDiscord | <Rika> `if cc == '"' and startPos != pos-1:` will always match any "string" i believe since cc doesnt change within the while loop |
11:09:03 | FromDiscord | <Rika> so: |
11:10:34 | FromDiscord | <Rika> i think |
11:10:36 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3Xr6 |
11:10:57 | FromDiscord | <Rika> so dont check cc, check input[pos] instead |
11:11:23 | FromDiscord | <Rika> ignore the fucked highlighting, discord is funky there lol |
11:11:38 | FromDiscord | <Rika> wdyt? |
11:11:53 | FromDiscord | <Forest> trying to understand this rn- |
11:13:11 | FromDiscord | <Rika> there |
11:14:32 | FromDiscord | <Rika> the fix is really just `if cc == '"'` -> `if input[pos] == '"'` i believe |
11:15:11 | FromDiscord | <Rika> though i also dont know why you put `and startPos != pos-1:`, maybe `and startPos != pos-2:` would be more correct or put it before the `pos += 1` |
11:16:02 | FromDiscord | <Forest> idk why either lol |
11:16:31 | FromDiscord | <Rika> i think you can just put `if input[pos] == '"':` |
11:16:56 | FromDiscord | <Rika> `""` is still an empty string, and you do `pos += 1` before it anyway |
11:16:59 | FromDiscord | <Forest> yeah that was just unnecessary lol |
11:17:05 | FromDiscord | <Rika> yeah okay |
11:17:10 | FromDiscord | <Rika> what else do you not understand |
11:17:32 | FromDiscord | <Rika> oh also super tiny nitpick lol its spelled "lexeme" |
11:18:07 | FromDiscord | <Forest> it makes sense to me now aha, thanks for helping lol |
11:18:21 | FromDiscord | <Forest> In reply to @Rika "oh also super tiny": will correct now lol |
11:56:23 | * | jjido joined #nim |
11:56:47 | * | Zectbumo quit (Remote host closed the connection) |
12:12:39 | FromDiscord | <tandy> hmm, is there any way to tell the compiler the working directory to use? |
12:14:24 | FromDiscord | <mratsim> use a .cfg |
12:23:27 | * | slowButPresent joined #nim |
12:30:11 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
12:34:35 | FromDiscord | <thadeudepaula> sent a code paste, see https://paste.rs/QH4 |
12:35:11 | FromDiscord | <thadeudepaula> (edit) "https://play.nim-lang.org/#ix=3Xrj" => "https://play.nim-lang.org/#ix=3Xri" |
12:36:08 | FromDiscord | <demotomohiro> How about to use `nil` in Nim code? |
12:36:47 | FromDiscord | <demotomohiro> `Fun` in your C code is pointer? |
12:36:58 | FromDiscord | <Rika> He said it’s for c functions so I assume so |
12:38:21 | * | noeontheend joined #nim |
12:40:32 | * | PMunch joined #nim |
12:42:12 | FromDiscord | <thadeudepaula> sent a long message, see http://ix.io/3Xrk |
12:42:38 | FromDiscord | <thadeudepaula> (edit) "http://ix.io/3Xrk" => "http://ix.io/3Xrl" |
12:43:49 | FromDiscord | <thadeudepaula> (edit) "long message," => "code paste," | "http://ix.io/3Xrl" => "https://play.nim-lang.org/#ix=3Xrm" |
12:47:42 | FromDiscord | <Rika> In reply to @thadeudepaula "No, fun is just": Function types are nillable so that’s fine |
12:47:55 | FromDiscord | <Rika> Nil is a value not a type I believe |
12:50:35 | * | lumo_e joined #nim |
12:57:32 | FromDiscord | <demotomohiro> !eval echo nil is typedesc |
12:57:35 | NimBot | false |
13:03:22 | FromDiscord | <demotomohiro> In reply to @thadeudepaula "No, fun is just": Procedual types in Nim except closure types corresponds to function pointer type in C. As they are pointer types, set nil to procedual type variables is same to set NULL to function pointer in C. |
13:04:45 | * | noeontheend quit (Ping timeout: 276 seconds) |
13:09:21 | NimEventer | New question by lilroo: How do I call Mix_GetError from the nim SDL2 Mixer bindings?, see https://stackoverflow.com/questions/72186919/how-do-i-call-mix-geterror-from-the-nim-sdl2-mixer-bindings |
13:09:32 | * | Arrrrrrr quit (Quit: Arrrrrrr) |
13:19:46 | * | rockcavera joined #nim |
13:19:46 | * | rockcavera quit (Changing host) |
13:19:46 | * | rockcavera joined #nim |
13:20:24 | FromDiscord | <Zoom> How do you match a bool for a term-rewrite macro? |
13:26:22 | * | Schnouki quit (Remote host closed the connection) |
13:26:22 | * | toothlessgear quit (Remote host closed the connection) |
13:27:17 | * | Schnouki joined #nim |
13:27:47 | * | toothlessgear joined #nim |
13:28:07 | * | jjido joined #nim |
13:31:32 | FromDiscord | <thadeudepaula> In reply to @Zoom "How do you match": Well It is something I'll need to deal... There are some functions in C called isnumber that returns int... I wonder how expensive is to wrap it as returning cint and create a template casting on return. Really an interesting thing to play with |
13:34:38 | FromDiscord | <Rika> In reply to @thadeudepaula "Well It is something": Why did you reply to zoom? I don’t know how that was related to their question |
13:34:49 | FromDiscord | <Rika> Or is discord bugged for me? |
13:35:40 | FromDiscord | <Zoom> Well, `{sym}` works, but it's a bit unspecific, innit? |
13:37:32 | FromDiscord | <Rika> In reply to @thadeudepaula "Well It is something": With regards to the question it doesn’t sound expensive to me; nonetheless why don’t you just use the procedures in the Nim standard library instead? |
13:52:37 | FromDiscord | <Yardanico> In reply to @thadeudepaula "Well It is something": if you make your "wrapper" a template then with optimizations it'll be not noticeable at all |
13:53:05 | FromDiscord | <Yardanico> it will have a runtime cost, but really only a single assembly instruction on x86_64, so you won't notice it unless you're doing this conversion billions of times a second |
14:01:48 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
14:15:14 | FromDiscord | <Zoom> sent a code paste, see https://paste.rs/C69 |
14:15:37 | FromDiscord | <Zoom> sent a code paste, see https://paste.rs/oJv |
14:25:49 | * | ehmry quit (Ping timeout: 256 seconds) |
14:26:38 | * | arkurious joined #nim |
14:31:32 | * | noeontheend joined #nim |
14:34:00 | * | noeontheend quit (Remote host closed the connection) |
14:34:44 | FromDiscord | <exelotl> compileTime variables at runtime were a mistake 😅 |
14:34:44 | * | noeontheend joined #nim |
14:36:31 | FromDiscord | <Bubblie> So nim has unsafeAddr and addr but isnt addr by itself unsafe as well? |
14:36:51 | FromDiscord | <Bubblie> Because taking an address of an object from a stack is unsafe is it not |
14:37:51 | FromDiscord | <Bubblie> Is unsafeAddr just to make it easier to interop with C? |
14:38:12 | FromDiscord | <Yardanico> In reply to @Bubblie "So nim has unsafeAddr": yes, and this was changed in devel |
14:38:18 | FromDiscord | <Yardanico> so `addr` works for everything now |
14:38:23 | FromDiscord | <Bubblie> Oh awesome |
14:38:26 | FromDiscord | <Zoom> It shouldn't compile↵(@exelotl) |
14:38:32 | FromDiscord | <Bubblie> What if I use pointer math for memes |
14:38:37 | FromDiscord | <Bubblie> I think everyone would hate me |
14:38:43 | FromDiscord | <Yardanico> no one would care 🤔 |
14:38:52 | FromDiscord | <Bubblie> Pointer arithmetic 😭 |
14:39:00 | FromDiscord | <Yardanico> it's not like pointer arithmetic is something complex |
14:39:02 | FromDiscord | <Yardanico> just numbers |
14:39:50 | FromDiscord | <Bubblie> C++ ruined me |
14:45:30 | * | lumo_e quit (Ping timeout: 276 seconds) |
14:56:12 | * | noeontheend quit (Ping timeout: 240 seconds) |
15:00:06 | FromDiscord | <Bung> any async std io lib ? |
15:04:42 | NimEventer | New thread by Ctclmsn: C++ copy-constructor issue when using {.constructor.} pragma, see https://forum.nim-lang.org/t/9150 |
15:05:37 | FromDiscord | <spoon> asyncdispatch or threads? |
15:06:05 | FromDiscord | <Bung> async dispatch way |
15:07:56 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=3XrQ |
15:07:57 | FromDiscord | <ambient> This works but I'm sure there's a better way |
15:10:03 | FromDiscord | <ambient> Ideally I would just .add() inside the func necessary amounts, without scanning through the entire seq |
15:10:18 | FromDiscord | <ambient> but apparently something makes it immutable? |
15:11:17 | FromDiscord | <enthus1ast> change (arr\: seq[float]) to (arr\: var seq[float])↵(@ambient) |
15:11:20 | FromDiscord | <Rika> ? |
15:11:22 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3XrS |
15:11:57 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3XrT |
15:13:08 | FromDiscord | <ambient> @enthus1ast @Rika yeah that works, ty |
15:13:48 | FromDiscord | <Rika> if youre wondering, `result` is another way to return from a function |
15:14:33 | FromDiscord | <spoon> In reply to @Bung "async dispatch way": ah, think you're looking for asyncfile |
15:14:37 | FromDiscord | <spoon> https://nim-lang.org/docs/asyncfile.html |
15:15:13 | FromDiscord | <Rika> cant do stdin/stdout which i think is what he means ("stdio") |
15:15:22 | FromDiscord | <ambient> Here's the current project https://github.com/amb/nim_audiobook FFT seems to be working. Would be nice to have a 100% Nim audiolib, without any C or C++ |
15:15:46 | FromDiscord | <spoon> like terminal i/o? |
15:16:09 | FromDiscord | <Bung> but it does not support windows |
15:16:49 | FromDiscord | <spoon> what doesn't? |
15:17:39 | FromDiscord | <Bung> async file it has no windows specific code |
15:17:49 | FromDiscord | <spoon> i'm using the nimsaem vscode plugin and i'm getting no intellisense recommendations here |
15:18:17 | FromDiscord | <spoon> hm? |
15:19:02 | FromDiscord | <spoon> should be cross-platform |
15:25:16 | FromDiscord | <Bung> I use it in nimlsp but face error |
15:26:03 | FromDiscord | <Bung> https://github.com/PMunch/nimlsp/issues/121 |
15:26:14 | FromDiscord | <deeuu> In reply to @ambient "Here's the current project": This is interesting, so you're implementing all the audio primitives from scratch? (not sure if you've seen: https://github.com/johnnovak/easywave_ |
15:26:30 | FromDiscord | <deeuu> (edit) "https://github.com/johnnovak/easywave_" => "https://github.com/johnnovak/easywave )" |
15:26:54 | FromDiscord | <tandy> this is cool, have you got any plans for a dsp / audio project?↵(@ambient) |
15:28:21 | FromDiscord | <ambient> @deeuu thanks that looks useful, @tandy well I'm planning on Mel spectrograms and MFCCs, but nothing like pole filters or anything like that |
15:28:31 | FromDiscord | <ambient> maybe granular synthesis, who knows |
15:29:02 | FromDiscord | <tandy> nice, any reason for not wrapping an existing cpp library like https://github.com/flucoma/flucoma-core ?↵(@ambient) |
15:29:24 | FromDiscord | <tandy> im also interested in working on this, send me a message when you get there \:)↵(@ambient) |
15:29:34 | FromDiscord | <ambient> seems it's faster to write by hand than try to wrap and dodge all the edge cases and issues |
15:29:38 | FromDiscord | <deeuu> In reply to @ambient "<@746663152459972669> thanks that looks": I'm considering a librosa/essentia type library for Nim, but using arraymancer for n-dim arrays, rather than seqs |
15:30:07 | * | ehmry joined #nim |
15:30:12 | FromDiscord | <tandy> that would be awesome↵(@deeuu) |
15:30:23 | FromDiscord | <tandy> we need a nim dsp / audio chat |
15:30:28 | FromDiscord | <ambient> yeah librosa was my main inspiration |
15:30:31 | FromDiscord | <deeuu> Yeah that would be great |
15:33:25 | FromDiscord | <ambient> althought with Griffin-Lim from Mel spectrographs, don't you get the same effect as granular synthesis? |
15:33:44 | FromDiscord | <ambient> slowing or speeding up without changing frequency |
15:40:17 | FromDiscord | <deeuu> In reply to @ambient "althought with Griffin-Lim from": Didn't know about that algo. Looks like Librosa have one for constant Q: https://librosa.org/doc/latest/generated/librosa.griffinlim_cqt.html↵(we do need to talk elsewhere) |
16:12:13 | * | noeontheend joined #nim |
16:26:36 | * | lumo_e joined #nim |
16:27:16 | * | noeontheend quit (Ping timeout: 248 seconds) |
16:27:37 | * | duuuuuude quit (Ping timeout: 246 seconds) |
16:33:32 | FromDiscord | <Bubblie> Pixie is amazing |
16:33:40 | FromDiscord | <Bubblie> Wow |
16:44:25 | FromDiscord | <Alea> In reply to @Bubblie "Pixie is amazing": yes very nice↵i should release my pixie-boxy integrations as a stand alone lib at some point :EmotiPleased: |
16:44:32 | FromDiscord | <Alea> (edit) "nice↵i" => "nice↵I" |
16:45:57 | * | duuuuuude joined #nim |
16:46:35 | FromDiscord | <Alea> well stand alone(on top of pixie & boxy) |
16:48:26 | FromDiscord | <Bubblie> Pixie works with opengl with boxy |
16:48:36 | FromDiscord | <Bubblie> However I may need to write one for it to use vulkan |
16:48:43 | FromDiscord | <Yardanico> but pixie itself renders on the CPU |
16:48:50 | FromDiscord | <Yardanico> just keep that in mind |
16:48:59 | FromDiscord | <Bubblie> Boxy makes pixie use the gpu for rendering doesnt it |
16:49:04 | FromDiscord | <Yardanico> no |
16:49:16 | FromDiscord | <Yardanico> pixie still renders stuff on the CPU, but then copies to the GPU so you can see it on your screen |
16:49:26 | FromDiscord | <Yardanico> pixie is SIMD-accelerated though, yeah |
16:49:58 | FromDiscord | <Yardanico> boxy is really only for window management, it doesn't change anything in pixie or other libraries |
16:50:07 | FromDiscord | <Alea> that's why I'm hacking together my stuff↵draw stuff once with pixie and use boxy to wrangle it into whatever shape you need from then on |
16:50:13 | FromDiscord | <Alea> much much faster than just pixie |
16:50:19 | FromDiscord | <Yardanico> ah sorry, boxy is a 2d rendering api, hm |
16:50:25 | FromDiscord | <Bubblie> Yeah |
16:50:26 | FromDiscord | <Yardanico> but yeah "Render any dynamic assets (such as text) into images once using Pixie." |
16:50:30 | FromDiscord | <Yardanico> it's still rendered with pixie |
16:51:54 | FromDiscord | <Bubblie> Hmmmm |
16:52:17 | FromDiscord | <Bubblie> This is a predicament then |
16:52:29 | FromDiscord | <Bubblie> For what im doing it would be nice to make pixie use the gpu |
16:52:38 | FromDiscord | <Yardanico> well, you really can't :) |
16:52:44 | FromDiscord | <Bubblie> https://media.discordapp.net/attachments/371759389889003532/973628666649145364/image0-2.gif |
16:53:00 | FromDiscord | <Alea> what exactly are you trying todraw? |
16:53:56 | FromDiscord | <Bubblie> Well, not drawing anything just using vulkan, and it would be nice to have this use the gpu primarily for rendering considering how im also planning to use this for a gui library for my game itself cause it would be pretty nice to have that because of how I may want to do inventories |
16:54:04 | FromDiscord | <Bubblie> (edit) "Well, not drawing anything ... just" added "atm" |
16:54:19 | FromDiscord | <Bubblie> I used because like 5 times in that sentence shit |
16:54:59 | FromDiscord | <Alea> most GUI stuff is feasible with pixie + boxy |
16:55:24 | FromDiscord | <Alea> text, icons, dynamic panes, etc. |
16:55:28 | FromDiscord | <Bubblie> Yeah, boxy is opengl isnt it |
16:55:56 | FromDiscord | <Alea> yup |
16:56:03 | FromDiscord | <Bubblie> I got nim vulkan and glfw working and a triangle is rendering, it will he in a repo soon so others can use it as reference but |
16:56:08 | FromDiscord | <Alea> create a boxy vulkan fork <:cowboy_eyes:862249101180272650> |
16:56:19 | FromDiscord | <Bubblie> Looks like I may have to 👀 |
16:57:06 | FromDiscord | <Alea> boxy may not be the worst thing to port since in my digging it was mostly treeform's code with a bit of opengl at the end of every operation |
16:57:18 | FromDiscord | <Bubblie> Thats good |
16:57:31 | FromDiscord | <Bubblie> Is there a reason why pixie decided to render on cpu |
16:57:36 | FromDiscord | <Bubblie> Rather than gpu like nanovg and skia |
17:05:08 | * | lumo_e quit (Ping timeout: 248 seconds) |
17:11:19 | FromDiscord | <Bubblie> So pixie renders on the cpu, but what does boxy do in this case to make this gpu accelerated? Is everything else boxy does gpu accelerated while images are rendered with pixie? |
17:12:44 | FromDiscord | <spoon> i think boxie uses pixie to load images, or you can do image manipulation stuff like spritesheets with pixie and pass it to boxy |
17:13:01 | * | jjido joined #nim |
17:13:08 | FromDiscord | <spoon> and i think after that everything is handled on gpu by boxy |
17:13:50 | FromDiscord | <Bubblie> Thats great |
17:14:24 | FromDiscord | <Bubblie> Lovely even |
17:14:26 | FromDiscord | <Bubblie> It is time |
17:14:27 | FromDiscord | <Bubblie> To fork |
17:14:50 | FromDiscord | <Bubblie> And add vulkan |
17:17:04 | FromDiscord | <Bubblie> Im surprised nim isnt used often for vulkan |
17:17:12 | FromDiscord | <Bubblie> Its absolutely great for vulkan actually |
17:43:12 | FromDiscord | <Bubblie> Can nim wrap headers with the .cimport pragma like it can with regular c files |
17:44:19 | FromDiscord | <Yardanico> In reply to @Bubblie "Can nim wrap headers": yes, there's a `header` pragma |
17:44:28 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma |
17:44:36 | FromDiscord | <Bubblie> Lets go |
17:48:34 | FromDiscord | <Bubblie> Thank you |
18:03:39 | * | kenran joined #nim |
18:04:35 | * | kenran quit (Client Quit) |
18:16:48 | * | Zectbumo joined #nim |
18:19:01 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3XsA |
18:19:17 | FromDiscord | <d4rckh> what's the proper way of closing a tcp socket server? |
18:19:38 | FromDiscord | <d4rckh> do i have to call `.close` on the clients connected to it before calling `.close` on the server itself? |
18:23:59 | FromDiscord | <Yardanico> In reply to @tandy "I want to make": any Cifar or any type really? do you think your code works with any type? |
18:24:03 | FromDiscord | <Yardanico> but yeah, you can just use generics for this |
18:26:57 | * | lumo_e joined #nim |
18:27:00 | * | def- quit (Quit: -) |
18:28:38 | FromDiscord | <tandy> https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/nn/nn_dsl.nim |
18:28:39 | FromDiscord | <tandy> well cifar is a network created with arraymancer's neural network macro↵(@Yardanico) |
18:28:58 | FromDiscord | <Yardanico> but as I said, you can just use generics |
18:29:24 | FromDiscord | <tandy> hmm |
18:29:34 | FromDiscord | <Yardanico> proc test[T](arg: T) |
18:29:42 | FromDiscord | <Yardanico> arg can be any type, and proc will be instantiated for each arg type |
18:29:53 | FromDiscord | <tandy> ahh |
18:30:35 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:35:56 | FromDiscord | <dom96> In reply to @d4rckh "do i have to": Good question. I believe the OS will close all the clients for you if you close the server |
18:37:40 | FromDiscord | <d4rckh> asking because when i do that, close my program and then reopen it, its telling me that the address is in use |
18:37:54 | FromDiscord | <d4rckh> even tho i called close on the tcp socket server |
18:44:15 | FromDiscord | <dom96> set SO_REUSEADDR on the server socket |
18:44:39 | FromDiscord | <d4rckh> what does that do? |
18:45:21 | * | def- joined #nim |
18:46:35 | FromDiscord | <Yardanico> In reply to @dom96 "set SO_REUSEADDR on the": wouldn't that be kind of a hack? |
18:50:02 | FromDiscord | <dom96> Maybe, but it's a pretty common pattern. When you close a server socket it goes into TIME_WAIT and so you'll get "address already in use errors" until that time elapses. |
18:51:15 | NimEventer | New thread by Cnerd: Weird behaviour from fmt in strformat library, see https://forum.nim-lang.org/t/9151 |
18:52:42 | FromDiscord | <dom96> This looks like a good reference: https://www.howtouselinux.com/post/tcp_time_wait_linux |
18:52:58 | FromDiscord | <dom96> It even mentions: "So there is no way to reduce this timer. But in some operating systems, we can reuse these ports by configuring some kernel parameters." |
18:56:27 | FromDiscord | <d4rckh> In reply to @dom96 "Maybe, but it's a": yeah i noticed that after like a minute or something i can reuse that specific port |
18:56:57 | FromDiscord | <d4rckh> so i was thinking i was doing something wrong the way i closed the tcp server |
19:01:23 | omanom | @d4rckh how long you have to wait can vary a lot depending on a bunch of things. maximum is like 4 minutes or so if i remember right |
19:02:11 | FromDiscord | <treeform> In reply to @Alea "create a boxy vulkan": My hope that in the future Boxy will have multiple backends, manly Metal and DX12. |
19:03:06 | FromDiscord | <treeform> In reply to @Bubblie "Is there a reason": Yes because GPU vector rendering is hard. I tried several approaches, but they continue to be slower than CPU. |
19:03:33 | FromDiscord | <treeform> Also once you rasterize your vectors you want to keep them as restores for speed. |
19:03:52 | FromDiscord | <tandy> didnt work \:(↵(@Yardanico) |
19:03:53 | FromDiscord | <treeform> Is it does not really matter how fast vector to raster is. |
19:03:58 | FromDiscord | <Yardanico> In reply to @tandy "didnt work \:( (<@177365113899057152>)": huh? |
19:04:05 | FromDiscord | <Yardanico> maybe you didn something wrong? |
19:04:07 | FromDiscord | <Yardanico> (edit) "didn" => "did" |
19:04:13 | FromDiscord | <Yardanico> this pattern works for normal types just fine |
19:05:07 | FromDiscord | <tandy> probably \:)↵(@Yardanico) |
19:05:31 | FromDiscord | <tandy> `Error: type mismatch: got <Cifar[system.float32], Variable[Tensor[system.float32]]>` it says it got cifar but it expected T |
19:05:44 | * | noeontheend joined #nim |
19:05:45 | FromDiscord | <treeform> In reply to @spoon "i think boxie uses": Exactly you render everything that's changed into boxy's texture atlas, then render everything from there super fast. Most UI vector/image things don't change every frame. |
19:06:09 | FromDiscord | <Yardanico> In reply to @tandy "`Error: type mismatch: got": can you show the proc definition? |
19:06:40 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3XsI |
19:07:19 | FromDiscord | <Yardanico> and can you paste the whole error? especially where it says which argument was wrong |
19:07:59 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3XsJ |
19:08:44 | FromDiscord | <Yardanico> it's not erroring because your proc |
19:08:59 | FromDiscord | <Yardanico> it's erroring because there's no forward that takes a Cifar[float32] and Variable[Tensor[float32]] |
19:09:32 | FromDiscord | <Yardanico> the error clearly says that, it also explicitly shows 2 arguments while your proc has 5 |
19:09:54 | FromDiscord | <tandy> oh i bet i know why |
19:10:58 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3XsL |
19:13:24 | FromDiscord | <tandy> i just needed to include the file |
19:20:51 | FromDiscord | <ambient> what's the best way to use AVX intrinsics? just copy laser/simd.nim into my project? does anyone have experience how well the compiler auto-vectorizes, how much room there is for perf improvement by doing it manually? |
19:22:04 | FromDiscord | <Bubblie> In reply to @treeform "Yes because GPU vector": fair |
19:22:35 | FromDiscord | <Bubblie> I don't see this being an issue really, because it does make sense to do this from the cpu |
19:22:43 | * | tiorock joined #nim |
19:22:43 | * | tiorock quit (Changing host) |
19:22:44 | * | tiorock joined #nim |
19:22:44 | * | rockcavera quit (Killed (strontium.libera.chat (Nickname regained by services))) |
19:22:44 | * | tiorock is now known as rockcavera |
19:22:49 | FromDiscord | <Bubblie> and its not like im handling intense graphics here, its just images and strokes |
19:23:00 | FromDiscord | <Bubblie> (edit) "and its not like im handling intense graphics here, its just images and strokes ... " added "and shapes" |
19:23:22 | FromDiscord | <Bubblie> btw for staticglfw I realized its still on 3.3.2 |
19:23:43 | * | tiorock joined #nim |
19:23:43 | * | tiorock quit (Changing host) |
19:23:44 | * | tiorock joined #nim |
19:23:44 | * | rockcavera is now known as Guest7557 |
19:23:44 | * | tiorock is now known as rockcavera |
19:26:28 | FromDiscord | <Rika> In reply to @ambient "what's the best way": I heard clang auto vectorises better than GCC but I don’t really know |
19:26:49 | * | Guest7557 quit (Ping timeout: 246 seconds) |
19:29:17 | FromDiscord | <ambient> I've done intrinsics before in Rust, both gcc and clang, but it's really tough to beat in that situation. but don't know how much different programming styles matter |
19:29:54 | FromDiscord | <ambient> for example in Nim is there a difference between iterator style chains and just C style loops |
19:30:55 | FromDiscord | <Rika> Iterators by default are inline so they’re pretty much c style |
19:31:03 | FromDiscord | <ambient> ok gotcha |
19:32:56 | * | Zectbumo quit (Remote host closed the connection) |
19:36:22 | FromDiscord | <Yardanico> In reply to @Rika "Iterators by default are": just don't forget that they're transformed into `while` loops so C compilers can get confused by this |
19:36:28 | FromDiscord | <Yardanico> i mean for loops |
19:36:42 | FromDiscord | <Yardanico> they get transformed into while loops in the frontend itself |
19:38:06 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XsP |
19:38:31 | FromDiscord | <Rika> Is there a reason for that |
19:38:44 | FromDiscord | <Yardanico> maybe it's easier to implement that way, i don't know |
19:38:49 | FromDiscord | <Rika> Okay |
19:38:58 | FromDiscord | <Yardanico> but i think it's harder for C compilers to figure this out than traditional `for` loops |
19:40:19 | FromDiscord | <ambient> any tips on howto tell https://godbolt.org/ to only print the asm for that small func? |
19:40:20 | FromDiscord | <Alea> In reply to @treeform "Exactly you render everything": I was wondering, us there any cost difference in rendering to the frame buffer versus to a pixie image? |
19:40:24 | FromDiscord | <ambient> seems it dumps A LOT |
19:40:25 | FromDiscord | <Alea> (edit) "us" => "is" |
19:40:35 | FromDiscord | <Yardanico> In reply to @ambient "any tips on howto": there's no way, and you really should compile with -d:danger --gc:arc |
19:40:38 | FromDiscord | <Yardanico> to get the minimal output |
19:41:10 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/973671056059555840/unknown.png |
19:41:15 | FromDiscord | <Yardanico> here the C compiler just precomputes the result |
19:41:46 | FromDiscord | <Yardanico> but godbolt support for nim is quite bad |
19:42:05 | FromDiscord | <Yardanico> it only shows you the assembly for the main module, not other Nim files (like the stdlib), labels aren't named, etc |
19:42:14 | FromDiscord | <ambient> what's a good profiler? |
19:42:40 | FromDiscord | <ambient> does pretty much any of my favorites work well? |
19:43:29 | FromDiscord | <Recruit_main707> they will most likely work |
19:43:44 | FromDiscord | <Recruit_main707> well can be an overstatement since names will be a bit obfuscated and whatnot |
19:43:53 | FromDiscord | <ambient> I"ve used https://superluminal.eu/ and it's nice for multithreading especially |
19:44:14 | FromDiscord | <Rika> If it’s GDB like or so then it might work well |
19:47:33 | * | vicfred quit (Quit: Leaving) |
19:56:48 | * | jjido joined #nim |
19:57:18 | FromDiscord | <Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973675115390836746/image.png |
19:57:34 | FromDiscord | <Theodore> while installing nimlanglangserver |
19:58:08 | FromDiscord | <Theodore> also there's another issue with nimsuggest not working at all using nimsaem's plugin on vscode. |
19:58:34 | FromDiscord | <Theodore> nim and nimsuggest is on path, the path config in config.cfg I think is setup correctly |
19:59:03 | FromDiscord | <Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973675552806412348/image.png |
20:00:40 | FromDiscord | <Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973675960283045948/image.png |
20:00:42 | FromDiscord | <Theodore> nim dump throws out this |
20:00:54 | FromDiscord | <Theodore> same result as on windows, which on it works. |
20:01:09 | FromDiscord | <Yardanico> not sure why are you doing a lot of extra stuff |
20:01:13 | FromDiscord | <Yardanico> nimlanglangserver is in development, it doesn't work yet |
20:01:19 | FromDiscord | <Yardanico> In reply to @Theodore "image.png": all of this is not needed at all |
20:01:29 | FromDiscord | <Yardanico> it should just work if you have nimsuggest in path |
20:01:35 | FromDiscord | <treeform> In reply to @Alea "I was wondering, is": well use frame buffer means openGL or some thing, while pixie is all CPU+SIMD operations. |
20:01:46 | FromDiscord | <Theodore> it was suggested in nimsaem's plugin↵(@Yardanico) |
20:01:56 | FromDiscord | <Yardanico> In reply to @Theodore "it was suggested in": yes, but it's still early in development |
20:02:28 | FromDiscord | <Yardanico> i think even https://github.com/PMunch/nimlsp is more stable |
20:03:20 | FromDiscord | <Alea> In reply to @treeform "well use frame buffer": I mean like hypothetically pixie -> framebuffer vs pixie -> boxy -> framebuffer every frame |
20:03:21 | FromDiscord | <treeform> In reply to @Bubblie "btw for staticglfw I": We stopped using staticglfw and now only focus on windy. Windy uses native APIs on Win, Mac and Linux and gives you a very Nim friendly API. |
20:03:32 | FromDiscord | <Theodore> ya, but the issue I was trying to get lsp was due to nimsuggest not working on vscode, while it does on wangblows.↵(@Yardanico) |
20:03:54 | FromDiscord | <Yardanico> In reply to @Theodore "ya, but the issue": also, i assume you're on some arch-based distro? |
20:04:03 | FromDiscord | <Yardanico> like general question, what distro :) |
20:04:05 | FromDiscord | <Theodore> correct↵(@Yardanico) |
20:04:11 | FromDiscord | <Yardanico> yeah, so nim is outdated on arch |
20:04:18 | FromDiscord | <Theodore> from choosenim |
20:04:19 | FromDiscord | <Yardanico> it's still 1.4.8 while the latest version is 1.6.6 |
20:04:29 | FromDiscord | <Yardanico> In reply to @Theodore "from choosenim": but your command shows nim installed system-wide |
20:04:58 | FromDiscord | <Yardanico> are you sure `which nimsuggest` uses choosenim nimsuggest and not global nim's nimsuggest? |
20:05:05 | FromDiscord | <treeform> In reply to @Alea "I mean like hypothetically": well its `pixie -> texture transfer -> frame buffer` every frame vs `pixie -> texture transfer (atlas) once` and then `-> framebuffer` every frame. Going through boxy is much faster, unless you update the image in boxy every frame, then its probably about the same. |
20:05:05 | FromDiscord | <Theodore> ya I installed it with the script in the nim folder↵(@Yardanico) |
20:05:20 | FromDiscord | <Yardanico> but yeah, not sure how to help, for me nimsuggest with saem's extension just works |
20:05:23 | FromDiscord | <Yardanico> on windows and on linux |
20:05:29 | FromDiscord | <Alea> In reply to @treeform "well its `pixie ->": Yeah the second bit is what I was wondering |
20:05:46 | FromDiscord | <Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973677248265740368/image.png |
20:06:07 | FromDiscord | <Yardanico> and what do you mean by "doesn't work"? does it show errors or not autocomplete at all? |
20:06:10 | FromDiscord | <Yardanico> can you see the outline in vscode? |
20:06:15 | FromDiscord | <Theodore> no autocomplete at all↵(@Yardanico) |
20:06:26 | FromDiscord | <Theodore> no errors either |
20:06:41 | FromDiscord | <Theodore> nimsuggest log, not much either, while on windows it shows requests |
20:06:52 | FromDiscord | <Theodore> I used the same folder on both boots |
20:06:52 | FromDiscord | <Yardanico> well, errors are made with `nim check` so it should show up even if nimsuggest is not working |
20:07:30 | FromDiscord | <Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973677681872871454/image.png |
20:07:40 | FromDiscord | <Theodore> after saving it shows errors yes.↵(@Yardanico) |
20:07:42 | FromDiscord | <treeform> In reply to @Alea "Yeah the second bit": The big slow parts are drawing large images onto images with pixie and transferring stuff to the atlas with boxy. The more you can "addImage" and don't change them in boxy - the better. But some times you have to change them ... its not super slow ... but can get slow. |
20:07:44 | FromDiscord | <Theodore> but that's not autocompletion |
20:08:11 | FromDiscord | <Yardanico> In reply to @Theodore "but that's not autocompletion": can you try to open a separate folder in vscode and just try to write hello world to see if it autocompletes? |
20:08:31 | FromDiscord | <Theodore> I have tried that, but sure.↵(@Yardanico) |
20:08:50 | FromDiscord | <Yardanico> also try doing it somewhere inside your /home dir, because i really don't know what could be causing this |
20:09:02 | FromDiscord | <Yardanico> but if that doesn't work, the only real way to know why is to debug nimsaem extension |
20:09:10 | FromDiscord | <Yardanico> build a debug build and debug vscode with it |
20:09:11 | FromDiscord | <Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973678105547911198/image.png |
20:09:32 | FromDiscord | <treeform> In reply to @Alea "Yeah the second bit": Ideally for a game you only load stuff once with `addImage` and just use `draw` for everything. Except text. If your text is small enough it's easy to update it with addImage only when it changes. Maybe if you have big level backgrounds is probably worth to load/unload them too. If you give me a better description of what your app does I can give better advice. |
20:09:48 | FromDiscord | <Theodore> I guess I don't have any other option than that then.↵(@Yardanico) |
20:10:16 | FromDiscord | <Yardanico> hmm, can you check your nimsaem settings in vscode as well? |
20:10:24 | FromDiscord | <Yardanico> like nim: provider |
20:10:41 | FromDiscord | <Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973678485967085568/image.png |
20:11:06 | FromDiscord | <Yardanico> :( |
20:11:14 | FromDiscord | <Theodore> I have been messing around with these for couple of days now, else I wouldn't come here begging for help |
20:12:44 | FromDiscord | <Yardanico> can you maybe verify that nimsuggest itself works? |
20:12:58 | FromDiscord | <Theodore> hmm, you mean over stdin |
20:13:03 | FromDiscord | <Yardanico> yes |
20:13:12 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XsX |
20:13:14 | FromDiscord | <Theodore> I think I tried that in past, and it did show up something. |
20:13:22 | FromDiscord | <Theodore> i'll try again I guess |
20:13:28 | FromDiscord | <Yardanico> `nimsuggest file.nim` |
20:13:30 | FromDiscord | <Yardanico> `def 3:5` |
20:14:23 | FromDiscord | <Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973679416657993828/image.png |
20:14:32 | FromDiscord | <Yardanico> yeah so it works |
20:14:57 | FromDiscord | <Yardanico> i really have no clue, the only way i can somehow help if we had some interactive session in discord/etc :P |
20:15:15 | FromDiscord | <Theodore> also I have tried all the packages from official repo and aur for vscode |
20:15:32 | FromDiscord | <Theodore> sure, if you can be bothered.↵(@Yardanico) |
20:32:16 | * | vicecea quit (Remote host closed the connection) |
20:32:44 | * | vicecea joined #nim |
20:34:28 | FromDiscord | <!Patitotective> In reply to @Yardanico "https://upload.wikimedia.org/wikipedia/commons/4/43": turkey or yemen |
21:09:28 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
21:13:04 | FromDiscord | <Yardanico> btw, we solved the issue about nimsuggest with Theodore, the root cause was that Theodore didn't have "127.0.0.1 localhost" in /etc/hosts so nimsuggest failed with OSError "Name does not resolve" when starting up |
21:15:14 | FromDiscord | <Yardanico> it's quite weird, yes, but nimsuggest uses sockets, so it was for some reason failing without "127.0.0.1 localhost". I guess nix in general really doesn't like when there's no "localhost" entry in hosts |
21:26:50 | * | noeontheend quit (Ping timeout: 240 seconds) |
21:38:46 | FromDiscord | <Bubblie> In reply to @treeform "We stopped using staticglfw": oh! is it alright if I fork it then and add the newest glfw to it |
21:39:14 | FromDiscord | <Bubblie> I currently need glfw for a lot of the things im doing with vulkan |
21:41:45 | FromDiscord | <Elegantbeef> "Is it alright to fork it" |
21:41:53 | FromDiscord | <Elegantbeef> Lol it's FOSS, if he didnt want forks he'd have had a proprietary license 😄 |
21:45:18 | FromDiscord | <Yardanico> @beef i want to ask you expert opinion |
21:45:20 | FromDiscord | <Yardanico> your |
21:45:31 | FromDiscord | <Yardanico> from another nim chat, this minimized snippet |
21:45:35 | FromDiscord | <Elegantbeef> I'm an expurt! |
21:45:38 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xtj |
21:45:49 | FromDiscord | <Yardanico> is it correct that Nim here applies NRVO so fullInfo call actually modifies prevInfo ? |
21:46:01 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xtk |
21:46:10 | FromDiscord | <Yardanico> so we modified `result` but it modified `prevInfo` as well because of NRVO |
21:47:47 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xtl |
21:48:00 | FromDiscord | <Elegantbeef> I mean it makes sense whether it's right is another thing |
21:48:20 | FromDiscord | <Elegantbeef> The only reason it's noticeable is that you're calling with the prevInfo |
21:49:04 | FromDiscord | <Yardanico> yes it makes sense, I know, but I wonder if it's correct or not |
21:49:09 | FromDiscord | <Yardanico> because the behaviour can be quite surprising |
21:49:55 | FromDiscord | <Elegantbeef> Well i mean it's hard to fix i think, since it means your NVRO needs to take into account callsite and variable usage, perhaps nvro should be disabled for non gcsafe procedures? |
21:50:11 | FromDiscord | <Elegantbeef> It's surprising |
21:50:57 | * | PMunch quit (Quit: leaving) |
21:52:49 | FromDiscord | <Elegantbeef> It's a complex reasoning here |
21:53:02 | FromDiscord | <Andreas> hi, is it possible to set the state of a closure-iterator ? i always get one elem too much ? |
21:53:32 | FromDiscord | <Elegantbeef> We cannot know that it shouldnt be nvro'd until the body of `fullInfo`, but that then means we need check all code to see if access the left hand of the assignment call |
21:53:47 | FromDiscord | <Elegantbeef> I'd say yard it's "correct" just due to the required complexity to resolve |
21:53:55 | FromDiscord | <Elegantbeef> `var prevInf = (let a = fullInfo(); a)` is the fix i'd say |
21:54:00 | FromDiscord | <Andreas> (edit) "hi, is it possible to set the state of" => "sent" | "closure-iterator ? i always get one elem too much ?" => "code paste, see https://play.nim-lang.org/#ix=3Xto" |
21:54:14 | FromDiscord | <Elegantbeef> Andreas iterators need 1 extra call to know if they're finished |
21:54:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Xtp |
21:55:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Xtq |
22:11:22 | FromDiscord | <theangryepicbanana> is there a way to make `new(T)` return `ref T not nil`? |
22:13:13 | FromDiscord | <Yardanico> also @ElegantBeef |
22:13:22 | FromDiscord | <Yardanico> i think it was introduced for this specific snippet in 1.6.2 only |
22:13:28 | FromDiscord | <Yardanico> it doesn't do NRVO on 1.6.0 |
22:13:31 | FromDiscord | <Yardanico> i suspect it's because of https://github.com/nim-lang/Nim/issues/14470 |
22:17:26 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Xtx |
22:18:05 | FromDiscord | <Elegantbeef> Yea i know yard, i dont know what's proper here #internal is better than beef's view |
22:18:18 | FromDiscord | <theangryepicbanana> sent a code paste, see https://play.nim-lang.org/#ix=3Xty |
22:18:49 | FromDiscord | <Elegantbeef> time to make it with concept |
22:18:54 | NimEventer | New post on r/nim by shujidev: dot operator is not working with a local function, see https://reddit.com/r/nim/comments/umucyy/dot_operator_is_not_working_with_a_local_function/ |
22:21:15 | * | noeontheend joined #nim |
22:21:49 | FromDiscord | <Elegantbeef> Hmm actually we need something more specific |
22:24:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Xtz |
22:24:43 | FromDiscord | <Elegantbeef> Not as nice as `new` but it works, guess we can drop `object` and just have `typedesc[ref]` |
22:25:12 | FromDiscord | <Elegantbeef> The nice part is that not nil is a structured type so all `T not nil` are equivlent |
22:29:18 | FromDiscord | <exelotl> ooh is NVRO like, somewhat dependable now? |
22:29:27 | FromDiscord | <Elegantbeef> Yea |
22:29:40 | FromDiscord | <Elegantbeef> Though as demonstrated above it can cause wacky issues that are complex to resolve |
22:30:08 | FromDiscord | <Elegantbeef> Well complex to resolve with the compiler |
22:30:17 | FromDiscord | <Elegantbeef> I'd argue any procedure that's not gcsafe shouldnt be NVRO'd, but YMMV \:d |
22:32:34 | * | Zectbumo joined #nim |
22:48:10 | * | lumo_e quit (Ping timeout: 240 seconds) |
22:54:08 | * | xet7 quit (Remote host closed the connection) |
23:01:21 | FromDiscord | <theangryepicbanana> is there a way to add a label to a for or while loop without an extra block? |
23:01:35 | FromDiscord | <theangryepicbanana> like `for x in y as label:` |
23:02:46 | * | jmdaemon joined #nim |
23:03:23 | FromDiscord | <Elegantbeef> Nope |
23:03:30 | FromDiscord | <Elegantbeef> You can use a template |
23:03:39 | FromDiscord | <Elegantbeef> `while(cond, nameOfblock)` |
23:03:48 | FromDiscord | <theangryepicbanana> oof |
23:05:26 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XtH |
23:06:08 | FromDiscord | <theangryepicbanana> yeah but it's just not as nice, that's all |
23:12:07 | * | duuuuuude quit (Ping timeout: 240 seconds) |
23:25:26 | * | duuuuuude joined #nim |
23:27:50 | * | jmd_ joined #nim |
23:27:57 | * | jmdaemon quit (Ping timeout: 252 seconds) |
23:35:54 | * | duuuuuude quit (Ping timeout: 276 seconds) |
23:38:50 | * | noeontheend quit (Ping timeout: 240 seconds) |