<< 10-05-2022 >>

00:09:02FromDiscord<!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:52FromDiscord<!Patitotective> @rockcavera @confus
01:16:58FromDiscord<!Patitotective> (edit) "@confus" => "😕"
01:18:13FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XpG
01:18:27FromDiscord<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:36FromDiscord<Yardanico> also why gcc 8 🤔
01:18:45FromDiscord<Yardanico> https://jmeubank.github.io/tdm-gcc/articles/2021-05/10.3.0-release
01:19:25FromDiscord<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:22FromDiscord<!Patitotective> In reply to @Yardanico "if you install mingw/tdm": but win32 not compatible with win64, right?
01:20:31FromDiscord<Yardanico> nonono
01:20:38FromDiscord<Yardanico> win32 is the general name for basic native Windows APIs
01:20:50FromDiscord<!Patitotective> :o
01:20:51FromDiscord<Yardanico> https://en.wikipedia.org/wiki/Windows_API
01:20:59FromDiscord<!Patitotective> w-why win32 lol
01:21:14FromDiscord<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:20FromDiscord<!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:21FromDiscord<!Patitotective> (edit) "manually" => "manually?"
01:21:25FromDiscord<Yardanico> the latter part is sarcastic
01:21:34FromDiscord<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:38FromDiscord<Yardanico> tdm gcc installer is really easy
01:21:42*Gustavo6046 joined #nim
01:21:42FromDiscord<Yardanico> i think it can actually add itself to path
01:21:58FromDiscord<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:21FromDiscord<!Patitotective> In reply to @Yardanico "just install tdm gcc": this https://jmeubank.github.io/tdm-gcc/download/ ?
01:22:36FromDiscord<Yardanico> yes, it's literally the same download as the link I gave you above
01:22:45FromDiscord<Yardanico> "tdm64-gcc-10.3.0-2.exe"
01:23:16FromDiscord<spoon> what's tdm?
01:23:29FromDiscord<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:32FromDiscord<Elegantbeef> \~\~Team deathmatch\~\~
01:24:39FromDiscord<spoon> hmm, i've never had a problem with mingw/gcc on windows
01:24:59FromDiscord<!Patitotective> do you use windows :oo?
01:25:09FromDiscord<Yardanico> if you use the win32 thread versions, then yeah, won't be much difference regarding the DLLs
01:25:10FromDiscord<spoon> yeah, my warranty hasn't expired yet
01:25:20FromDiscord<Yardanico> In reply to @spoon "yeah, my warranty hasn't": warranty doesn't work like that
01:25:24FromDiscord<Yardanico> just fyi
01:25:30FromDiscord<Elegantbeef> Any ideas why emcc compiles `proc doThing: MyType` to `proc doThing(i: int32)`?
01:25:32FromDiscord<spoon> In reply to @Yardanico "warranty doesn't work like": for broken drives it does
01:25:38FromDiscord<spoon> drivers
01:25:40*ltriant quit (Ping timeout: 246 seconds)
01:25:51FromDiscord<Yardanico> In reply to @Elegantbeef "Any ideas why emcc": you have a code to reproduce it of course? :)
01:26:02FromDiscord<!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:18FromDiscord<spoon> i had to have a support agent do diagnostics and they found a hardware issue so
01:26:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XpI
01:26:33FromDiscord<!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:09FromDiscord<spoon> In reply to @Patitotective "c-could you pls try": what's that for?
01:27:30FromDiscord<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:09FromDiscord<Elegantbeef> I'm guessing it expects a pointer to the type, or it just doesnt work with structs
01:28:35FromDiscord<Yardanico> emscripten works for really complex projects, so the problem must be somewhere else :)
01:28:50FromDiscord<!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:59FromDiscord<!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:02FromDiscord<Elegantbeef> I mean i'm exporting this procedure to the runtime interface
01:29:18FromDiscord<Yardanico> btw, why emscripten?
01:29:24FromDiscord<Yardanico> I think for your thing you really only need WASI SDK
01:29:29FromDiscord<Elegantbeef> Cause it's' the first tool i had at hand
01:30:00FromDiscord<Elegantbeef> It's standalone wasm i dont think it really matters
01:30:00FromDiscord<spoon> In reply to @Patitotective "nimassets just encodes files": what's the difference between that and slush()/staticLoad()?
01:30:08FromDiscord<!Patitotective> slush?
01:30:17FromDiscord<Yardanico> In reply to @Elegantbeef "It's standalone wasm i": WASI SDK is more "pure"
01:30:18FromDiscord<spoon> just a shortcut for staticload
01:30:24FromDiscord<Elegantbeef> I do want to try nlvm aswell but it's not compiling
01:30:28FromDiscord<spoon> or staticread()
01:30:30FromDiscord<spoon> forget which
01:30:41*ltriant joined #nim
01:31:02FromDiscord<!Patitotective> isnt it slurp?
01:31:15FromDiscord<Elegantbeef> I mean it doesnt matter right now yard I half want to support the compiles I can
01:31:24FromDiscord<Elegantbeef> I need to test to see which is the most friendly to use
01:31:44FromDiscord<spoon> yeah!
01:31:48FromDiscord<spoon> it's slurp
01:31:55FromDiscord<!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:06FromDiscord<spoon> got two names wrong in one go
01:32:41FromDiscord<Yardanico> works here @beef
01:32:44FromDiscord<Elegantbeef> But like i said yard i expected it to mangle the type but didnt expect it to add a parameter 😄
01:32:47FromDiscord<Yardanico> ` (func (;1;) (type 3) (param i32)`
01:33:02FromDiscord<Elegantbeef> `param i32`
01:33:05FromDiscord<Elegantbeef> Did the same thing ok
01:33:29FromDiscord<Yardanico> oh this
01:33:32FromDiscord<Elegantbeef> I dont know how one is supposed to interact with the procedure then
01:34:01FromDiscord<Elegantbeef> I'm assuming i'm supposed to allocate some wasm memory and pass it as a parameter
01:34:22FromDiscord<Yardanico> and have you actually checked if the C code is correct?
01:34:24FromDiscord<Elegantbeef> Then it uses that as a ptr to the data to write to
01:34:38FromDiscord<Yardanico> although looks like it is
01:35:16FromDiscord<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:24FromDiscord<Elegantbeef> Yea the C code is fine
01:35:27FromDiscord<!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:35FromDiscord<!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:50FromDiscord<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:03FromDiscord<Elegantbeef> Yea that's what i thought yard
01:36:12FromDiscord<Elegantbeef> Though there is an issue
01:36:25FromDiscord<!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:42FromDiscord<Elegantbeef> Ah nevermind i'm dumb
01:36:42FromDiscord<!Patitotective> (edit) ""other" => ""another"
01:36:55FromDiscord<Elegantbeef> Allocate into the runtime's linear memory and it uses teh result as a ptr to that i think
01:37:02FromDiscord<Elegantbeef> Then i just cast that to the type i want
01:37:08FromDiscord<Elegantbeef> It's pretty much what i expected
01:37:20FromDiscord<Elegantbeef> Just a bit more elaborate since sandboxing exists 😄
01:37:44FromDiscord<spoon> hold on nimassets just got blocked by my AV lol
01:38:14FromDiscord<Yardanico> you can also check https://wasdk.github.io/WasmFiddle/ @ElegantBeef
01:38:27FromDiscord<Yardanico> (func $other (; 0 ;) (param $0 i32)
01:38:28FromDiscord<Yardanico> for similar code
01:38:33*ltriant quit (Ping timeout: 256 seconds)
01:38:40FromDiscord<spoon> looks like it worked perfectly fine with no issue
01:38:51FromDiscord<spoon> `nimassets -d:.\Screenshots\ -o:.\test.nim`
01:39:00FromDiscord<!Patitotective> what windows version are you using? :[
01:39:04FromDiscord<spoon> just copied a screenshot folder over to test
01:39:06FromDiscord<spoon> windows 11
01:39:19FromDiscord<!Patitotective> :[
01:39:22FromDiscord<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:30FromDiscord<Elegantbeef> Luckily we have macros yard so i can always expand complex types to a tuple 😄
01:39:51FromDiscord<spoon> so what's the advantage of nimassets over staticload anyway?
01:39:59FromDiscord<spoon> staticREAD*
01:40:04FromDiscord<Elegantbeef> Self abuse
01:40:09FromDiscord<!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:15FromDiscord<spoon> i think i have dementia
01:40:27FromDiscord<Elegantbeef> spoon just write `template staticLoad(s: static string): string = staticRead(s)` 😛
01:40:29FromDiscord<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:32FromDiscord<Elegantbeef> Then you can play it off like you're using your own api
01:40:59FromDiscord<!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:21FromDiscord<Yardanico> I also found this @beef https://stackoverflow.com/a/56405899/5476128
01:41:47FromDiscord<Yardanico> so yeah, pass by value = pass by pointer in wasm apparently
01:42:06FromDiscord<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:07FromDiscord<Elegantbeef> Yea it makes sense
01:42:13FromDiscord<Yardanico> ah right
01:42:16FromDiscord<Yardanico> yeah
01:42:32FromDiscord<spoon> In reply to @Patitotective "staticRead requires a static": wait so like, it's for stuff defined after compiletime?
01:42:46FromDiscord<!Patitotective> sort of
01:42:50FromDiscord<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:06FromDiscord<Yardanico> because nimassets resulting file must be used in the compilation process anyway
01:43:22FromDiscord<Yardanico> its not some runtime thing
01:43:45FromDiscord<!Patitotective> w-what
01:43:48FromDiscord<Yardanico> ??
01:43:54FromDiscord<Yardanico> it's a compile time bundler
01:44:02FromDiscord<!Patitotective> how can i be so stupid
01:44:03FromDiscord<Yardanico> it creates a nim file that you then import and compile along with your project
01:44:28FromDiscord<Yardanico> also @beef are you making wasmedge nim stuff to allow extending nim programs with wasm plugins?
01:44:29FromDiscord<!Patitotective> then nimassets is for fun lol
01:44:32FromDiscord<!Patitotective> (edit) "fun" => "fun?"
01:44:47*duuuuuude quit (Ping timeout: 256 seconds)
01:44:52FromDiscord<Yardanico> it's just needed if you're too lazy and want a tool to preserve all paths and stuff
01:45:06FromDiscord<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:14FromDiscord<Yardanico> and of course wasm = easy sandboxing
01:45:48FromDiscord<!Patitotective> anyways thank youuuuu @spoon :]
01:45:57FromDiscord<sOkam!> Any idea how this is even possible? https://media.discordapp.net/attachments/371759389889003532/973400467717640213/unknown.png
01:46:43FromDiscord<Yardanico> In reply to @sOkam! "Any idea how this": what is the problem here?
01:47:31FromDiscord<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:41FromDiscord<sOkam!> I'm calling the same function in both
01:49:05FromDiscord<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:41FromDiscord<Yardanico> In reply to @sOkam! "Any idea how this": what "file1" do you pass in? just "tstfile1.txt" ?
01:53:48FromDiscord<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:16FromDiscord<sOkam!> sry, was cut https://media.discordapp.net/attachments/371759389889003532/973402815479304233/unknown.png
01:55:25FromDiscord<Yardanico> and yeah, please post code as text in the future (Discord has code blocks :P)
01:55:57FromDiscord<Yardanico> bridges handle code pastes correctly, and it's much easier as then you can immediately copy the code
01:56:03FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpL
01:56:04FromDiscord<Yardanico> instead of having to type it by hand
01:56:35FromDiscord<sOkam!> using nvim, so i usually don't copy paste because it brings line numbers with it
01:57:02FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XpM
01:57:02FromDiscord<Yardanico> your file1 isn't an absolute path
01:57:04FromDiscord<Yardanico> I think that's the reason
01:57:24FromDiscord<sOkam!> lets try
01:57:35FromDiscord<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:41FromDiscord<sOkam!> Trying to isolate the bug from the other day, doubt thats the reason. but doesn't hurt to try it
01:57:47FromDiscord<Yardanico> https://stackoverflow.com/questions/1620018/copy-all-the-lines-to-clipboard
01:58:00FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/973403497431199794/unknown.png
01:58:08FromDiscord<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:26FromDiscord<sOkam!> Which I haven't configured yet, so i'm just copying the terminal text
01:58:55FromDiscord<sOkam!> oh, didn't know about the `+` thing. handy. ty
01:59:17FromDiscord<Yardanico> so easy fix for your code is to just have `let dir = getCurrentDir() / "tstdir"`
01:59:21FromDiscord<Yardanico> instead of just `let dir = "tstdir"`
01:59:24FromDiscord<Yardanico> so your `dir` is absolute
02:01:43FromDiscord<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:52FromDiscord<Yardanico> yes
02:02:25FromDiscord<sOkam!> Maybe that's what I was doing before in my build system. And that's why it was giving the ../../../../../ crazyness 🤔
02:02:52FromDiscord<sOkam!> Will dig into that, might be some issue there
02:06:59FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpQ
02:07:03FromDiscord<sOkam!> Those are absolute folders
02:08:13FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpR
02:08:59FromDiscord<Yardanico> are you trying to codegolf :D
02:09:26FromDiscord<sOkam!> Whats codegolf?
02:09:27FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpS
02:09:33FromDiscord<Yardanico> trying to minimize code size as much as possible
02:09:43FromDiscord<Yardanico> no spaces, arg names like `s` and `d` :)
02:10:00FromDiscord<sOkam!> I just like writing that way, it makes more sense to me for some reason 🤷‍♂️
02:10:14FromDiscord<Yardanico> also, `s:seq` isn't what you think exactly, it makes your proc an implicit generic
02:10:15FromDiscord<Yardanico> just to let you know
02:10:16FromDiscord<sOkam!> Verbose syntax tires me a lot
02:10:31FromDiscord<Yardanico> In reply to @sOkam! "Verbose syntax tires me": you mean spaces tire you? everyone has different tastes i guess..
02:10:57FromDiscord<sOkam!> i mean full words that are extremely obvious implied meanings
02:11:09FromDiscord<sOkam!> (edit) "are" => "have"
02:11:35FromDiscord<sOkam!> In reply to @Yardanico "also, `s:seq` isn't what": what do you mean generic?
02:11:43FromDiscord<Yardanico> a generic type
02:11:46FromDiscord<sOkam!> because seq can have any type in them?
02:11:49FromDiscord<Yardanico> s:seq will also match for seq[int]
02:11:55FromDiscord<sOkam!> ah i see
02:11:57FromDiscord<Yardanico> you really want to have seq[string] here specifically
02:12:05FromDiscord<sOkam!> good catch ✍️
02:12:07FromDiscord<Yardanico> it's kind of weird otherwise :)
02:13:26FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XpT
02:13:37FromDiscord<Yardanico> `it = it.relativePath(d)`
02:14:39FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpU
02:14:40FromDiscord<Yardanico> sent a code paste, see https://paste.rs/7bk
02:16:52FromDiscord<Yardanico> but yeah, your code works for me fine
02:17:05FromDiscord<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:56FromDiscord<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:42FromDiscord<Yardanico> can you maybe show your getCurrentDir() when you call that zip ?
02:18:50FromDiscord<Yardanico> the code is a bit hard to follow, but I get what you want to do
02:19:29FromDiscord<Yardanico> sent a code paste, see https://paste.rs/PTi
02:19:35FromDiscord<sOkam!> sent a code paste, see https://paste.rs/Vz0
02:20:01FromDiscord<Yardanico> idk, it should work just fine
02:20:03FromDiscord<sOkam!> sorry, i thought I had included that. it was right before the splitting
02:20:04FromDiscord<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:18FromDiscord<Yardanico> just shows cgamex86_64.so
02:21:24FromDiscord<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:30FromDiscord<Yardanico> since you want to pass relative paths to `zip` in this case
02:21:33FromDiscord<Yardanico> otherwise your `tseq` is just unused
02:22:30FromDiscord<sOkam!> maybe that's the reason?
02:22:36FromDiscord<Yardanico> i don't know?
02:22:45FromDiscord<Yardanico> but then it shouldn't output `../../../../../../../home/sokam/gd/osdf/bin/release-linux-x86_64/osdf/cgamex86_64.so`
02:22:48FromDiscord<sOkam!> the problem I had was that it was trying to zip absolute paths, which wasn't intended
02:22:49FromDiscord<Yardanico> doesn't matter if tseq is used or not
02:23:12FromDiscord<sOkam!> zipping absolutes just zips the whole path from root
02:23:22FromDiscord<sOkam!> (edit) "zipping absolutes just zips the whole path from ... root" added "system"
02:25:04FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpX
02:25:38FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3XpY
02:25:41FromDiscord<Yardanico> well see
02:25:55FromDiscord<Yardanico> and let me guess - compileDir wasn't absolute or something?
02:27:06FromDiscord<sOkam!> should be absolute, i think? 🤔 https://media.discordapp.net/attachments/371759389889003532/973410823710068806/unknown.png
02:28:12FromDiscord<Yardanico> 🤔
02:31:52FromDiscord<sOkam!> good catch on the tseq thing. Next issue right after this was that line exactly 🙂
02:32:16FromDiscord<Yardanico> that's why you should use more verbose variable names :)
02:32:45FromDiscord<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:16FromDiscord<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:20FromDiscord<sOkam!> is there a way to decide if a string contains a file or a directory?
02:54:53FromDiscord<Elegantbeef> `fileExists` `dirExists`
02:55:35FromDiscord<Yardanico> In reply to @sOkam! "is there a way": not really
02:55:40FromDiscord<sOkam!> how would you check for both? just some conditionals with those, I guess?
02:55:47FromDiscord<Yardanico> i mean fileExists and dirExists works, but only if your string doesn't have anything extra
02:56:00FromDiscord<Yardanico> your question sounded like if the string "contains" a path, like if it can something else as well
02:56:05FromDiscord<Yardanico> In reply to @sOkam! "how would you check": yes
02:56:16FromDiscord<sOkam!> yeah, that's not an issue. they are meant to only contain paths
02:56:51FromDiscord<sOkam!> In reply to @Yardanico "your question sounded like": oh, should have said `is`. true
02:57:01FromDiscord<sOkam!> (edit) "`is`." => "`is`, not contains."
02:57:57FromDiscord<sOkam!> what about the situation where the file/dir does not exist yet, and will be created?
02:58:24FromDiscord<sOkam!> that's the current usecase, since I'm creating aliases for mkDir, cpDir, cpFile, etc
02:59:00FromDiscord<sOkam!> (edit) "etc" => "etc. aiming to target the functionality of bash's `cp`"
03:00:17FromDiscord<sOkam!> I could add a third input, like `cp this, there, "file"`. But wondered if there is something cleaner
03:01:28FromDiscord<Yardanico> In reply to @sOkam! "what about the situation": what about it?
03:01:40FromDiscord<Yardanico> you can't differentiate dir from a file on nix if it's not created yet
03:01:48FromDiscord<Yardanico> "/home/user/path" can be a file or a directory
03:08:29FromDiscord<Yardanico> i mean it's the same on windows, but extension-less files are quite rare on windows
03:16:45FromDiscord<sOkam!> True that. Makes sense
03:16:52FromDiscord<sOkam!> Didn't realize that
03:16:53*arkurious quit (Quit: Leaving)
03:17:00FromDiscord<Yardanico> but if you have the slash as the last symbol, then it should be easy to distiniguish
03:17:04FromDiscord<Yardanico> (edit) "distiniguish" => "distinguish"
03:19:23*vicfred joined #nim
03:23:39FromDiscord<sOkam!> sent a code paste, see https://paste.rs/tFm
03:24:00FromDiscord<sOkam!> Or does that imply both having the exact same type?
03:25:14FromDiscord<Yardanico> the latter of course
03:25:22FromDiscord<Yardanico> `source, dest: string;` clearly says "for both source and dest have the type as string"
03:25:32FromDiscord<Yardanico> there's even a semicolon to help differentiate even more
03:25:43FromDiscord<sOkam!> ic
03:25:50FromDiscord<Yardanico> you can use semicolon instead of a comma in argument list, they're effectively equivalent
03:26:00FromDiscord<Yardanico> except some special cases (that's why ; was made)
03:26:34FromDiscord<sOkam!> Does `source; dest:string` also mean that both are strings?
03:26:55FromDiscord<Yardanico> no
03:26:58FromDiscord<Yardanico> this won't compile
03:26:59FromDiscord<Elegantbeef> No
03:27:07FromDiscord<Elegantbeef> Source has no type there
03:27:08FromDiscord<Elegantbeef> So it's an error unless it's in a macro/template
03:27:13FromDiscord<sOkam!> ✍️
03:27:20FromDiscord<Yardanico> ✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️✍️
03:27:36FromDiscord<Yardanico> no
03:30:44FromDiscord<!Patitotective> you wont take the crown of the emojiest person 😑
03:30:48FromDiscord<!Patitotective> and good night everyone 🙃
03:30:51FromDiscord<!Patitotective> 🌃
03:31:03FromDiscord<Yardanico> 6:30 AM here 🤔
03:31:22FromDiscord<!Patitotective> here its 22:31 lol
03:34:26FromDiscord<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:36FromDiscord<Yardanico> it is valid, it's just that nim check didn't work for .nims by default
03:34:38FromDiscord<Yardanico> it was fixed in 1.6.6
03:34:39FromDiscord<!Patitotective> ~~(so you live in romania eh yard https://24timezones.com/Bucharest/time)~~
03:34:47FromDiscord<Yardanico> not romania
03:34:50FromDiscord<Yardanico> more to the east
03:34:56FromDiscord<Elegantbeef> The russian part of romania 😄
03:39:32FromDiscord<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:53FromDiscord<huantian> how do I make a new db with db_sqlite
04:49:57FromDiscord<huantian> couldn't find it in the docs
04:59:48FromDiscord<huantian> wait no I'm a dummy
05:25:57FromDiscord<d4rckh> It's 8:25am here 🤔
05:26:02FromDiscord<d4rckh> good morning yardanico
05:36:56FromDiscord<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:29FromDiscord<Zectbumo> "Error: defer statement not supported at top level"↵huh? why not? just execute the block before exiting.
05:45:49FromDiscord<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:04Amun-Ramorning
05:59:08Amun-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:13FromDiscord<sheerluck> personally I like it when time is japanese
07:05:41FromDiscord<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:54FromDiscord<enthus1ast> enum?
07:06:30FromDiscord<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:55FromDiscord<Elegantbeef> Yea just use an enum + set
07:07:15FromDiscord<Elegantbeef> Depending on what you're doing though you may need some bodging
07:07:22FromDiscord<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:59PMunchHmm, is there a way to define stuff in code
08:48:07PMunchAs if it was done with `--define`
08:48:42FromDiscord<Elegantbeef> I dont think so
08:51:56PMunchHmm
08:52:25PMunchBasically I want to import a variant of a library
08:54:15PMunchThis particular library is a i2c library that either uses a built-in i2c chip, or a USI chip, but shares common abstractions
08:55:21FromDiscord<mratsim> In reply to @PMunch "Basically I want to": welcome to my issues with std/bitops
08:57:07FromDiscord<Rika> In reply to @mratsim "welcome to my issues": ?
09:05:06FromDiscord<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:49PMunchI 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:09PMunchProblem with `include` files is that the editor hates them..
09:18:42Arrrrrrrlsp?
09:23:18PMunchYup
09:23:27PMunchI guess it might be fine if it was opened with a project file
09:23:57PMunchIt'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:22FromDiscord<jmgomez> hey guys, is there any json formatter package for nim?
10:14:15FromDiscord<Rika> std/json has a toPretty i believe?
10:20:20FromDiscord<tandy> is there a nim repl thing?
10:20:34FromDiscord<tandy> something where i can conveniently do stuff like `1000 div 2`
10:21:18FromDiscord<Rika> inim?
10:23:15FromDiscord<tandy> ok this is epic
10:23:16FromDiscord<tandy> thanks
10:25:49FromDiscord<jmgomez> In reply to @Rika "std/json has a toPretty": it does! Thanks! FYI toPretty is priv, pretty is the one public
10:26:09FromDiscord<Zoom> Why does not compiler track the usage of exported variables?
10:26:30FromDiscord<Rika> why should it?
10:27:06FromDiscord<Rika> its not sure if its going to be used or not by other packages you're currently not using
10:28:17FromDiscord<Zoom> Why shouldn't it? The current state of the code at hand is known, why not hint unused stuff on compilation?
10:29:35FromDiscord<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:39FromDiscord<Forest> sent a code paste, see https://paste.rs/qnU
10:30:00ArrrrrrrYeah, would be a good idea to have a hint for that case.
10:33:26FromDiscord<Zoom> I can understand it with types, but I'm talking about a global var, unused in the module.↵(@Rika)
10:34:00FromDiscord<Rika> well its the same idea no?
10:34:13FromDiscord<Rika> exporting a var means its public api
10:35:19FromDiscord<Zoom> Eh, only variable declaration possibly entails runtime init, while type/proc doesn't.
10:35:45FromDiscord<Rika> ? so what?
10:36:11FromDiscord<jmgomez> sent a code paste, see https://paste.rs/yPP
10:36:12FromDiscord<Zoom> So it would be nice to see a dead weight.
10:36:37FromDiscord<Rika> idk then its prolly "an oversight" or w/e
10:36:52FromDiscord<Rika> if you want more opinions perhaps a pr/issue
10:37:47FromDiscord<tandy> just do $jsonnode↵(@jmgomez)
10:37:59FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3XqV
10:38:03FromDiscord<Rika> In reply to @tandy "just do $jsonnode (<@726017160115126333>)": thats not equivalent to getting the string value
10:38:18FromDiscord<tandy> o yeah its getStr or something
10:38:28FromDiscord<Zoom> Well, I prefer to ask stupid questions in IRC first.↵(@Rika)
10:38:37FromDiscord<Rika> okay
10:40:01*PMunch quit (Quit: Leaving)
10:40:17*duuuuuude joined #nim
10:43:14FromDiscord<Zoom> I don't really think your answers were really helpful, tbh. Sorry.
10:43:21FromDiscord<Rika> i dont care'
10:44:57FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3XqW
10:44:59FromDiscord<Zoom> Well, this lessens the chance of a question getting an answer from the other folk here.↵(@Rika)
10:45:22FromDiscord<Rika> thats your problem
10:45:43FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3XqX
10:45:48FromDiscord<Rika> are you compiling with flags
10:45:56FromDiscord<Rika> or rather how is this run
10:45:58FromDiscord<Rika> looks like its from ue
10:46:03FromDiscord<Rika> unreal engine i mean
10:46:29FromDiscord<jmgomez> Yes, but not even UE this is being called from their .NET build tool (UBT)
10:47:16FromDiscord<jmgomez> It may be how dot net treats cstrings?
10:47:33*xet7 joined #nim
10:47:34FromDiscord<Rika> i dont see how thats relevant
10:47:58FromDiscord<Rika> theres no cstring in sight so i dont know what you mean
10:48:09FromDiscord<Rika> JsonNodes dont store cstrings either
10:48:24FromDiscord<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:25FromDiscord<jmgomez> whell, Im interoping with a function that uses CStrings. Then I convert those cstrings to strings
10:48:59FromDiscord<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:03FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3XqZ
10:49:04FromDiscord<Rika> i will not reply back
10:49:20FromDiscord<Rika> go stop wasting your time if you really think my answers werent helpful
10:50:15FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3Xr1
10:50:37FromDiscord<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:23FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Xr3
10:51:33ArrrrrrrI 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:51FromDiscord<Rika> because its deemed as such
10:52:02FromDiscord<Rika> its not "stable" according to the devs
10:52:17ArrrrrrrReally? It's been there since as far as I can remember
10:52:19Arrrrrrrmore than 5 years
10:52:22FromDiscord<Rika> what's new wrt. the ordering? its been like this for a long time
10:52:32FromDiscord<Rika> yeah its still not stable
10:52:53FromDiscord<Rika> according to the devs, i'd say it isnt either but its "good enough" if
10:52:54FromDiscord<Rika> (edit) "if" => "ig"
10:52:59ArrrrrrrHow is not stable? You don't even need compile time switches to active them
10:53:38FromDiscord<Rika> In reply to @jmgomez "that it was I": can you `echo` with `repr`? `echo repr thejson` or smth
10:53:44FromDiscord<Rika> thejson in string form
10:54:11FromDiscord<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:18FromDiscord<Rika> thats prolly why
10:54:28FromDiscord<Rika> the new impl is even still an rfc
10:54:47ArrrrrrrSituations like this one are no good.
10:56:14FromDiscord<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:24ArrrrrrrI think that for 2.0 Araq kills half of these unfinished features.
10:56:27Arrrrrrr*Hope
10:56:51FromDiscord<Rika> yeah actually instead of the thing you wrote what about `jsonNode.getStr` that was eluded to above
10:57:17FromDiscord<Rika> In reply to @Arrrrrrr "I think that for": well we'll see
11:01:22FromDiscord<Rika> though i do have to add that concepts are very useful and powerfuk
11:01:25FromDiscord<Rika> (edit) "powerfuk" => "powerful"
11:02:49FromDiscord<jmgomez> In reply to @Rika "yeah actually instead of": yes, that was it!
11:03:05FromDiscord<Rika> my bad, i thought you tried it already
11:03:14FromDiscord<Rika> or rather maybe i got thoughts mixed
11:03:19FromDiscord<Rika> but good to know
11:03:27FromDiscord<jmgomez> Np thank you for your help!
11:04:37FromDiscord<Forest> In reply to @Forest "main.nim: https://play.nim-lang.org/#ix=3XqR interp": bump
11:08:11FromDiscord<Rika> ill look
11:08:54FromDiscord<Rika> `if cc == '"' and startPos != pos-1:` will always match any "string" i believe since cc doesnt change within the while loop
11:09:03FromDiscord<Rika> so:
11:10:34FromDiscord<Rika> i think
11:10:36FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3Xr6
11:10:57FromDiscord<Rika> so dont check cc, check input[pos] instead
11:11:23FromDiscord<Rika> ignore the fucked highlighting, discord is funky there lol
11:11:38FromDiscord<Rika> wdyt?
11:11:53FromDiscord<Forest> trying to understand this rn-
11:13:11FromDiscord<Rika> there
11:14:32FromDiscord<Rika> the fix is really just `if cc == '"'` -> `if input[pos] == '"'` i believe
11:15:11FromDiscord<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:02FromDiscord<Forest> idk why either lol
11:16:31FromDiscord<Rika> i think you can just put `if input[pos] == '"':`
11:16:56FromDiscord<Rika> `""` is still an empty string, and you do `pos += 1` before it anyway
11:16:59FromDiscord<Forest> yeah that was just unnecessary lol
11:17:05FromDiscord<Rika> yeah okay
11:17:10FromDiscord<Rika> what else do you not understand
11:17:32FromDiscord<Rika> oh also super tiny nitpick lol its spelled "lexeme"
11:18:07FromDiscord<Forest> it makes sense to me now aha, thanks for helping lol
11:18:21FromDiscord<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:39FromDiscord<tandy> hmm, is there any way to tell the compiler the working directory to use?
12:14:24FromDiscord<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:35FromDiscord<thadeudepaula> sent a code paste, see https://paste.rs/QH4
12:35:11FromDiscord<thadeudepaula> (edit) "https://play.nim-lang.org/#ix=3Xrj" => "https://play.nim-lang.org/#ix=3Xri"
12:36:08FromDiscord<demotomohiro> How about to use `nil` in Nim code?
12:36:47FromDiscord<demotomohiro> `Fun` in your C code is pointer?
12:36:58FromDiscord<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:12FromDiscord<thadeudepaula> sent a long message, see http://ix.io/3Xrk
12:42:38FromDiscord<thadeudepaula> (edit) "http://ix.io/3Xrk" => "http://ix.io/3Xrl"
12:43:49FromDiscord<thadeudepaula> (edit) "long message," => "code paste," | "http://ix.io/3Xrl" => "https://play.nim-lang.org/#ix=3Xrm"
12:47:42FromDiscord<Rika> In reply to @thadeudepaula "No, fun is just": Function types are nillable so that’s fine
12:47:55FromDiscord<Rika> Nil is a value not a type I believe
12:50:35*lumo_e joined #nim
12:57:32FromDiscord<demotomohiro> !eval echo nil is typedesc
12:57:35NimBotfalse
13:03:22FromDiscord<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:21NimEventerNew 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:24FromDiscord<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:32FromDiscord<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:38FromDiscord<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:49FromDiscord<Rika> Or is discord bugged for me?
13:35:40FromDiscord<Zoom> Well, `{sym}` works, but it's a bit unspecific, innit?
13:37:32FromDiscord<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:37FromDiscord<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:05FromDiscord<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:14FromDiscord<Zoom> sent a code paste, see https://paste.rs/C69
14:15:37FromDiscord<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:44FromDiscord<exelotl> compileTime variables at runtime were a mistake 😅
14:34:44*noeontheend joined #nim
14:36:31FromDiscord<Bubblie> So nim has unsafeAddr and addr but isnt addr by itself unsafe as well?
14:36:51FromDiscord<Bubblie> Because taking an address of an object from a stack is unsafe is it not
14:37:51FromDiscord<Bubblie> Is unsafeAddr just to make it easier to interop with C?
14:38:12FromDiscord<Yardanico> In reply to @Bubblie "So nim has unsafeAddr": yes, and this was changed in devel
14:38:18FromDiscord<Yardanico> so `addr` works for everything now
14:38:23FromDiscord<Bubblie> Oh awesome
14:38:26FromDiscord<Zoom> It shouldn't compile↵(@exelotl)
14:38:32FromDiscord<Bubblie> What if I use pointer math for memes
14:38:37FromDiscord<Bubblie> I think everyone would hate me
14:38:43FromDiscord<Yardanico> no one would care 🤔
14:38:52FromDiscord<Bubblie> Pointer arithmetic 😭
14:39:00FromDiscord<Yardanico> it's not like pointer arithmetic is something complex
14:39:02FromDiscord<Yardanico> just numbers
14:39:50FromDiscord<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:06FromDiscord<Bung> any async std io lib ?
15:04:42NimEventerNew thread by Ctclmsn: C++ copy-constructor issue when using {.constructor.} pragma, see https://forum.nim-lang.org/t/9150
15:05:37FromDiscord<spoon> asyncdispatch or threads?
15:06:05FromDiscord<Bung> async dispatch way
15:07:56FromDiscord<ambient> sent a code paste, see https://play.nim-lang.org/#ix=3XrQ
15:07:57FromDiscord<ambient> This works but I'm sure there's a better way
15:10:03FromDiscord<ambient> Ideally I would just .add() inside the func necessary amounts, without scanning through the entire seq
15:10:18FromDiscord<ambient> but apparently something makes it immutable?
15:11:17FromDiscord<enthus1ast> change (arr\: seq[float]) to (arr\: var seq[float])↵(@ambient)
15:11:20FromDiscord<Rika> ?
15:11:22FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3XrS
15:11:57FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3XrT
15:13:08FromDiscord<ambient> @enthus1ast @Rika yeah that works, ty
15:13:48FromDiscord<Rika> if youre wondering, `result` is another way to return from a function
15:14:33FromDiscord<spoon> In reply to @Bung "async dispatch way": ah, think you're looking for asyncfile
15:14:37FromDiscord<spoon> https://nim-lang.org/docs/asyncfile.html
15:15:13FromDiscord<Rika> cant do stdin/stdout which i think is what he means ("stdio")
15:15:22FromDiscord<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:46FromDiscord<spoon> like terminal i/o?
15:16:09FromDiscord<Bung> but it does not support windows
15:16:49FromDiscord<spoon> what doesn't?
15:17:39FromDiscord<Bung> async file it has no windows specific code
15:17:49FromDiscord<spoon> i'm using the nimsaem vscode plugin and i'm getting no intellisense recommendations here
15:18:17FromDiscord<spoon> hm?
15:19:02FromDiscord<spoon> should be cross-platform
15:25:16FromDiscord<Bung> I use it in nimlsp but face error
15:26:03FromDiscord<Bung> https://github.com/PMunch/nimlsp/issues/121
15:26:14FromDiscord<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:30FromDiscord<deeuu> (edit) "https://github.com/johnnovak/easywave_" => "https://github.com/johnnovak/easywave )"
15:26:54FromDiscord<tandy> this is cool, have you got any plans for a dsp / audio project?↵(@ambient)
15:28:21FromDiscord<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:31FromDiscord<ambient> maybe granular synthesis, who knows
15:29:02FromDiscord<tandy> nice, any reason for not wrapping an existing cpp library like https://github.com/flucoma/flucoma-core ?↵(@ambient)
15:29:24FromDiscord<tandy> im also interested in working on this, send me a message when you get there \:)↵(@ambient)
15:29:34FromDiscord<ambient> seems it's faster to write by hand than try to wrap and dodge all the edge cases and issues
15:29:38FromDiscord<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:12FromDiscord<tandy> that would be awesome↵(@deeuu)
15:30:23FromDiscord<tandy> we need a nim dsp / audio chat
15:30:28FromDiscord<ambient> yeah librosa was my main inspiration
15:30:31FromDiscord<deeuu> Yeah that would be great
15:33:25FromDiscord<ambient> althought with Griffin-Lim from Mel spectrographs, don't you get the same effect as granular synthesis?
15:33:44FromDiscord<ambient> slowing or speeding up without changing frequency
15:40:17FromDiscord<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:32FromDiscord<Bubblie> Pixie is amazing
16:33:40FromDiscord<Bubblie> Wow
16:44:25FromDiscord<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:32FromDiscord<Alea> (edit) "nice↵i" => "nice↵I"
16:45:57*duuuuuude joined #nim
16:46:35FromDiscord<Alea> well stand alone(on top of pixie & boxy)
16:48:26FromDiscord<Bubblie> Pixie works with opengl with boxy
16:48:36FromDiscord<Bubblie> However I may need to write one for it to use vulkan
16:48:43FromDiscord<Yardanico> but pixie itself renders on the CPU
16:48:50FromDiscord<Yardanico> just keep that in mind
16:48:59FromDiscord<Bubblie> Boxy makes pixie use the gpu for rendering doesnt it
16:49:04FromDiscord<Yardanico> no
16:49:16FromDiscord<Yardanico> pixie still renders stuff on the CPU, but then copies to the GPU so you can see it on your screen
16:49:26FromDiscord<Yardanico> pixie is SIMD-accelerated though, yeah
16:49:58FromDiscord<Yardanico> boxy is really only for window management, it doesn't change anything in pixie or other libraries
16:50:07FromDiscord<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:13FromDiscord<Alea> much much faster than just pixie
16:50:19FromDiscord<Yardanico> ah sorry, boxy is a 2d rendering api, hm
16:50:25FromDiscord<Bubblie> Yeah
16:50:26FromDiscord<Yardanico> but yeah "Render any dynamic assets (such as text) into images once using Pixie."
16:50:30FromDiscord<Yardanico> it's still rendered with pixie
16:51:54FromDiscord<Bubblie> Hmmmm
16:52:17FromDiscord<Bubblie> This is a predicament then
16:52:29FromDiscord<Bubblie> For what im doing it would be nice to make pixie use the gpu
16:52:38FromDiscord<Yardanico> well, you really can't :)
16:52:44FromDiscord<Bubblie> https://media.discordapp.net/attachments/371759389889003532/973628666649145364/image0-2.gif
16:53:00FromDiscord<Alea> what exactly are you trying todraw?
16:53:56FromDiscord<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:04FromDiscord<Bubblie> (edit) "Well, not drawing anything ... just" added "atm"
16:54:19FromDiscord<Bubblie> I used because like 5 times in that sentence shit
16:54:59FromDiscord<Alea> most GUI stuff is feasible with pixie + boxy
16:55:24FromDiscord<Alea> text, icons, dynamic panes, etc.
16:55:28FromDiscord<Bubblie> Yeah, boxy is opengl isnt it
16:55:56FromDiscord<Alea> yup
16:56:03FromDiscord<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:08FromDiscord<Alea> create a boxy vulkan fork <:cowboy_eyes:862249101180272650>
16:56:19FromDiscord<Bubblie> Looks like I may have to 👀
16:57:06FromDiscord<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:18FromDiscord<Bubblie> Thats good
16:57:31FromDiscord<Bubblie> Is there a reason why pixie decided to render on cpu
16:57:36FromDiscord<Bubblie> Rather than gpu like nanovg and skia
17:05:08*lumo_e quit (Ping timeout: 248 seconds)
17:11:19FromDiscord<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:44FromDiscord<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:08FromDiscord<spoon> and i think after that everything is handled on gpu by boxy
17:13:50FromDiscord<Bubblie> Thats great
17:14:24FromDiscord<Bubblie> Lovely even
17:14:26FromDiscord<Bubblie> It is time
17:14:27FromDiscord<Bubblie> To fork
17:14:50FromDiscord<Bubblie> And add vulkan
17:17:04FromDiscord<Bubblie> Im surprised nim isnt used often for vulkan
17:17:12FromDiscord<Bubblie> Its absolutely great for vulkan actually
17:43:12FromDiscord<Bubblie> Can nim wrap headers with the .cimport pragma like it can with regular c files
17:44:19FromDiscord<Yardanico> In reply to @Bubblie "Can nim wrap headers": yes, there's a `header` pragma
17:44:28FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma
17:44:36FromDiscord<Bubblie> Lets go
17:48:34FromDiscord<Bubblie> Thank you
18:03:39*kenran joined #nim
18:04:35*kenran quit (Client Quit)
18:16:48*Zectbumo joined #nim
18:19:01FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3XsA
18:19:17FromDiscord<d4rckh> what's the proper way of closing a tcp socket server?
18:19:38FromDiscord<d4rckh> do i have to call `.close` on the clients connected to it before calling `.close` on the server itself?
18:23:59FromDiscord<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:03FromDiscord<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:38FromDiscord<tandy> https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/nn/nn_dsl.nim
18:28:39FromDiscord<tandy> well cifar is a network created with arraymancer's neural network macro↵(@Yardanico)
18:28:58FromDiscord<Yardanico> but as I said, you can just use generics
18:29:24FromDiscord<tandy> hmm
18:29:34FromDiscord<Yardanico> proc test[T](arg: T)
18:29:42FromDiscord<Yardanico> arg can be any type, and proc will be instantiated for each arg type
18:29:53FromDiscord<tandy> ahh
18:30:35*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
18:35:56FromDiscord<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:40FromDiscord<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:54FromDiscord<d4rckh> even tho i called close on the tcp socket server
18:44:15FromDiscord<dom96> set SO_REUSEADDR on the server socket
18:44:39FromDiscord<d4rckh> what does that do?
18:45:21*def- joined #nim
18:46:35FromDiscord<Yardanico> In reply to @dom96 "set SO_REUSEADDR on the": wouldn't that be kind of a hack?
18:50:02FromDiscord<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:15NimEventerNew thread by Cnerd: Weird behaviour from fmt in strformat library, see https://forum.nim-lang.org/t/9151
18:52:42FromDiscord<dom96> This looks like a good reference: https://www.howtouselinux.com/post/tcp_time_wait_linux
18:52:58FromDiscord<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:27FromDiscord<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:57FromDiscord<d4rckh> so i was thinking i was doing something wrong the way i closed the tcp server
19:01:23omanom@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:11FromDiscord<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:06FromDiscord<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:33FromDiscord<treeform> Also once you rasterize your vectors you want to keep them as restores for speed.
19:03:52FromDiscord<tandy> didnt work \:(↵(@Yardanico)
19:03:53FromDiscord<treeform> Is it does not really matter how fast vector to raster is.
19:03:58FromDiscord<Yardanico> In reply to @tandy "didnt work \:( (<@177365113899057152>)": huh?
19:04:05FromDiscord<Yardanico> maybe you didn something wrong?
19:04:07FromDiscord<Yardanico> (edit) "didn" => "did"
19:04:13FromDiscord<Yardanico> this pattern works for normal types just fine
19:05:07FromDiscord<tandy> probably \:)↵(@Yardanico)
19:05:31FromDiscord<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:45FromDiscord<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:09FromDiscord<Yardanico> In reply to @tandy "`Error: type mismatch: got": can you show the proc definition?
19:06:40FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3XsI
19:07:19FromDiscord<Yardanico> and can you paste the whole error? especially where it says which argument was wrong
19:07:59FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3XsJ
19:08:44FromDiscord<Yardanico> it's not erroring because your proc
19:08:59FromDiscord<Yardanico> it's erroring because there's no forward that takes a Cifar[float32] and Variable[Tensor[float32]]
19:09:32FromDiscord<Yardanico> the error clearly says that, it also explicitly shows 2 arguments while your proc has 5
19:09:54FromDiscord<tandy> oh i bet i know why
19:10:58FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3XsL
19:13:24FromDiscord<tandy> i just needed to include the file
19:20:51FromDiscord<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:04FromDiscord<Bubblie> In reply to @treeform "Yes because GPU vector": fair
19:22:35FromDiscord<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:49FromDiscord<Bubblie> and its not like im handling intense graphics here, its just images and strokes
19:23:00FromDiscord<Bubblie> (edit) "and its not like im handling intense graphics here, its just images and strokes ... " added "and shapes"
19:23:22FromDiscord<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:28FromDiscord<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:17FromDiscord<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:54FromDiscord<ambient> for example in Nim is there a difference between iterator style chains and just C style loops
19:30:55FromDiscord<Rika> Iterators by default are inline so they’re pretty much c style
19:31:03FromDiscord<ambient> ok gotcha
19:32:56*Zectbumo quit (Remote host closed the connection)
19:36:22FromDiscord<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:28FromDiscord<Yardanico> i mean for loops
19:36:42FromDiscord<Yardanico> they get transformed into while loops in the frontend itself
19:38:06FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XsP
19:38:31FromDiscord<Rika> Is there a reason for that
19:38:44FromDiscord<Yardanico> maybe it's easier to implement that way, i don't know
19:38:49FromDiscord<Rika> Okay
19:38:58FromDiscord<Yardanico> but i think it's harder for C compilers to figure this out than traditional `for` loops
19:40:19FromDiscord<ambient> any tips on howto tell https://godbolt.org/ to only print the asm for that small func?
19:40:20FromDiscord<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:24FromDiscord<ambient> seems it dumps A LOT
19:40:25FromDiscord<Alea> (edit) "us" => "is"
19:40:35FromDiscord<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:38FromDiscord<Yardanico> to get the minimal output
19:41:10FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/973671056059555840/unknown.png
19:41:15FromDiscord<Yardanico> here the C compiler just precomputes the result
19:41:46FromDiscord<Yardanico> but godbolt support for nim is quite bad
19:42:05FromDiscord<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:14FromDiscord<ambient> what's a good profiler?
19:42:40FromDiscord<ambient> does pretty much any of my favorites work well?
19:43:29FromDiscord<Recruit_main707> they will most likely work
19:43:44FromDiscord<Recruit_main707> well can be an overstatement since names will be a bit obfuscated and whatnot
19:43:53FromDiscord<ambient> I"ve used https://superluminal.eu/ and it's nice for multithreading especially
19:44:14FromDiscord<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:18FromDiscord<Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973675115390836746/image.png
19:57:34FromDiscord<Theodore> while installing nimlanglangserver
19:58:08FromDiscord<Theodore> also there's another issue with nimsuggest not working at all using nimsaem's plugin on vscode.
19:58:34FromDiscord<Theodore> nim and nimsuggest is on path, the path config in config.cfg I think is setup correctly
19:59:03FromDiscord<Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973675552806412348/image.png
20:00:40FromDiscord<Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973675960283045948/image.png
20:00:42FromDiscord<Theodore> nim dump throws out this
20:00:54FromDiscord<Theodore> same result as on windows, which on it works.
20:01:09FromDiscord<Yardanico> not sure why are you doing a lot of extra stuff
20:01:13FromDiscord<Yardanico> nimlanglangserver is in development, it doesn't work yet
20:01:19FromDiscord<Yardanico> In reply to @Theodore "image.png": all of this is not needed at all
20:01:29FromDiscord<Yardanico> it should just work if you have nimsuggest in path
20:01:35FromDiscord<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:46FromDiscord<Theodore> it was suggested in nimsaem's plugin↵(@Yardanico)
20:01:56FromDiscord<Yardanico> In reply to @Theodore "it was suggested in": yes, but it's still early in development
20:02:28FromDiscord<Yardanico> i think even https://github.com/PMunch/nimlsp is more stable
20:03:20FromDiscord<Alea> In reply to @treeform "well use frame buffer": I mean like hypothetically pixie -> framebuffer vs pixie -> boxy -> framebuffer every frame
20:03:21FromDiscord<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:32FromDiscord<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:54FromDiscord<Yardanico> In reply to @Theodore "ya, but the issue": also, i assume you're on some arch-based distro?
20:04:03FromDiscord<Yardanico> like general question, what distro :)
20:04:05FromDiscord<Theodore> correct↵(@Yardanico)
20:04:11FromDiscord<Yardanico> yeah, so nim is outdated on arch
20:04:18FromDiscord<Theodore> from choosenim
20:04:19FromDiscord<Yardanico> it's still 1.4.8 while the latest version is 1.6.6
20:04:29FromDiscord<Yardanico> In reply to @Theodore "from choosenim": but your command shows nim installed system-wide
20:04:58FromDiscord<Yardanico> are you sure `which nimsuggest` uses choosenim nimsuggest and not global nim's nimsuggest?
20:05:05FromDiscord<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:05FromDiscord<Theodore> ya I installed it with the script in the nim folder↵(@Yardanico)
20:05:20FromDiscord<Yardanico> but yeah, not sure how to help, for me nimsuggest with saem's extension just works
20:05:23FromDiscord<Yardanico> on windows and on linux
20:05:29FromDiscord<Alea> In reply to @treeform "well its `pixie ->": Yeah the second bit is what I was wondering
20:05:46FromDiscord<Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973677248265740368/image.png
20:06:07FromDiscord<Yardanico> and what do you mean by "doesn't work"? does it show errors or not autocomplete at all?
20:06:10FromDiscord<Yardanico> can you see the outline in vscode?
20:06:15FromDiscord<Theodore> no autocomplete at all↵(@Yardanico)
20:06:26FromDiscord<Theodore> no errors either
20:06:41FromDiscord<Theodore> nimsuggest log, not much either, while on windows it shows requests
20:06:52FromDiscord<Theodore> I used the same folder on both boots
20:06:52FromDiscord<Yardanico> well, errors are made with `nim check` so it should show up even if nimsuggest is not working
20:07:30FromDiscord<Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973677681872871454/image.png
20:07:40FromDiscord<Theodore> after saving it shows errors yes.↵(@Yardanico)
20:07:42FromDiscord<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:44FromDiscord<Theodore> but that's not autocompletion
20:08:11FromDiscord<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:31FromDiscord<Theodore> I have tried that, but sure.↵(@Yardanico)
20:08:50FromDiscord<Yardanico> also try doing it somewhere inside your /home dir, because i really don't know what could be causing this
20:09:02FromDiscord<Yardanico> but if that doesn't work, the only real way to know why is to debug nimsaem extension
20:09:10FromDiscord<Yardanico> build a debug build and debug vscode with it
20:09:11FromDiscord<Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973678105547911198/image.png
20:09:32FromDiscord<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:48FromDiscord<Theodore> I guess I don't have any other option than that then.↵(@Yardanico)
20:10:16FromDiscord<Yardanico> hmm, can you check your nimsaem settings in vscode as well?
20:10:24FromDiscord<Yardanico> like nim: provider
20:10:41FromDiscord<Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973678485967085568/image.png
20:11:06FromDiscord<Yardanico> :(
20:11:14FromDiscord<Theodore> I have been messing around with these for couple of days now, else I wouldn't come here begging for help
20:12:44FromDiscord<Yardanico> can you maybe verify that nimsuggest itself works?
20:12:58FromDiscord<Theodore> hmm, you mean over stdin
20:13:03FromDiscord<Yardanico> yes
20:13:12FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XsX
20:13:14FromDiscord<Theodore> I think I tried that in past, and it did show up something.
20:13:22FromDiscord<Theodore> i'll try again I guess
20:13:28FromDiscord<Yardanico> `nimsuggest file.nim`
20:13:30FromDiscord<Yardanico> `def 3:5`
20:14:23FromDiscord<Theodore> image.png https://media.discordapp.net/attachments/371759389889003532/973679416657993828/image.png
20:14:32FromDiscord<Yardanico> yeah so it works
20:14:57FromDiscord<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:15FromDiscord<Theodore> also I have tried all the packages from official repo and aur for vscode
20:15:32FromDiscord<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:28FromDiscord<!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:04FromDiscord<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:14FromDiscord<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:46FromDiscord<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:14FromDiscord<Bubblie> I currently need glfw for a lot of the things im doing with vulkan
21:41:45FromDiscord<Elegantbeef> "Is it alright to fork it"
21:41:53FromDiscord<Elegantbeef> Lol it's FOSS, if he didnt want forks he'd have had a proprietary license 😄
21:45:18FromDiscord<Yardanico> @beef i want to ask you expert opinion
21:45:20FromDiscord<Yardanico> your
21:45:31FromDiscord<Yardanico> from another nim chat, this minimized snippet
21:45:35FromDiscord<Elegantbeef> I'm an expurt!
21:45:38FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xtj
21:45:49FromDiscord<Yardanico> is it correct that Nim here applies NRVO so fullInfo call actually modifies prevInfo ?
21:46:01FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xtk
21:46:10FromDiscord<Yardanico> so we modified `result` but it modified `prevInfo` as well because of NRVO
21:47:47FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Xtl
21:48:00FromDiscord<Elegantbeef> I mean it makes sense whether it's right is another thing
21:48:20FromDiscord<Elegantbeef> The only reason it's noticeable is that you're calling with the prevInfo
21:49:04FromDiscord<Yardanico> yes it makes sense, I know, but I wonder if it's correct or not
21:49:09FromDiscord<Yardanico> because the behaviour can be quite surprising
21:49:55FromDiscord<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:11FromDiscord<Elegantbeef> It's surprising
21:50:57*PMunch quit (Quit: leaving)
21:52:49FromDiscord<Elegantbeef> It's a complex reasoning here
21:53:02FromDiscord<Andreas> hi, is it possible to set the state of a closure-iterator ? i always get one elem too much ?
21:53:32FromDiscord<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:47FromDiscord<Elegantbeef> I'd say yard it's "correct" just due to the required complexity to resolve
21:53:55FromDiscord<Elegantbeef> `var prevInf = (let a = fullInfo(); a)` is the fix i'd say
21:54:00FromDiscord<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:14FromDiscord<Elegantbeef> Andreas iterators need 1 extra call to know if they're finished
21:54:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Xtp
21:55:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Xtq
22:11:22FromDiscord<theangryepicbanana> is there a way to make `new(T)` return `ref T not nil`?
22:13:13FromDiscord<Yardanico> also @ElegantBeef
22:13:22FromDiscord<Yardanico> i think it was introduced for this specific snippet in 1.6.2 only
22:13:28FromDiscord<Yardanico> it doesn't do NRVO on 1.6.0
22:13:31FromDiscord<Yardanico> i suspect it's because of https://github.com/nim-lang/Nim/issues/14470
22:17:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Xtx
22:18:05FromDiscord<Elegantbeef> Yea i know yard, i dont know what's proper here #internal is better than beef's view
22:18:18FromDiscord<theangryepicbanana> sent a code paste, see https://play.nim-lang.org/#ix=3Xty
22:18:49FromDiscord<Elegantbeef> time to make it with concept
22:18:54NimEventerNew 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:49FromDiscord<Elegantbeef> Hmm actually we need something more specific
22:24:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Xtz
22:24:43FromDiscord<Elegantbeef> Not as nice as `new` but it works, guess we can drop `object` and just have `typedesc[ref]`
22:25:12FromDiscord<Elegantbeef> The nice part is that not nil is a structured type so all `T not nil` are equivlent
22:29:18FromDiscord<exelotl> ooh is NVRO like, somewhat dependable now?
22:29:27FromDiscord<Elegantbeef> Yea
22:29:40FromDiscord<Elegantbeef> Though as demonstrated above it can cause wacky issues that are complex to resolve
22:30:08FromDiscord<Elegantbeef> Well complex to resolve with the compiler
22:30:17FromDiscord<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:21FromDiscord<theangryepicbanana> is there a way to add a label to a for or while loop without an extra block?
23:01:35FromDiscord<theangryepicbanana> like `for x in y as label:`
23:02:46*jmdaemon joined #nim
23:03:23FromDiscord<Elegantbeef> Nope
23:03:30FromDiscord<Elegantbeef> You can use a template
23:03:39FromDiscord<Elegantbeef> `while(cond, nameOfblock)`
23:03:48FromDiscord<theangryepicbanana> oof
23:05:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XtH
23:06:08FromDiscord<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)