<< 17-11-2020 >>

00:05:06FromGitter<ynfle> It seems like there is an issue with reassigning an array that is `var` with values from it self
00:05:29FromDiscord<nikki> any way to make a proc instantiate "later" (bc. some macro it uses uses a compileTime var that isn't filled yet)? making it a template is one route. was also considering making it generic but it happens to apply to only one set of types
00:05:50FromDiscord<nikki> the latter is nice cuz the instantiation then gets memoized and reused and it actually generates a single function in the output
00:06:15FromGitter<ynfle> You mean `mixin` & `bind`?
00:06:58FromGitter<ynfle> I think you are looking for one of those
00:07:08FromDiscord<nikki> _looks this up_
00:08:26FromGitter<ynfle> https://nim-lang.org/docs/manual.html#generics-mixin-statement
00:08:36FromGitter<ynfle> https://nim-lang.org/docs/manual.html#symbol-lookup-in-generics-open-and-closed-symbols
00:10:29Zoom[m]Hey, are open slices a thing in Nim? Why not?
00:10:38*krux02 quit (Quit: Leaving)
00:11:47*gangstacat quit (Ping timeout: 260 seconds)
00:13:09*ehmry quit (Quit: No Ping reply in 180 seconds.)
00:13:38FromGitter<sealmove> opinion? https://github.com/sealmove/n4n6
00:13:43FromGitter<ynfle> Use BackwardIndex
00:13:52FromGitter<ynfle> `x[1..^1]`
00:14:17FromGitter<ynfle> The reason is, I think, because no postfix operators
00:15:33*ehmry joined #nim
00:17:50Zoom[m]@ynfle , thanks
00:17:59FromGitter<ynfle> πŸ‘
00:18:41*gangstacat joined #nim
00:33:17jonjitsu[m]how would I make multiple async http requests at the same time, I tried `await all(client.get("http://httpbin.org/ip"), client.get("http://httpbin.org/ip"))` to no avail.
00:50:56FromDiscord<Clownstick Von FuckFace> how can you statically link openssl to a nim binary on windows?
00:51:10*abm quit (Quit: Leaving)
00:51:48FromDiscord<Clownstick Von FuckFace> i.e., i keep getting the dlls are not found error when i run it on a box that doesn't have nim installed/ is there a simpleler http client libary that doesn't have this limitation?
00:56:47FromDiscord<nikki> is there some standard utility to assign locals to template parameters -- so that expressions as parameters are not repeated multiple times in generated code πŸ€”
00:57:35FromDiscord<juan_carlos> using
00:59:23FromDiscord<nikki> i mean like if you have `template min(a, b) = if a < b: a else: b` where if you do `min(foo(), bar())` the code potentially executes `foo()` and `bar()` twice
00:59:48FromDiscord<nikki> so you wanna do `let a2 = a; let b2 = b;` and then use `a2`, `b2` instead
01:01:41FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Eqk
01:01:56FromDiscord<Clownstick Von FuckFace> namely, with the -d:ssl flag.
01:02:29FromGitter<ynfle> Many compiled binaries work without nim
01:04:17FromDiscord<nikki> also does a `NimNode` have a way to get a 'stack trace' kinda of its definition? i want to do an error message where i say "you can't X because X was already done by <other NimNode i saved earlier>"
01:04:30FromDiscord<nikki> and i want to show a nice trace for the other NimNode's instantiation
01:04:32FromDiscord<Clownstick Von FuckFace> right but anytime i compile with -d:ssl i get libcrypto-1_1-x64.dll was not found
01:04:39FromDiscord<Clownstick Von FuckFace> that dll is setup when choosenim is run
01:04:48FromGitter<ynfle> Static linking was just asked
01:04:58FromGitter<ynfle> I'm not sure about it too much but it can be done
01:05:10FromGitter<ynfle> @nikki, just add the let to you template
01:05:21FromDiscord<nikki> ynfle: yeah i'm going with that for now
01:05:28FromGitter<ynfle> πŸ‘
01:05:38FromGitter<ynfle> You won't see it anyways so it doesn't make a difference
01:07:10FromDiscord<nikki> ooh lineInfo (answer to second q)
01:11:03*Tanger joined #nim
01:13:21*Tanger quit (Remote host closed the connection)
01:14:57*Tanger joined #nim
01:25:34FromDiscord<Clownstick Von FuckFace> @ynfle not sure i understand your response. -d:ssl dynamically links open ssl, and asusmes 3 dlls are installed on windwos that are non-standard. is there a way to statically link them?
01:33:06FromDiscord<Rika> its kinda complicated, a few things need to be done to do such
01:33:28FromDiscord<Rika> especially that youre on windows, i have no idea how to compile statically on windows
02:09:16FromDiscord<nikki> is there a way to get the "instantiation stack" for the current macro? i want to save this, and in some other macro echo that saved stuff in case of an error
02:10:14FromDiscord<nikki> i'll try `getStackTrace` in the macro code
02:12:35*NimBot joined #nim
02:13:14*apahl quit (Ping timeout: 264 seconds)
02:14:31FromDiscord<emizzle> sent a code paste, see https://play.nim-lang.org/#ix=2Eqz
02:14:57*apahl joined #nim
02:15:27FromDiscord<Rika> remove the r before the ""
02:16:53FromDiscord<emizzle> Ah, of course, thanks!
02:19:18FromDiscord<Clownstick Von FuckFace> not being able to compile standalone apps with ssl seems like a huge blocking factor to nim becoming popular
02:19:51FromDiscord<Rika> well you deffo can
02:19:55FromDiscord<Rika> i just dont know how on windows
02:44:36FromDiscord<nikki> @Clownstick Von FuckFace have you tried shipping the dll with the application? a lot of windows games and apps do that
02:44:52FromDiscord<nikki> but yeah personally i use a CMake setup that just statically incorporates all of my dependencies
02:45:12FromDiscord<nikki> https://github.com/nikki93/ng-public <-- CMakeLists.txt + run.sh here should show how it works
02:46:25FromDiscord<nikki> https://wiki.openssl.org/index.php/Binaries you can also find some '.lib' here and link against it directly, by passing linker flags to nim through pragmas or command line
03:08:14FromDiscord<Zachary Carter> @Clownstick Von FuckFace have you ever compiled an app in any language with SSL support? This is just FUD really - it's no different with Nim than it is with any other language.
03:15:34FromDiscord<Clownstick Von FuckFace> soryr, I am having a lot of trouble w/ this, thanks a buch for the help!
03:16:05FromDiscord<Clownstick Von FuckFace> i think linking directly against those binaries is the move
03:16:10FromDiscord<Clownstick Von FuckFace> do you have an example for how to do that?
03:16:24FromDiscord<Clownstick Von FuckFace> and I cannot ship all the dlls w/ the app, has ot be standalone πŸ™‚
03:17:44FromDiscord<Clownstick Von FuckFace> like how would i evne compile https://github.com/nim-lang/Nim/blob/devel/tests/untestable/tssl.nim for windows?
03:18:17FromDiscord<Clownstick Von FuckFace> does `nim c -d:ssl -p:. --dynlibOverride:ssl --passL:-lcrypto --passL:-lssl -r tests/untestable/tssl.nim` statically link librries exported by openssl to the binary?
03:22:24FromDiscord<nikki> the link from the openssl wiki above contains links to find openssl '.lib' binaries i believe
03:22:27FromDiscord<nikki> you can statically link with those
03:22:40FromDiscord<nikki> i'm not at a windows computer right now so i can't try it out
03:22:55FromDiscord<Clownstick Von FuckFace> with `--passL:blah.a`?
03:23:12FromDiscord<Xydium> That feeling when you downgraded from 1.4 so asynchttpserver would work, but now you need to upgrade to 1.4 so that threadpool with --gc:arc works
03:23:39FromDiscord<nikki> windows libraries usually end in '.lib' as just mentioned
03:23:48FromDiscord<nikki> so probably `--passL:blah.lib`
03:23:56FromDiscord<nikki> but, could be that they end in '.a' in this case due to mingw
03:24:07FromDiscord<Clownstick Von FuckFace> kk just wana makse sure i got the syntax right. Thanks!
03:24:10FromDiscord<Clownstick Von FuckFace> illgive it a try
03:24:11FromDiscord<nikki> er `--passL:-lblah.lib`
03:24:16FromDiscord<nikki> are you using mingw as nim's compiler?
03:24:17FromDiscord<nikki> or msvc
03:24:21FromDiscord<nikki> (aka vcc)
03:24:22FromDiscord<Clownstick Von FuckFace> mingw
03:24:31FromDiscord<nikki> cool, yeah `-l` should work
03:24:32FromDiscord<Clownstick Von FuckFace> ideally trying to cross compile on my ubuntu box
03:24:39*cgfuh quit (Quit: WeeChat 2.9)
03:25:29FromDiscord<nikki> the main thing is to make sure the version of the function prototypes expected by the code and that of the static libs align; but also ssl's api is pretty stable and maybe it'll work even if not
03:42:27*muffindrake quit (Ping timeout: 272 seconds)
03:44:33*muffindrake joined #nim
03:53:36*a_chou joined #nim
03:53:57*rockcavera quit (Remote host closed the connection)
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:37*supakeen joined #nim
04:09:12*vicfred quit (Quit: Leaving)
04:10:18*a_chou quit (Quit: a_chou)
04:11:03*hpyc9 quit (Quit: 420)
04:11:24*hpyc9 joined #nim
04:13:32FromDiscord<Clownstick Von FuckFace> hmm still having trouble
04:13:34FromDiscord<Clownstick Von FuckFace> `nim c -d:mingw -d:os=windows -f -d:ssl -p:. -d:noOpenSSLHacks --dynlibOverride:ssl- --dynlibOverride:crypto- --passL:-Lpath/home/kbsec/openssl/libssl.dll.a --passL:-Lpath/home/kbsec/openssl/libcrypto.dll.a`
04:14:07*fowl quit (Ping timeout: 272 seconds)
04:14:13FromDiscord<Clownstick Von FuckFace> `--passL:-lcrypto --passL:-lssl ` flags crash the program
04:14:23FromDiscord<Clownstick Von FuckFace> (edit) "--passL:-Lpath/home/kbsec/openssl/libssl.dll.a" => "--passL:-Lpath/home/me/openssl/libssl.dll.a"
04:15:14FromDiscord<nikki> make sure to use the static version
04:15:26FromDiscord<nikki> .dll.a may be the static part of a dynamic combo or sth
04:15:49FromDiscord<Clownstick Von FuckFace> so whats weird is that command on its own if i leave out `--passL:-lcrypto --passL:-lssl ` doesn't crash at compilation
04:15:52FromDiscord<Clownstick Von FuckFace> it just doesn't do aything
04:16:11FromDiscord<Clownstick Von FuckFace> So i actually compilled openssl from src for mingw
04:16:58*fowl joined #nim
04:17:24FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2EqS
04:17:36FromDiscord<Clownstick Von FuckFace> tried both
04:18:14*hpyc9 quit (Quit: 420)
04:18:47FromDiscord<Clownstick Von FuckFace> (edit) `nim c -d:mingw -d:os=windows -f -d:ssl -p:. -d:noOpenSSLHacks --dynlibOverride:ssl- --dynlibOverride:crypto- --passL:-Lpath/home/me/openssl/libssl.dll.a --passL:-Lpath/home/me/openssl/libcrypto.dll.a`
04:19:11FromDiscord<Clownstick Von FuckFace> the file size is the same
04:19:39*hpyc9 joined #nim
04:20:06FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2EqT
04:21:43*sirn quit (Ping timeout: 272 seconds)
04:25:43*sirn joined #nim
04:27:44FromDiscord<shashlick> @Clownstick Von FuckFace please see choosenim nims file
04:29:25FromDiscord<Clownstick Von FuckFace> https://github.com/dom96/choosenim/blob/master/src/choosenim.nim ? this just drops the dlls on disk
04:29:39FromDiscord<Clownstick Von FuckFace> I want to ship a single binary
04:37:42FromDiscord<nikki> @Clownstick Von FuckFace the `-L` needs the linker path, not path to the file itself
04:38:18FromDiscord<nikki> also one time you said crash the program, the other time you said crash compilation -- which one is it?
04:38:26FromDiscord<Clownstick Von FuckFace> ahh sorry
04:38:44FromDiscord<Clownstick Von FuckFace> theres a distinction: sompilation won't work if I pass `-lscrypto` and `-lssl`
04:38:46FromDiscord<nikki> you need to do `--passL:-L<path to where libs are>`
04:38:56FromDiscord<Clownstick Von FuckFace> but if i don't, then it doens't get linked
04:39:03FromDiscord<nikki> and then `--passL:-l<name of lib without path>`
04:39:27FromDiscord<Clownstick Von FuckFace> im sorry im struggling with this so much. All I want to do is statically build this https://github.com/nim-lang/Nim/blob/devel/tests/untestable/tssl.nim for windows 😒
04:39:36FromDiscord<nikki> let's focus on fixing it πŸ™‚
04:39:42FromDiscord<Clownstick Von FuckFace> ❀️
04:39:47FromDiscord<nikki> you probably need to do `-L` once with the path where both libs are, and then `-l` twice with the names of the libs
04:39:52FromDiscord<Rika> statically building anything on windows sounds like a pain
04:40:02FromDiscord<nikki> it's pretty easy for me with cmake haha
04:40:38FromDiscord<nikki> actually. scratch that. it's not easy lmao. but once you have it working it basically seems to keep working
04:40:47FromDiscord<Rika> thats true
04:41:00FromDiscord<Rika> just copy paste and change some stuff for other libs
04:41:08FromDiscord<Clownstick Von FuckFace> so that command works fine for linux with libssl-dev installed
04:41:22FromDiscord<nikki> i like hand-rolled vendored setup for this reason, it just keeps working. even if it's janky and not the idiomatic way. like i cloned a repo for some C proj i did 6 years ago and it still just builds and runs bc. everything is vendored
04:41:28FromDiscord<Clownstick Von FuckFace> i installed and made openssl for windows and ran make install as reccomended by here https://gist.github.com/udnaan/80c5ad125fc4702309b9
04:42:10FromDiscord<nikki> this is all pretty general. do you have some '.a' files, and a path they're at?
04:42:18FromDiscord<nikki> if so you can do -L<path> and -l<per lib>
04:42:34FromDiscord<nikki> make sure to use the same compiler as the one nim uses
04:42:40FromDiscord<nikki> msvc and mingw are allegedly compatible but yeah
04:43:11FromDiscord<Clownstick Von FuckFace> you can just hardcode the compiler with --gcc.exe: right?
04:43:15*waleee-cl quit (Ping timeout: 272 seconds)
04:43:33*waleee-cl joined #nim
04:43:51FromDiscord<nikki> i've never really tried that but -- maybe?
04:44:02FromDiscord<nikki> the way i 'hard code' it personally is by having nim only generate C output and then compiling that myself xD
04:44:34FromDiscord<nikki> are you able to eg. just build a hello world windows executable and run it on windows / wine?
04:44:56FromDiscord<Clownstick Von FuckFace> oh yeah that all works
04:45:04FromDiscord<Clownstick Von FuckFace> my application works flawleslly without -d:ssl enabled
04:45:14FromDiscord<nikki> so you're already using a windows-compatible compiler with nim right
04:45:19FromDiscord<Clownstick Von FuckFace> yup!
04:45:21FromDiscord<nikki> then it makes sense to use that to build ssl
04:45:39FromDiscord<nikki> once you've done that, do the equiv of -L and -l with the resulting libs
04:45:44FromDiscord<nikki> making sure to build them with static flags and not shared
04:45:48FromDiscord<nikki> .dll.a is suspicious
04:46:03FromDiscord<nikki> the makefile might have some flags to enable static build
04:48:05FromDiscord<Clownstick Von FuckFace> `nim c --cpu:amd64 --os:windows -d:mingw -d:ssl --dynlibOverride:ssl --passL:-Lpath/home/kbsec/openssl/libcrypto.a --passL:-Lpath/home/kbsec/openssl/libssl.a --passl:-lcrypto --passl:-lssl`
04:48:07FromDiscord<Clownstick Von FuckFace> like so?
04:48:36FromDiscord<nikki> so in the wall of text above
04:48:43FromDiscord<nikki> the thing i was trying to clarify is that -L takes the directory
04:48:46FromDiscord<nikki> not the file
04:48:56FromDiscord<Clownstick Von FuckFace> ohhhhhhh
04:49:08FromDiscord<Clownstick Von FuckFace> so if both of my libs are in 1 folder i only need 1 passL
04:49:36FromDiscord<nikki> https://discord.com/channels/371759389889003530/371759389889003532/778117153521401866
04:49:58FromDiscord<Clownstick Von FuckFace> ...sorry my brains kinda fried right now πŸ˜…
04:50:01FromDiscord<Clownstick Von FuckFace> that you did
04:50:28FromDiscord<nikki> -L<path where libs are> -l<lib1Name> -l<lib2Name>
04:51:23FromDiscord<nikki> i wonder how `-d:ssl` and `--dynlibOverride:ssl` interact with all this. never used those / not familiar with them
04:52:13FromDiscord<Clownstick Von FuckFace> (edit) `nim c --cpu:amd64 --os:windows -d:mingw -d:ssl --dynlibOverride:ssl --passL:-Lpath/home/me/openssl/libcrypto.a --passL:-Lpath/home/me/openssl/libssl.a --passl:-lcrypto --passl:-lssl`
04:54:45FromDiscord<Clownstick Von FuckFace> hmm
04:54:59FromDiscord<Clownstick Von FuckFace> `could not load: (libssl-1_1-x64|ssleay64|libssl64).dll` is the error on windows when it does compile btw
04:55:40FromDiscord<Clownstick Von FuckFace> `nim c --cpu:amd64 -d:mingw -d:ssl --dynlibOverride:ssl --passL:-Lpath/home/me/openssl/-lcrypto-lssl a.nim` doesn't seem to be statically linking the libraires. the executable file size is stil the same
04:56:42FromDiscord<nikki> in what you pasted there are no spaces in the passL sstuff
04:57:13FromDiscord<nikki> it's hard to debug this because idk what's a formatting error when pasting your message, or what's an error when you're paraphrasing, or ...
04:57:28FromDiscord<nikki> there are 3 options to pass
04:57:28FromDiscord<shashlick> @Clownstick Von FuckFace wrong file - https://github.com/dom96/choosenim/blob/master/src/choosenim.nims
04:57:55FromDiscord<nikki> `--passL:-L/path/to/where/libs/are --passL:-lcrypto --passL:-lssl`
04:58:33FromDiscord<shashlick> also, see https://github.com/dom96/choosenim/blob/master/src/choosenimpkg/ssl.nim - that's how choosenim downloads ssl binaries using nimterop
04:58:44FromDiscord<shashlick> during the build process
04:58:51FromDiscord<shashlick> choosenim is distributed as a standalone binary
05:01:54FromDiscord<nikki> how much is `--exceptions:goto` supported btw? seems to have codegen errors with 'std/json'
05:02:11FromDiscord<ElegantBeef> Isnt that used for arc?
05:02:33FromDiscord<Clownstick Von FuckFace> so it does compile but i still get `could not load: (libssl-1_1-x64|ssleay64|libssl64).dll`
05:02:46FromDiscord<Clownstick Von FuckFace> `nim c --cpu:amd64 -d:mingw -d:ssl --dynlibOverride:ssl --passL:-L/home/me/openssl/ --passL:-lcrypto --passL:-lssl a.nim`
05:02:48FromDiscord<nikki> hmmmmm i'm compiling as c++; it's possible the goto issue is marked as an error in c++ only. the default is to use c++ exceptions for exceptions there
05:03:14FromDiscord<nikki> yeah the important thing @Clownstick Von FuckFace is to check if the libs you're linking against are eg. just stubs that load the dyn libs
05:03:28FromDiscord<ElegantBeef> Where is are pure nim ssl stuff πŸ˜„
05:03:33FromDiscord<ElegantBeef> (edit) "are" => "our"
05:03:38FromDiscord<nikki> idk how to make sure of that, maybe you could compile a simple test of using openssl from c and build that against that lib
05:04:18FromDiscord<nikki> maybe you could gdb (can you gdb a windows executable) and see the callstack for where it complains -- is that nim trying to load it or the ssl .a tryna do that
05:04:33FromDiscord<Clownstick Von FuckFace> so thats the good news
05:04:50FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Er1
05:04:56FromDiscord<Clownstick Von FuckFace> which means it is finding the names correctly
05:05:00FromDiscord<shashlick> see the nims file dude, there's a known bug in nim that's worked around
05:05:11FromDiscord<Clownstick Von FuckFace> checking
05:05:17FromDiscord<shashlick> #15220
05:05:19disbothttps://github.com/nim-lang/Nim/issues/15220 -- 3OpenSSL static linking on Windows ; snippet at 12https://play.nim-lang.org/#ix=2Er2
05:05:33FromDiscord<Rika> i think exceptions goto doesnt give any useful benefits on c++
05:05:50*vicfred joined #nim
05:06:04FromDiscord<nikki> @Rika hmm word. i was mostly enabling it bc. in the emscripten build i disable exceptions for c++ / it does that
05:06:09FromDiscord<nikki> but in any case i don't care that much. down for a crash lol
05:08:48FromDiscord<Clownstick Von FuckFace> @shashlick looking at the files, i confident im being blind but i don't see what hack is
05:08:53*bung_ joined #nim
05:10:12FromDiscord<Clownstick Von FuckFace> do i just include https://github.com/dom96/choosenim/blob/master/src/choosenimpkg/ssl.nim since it installs and wrapps openssl?
05:10:46FromDiscord<shashlick> note how dynliboverride calls have a `-` at the end
05:10:55FromDiscord<shashlick> and the sslVersion define
05:11:05FromDiscord<shashlick> see the issue linked above for the reason its broken on windows
05:11:29FromDiscord<shashlick> ssl.nim is to download the static libs and link them in - not essential but just easy
05:11:41FromDiscord<shashlick> but note that nimterop doesn't work in cross-compile scenario
05:11:45FromDiscord<shashlick> so -d:mingw will break it
05:15:45*thomasross quit (Ping timeout: 240 seconds)
05:16:08FromDiscord<Clownstick Von FuckFace> progress: `nim c --cpu:amd64 -d:mingw -f -d:ssl -p:. -d:noOpenSSLHacks --dynlibOverride:ssl- --dynlibOverride:crypto- -d:sslVersion:"(" --passL:-L/home/me/openssl --passL:-Bstatic --passL:-lssl --passL:-lcrypto --passL:-Bdynamic a.nim`
05:16:11FromDiscord<Clownstick Von FuckFace> https://media.discordapp.net/attachments/371759389889003532/778126310962626588/unknown.png
05:16:48FromDiscord<Clownstick Von FuckFace> thanks for the tip @shashlick πŸ™‚
05:17:07FromDiscord<Clownstick Von FuckFace> were you directing me to the choosenim because of the extra falgs?
05:17:19FromDiscord<shashlick> yes in the nims file
05:17:57FromDiscord<Clownstick Von FuckFace> so this is really close!
05:18:06FromDiscord<Clownstick Von FuckFace> the only thing missing i think is its not actually adding `libssl-3-x64.dll` for some reason
05:18:41FromDiscord<Clownstick Von FuckFace> also, is nimterop just not cross compile friendly, or are you saying compiling openssl statically linked isn't an options atm
05:19:38FromDiscord<shashlick> just not cross compile capable
05:21:30FromDiscord<shashlick> do you have libssl.a and libcrypto.a for windows on your system
05:21:40FromDiscord<Clownstick Von FuckFace> yup!
05:21:55FromDiscord<Clownstick Von FuckFace> and it works if i drop the dlls for the associated libraries
05:22:13FromDiscord<shashlick> that simply means that it didn't statically link
05:22:18FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Er4
05:22:49FromDiscord<Clownstick Von FuckFace> yup! gathered that much πŸ˜„ the dlls weren't included for in the binary
05:23:05FromDiscord<shashlick> why do you have -Bstatic for passL
05:24:11FromDiscord<Clownstick Von FuckFace> blindly referencing https://github.com/nim-lang/Nim/issues/15220
05:24:12disbotβž₯ OpenSSL static linking on Windows ; snippet at 12https://play.nim-lang.org/#ix=2Er2
05:25:33FromDiscord<shashlick> hmm\
05:27:12FromDiscord<Clownstick Von FuckFace> https://play.nim-lang.org/#ix=2Er2 appears to have the same issue
05:28:26FromDiscord<Clownstick Von FuckFace> the refs are overwritten, but it still expects dlls on the box
05:28:58FromDiscord<shashlick> no need to copy it over
05:29:14FromDiscord<shashlick> well, maybe you do
05:29:50FromDiscord<shashlick> do you have a mingw version of ldd
05:29:56FromDiscord<shashlick> well, even that won't heo
05:29:59FromDiscord<shashlick> (edit) "heo" => "help"
05:30:17FromDiscord<shashlick> what version of nim you using
05:30:47FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Er5
05:33:13FromDiscord<Rika> man im glad i dont need static bins for my projects
05:33:52FromDiscord<nikki> i love static bins
05:34:19FromDiscord<PizzaFox> whats `--asm` do
05:37:33FromDiscord<Clownstick Von FuckFace> to confirm does not work on windows either
05:37:35FromDiscord<Clownstick Von FuckFace> https://media.discordapp.net/attachments/371759389889003532/778131697530437642/unknown.png
05:37:39FromDiscord<shashlick> @Clownstick Von FuckFace `nim c -d:mingw -d:ssl -d:noOpenSSLHacks --dynlibOverride:ssl- -d:sslVersion:"(" a.nim` worked for me
05:38:17FromDiscord<shashlick> it complains at link time that it couldn't find the openssl symbol i have in a.nim
05:38:46FromDiscord<nikki> what's a quick way to iterate from 0 to n moving up by 2 each time
05:38:54FromDiscord<nikki> is it just a while loop?
05:40:06bung_in testament how to do errmsg sub ?
05:40:21FromDiscord<nikki> actually i have a better way
05:41:45FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Er6
05:41:57FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=
05:42:31FromDiscord<shashlick> ya cause it doesn't try to link the ssl static libs
05:42:41FromDiscord<shashlick> now if you passL, it should pick it up
05:42:48FromDiscord<nikki> nice
05:42:50FromDiscord<nikki> this is what you want to see
05:42:56FromDiscord<nikki> it's asking you for static libs
05:43:10FromDiscord<shashlick> and your windows command also is not covering the `-` suffix for dynlibOverride and the other things mentioned in the issue
05:44:20FromDiscord<Clownstick Von FuckFace> in case it wasn't painfully obvious, I am a python programer and all of this is alien to me πŸ˜…
05:44:23FromDiscord<shashlick> just create a config.nims with that choosenim.nims contents - why fight with the command line
05:46:51FromDiscord<Clownstick Von FuckFace> @nikki `--passL:-L/home/kbsec/openssl --passL:-lssl --passL:-lcrypto ` is supposed pass the static libs right?
05:47:05FromDiscord<Clownstick Von FuckFace> it does this but it doesn't bake the dlls refrenced in openssl/ into it
05:47:07FromDiscord<Clownstick Von FuckFace> namely
05:47:28FromDiscord<Clownstick Von FuckFace> libssl-3-x64.dll libcrypto-3-x64.dll
05:47:41FromDiscord<Clownstick Von FuckFace> can i force nim to pack them into the resulting exe?
05:48:46FromDiscord<shashlick> instead of that, simply pass the full paths to the .a files to passL
05:49:06FromDiscord<nikki> you shouldn't be thinking about the dlls anymore at all
05:49:13FromDiscord<shashlick> `--passL:"/path/to/libssl.a /path/to/libcrypto.a"`
05:51:39*Adeon quit (Ping timeout: 272 seconds)
05:53:40FromDiscord<Clownstick Von FuckFace> different error this time
05:53:41FromDiscord<Clownstick Von FuckFace> `/usr/bin/x86_64-w64-mingw32-ld: /home/kbsec/openssl/libcrypto.a(libcrypto-lib-b_addr.obj):b_addr.c:(.text+0xab): undefined reference to `imp_getnameinfo'↡`
05:54:53FromDiscord<Clownstick Von FuckFace> out of curiousity
05:55:00FromDiscord<Clownstick Von FuckFace> can https://github.com/genotrance/nimssl/blob/master/nimssl/ssl.nim just be used as a drop in replacement?
05:55:51*Adeon joined #nim
05:59:00FromDiscord<Rika> i believe there is no difference
06:00:39FromDiscord<shashlick> That must be a windows symbol
06:03:35FromDiscord<Clownstick Von FuckFace> ` nim c -d:mingw -d:ssl -d:noOpenSSLHacks --dynlibOverride:ssl- -d:sslVersion:"(" --passL:-L/home/kbsec/openssl/ --passL:"/home/me/openssl/libssl.a/home/me/openssl/libcrypto.a" a.nim `
06:04:04FromDiscord<Clownstick Von FuckFace> do i need the `--passl:-lcrypto --passl:-lssl` and `--dynlibOverride:crypto-`?
06:04:21FromDiscord<Clownstick Von FuckFace> @shashlick thinks for the help btw. i know im being obtuse af.
06:05:52FromDiscord<nikki> https://github.com/openssl/openssl/issues/11373
06:05:53disbotβž₯ openssl issues: build on windows mingw
06:05:54FromDiscord<nikki> maybe relevant?
06:10:19FromDiscord<Clownstick Von FuckFace> 😭 why is it so hard to just statically compile an https client
06:10:58FromDiscord<nikki> https is pretty complicated...
06:11:42FromDiscord<nikki> i sent something that actually has information in it. there is a ton of information like that on the internet. all of this is meant to help you
06:11:50FromDiscord<nikki> you can do it πŸ˜…
06:12:02FromDiscord<nikki> don't lose hope haha
06:15:56FromDiscord<Clownstick Von FuckFace> thanks @nikki ! I am a little nervous about changing openssl files :S
06:17:08FromDiscord<nikki> what if you do it and your program runs
06:17:13FromDiscord<nikki> would that make you feel better πŸ˜„
06:17:18FromDiscord<nikki> maybe that's what will happen :p
06:18:35FromDiscord<Clownstick Von FuckFace> this is true
06:19:19FromDiscord<nikki> there is no reason to fear. unless.... you're pushing to production for some application a lot of people depend on. then maybe you can worry a teeny bit :p
06:20:57FromDiscord<Clownstick Von FuckFace> ok added `#undef AI_PASSIVE` and am rebuilding openssl
06:21:15FromDiscord<Clownstick Von FuckFace> to crypto/bio/b_addr.c
06:21:42FromDiscord<Clownstick Von FuckFace> i didnt get an error when i built so i skpped that
06:21:47FromDiscord<Rika> Why even worry then
06:21:51FromDiscord<Rika> Fuck the users
06:22:18FromDiscord<nikki> you didn't get an error when you built so you skipped: what?
06:22:25FromDiscord<nikki> and yeah never worry. fear is the mind killer
06:23:06FromDiscord<Clownstick Von FuckFace> ", I manually changed the Makefile to↡PERL=/d/perl-5.24.0/bin/perl.exe↡↡"
06:23:15FromDiscord<Clownstick Von FuckFace> well getting 1 less error πŸ˜„
06:23:19FromDiscord<Clownstick Von FuckFace> still more erors though
06:23:49FromDiscord<nikki> it helps to be as specific and informative as possible when describing issues :p
06:26:45FromDiscord<Clownstick Von FuckFace> πŸ˜„ https://media.discordapp.net/attachments/371759389889003532/778144073051537448/message.txt
06:26:48FromDiscord<Clownstick Von FuckFace> so i am debugging right now
06:26:52FromDiscord<Clownstick Von FuckFace> it looks like its a cross compile issue
06:30:00FromDiscord<Clownstick Von FuckFace> https://stackoverflow.com/questions/44694954/cant-link-c-project-with-openssl-static-libraries
06:30:13FromDiscord<Clownstick Von FuckFace> maybe relevant
06:30:45FromDiscord<Clownstick Von FuckFace> yeah looks like its the same messed up imports
06:31:00FromDiscord<Clownstick Von FuckFace> how do i specify to link with -lws2_32. on nimc?
06:31:55FromDiscord<Clownstick Von FuckFace> tried adding `--passL:-lws2_32`
06:34:34FromDiscord<Clownstick Von FuckFace> haha giving up for tonight-- is late where I am. Thanks @nikki @shashlick for all the help!
06:36:09FromDiscord<Rebel> Are their negative indices for string slicing?
06:36:15FromDiscord<Rebel> (edit) "their" => "there"
06:36:24FromDiscord<Clownstick Von FuckFace> yeah, blah[^1]
06:36:24FromDiscord<nikki> @Rebel from end? you can use ^blah
06:36:27FromDiscord<Clownstick Von FuckFace> gives you the end
06:36:37FromDiscord<Rebel> πŸ‘
06:36:41FromDiscord<nikki> πŸ‘Œ
06:37:24FromDiscord<Rebel> I wish all my questions about Nim were that sample to answer
06:37:44FromDiscord<Clownstick Von FuckFace> Same
06:38:43FromDiscord<Rebel> The next question would be able doing window syscalls in Nim with inline assembly and if that's even possible πŸ˜›
06:40:45FromDiscord<Clownstick Von FuckFace> l
06:42:08FromDiscord<Clownstick Von FuckFace> lots of support for windows sycalls actually, and you can specify assembly at compile time πŸ˜„
06:43:52FromDiscord<Rebel> πŸ‘€
06:43:56FromDiscord<Rebel> any examples lol
06:44:03FromDiscord<Rebel> What have you been reading?
06:45:19*waleee-cl quit (Quit: Connection closed for inactivity)
06:47:17FromDiscord<Rika> maybe winlean?
06:48:21FromDiscord<Rika> or https://github.com/def-/nim-syscall/blob/master/src/linux_x86_64/call.nim
06:49:05FromDiscord<Rika> uh good luck
06:50:33FromDiscord<nikki> but if everything was simple, is it fun?
06:51:47FromDiscord<ElegantBeef> I'm simple, and clearly not fun
06:53:15FromDiscord<nikki> !eval import tables; echo("fun" in cast[Table[string]](0xbeef))
06:53:17NimBotCompile failed: /usercode/in.nim(1, 40) Error: cannot instantiate Table
06:53:29*bunbunbunbunny joined #nim
06:53:33FromDiscord<nikki> !eval import sets; echo("fun" in cast[HashSet[string]](0xbeef))
06:53:35FromDiscord<ElegantBeef> Tables have two types
06:53:37NimBotTraceback (most recent call last)↡/usercode/in.nim(1) in↡/playground/nim/lib/pure/collections/sets.nim(167) contains↡/playground/nim/lib/pure/collections/hashcommon.nim(52) rawGet↡SIGSEGV: Illegal storage access. (Attempt to read from nil?)
06:53:39FromDiscord<ElegantBeef> You failed!
06:53:45FromDiscord<nikki> i can confirm that you aren't fun
06:54:10FromDiscord<ElegantBeef> !eval import strutils; echo "ElegantBeef".contains("fun")
06:54:14NimBotfalse
06:54:27FromDiscord<nikki> no segfault? where's the fun in that!
06:54:56FromDiscord<nikki> @ElegantBeef also i am at the point of loading a large level that my c++ engine used to load
06:54:57FromDiscord<nikki> and it loads faster in nim
06:55:10FromDiscord<nikki> _holds back tears_
06:56:11FromDiscord<ElegantBeef> To quote my Rust loving friend "Nim is transpiled and cant be as fast as Rust"
06:57:28*habamax joined #nim
06:57:32FromDiscord<nikki> if you use rust, you never ship, so your program contains no bugs
06:57:53FromDiscord<ElegantBeef> The funny part is i dont think he's actually released any of his Rust code πŸ˜„
06:57:58FromDiscord<nikki> but at least it maybe will finish compiling soon!
06:59:08FromDiscord<nikki> @ElegantBeef check out my progress in #gamedev πŸ˜„
06:59:24FromDiscord<nikki> (the big level is not in the video bc. spoilerz lol)
06:59:50FromDiscord<ElegantBeef> The `ng` pragma is junk, it's so undescript πŸ˜„
07:00:04FromDiscord<nikki> that's the idea :p
07:00:26FromDiscord<ElegantBeef> What's it do.. no one knows, they just use it
07:00:56FromDiscord<nikki> it's non-descript until i figure out what it's describing 😐
07:01:13FromDiscord<ElegantBeef> Is it not actually doing anything atm?
07:01:13FromDiscord<nikki> but yeah it shud probably be called .gameplayComponent.
07:01:30FromDiscord<nikki> or .thisIsLongBecauseBeefToldMeTo.
07:01:43FromDiscord<nikki> it just registers the type as a component type for the game
07:01:49FromDiscord<nikki> for the entity component system
07:01:55FromDiscord<nikki> .comp. is probs good
07:02:29FromDiscord<nikki> it's basically aspects of data each game entity can have
07:07:47bung_how to test compilation error https://github.com/nim-lang/Nim/pull/15098
07:07:47disbotβž₯ Fix #15097 Compiler crashes when referring to an undeclared gensymmed…
07:20:53FromDiscord<Rika> @ElegantBeef :facepalm1:
07:22:32FromDiscord<Rika> so why does your friend believe that
07:23:04FromDiscord<ElegantBeef> He doesnt like Nim and rationalizes it with his feelings instead of the facts
07:23:25FromDiscord<Rika> he jelly he learned the wrong language πŸ˜›
07:23:37FromDiscord<Rika> big salt
07:30:40*narimiran joined #nim
07:36:22FromDiscord<nikki> that's why it makes sense to learn multiple things
07:36:40FromDiscord<nikki> and choose the best tool for the particular context
07:36:48FromDiscord<nikki> but cognitive dissonance is more fun i guess
07:37:12FromDiscord<ElegantBeef> Facts dont care about your feelings, Nim is the best for everything, from brushing your teeth to wiping your ass
07:37:17FromDiscord<ElegantBeef> πŸ˜„
07:38:07FromDiscord<nikki> an elegantbeef that can code C and nim is better than an elegantbeef that only codes nim ;o
07:38:29FromDiscord<ElegantBeef> An elegant beef that actually codes is better than the version infront of you
07:38:40FromDiscord<nikki> lmao
07:40:14FromDiscord<nikki> @ElegantBeef what's the story behind ur name
07:40:31*PMunch joined #nim
07:40:46FromDiscord<ElegantBeef> Adjective + Noun, the way to live
07:45:36FromDiscord<Rika> how about you nikki
08:01:49FromDiscord<Rika> ok i guess you can just not respond as well
08:02:45PMunchI love getting on IRC in the morning and drop into a totally random conversation :P
08:03:33FromDiscord<Rika> lol
08:03:54FromDiscord<Rika> no one has spoken since 20 minutes ago, barring me
08:07:44*bunbunbunbunny quit (Quit: Lost terminal)
08:08:24PMunchFirst message I saw was ElegantBeefs last message
08:12:59FromDiscord<ElegantBeef> I'm sorry for your loss pmunch
08:13:11FromDiscord<ElegantBeef> Having to read anything i write is a diservice
08:13:32PMunchHaha, that's the beauty of IRC, I can only read when I'm online
08:13:43PMunchI mean I can check the logs
08:15:29PMunchWow, just discovered a terrible design flaw on GitHub
08:16:05PrestigeWhich one?
08:16:10PMunchI got what looked like a notification identifier on my profile picture (instead of by the bell)
08:16:20FromDiscord<ElegantBeef> Yea i got that today aswell
08:16:26FromDiscord<ElegantBeef> It's due to a new feature
08:16:32PMunchClicking on it just expanded the menu, with no indication of where the new thing was
08:16:58PMunchHad to do inspect element to figure out that it was called a feature-notifier or something like that before I realised what it was for
08:17:11FromDiscord<ElegantBeef> Yea i just started clicking until it disappeared
08:17:24FromDiscord<ElegantBeef> UX designed by a blind person
08:17:29bung_yeah, today I found , I thought maybe feature preview, but I dont remenber the last feature
08:17:48FromDiscord<Rika> ux designed by a blind person for a blind person
08:18:23bung_it maybe just a wrong message pass to notification
08:18:27PMunchThey still haven't fixed their bunged up design changes made recently
08:18:39PMunchThe experience on 4K monitors is pretty bad
08:19:35PrestigeI'm waiting at least 5 years before I get a 4k monitor
08:19:43FromDiscord<Rika> The experience ~~on 4K monitors~~ is pretty bad
08:20:22PrestigeYeah, I miss the old design
08:20:30PrestigeMicrosoft been messing things up
08:20:48FromDiscord<lqdev> yes
08:21:00PMunchI have 4K monitors at work, not my choice..
08:21:03FromDiscord<lqdev> how do they manage to fuck up everything they touch tho
08:21:03PMunchhttps://uploads.peterme.net/github_current.png
08:21:12FromDiscord<ElegantBeef> If you're cynical you could say it's EEE πŸ˜„
08:21:26FromDiscord<Rika> microsoft: the modern oracle?
08:21:28PMunchAs you cad see the menu is all the way over to the side -_-
08:21:34PrestigePMunch: I asked for a 1080p monitor at work and everyone was confused. HahA
08:22:05PMunchHaha :P
08:22:11PMunchI mean I don't mind it
08:22:34PrestigeWait, how is nimdow on a hidpi monitor?
08:22:37PMunchI have set my browser to default zoom in to 120% or something, and my terminal has a slightly larger font size than I would otherwise use
08:22:54PMunchWorks fine, but that's the reason I discovered that the bar height option didn't work :P
08:22:58FromDiscord<ElegantBeef> Yea was going to ask, hows the font scaling on a 4k monitor
08:23:25PMunch@Elegant, why would font-scaling be an issue?
08:24:39FromDiscord<lqdev> i'm serious tho, so far microsoft has brought so much shit into the products they bought
08:24:56PMunchYou sound surprised
08:25:02FromDiscord<lqdev> i'm not
08:25:12FromDiscord<lqdev> that's old news by this point
08:25:26FromDiscord<ElegantBeef> I mean the default font size πŸ˜„
08:26:04FromDiscord<lqdev> they screwed up minecraft by creating bedrock edition, and now they fucked up github's design
08:26:37PrestigeNeed I remind you about Banjo Threeie?
08:26:56FromDiscord<lqdev> first time i've heard about it :/
08:27:08FromDiscord<lqdev> the only good thing they're providing is funding for those projects
08:27:20FromDiscord<lqdev> and that's where the good things end
08:28:13FromDiscord<lqdev> after all, microsoft is just another company focusing on their gOoD PR
08:31:37PMunch@Elegant, well there isn't much default about my installation to begin with :P But after having upped the Gtk font size, zoomed in in Firefox, and set my terminal to use a slightly larger font I haven't thought much of it
08:31:45PMunchBut then again I like my fonts small
08:32:01*jjido joined #nim
08:32:12FromDiscord<shad0w> @PMunch ↡so, how much margin you want.↡microsoft: YES
08:34:13FromDiscord<ache of head> xD
08:34:46PMunchI mean that site is more margin than content at this point
08:49:33*hmmmmm joined #nim
08:49:45hmmmmmhallo nimlets!
08:50:27FromDiscord<Rika> hello
08:50:42FromDiscord<Rika> nimlet lmao the more accepted words are nimion and nimmer
08:56:57*hnOsmium0001 quit (Quit: Connection closed for inactivity)
08:57:53hmmmmmsince I'm low level nimmer I'm a nimlet
08:59:24FromDiscord<shad0w> someone must've max-width + margin: auto'd it avoid weird issues and wraps on wide screens
08:59:35FromDiscord<shad0w> i used to be frontend in a prev life
09:00:44*Tanger quit (Quit: Leaving)
09:04:13FromDiscord<fwsgonzo> changing the strings in `struct TFrame_` to be const char solves all of the warnings I get when building with the C/C++ backends
09:05:49FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2ErR
09:06:01FromDiscord<fwsgonzo> (edit) "https://play.nim-lang.org/#ix=2ErR" => "https://play.nim-lang.org/#ix=2ErS"
09:07:18FromDiscord<fwsgonzo> (edit) "https://play.nim-lang.org/#ix=2ErS" => "https://play.nim-lang.org/#ix=2ErR"
09:08:45*krux02 joined #nim
09:19:00*neceve joined #nim
09:22:05*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:25:21*lritter joined #nim
09:27:13*FromDiscord quit (Ping timeout: 264 seconds)
09:28:03*FromDiscord joined #nim
09:28:20FromDiscord<levovix> trying to connect nim and c++, i get link error: `undefined reference to Β«S::foo(char)Β»`
09:28:30FromDiscord<levovix> source code: https://media.discordapp.net/attachments/371759389889003532/778189810845876224/unknown.png
09:28:33FromDiscord<levovix> what am I doing wrong?
09:33:37FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2ErZ
09:34:29FromDiscord<ElegantBeef> How dare... you feel ashamed to open another post πŸ˜›
09:35:01PMunchWhat does your template look like?
09:35:21FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2Es0
09:36:25FromDiscord<ElegantBeef> Thought templates were just code subsitution
09:36:30FromDiscord<Rika> `let it2` instead of `let it` then also on the last line use `it2`
09:38:29FromDiscord<KnorrFG> lol, i cant believe i didnt catch that ... ty, but now it produces:↡`Error: illformed AST: proc (): auto {.closure.} = for x`gensym116 in values(state.sessions):↡ yield x`gensym116`
09:38:47FromDiscord<KnorrFG> (edit) "values(state.sessions):↡ " => "values(state.sessions):"
09:39:45FromDiscord<ElegantBeef> Unrelated, just curious. Isnt the `: untyped` return completely useless for templates?
09:40:00PMunchI mean this works: https://play.nim-lang.org/#ix=2Es2
09:40:21FromDiscord<KnorrFG> @ElegantBeef Probably, I just tried a lot of different things when it didnt work
09:40:22FromDiscord<lqdev> @ElegantBeef yes it's redundant, but it signals intent better
09:41:08FromDiscord<ElegantBeef> Actually it's not in this case, just tried with pmunchs example and without that it complains about the unhandled value
09:41:48PMunchHaha, yeah that's because you don't have a return type and you implicitly try to return something
09:42:21FromDiscord<ElegantBeef> Yea i got why, just have never returned from inside a template before i guess
09:42:36FromDiscord<ElegantBeef> Always just use them cause i go "fuck this is redundant"
09:48:18planetis[m]actually `template foo: untyped =` and `template foo =` are different
09:48:29planetis[m]i was confused a lot with this
09:48:35PMunchDifferent how?
09:48:47planetis[m]the last one returns void
09:49:07PMunchBut it's a template..
09:49:30PMunchOh, the thing inside the template returns void?
09:49:38planetis[m]yes
09:52:36planetis[m]https://play.nim-lang.org/#ix=2Es5
09:53:51*Tanger joined #nim
09:55:27PMunchRight
09:55:56FromDiscord<KnorrFG> @PMunch Thank you, for your answer, I didn't reply at first, because I wanted to try to fix the problem first, but I cant, I modified the example slightliy, and it stopped working, is that actually a bug? https://play.nim-lang.org/#ix=2Es6
09:56:14PMunchplanetis[m], and similarly: https://play.nim-lang.org/#ix=2Es7
09:59:04PMunch@KnorrFG, well something is odd here
10:01:08PMunchI mean this works, but the sequence produced isn't right: https://play.nim-lang.org/#ix=2Esa
10:01:35PMunch(Oh and that {.closure.} pragma isn't necessary, added it to try something)
10:02:12PMunchOh, nvm, this works: https://play.nim-lang.org/#ix=2Esc
10:02:33*Tlangir joined #nim
10:03:08FromDiscord<KnorrFG> wait. Does that mean the template does not return an iterator but a function that returns an iterator?
10:03:34FromGitter<ynfle> A template is just code replacement
10:03:40PMunchUhm, something like that
10:03:50PMunchClosure iterators are a bit, uhm, odd
10:04:47PMunchhttps://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-first-class-iterators
10:05:04*Tanger quit (Ping timeout: 260 seconds)
10:06:04FromDiscord<KnorrFG> it seems like nim is in general no big friend of iterations. It seems its also not possible to call map, filter, fold and co on iterators. So I'm always forced to allocate that unnessecary memory by making an iter into a seq first, right?
10:06:12FromDiscord<KnorrFG> should I just refrain from using iterators
10:06:14FromDiscord<KnorrFG> (edit) "iterators" => "iterators?"
10:06:14PMunchBasically you have to "call" an iterator to start it
10:06:49PMunchWell depends on what you need them for
10:07:02FromGitter<ynfle> You could try `zero-functional`
10:07:11FromGitter<ynfle> !repo zero-functional
10:07:12disbothttps://github.com/mikebelanger/nim_functional_benchmarks -- 9nim_functional_benchmarks: 11Comparing performance between nim's functional libraries: sequtils, iterutils and zero_functional 15 0⭐ 0🍴
10:07:32PMunchUhm, that's not the right repo :P
10:07:43FromGitter<ynfle> https://github.com/zero-functional/zero-functional
10:08:35FromDiscord<KnorrFG> but would somethign like `aHashSet --> map(...)` work with zerofunctional?
10:09:15FromGitter<ynfle> I don't see why not
10:09:28FromDiscord<KnorrFG> Oh, awesome, ok thanks!
10:11:56PMunch@levovix, could you share that code in a more copy-able format?
10:13:23FromGitter<ynfle> @Pmunch, Could you take a look at this before I file a bug report https://play.nim-lang.org/#ix=2EpY?
10:14:05FromDiscord<levovix> sent a code paste, see https://play.nim-lang.org/#ix=2Esf
10:15:14FromDiscord<levovix> (edit) "https://play.nim-lang.org/#ix=2Esf" => "https://play.nim-lang.org/#ix=2Esg"
10:15:50PMunch@ynfle, huh curious. It seems to apply it directly so that the a[0] in that pattern points to the new a[0] (which was just set to a[2]). I'm guessing this is an optimisation somewhere..
10:16:17FromGitter<ynfle> So I should file a bug report?
10:16:29PMunchYeah, that shouldn't happen
10:18:07PMunchHmm, where are you guys copying from that turns * into that weird symbol..
10:18:16FromGitter<ynfle> πŸ‘ Thanks
10:25:09PMunchCompiling with this works: nim cpp --passL:-Lbuild --passL:-lcppbind -r main
10:25:41PMunchNot quite sure why the link pragma doesn't work
10:27:08FromDiscord<levovix> thanks
10:27:43PMunchOh wait, that weird symbol is from the IRC bridge..
10:27:51PMunchWhere is Yardanico when you need him
10:28:07PMunch@levovix, no problem :)
10:30:52*xet7 quit (Remote host closed the connection)
10:31:26FromGitter<ynfle> Done https://github.com/nim-lang/Nim/issues/16017
10:31:28disbotβž₯ Array modification doesn't propagate for indexing after change the values for `var array` ; snippet at 12https://play.nim-lang.org/#ix=2Esk
10:32:11*xet7 joined #nim
10:32:19PMunchNice
10:33:22FromGitter<ynfle> Thanks
10:33:40*xet7 quit (Remote host closed the connection)
10:34:03PMunch@levovix, those could of course be put as a pragma instead of compiler options
10:35:28*xet7 joined #nim
10:36:46PMunchWhat a weird set of speeds to show examples for: http://ix.io/2Esm
10:36:51PMunchFor context, I'm updating a server
10:37:03PMunchWho has a server on a 56k link :P
10:42:03PMunchHmm, updating this server was a bit more pain than I expected..
10:59:12*Vladar joined #nim
11:14:17planetis[m]dumb question ahead make sure you'r sitted: can I use packedjson internal representation directly as a binary format? This way it would be interchangable with JSON and have the advantages of a binary format.
11:14:42planetis[m]s/sitted/seated
11:16:11planetis[m]for my own services/protocols that is
11:27:31PMunchI'm pretty sure packedjson just keeps the original json string as the internal representation
11:27:48PMunchBut it knows where in the string every field is, and what object/type it is
11:28:12PMunchSo when you access something it snips out the relevant section and converts it to the correct type for you
11:34:14*apahl quit (Ping timeout: 264 seconds)
11:35:42FromDiscord<ache of head> This is probably an extremely newb question but what does the `template / generic instantiation error from here` mean?
11:36:30*apahl joined #nim
11:36:54FromDiscord<Clyybber> its not an error :)
11:37:35FromDiscord<ache of head> wait, it isn't?
11:37:55FromDiscord<ache of head> damn you're right
11:38:36planetis[m]yeah it seems like it
11:39:42planetis[m]what else would i need though... seems perfect
11:47:00planetis[m]more like message pack
11:48:34*Zevv quit (Quit: Lost terminal)
11:48:35planetis[m]well no but with some changes...
11:53:39PMunchbson?
11:54:57*rockcavera joined #nim
11:55:24PMunchOr UBJSON
11:56:47planetis[m]the bah-son, the gah-son, Ol Dirty Bastard, Inspectah Deck, Raekwon the Chef
11:56:47planetis[m]U-God, Ghost Face Killer and the Method man
11:56:56planetis[m]man fuck all that!
11:57:29PMunchHuh?
11:59:27planetis[m]nothing sry, they remind me the Wu-Tang clan
11:59:36planetis[m]all these names
12:00:39federico3"binary" json still needs sequential parsing - not a big improvement
12:01:08PMunchDepends on what you're optimising for
12:01:44*opal quit (Ping timeout: 240 seconds)
12:02:20*opal joined #nim
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:32*supakeen joined #nim
12:08:34ForumUpdaterBotNew thread by Miran: Nim's rst parser now supports markdown tables, see https://forum.nim-lang.org/t/7108
12:21:42hmmmmmhmm
12:21:51hmmmmmnarimiran r u there?
12:21:55narimiranhmmmmm: yeah
12:22:01hmmmmmnice!
12:22:21hmmmmmit seems we have a bug on our exerciese of yesterday :O
12:22:39narimiranok, you got my attention
12:23:20hmmmmmI'll share some code but don't give me the solution I want to find it myself
12:23:36narimiranok, easy-peasy for me then
12:23:54hmmmmmyes!
12:24:59hmmmmmwhy on playground I find someone else code
12:25:05hmmmmm:o
12:25:22narimiranbecause you don't use https://play.nim-lang.org/
12:25:30narimiranbut some link with some gibberish at the end
12:25:34hmmmmmoh
12:25:45PMunchIt's not gibberish! :P
12:25:56planetis[m]uhm no sequential parsing, to get the next field, it reads everything
12:26:01narimiran:P
12:26:23hmmmmmhttps://play.nim-lang.org/#ix=2EsF
12:26:43hmmmmmif you run the code it gives you the start of the correct solution but not the entire thing
12:26:49narimiranusing floats? that's a hard mode
12:27:03hmmmmm:O
12:27:14narimiranshow your python version
12:27:44hmmmmmdon't give me the solution but it would be appreciated if there was one so I don't spend 6 months finding it :D
12:27:50hmmmmmok coming
12:28:16planetis[m]hmmmmm: are you working on the sums module?
12:28:17narimiranbut i think i know where's the bug ;)
12:28:48hmmmmmhttps://paste.ofcode.org/trsa7CqXrkjrGstV46Duzs
12:28:58narimiranyep, i'm sure now
12:29:09hmmmmmok can you give me a small hint
12:29:16narimiranline 12
12:29:23hmmmmmhmm
12:29:42*xet7 quit (Remote host closed the connection)
12:30:19narimirani didn't translate python's version correctly
12:30:27hmmmmmdon't tell me more
12:30:31hmmmmmsee you in six months
12:30:35narimiran:)
12:38:39*jjido joined #nim
12:41:05*xet7 joined #nim
13:11:42*Tlangir quit (Quit: Leaving)
13:12:36*Vladar quit (Quit: Leaving)
13:12:36*hmmm joined #nim
13:16:06*Vladar joined #nim
13:22:03hmmmnari nari
13:22:31narimiranyes?
13:22:37hmmmwhy on line 8 you use "result" and in the other lines you use "return"
13:23:15narimiranyou can change it to return if you want
13:23:20hmmmits the same?
13:23:29narimiranhere yes, generally no
13:23:32hmmmoh
13:24:43narimiranhmmm: but more importantly, do you know what's the bug in nim version of the code?
13:24:52narimiranwhat is different than in python version?
13:25:05hmmmI'm looking but I'm also preparing food so I'm doing both things and I'm slow :p
13:25:18hmmmshhh don't tell me
13:26:00narimirani won't. but spotting a bug/difference is only the first step in correcting it
13:26:05planetis[m]hmmm: return is control flow, result is just a variable
13:26:27hmmmif instead of result I set it to molly it works the same?
13:27:05FromGitter<ynfle> `result` is implicitly initialized and implicitly returned
13:27:21FromGitter<ynfle> If there is no reached `return` statment
13:27:37hmmmit's like a package of "x=something and return it too"
13:27:41hmmm?
13:27:56narimiranyeah, but you don't have to return immediately
13:28:02hmmmhmm
13:28:52narimirannow, go prepare/eat your food, don't worry about `result`
13:28:57hmmm:p
13:30:34FromGitter<ynfle> It's a regular variable that is returned if the end of the `proc`/`func` etc. is reached without a return (and implicitly initialized)
13:32:09hmmmso I can result = something, do something else in the function and when it reaches the end goes back take result and returns it?
13:32:22FromGitter<deech> Is {de}serializing `proc`s expected to work? This fails with a SIGSEGV: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5fb3d0e67cac87158fb0aa98]
13:35:11*vicfred quit (Quit: Leaving)
13:37:48hmmmok and why return works here but not result? https://play.nim-lang.org/#ix=2Et0
13:39:54hmmmoh I need to maybe do result = something
13:40:02hmmmhaha it works
13:45:13narimiranhmmm: i think you should really start reading some tutorials
13:45:51narimiranotherwise, everything feels like tapping in dark
13:47:29PMunchhmmm, result is a automatically defined variable that is the type of your return value
13:47:42PMunchs/a/an
13:47:43hmmmI'm reading them, some are easier than others, but I come back to them frequently, I'm a total beginner so just ask stupid questions lol
13:48:24FromDiscord<Clownstick Von FuckFace> @shashlick i downloaded choosenim and i finally get what you are sayingt, thanks for the advice. I think I am closer to a solution!
13:48:32PMunchProblem with tutorials is that you can either make them super terse, or risk assuming that someone knows about something they don't
13:49:11PMunchYou could've easily read a part of the manual that said "Nim has an implicit return variable named `result`" and without knowing what that meant just ignored it.
13:50:13hmmmthe most interesting thing I've read in the tutorials is that nim procs can minipulate vars outside the proc scope
13:50:42hmmmI think python funcs can't do that
13:51:01narimiranhmmm: here is a part of a beginners tutorial regarding `result`: https://narimiran.github.io/nim-basics/#_result_variable
13:51:03hmmmoh I go eat cu later
14:07:40FromDiscord<Clownstick Von FuckFace> how does one build choosenim fom sourceon windows?
14:09:20*bung_ quit (Quit: Lost terminal)
14:11:51FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Eta
14:14:23*neceve quit (Read error: Connection reset by peer)
14:15:40FromDiscord<0xfabe (vn-ki)> does nim's compile time function eval support dynamic allocations (heap)?↡↡Where can I find some literature on nim's CTFE?
14:16:17FromDiscord<Rika> https://nim-lang.org/docs/nims.html
14:16:27*apahl quit (Ping timeout: 260 seconds)
14:17:12*apahl joined #nim
14:19:46FromDiscord<Clyybber> @0xfabe (vn-ki) yes it does
14:20:06FromDiscord<Clyybber> you can use ref objects/seqs/strings and all that jazz
14:20:42PMunch@Clownstick, it looks like you might have an outdated dependency or something
14:20:52Zoom[m]Hey, is `high` preferable for indexing over `^1`?
14:21:14PMunchDepends on what you're doing
14:21:37FromDiscord<notchris> good morning
14:22:00PMunchif you do `mySequenceOfInts[2..^1]` it's definitely not recommended to do `mySequenceOfInts[2..mySequenceOfInts.high]`
14:22:04PMunchHi @notchrist
14:22:07PMunchHi @notchris *
14:22:15notchriso/
14:23:08FromDiscord<0xfabe (vn-ki)> @Rika while this is a good intro, i'd like something more in depth.↡↡I'm specifically interested in how heap allocated structures would work
14:23:38FromDiscord<0xfabe (vn-ki)> like, are the heap vars promoted to static, or are they heap intialized at startup
14:24:12FromDiscord<0xfabe (vn-ki)> if there is some rfc or implementation doc surrounding this, it would be great (i searched nim-lang/rfcs, but didnt find anything)
14:25:16FromDiscord<Clownstick Von FuckFace> @PMunch Thanks for the response! I am on a windows box and did a fresh install of nim with choose nim --firstTime then I cloned the choosenim repo and its throwing these errors. Any way to track down what the dependcy issue coudl be?
14:25:38PMunchLooks like bzip
14:25:53PMunchJust judging from filenames/procedure names
14:26:21PMunchWhy are you trying to build it from scratch anyways?
14:26:25hmmmnari nari I found something suspicious on line 12
14:26:46narimiranhmmm: still not pinging me with "nari nari", but ok
14:26:59hmmmit shouldn't be [0] because I want the full sequence not just the first value
14:27:05narimiranhmmm: bingo :)
14:27:08hmmmHA
14:27:09hmmm:D
14:27:21hmmmI don't ping you because I don't want to disturb you lol
14:27:22narimiran(but if you just delete `[0]`, it won't work)
14:27:27hmmm:O
14:27:28Zoom[m]I'm just looking at hmmm's paste here. Not really sure what is the goal here
14:27:34FromDiscord<Clownstick Von FuckFace> @PMunch https://github.com/dom96/choosenim
14:27:40FromDiscord<Clownstick Von FuckFace> i want to build this from source
14:27:49FromDiscord<Clownstick Von FuckFace> it statically embeds openssl
14:27:49narimiranZoom[m]: he's learning and doesn't want us to tell him the answer :)
14:27:53FromDiscord<Clownstick Von FuckFace> and I want tofigure out how ti does that
14:28:07narimiranhmmm: why doesn't it work? any idea?
14:29:17hmmmlet's see what kind of error I get
14:30:35PMunch@Clownstick, just how Nim statically links stuff?
14:31:23FromDiscord<Clownstick Von FuckFace> naw, specifically openssl
14:31:33FromDiscord<Clownstick Von FuckFace> I ahve been trying to make a standalone windows binary with -ssl
14:31:44hmmmok if I try the naive fix (which is to just remove the [0] and leave withv) I get ident error. I think my problem is I don't know how to express in nim the concept of "whatever is in the sequence, I want it"
14:31:58FromDiscord<Clownstick Von FuckFace> but when i run it on a fresh windows box its missing DLLs. I want to statically link Openssl to the standalone binary
14:32:04FromDiscord<Clownstick Von FuckFace> Choosenim does this and I amtrying ot emlate that
14:32:14FromDiscord<Clownstick Von FuckFace> but when I try to build choosenim frm source, it still errors out πŸ˜„
14:32:35narimiranhmmm: what does `+` do in the python version?
14:33:16hmmmadds whatever is in list withv with the first element of the array result
14:33:30hmmmhmm kinds of concat the arrays/lists
14:33:31narimirannope
14:33:32Zoom[m]Even the python version looks strange. Is it yours?
14:33:33narimiranyeg
14:33:36narimiran*yep
14:33:53hmmmso how I concat seqs in nim? Don't tell me
14:33:56narimiran"kinds of concat" -- here's the clue
14:33:57hmmmI will read the tutorial
14:34:29narimiranhmmm: you go here: https://nim-lang.github.io/Nim/lib.html and then type `concat` in the search box
14:36:21hmmmthere is a suspicious entry with sequtils :o
14:36:33narimiranwhat does that mean?
14:36:43Zoom[m]Looks like one of the problem from Programming Perals, but not quite
14:36:54Zoom[m] * Looks like one of the problem from Programming Pearls, but not quite
14:36:59hmmmhmmm
14:37:07hmmmthere is a concat function
14:37:17hmmmthat adds seqs together
14:37:19narimiranhmmm: btw, is the order of the resulting seq important? if not, there's a very simple solution
14:37:28hmmmorder of seqs is not important
14:38:12hmmmoh shi I have to go do some irl stuff
14:38:13hmmmcu later
14:38:18*hmmm quit ()
14:38:23narimirancu
14:40:56*hmmmmm quit (Ping timeout: 256 seconds)
14:41:09*hmmmmm joined #nim
15:01:21*vicfred joined #nim
15:02:26*vicfred quit (Max SendQ exceeded)
15:02:56*vicfred joined #nim
15:04:06*vicfred quit (Max SendQ exceeded)
15:04:21*PMunch quit (Quit: leaving)
15:04:38*vicfred joined #nim
15:11:50FromDiscord<Xydium> Has anyone had success with non-blocking IO in nim on windows? It's supposed to be possible but Nim's winlean module doesn't expose the necessary functions
15:12:15FromDiscord<Xydium> (Specifically on the stdin handle0
15:12:17FromDiscord<Xydium> )
15:13:00ForumUpdaterBotNew thread by Vitaliy: Empty proc body, see https://forum.nim-lang.org/t/7109
15:25:30FromDiscord<haxscramper> I'm trying to create a type that can be configured using set of compile-time flags (`static[set]` as generic parameter) - it mostly works fine, but I'm getting `Error: cannot generate code for: Flags` error - https://play.nim-lang.org/#ix=2Etv when I try to use `[]` operator.
15:39:24narimiranhmmmmm: you here?
15:40:24*waleee-cl joined #nim
15:40:35*astronavt joined #nim
15:43:01*Vladar quit (Remote host closed the connection)
15:51:37planetis[m]narimiran: can you merge https://github.com/nim-lang/fusion/pull/40 ? πŸ™
15:51:40disbotβž₯ Added macro dsl based on karaxdsl ; snippet at 12https://play.nim-lang.org/#ix=2EtN
15:52:12narimiranplanetis[m]: let me try to fix CIs first
15:57:36FromDiscord<haxscramper> I made PR with CI fix
15:58:34narimiraneh, i'm fixing it differently
15:58:44narimiranlike it was done here: https://github.com/nim-lang/Nim/pull/15892/files
15:58:45disbotβž₯ CI(actions): Replace deprecated `add-path` commands
16:01:16*hmmmmm quit (Ping timeout: 240 seconds)
16:02:38*habamax quit (Remote host closed the connection)
16:04:24*Zevv joined #nim
16:20:03*bung joined #nim
16:28:31*vicfred quit (Quit: Leaving)
16:29:48*vicfred joined #nim
16:32:07planetis[m]yay thanks!
16:39:22*natrys joined #nim
17:01:18*luis__ joined #nim
17:02:06*habamax joined #nim
17:06:13*hnOsmium0001 joined #nim
17:09:05*tane joined #nim
17:18:47*haxscramper joined #nim
17:20:53haxscrampernarimiran: I'm not really familliar with the process - should I pull all CI changes & related (there is a merge conflict now, due to changes in `changelog.md`) into my branch from master?
17:21:23narimiranhaxscramper: can you be more specific? what PR are we talking about?
17:22:10narimiranhttps://github.com/nim-lang/fusion/pull/34 ?
17:22:11disbotβž₯ [!!!] Rename `*Table` types to `*Map`
17:23:07haxscramperMy PR I'm talking about is https://github.com/nim-lang/fusion/pull/33
17:23:08disbotβž₯ Pattern matching implementation
17:24:24haxscramperBut #34 also has conflicts to to changelog
17:24:28narimiranhaxscramper: why does that PR contain changelog entry from #34?
17:24:56disruptekmiran: i had a dream about you last night.
17:25:02narimirandisruptek: wet?
17:25:13disruptekdid you have the same dream?
17:25:19narimiranmaybe
17:25:26disruptekit's fate.
17:25:40planetis[m]every Pr that has merge conflict due to changelog.md
17:25:40narimiranZevv: you hear this?
17:26:03planetis[m]I just wrote mine on top
17:27:13narimirandisruptek: what about your engagement with Zevv?
17:27:19*PMunch joined #nim
17:27:25disruptekwhat about it?
17:28:06narimirandisruptek: yesterday he was telling us how he was very in love with you. it would be shame to break his heart
17:28:30disruptekeverybody lies, everybody fucks.
17:29:02planetis[m]is that the correct phrase?
17:29:25*luis__ quit (Quit: luis__)
17:29:36narimiranhaxscramper: i resolved merge commits now
17:30:09haxscramperThank you. Is it how it should be done, or should I pull master myself in the future if necessary?
17:30:17haxscramperOr there is no general recommendations
17:31:26disruptekprefer rebase to pull devel.
17:31:31narimiran^
17:31:56disruptekonly araq pulls devel because he's too busy to git.
17:39:47*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:40:32*astronavt quit (Quit: ...)
17:40:52*astronavt joined #nim
17:41:06*abm joined #nim
17:43:00*astronavt quit (Client Quit)
17:43:23*astronavt joined #nim
17:45:09*hmmmmm joined #nim
17:45:16hmmmmmhallo!
17:46:50*Vladar joined #nim
17:55:37*jjido joined #nim
17:58:49supakeenHey.
17:59:55Zoom[m]Eh, how do you modify contents of option with map directly? Is there mapIt for option?
18:00:34Zoom[m]hmmmmm: I've translated your subsetsum to Nim
18:01:02planetis[m]you spoil him dont give it
18:01:51Zoom[m]Not gonna yet
18:02:29*Vladar quit (Remote host closed the connection)
18:05:06*thomasross joined #nim
18:05:50*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:06:41hmmmmmZOOM!
18:06:48hmmmmmyou used concat? :o
18:07:21Zoom[m]I used Vim
18:07:52hmmmmm:o
18:08:14planetis[m]Options has its own map implementation
18:08:24*bung quit (Ping timeout: 256 seconds)
18:09:00hmmmmmwell I'm importing sequtils and trying concat hope the compiler doesn't explode in my face
18:09:03Zoom[m]In a way, I think you'd better not to use concat, but it's there until I wrap my head about using map and anonymous proc on option
18:09:34planetis[m]https://nim-lang.org/docs/options.html
18:09:34Zoom[m]You don't need sequtils to translate your version
18:10:03Zoom[m]Yeah, planetis, do you think I don't have it open right there? ;)
18:10:18hmmmmmye nari told me so but it's the only tool I know right now so I'm trying it
18:11:52Zoom[m]hmmmmm: https://nim-lang.org/docs/system.html#system-module-seqs
18:12:03Zoom[m]Look there
18:14:37*hmmmm joined #nim
18:14:38*hmmmmm quit (Ping timeout: 256 seconds)
18:14:58hmmmmoh
18:15:04hmmmmthere is a & operator :o
18:15:14hmmmmalso can I use slices?
18:17:38*Vladar joined #nim
18:17:43Zoom[m]you already are, in what you had in the playground
18:18:24hmmmmoh right those are slices of seqs
18:20:35Zoom[m]I don't really get yet how to pass a closure into option.map
18:22:31FromDiscord<lqdev> `myOption.map(proc (value: YourType) = discard)`
18:22:58Zoom[m]It wants `proc (input: T){.closure.}`
18:23:34Zoom[m]But I have `proc (x: var seq[float]){.closure, noSideEffect, gcsafe, locks: 0.}`
18:24:28FromDiscord<lqdev> it's because you're passing `var seq[float]`
18:24:40FromDiscord<nikki> is seq[float] the value type in the option
18:25:00*astronavt quit (Quit: ...)
18:25:03Zoom[m]nikki, yep
18:25:27FromDiscord<nikki> you probs want non-var
18:25:32FromDiscord<nikki> but otherwise that should work right
18:26:07Zoom[m]But that's the tpoint, I'd like to modify the contents
18:26:21Zoom[m]It doesn't
18:26:34FromDiscord<lqdev> Zoom: https://nim-lang.org/docs/options.html#get%2COption%5BT%5D_2
18:26:47*astronavt joined #nim
18:26:51FromDiscord<nikki> ya map is for reading and returning new contents
18:26:53*astronavt quit (Remote host closed the connection)
18:26:57FromDiscord<lqdev> if your option is `var` you can just modify your seq with `x.get[1] = 123` or sth
18:27:54*astronavt joined #nim
18:28:01FromDiscord<nikki> yea and you can also so `theProc(x.get)`
18:28:10FromDiscord<nikki> if you meant you wanted to use a proc that already exists
18:28:10Zoom[m]Of course I could use get, but it's strange that you can't modify with map
18:28:34FromDiscord<nikki> it's not, map for any mappable literally always means return new value
18:28:41FromDiscord<lqdev> but why'd you want to use map anyways
18:28:45FromDiscord<nikki> the modification is by returning the new value in the proc
18:28:49Zoom[m]Does it change anything? If it doesn't let me :)
18:28:53FromDiscord<lqdev> it's less efficient because you're creating a closure
18:29:04FromDiscord<lqdev> so why use it when you can just `get`
18:29:04FromDiscord<nikki> like: foo.map(proc(x: int) = 2 x)
18:29:10planetis[m]I wonder if sugar.collect can work with option
18:29:26FromDiscord<lqdev> nikki more like `foo.map(proc (x: int): int = 2 x)`
18:29:31FromDiscord<mratsim> there is always an option to collect sugar
18:29:32Zoom[m]Yaah, nikki, you're right
18:29:36FromDiscord<nikki> yea i'm on mobile but u get the idea
18:29:50FromDiscord<nikki> https://discord.com/channels/371759389889003530/371759389889003532/778325292917587989
18:29:55FromDiscord<nikki> did u read this msg or just skip it lol
18:30:01planetis[m]only if we define special syntax for it
18:30:05FromDiscord<nikki> oh wait ur on matrix
18:30:11planetis[m]Lol mratsim
18:30:17hmmmmwoa I think it works now :O
18:30:21Zoom[m]I'm so used to move by default I still think this way
18:30:32hmmmmreturn s[0] & withv was the solution
18:30:58hmmmmthanks nari and zoom
18:31:06FromDiscord<nikki> in any language with mappable types (aka functors) the fn you pass to map is a -> b
18:31:14FromDiscord<nikki> not a -> void with modification
18:32:03FromDiscord<nikki> https://en.m.wikipedia.org/wiki/Functor_(functional_programming)
18:33:00FromDiscord<nikki> Zoom: one thing (the main thing even) this allows you to do is return a value of a different type
18:33:14FromDiscord<nikki> not possible by just modifying the param
18:33:41FromDiscord<nikki> eg. theOpt.map(proc(x: int): string = $x)
18:33:59FromDiscord<nikki> now you get an optional string that either contains the stringified int if it was some, or none if it was none
18:35:21FromDiscord<mratsim> if you want to modify the input use applyIt template from sequtils
18:36:00FromDiscord<mratsim> foo.applyIt(2 it). It's inlined and as efficient as could be in terms of codesize and speed and compiler ease-of-optimization
18:36:57Zoom[m]I had a brainfart, really. What I want is flatMap
18:37:58Zoom[m]mratsim, thanks, but I think applyIt and mapIt are not implemented for options
18:38:44FromDiscord<nikki> i usually just use for loops and eg. foo.get = 3 or whatever even tho i've studied functional stuff :p
18:38:51FromDiscord<nikki> .keepItIf is rly useful tho
18:39:14*bung joined #nim
18:40:13FromDiscord<nikki> Zoom: even flatMap doesn't let you just modify the parameter
18:40:33FromDiscord<nikki> but yeah you can get another level of optionality with flatmap (returning a new option)
18:40:57Zoom[m]Yeah, I see it
18:41:04FromDiscord<mratsim> flatmap is Option[Option[T]] -> Option[U] no?
18:41:22FromDiscord<mratsim> or I'm missing something
18:42:22Zoom[m]Nope, that's just flatten.
18:42:25Zoom[m]https://doc.rust-lang.org/std/option/enum.Option.html#method.and_then
18:42:26Zoom[m]It's and_then in Rust
18:42:43Zoom[m]I want that :D
18:43:11FromDiscord<nikki> i may have forgotten but flatmap acts on an Option[T] and applies a T -> Option[U] fn; then the ultimate result is Option[U]
18:43:22FromDiscord<nikki> you get none if the original was none or if the fn returned none
18:43:23FromDiscord<mratsim> isn't that just map
18:43:34FromDiscord<nikki> no map applies T -> U fn
18:43:56FromDiscord<nikki> you are just able to also return none in the fn in flatMap
18:43:58FromDiscord<mratsim> ok
18:44:19*bung quit (Ping timeout: 272 seconds)
18:44:25FromDiscord<nikki> i mean, i personally think this is all kinda silly and writing imperative normal code that people can read normally is where it's at :p
18:44:41FromDiscord<nikki> the compiler agrees lol
18:44:53FromDiscord<nikki> it's nice for streams tho
18:44:55FromDiscord<mratsim> I can read functional code, but I can't name all the concepts :p
18:45:05Zoom[m]I'm just hooked
18:45:25FromDiscord<nikki> yea i had a pretty solid hooked phase which is when i picked up the concepts πŸ˜„
18:45:36FromDiscord<nikki> Zoom u write any Haskell / ML?
18:45:50*jjido joined #nim
18:45:58Zoom[m]Nope, I get headaches from reading Nix, though.
18:46:06FromDiscord<nikki> lmao
18:46:32FromDiscord<nikki> mratsim: one cool application of flatMap is for "errors"
18:46:38Zoom[m]I'm most fluent with Rust, if you could use 'fluent' on me
18:46:42*hmmmm quit (Remote host closed the connection)
18:46:42FromDiscord<nikki> like imagine if each step can error among a chain of transforms
18:46:51FromDiscord<nikki> if any early one errors you bail
18:47:11FromDiscord<nikki> each step has to be allowed to return Option[K] for whatever K
18:47:35ForumUpdaterBotNew thread by Mildred: How to make code GC-Safe when a global constant is used in a proc ?, see https://forum.nim-lang.org/t/7110
18:47:59FromDiscord<nikki> the funny thing is with a constructor unit and flatmap, you get a monad. that's the two operations it takes /shrug
18:48:52FromDiscord<mratsim> I remember instance type for my Haskell days, and I do use Result monads for error handling in Nim
18:49:14FromDiscord<nikki> nice. what context do you end up doing the error handling in?
18:49:21FromDiscord<mratsim> blockchain
18:49:27FromDiscord<nikki> makes sense
18:49:48FromDiscord<nikki> my main work is in ui or games lol where i still can't decide what the meaningful error system is
18:50:03FromDiscord<nikki> it's usually just something like exceptions with reporting at toplevel
18:50:50FromDiscord<mratsim> for UI exceptions are fine, but for core libraries where you might want multithreading or async, I think you need result enums or Result[T] monad
18:51:04FromDiscord<nikki> agree with that def
18:51:14FromDiscord<nikki> if i'm writing a library, i need to give the lib user the control over errors
18:51:35FromDiscord<nikki> zig's error system was kiiinda nice when i tried it
18:51:44FromDiscord<nikki> it's result enums with some syntax sugar
18:51:53FromDiscord<mratsim> Example: https://github.com/status-im/nimbus-eth2/blob/master/beacon_chain/fork_choice/fork_choice.nim#L172-L179
18:52:15FromDiscord<nikki> looks sensible
18:52:43FromDiscord<mratsim> THe "?" is a template shortcut that does early return on an error Result
18:53:07FromDiscord<nikki> great. nim's flexibility is so good regarding such things
18:53:28FromDiscord<mratsim> can even be used in an if expression: https://github.com/status-im/nimbus-eth2/blob/master/beacon_chain/fork_choice/fork_choice.nim#L240
18:53:57FromDiscord<nikki> yea saw that. one interesting version is also an infix variant that returns the left else the right
18:54:33FromDiscord<nikki> parseSomething() orElse defaultValue
18:58:49Zoom[m]So, I changed my mind. I want a map with a sink.
19:01:46FromDiscord<nikki> Zoom: why not just use normal things like =
19:01:55FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Eva
19:01:59FromDiscord<nikki> Zoom: assigning to things, using if else and loops πŸ˜„
19:02:35FromDiscord<nikki> @Clownstick Von FuckFace lmao uhhh
19:02:49FromDiscord<nikki> if you echo sth in the when does it get executed
19:02:58FromDiscord<nikki> aka is that actually the main module
19:02:58Zoom[m]That's exactly that, but without intermediate variables that serve only for temporarily storing a value you just extracted out of a container, just to put it back
19:03:15FromDiscord<Clownstick Von FuckFace> yeah, if i manually put the dlls there it works
19:03:20FromDiscord<nikki> yeah but those variables are sensible to have. they are actually documentation imo
19:03:30FromDiscord<nikki> otherwise you can just write things pointfree with SKI if you want :p
19:03:44FromDiscord<nikki> @Clownstick Von FuckFace you answered a diff question from the one i asked
19:04:00Zoom[m]hmmmm: what did you end up with?
19:04:20FromDiscord<Recruit_main707> bruh
19:04:42FromDiscord<nikki> @Clownstick Von FuckFace highly recommend static linking tho ;o
19:04:44FromDiscord<Recruit_main707> (discord related)
19:04:50Zoom[m]nikki93: SKI?
19:06:25FromDiscord<nikki> Zoom: https://en.m.wikipedia.org/wiki/SKI_combinator_calculus
19:06:34FromDiscord<nikki> look, no intermediate variables!!!!
19:09:08FromDiscord<Clownstick Von FuckFace> @nikki you;re right but im out of time for a deadline :/
19:09:14*hmmm joined #nim
19:09:20FromDiscord<Clownstick Von FuckFace> now all i want ot do is just write the dlls to the cwd when the binary runs
19:09:37FromDiscord<Clownstick Von FuckFace> butt it seems seems to crash before it can write them
19:09:39FromDiscord<nikki> that might be ... too late
19:09:40*luis__ joined #nim
19:09:41FromDiscord<nikki> yeah
19:09:56FromDiscord<nikki> you can write two exes
19:10:07FromDiscord<nikki> have one exe that writes the real exe and the dlls
19:10:11FromDiscord<nikki> then executes the real exe
19:10:12FromDiscord<nikki> and exits
19:10:14FromDiscord<nikki> lol
19:11:34FromDiscord<nikki> so the meta exe A is just slurp on dll and the other main exe B u made; and B is the one that runs using the dlls
19:13:08hmmmhallo :>
19:13:20hmmmnari nari you there :o
19:14:09Prestigehello
19:14:10FromDiscord<Clownstick Von FuckFace> 😒
19:14:22FromDiscord<Clownstick Von FuckFace> nim + ssl is brutal man
19:14:38hmmmhi prestige
19:14:40FromDiscord<ache of head> What even is your username
19:15:13Prestigesup hmmm
19:15:55*bung joined #nim
19:16:28hmmmI finally have a proc working that takes some floats and output some floats
19:16:39hmmmwhat if I want to take some floats and ints?
19:16:50hmmmhow do I abstract the proc to work with any number
19:17:11FromDiscord<lqdev> use SomeNumber instead of `float`
19:17:19hmmmoh
19:17:27hmmmI'll look in the tutorials
19:17:47FromDiscord<lqdev> you probably want to use an explicit generic for this to return the same type as you pass in: `proc doThings[T: SomeNumber](x: T): T`
19:18:08hmmmI'll look into it
19:18:10FromDiscord<nikki> @Clownstick Von FuckFace it really isn't. most people are fine either sending dlls or they figure out static linking
19:18:36FromDiscord<Clownstick Von FuckFace> @nikki I too am fine sneding dlls now πŸ˜„
19:18:40FromDiscord<Clownstick Von FuckFace> well more or less infe
19:18:51FromDiscord<Clownstick Von FuckFace> I just want to write bytes bfore trying to load the library
19:19:42FromDiscord<nikki> i feel like we spend 60% on the convo on how much this is a problem or not. lots just focus on: try x. did it work? if not what was the full information about how it didn't work. now try y. repeat
19:19:48FromDiscord<nikki> lets just
19:20:05Zoom[m]hmmm, show what you ended up with for sybsetsum
19:20:17hmmmoh it works like a charm
19:20:17FromDiscord<nikki> @Clownstick Von FuckFace try the installer exe approach maybe
19:20:19hmmmI'll show you
19:20:34*bung quit (Ping timeout: 265 seconds)
19:21:05hmmmhttps://play.nim-lang.org/#ix=2Evf
19:21:18hmmmnow I need it to take ints too
19:21:24*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:22:16hmmmbut don't tell me, I'm looking into this T thing
19:23:31Zoom[m]hmmm: look: https://play.nim-lang.org/#ix=2Evh
19:23:55Zoom[m]Do you see the difference?
19:25:30hmmmit's completely different there is an openarray thing, there is a sink and an option and I don't understand half of that :|
19:26:28planetis[m]man stop confusing hmmm
19:26:32narimiran+1
19:26:35hmmmyea do it
19:26:45planetis[m]if i was a noob i wouldn't understand that stuff either
19:26:58narimiranZoom[m]: is your version a try to overwhelm a newcomer?
19:27:02Zoom[m]At least look at the superfluous branching
19:27:04hmmmand you wouldn't be a noob half as big as me
19:27:26planetis[m]nah im sure i was
19:27:32hmmmnono I'm looking at passing some ints to it by using T and somenumber but I'm still researching how to do that
19:27:34narimiranno need for `Option` there
19:27:43Zoom[m]narimiran in no way, I'd like to show what's possible
19:28:48narimiranZoom[m]: showing hmmm what's possible means showing him that he could change the first line to `proc subsetSum[T: SomeNumber](s: seq[T], num: T): seq[T] =` and then use both floats and ints
19:28:49FromDiscord<shashlick> @Clownstick Von FuckFace it won't work for dlls since they are loaded by Nim before your main function is called
19:29:00hmmmaaaaa
19:29:03hmmm:|
19:29:03Zoom[m]I'm a noob too, I don't say I have the correct way or anything like that
19:29:03FromDiscord<shashlick> Tried pinging on telegram but it's broken for me
19:29:19Zoom[m]narimiran, He mentioned other types after I wrote that
19:29:20FromDiscord<shashlick> i made nimdeps for the same use case
19:29:22narimiranZoom[m]: showing him (1) sink, (2) openarray, (3) Option is way too much
19:29:36Zoom[m]I don't see how generics are easier for a noob than an option.
19:29:36FromDiscord<shashlick> you can only work with dlls if they are loaded afterwards either manually using the dynlib module or with something like lazylib
19:29:48FromDiscord<shashlick> but openssl.nim doesn't have support for either
19:30:03Zoom[m]I wanted to start with the obvious - the comparisons
19:30:23narimiranoh, and (4) if expression
19:30:56Zoom[m]hmmm: look, you have 2 branches of your first if that return exactly the same thing
19:31:39FromDiscord<Clownstick Von FuckFace> @shashlick . @nikki can i please buy you 2 coffee :). For now i have a work around using winapi virtualalloc --> create remote thread πŸ˜„
19:31:46FromDiscord<Clownstick Von FuckFace> and it still drops dlls onto disk but for now this will have to do
19:32:02FromDiscord<nikki> lolol
19:32:08narimiranZoom[m]: "you have two branches, let me fix that by introducing 4 new concepts" :P :D
19:32:17Zoom[m]hmmm: AND you compare a variable with 0 and right after that make sure it's < 1.
19:32:19FromDiscord<Clownstick Von FuckFace> also my bad. ive been up for like... 3 days and im a zombie
19:32:24FromDiscord<shashlick> Can you share your code and build steps
19:32:26FromDiscord<Clownstick Von FuckFace> sorry if i wasn't easy to help
19:32:49FromDiscord<Clownstick Von FuckFace> @shashlick yeah sure-- for openssl attempt at static linking, or for the dll workaround?
19:32:51FromDiscord<nikki> i think when asking for help the best you can do is share entire code snd steps etcth
19:32:54Zoom[m]narimiran: c'mon, it's not hard to explain them all one by one with that code.
19:33:05FromDiscord<shashlick> Static
19:33:14FromDiscord<Clownstick Von FuckFace> yeah sure thing. is a zip ok?
19:33:16*luis__ quit (Ping timeout: 240 seconds)
19:33:17FromDiscord<shashlick> You cannot use the dll method like I mentioned above
19:33:18*habamax quit (Ping timeout: 260 seconds)
19:33:21FromDiscord<shashlick> Ya
19:33:23FromDiscord<Clownstick Von FuckFace> 1 sec
19:33:37narimiranZoom[m]: it was hard to explain the difference between `s[0]` and `s`, `result` and `return`; but those 4 won't be hard?
19:34:01narimirando even regular nim users know about `sink`?
19:34:28Zoom[m]narimiran, I wasn't there :D
19:34:42narimiranthat explains your optimism ;)
19:35:03hmmmyea but now I'm a result and return expert
19:35:11hmmmask me anything
19:35:13*luis__ joined #nim
19:35:19narimiranbbl guys, good luck :)
19:35:25hmmmcu :>
19:35:30Zoom[m]BTW, the point is, I thought someone would look at my code too and say a couple of bitter word to me too
19:35:30FromDiscord<nikki> u don't eveen need sink openArray
19:35:32FromDiscord<nikki> that doesn't do anything
19:35:37FromDiscord<nikki> an openArray is already a reference
19:35:51FromDiscord<nikki> er; is already a view really
19:36:13FromDiscord<nikki> you want sink if you're transferring the ownership of something inward
19:37:02Zoom[m]K, that's good to hear.
19:37:12FromDiscord<nikki> there
19:37:17FromDiscord<nikki> there's also not actually less branching?
19:37:28Zoom[m]I just don't have an intuition on when's any copying happen in nim
19:37:32FromDiscord<nikki> or just one fewer
19:37:40FromDiscord<nikki> Zoom: do you understand C?
19:37:42FromDiscord<nikki> if so you can look at the generated C code
19:37:56FromDiscord<nikki> that's what i've been doing usually
19:37:59PrestigeI'm in the same boat as Zoom[m]
19:38:08FromDiscord<nikki> otherwise -- the main thing is that all types are copied, except view types which are just views
19:38:23FromDiscord<nikki> even references are copied (the data they point to is not copied)
19:38:36Zoom[m]Yeah, that's what I was afraid of when I put the superfluous sink there
19:38:39FromDiscord<nikki> you can mark =copy for any type as an error
19:38:46FromDiscord<nikki> openArray is a view type
19:38:55Zoom[m]I got that
19:39:20Prestigehow does a 'view' work, a non-copied ref?
19:40:07Zoom[m]I also got away with seq concatenation and replaced it with growing
19:40:23FromDiscord<nikki> Prestige: underneath usually there's just a pointer. no incref/decref
19:40:32FromDiscord<nikki> a ref, when copied, involves an incref (and a decref when dropped)
19:40:45FromDiscord<nikki> moving a ref involves no inc/dec tho (so eg. if a ref is sunk)
19:41:02FromDiscord<Clownstick Von FuckFace> https://media.discordapp.net/attachments/371759389889003532/778343963525382164/ssl_test.7z
19:41:11FromDiscord<Clownstick Von FuckFace> @shashlick here is my setup
19:41:26FromDiscord<nikki> so in the code `let a = @[...]; use(a)` and then `use` is `proc use(x: seq[...]) = ...` the seq is incref/decref'd but with sink inference or if you had `x: sink seq[...]` there is no incref/decref
19:41:29Prestige@nikki thanks - where's the literature on this btw?
19:41:32FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=
19:41:55FromDiscord<nikki> i mostly was looking at https://nim-lang.org/docs/destructors.html and https://nim-lang.github.io/Nim/manual_experimental.html#view-types
19:42:02FromDiscord<nikki> and also just writing stuff and looking at the gen'd C (highly recommend that)
19:42:31Prestigeah ty ty
19:42:37PrestigeI should learn C I guess
19:42:40FromDiscord<nikki> one thing that's πŸ€” πŸ€” in nim is that strings get copied a ton
19:42:53FromDiscord<nikki> or can be -- by default
19:43:47hmmmso T : Somenumber basically says that the proc can take any kind of int or there is something more subtle I'm missing :o
19:44:36FromDiscord<nikki> hmmm: when you write `proc [T](... blah: T) = ... T ...` etc.
19:44:52FromDiscord<nikki> you're basically saying that `T` is a parameter just like the other normal parameters of a proc
19:44:59FromDiscord<nikki> except in this case it denotes a type (rather than a value)
19:45:07hmmmoh
19:45:10FromDiscord<nikki> er sorry `proc foo[T]`
19:45:27FromDiscord<nikki> but yeah you can also say eg. `proc foo[T: SomeNumber]` or in general `proc foo[T: ...]` where in the `...` you constrain the type somehow
19:45:31FromDiscord<nikki> `SomeNumber` just says it has to be a number
19:46:06FromDiscord<nikki> this is useful to write procs that work over many different types (aka generics)
19:46:13hmmmyes I want that
19:47:11FromDiscord<nikki> nim will basically create a version of your proc for each type that you end up using it (called an 'instantiation')
19:47:19FromDiscord<nikki> this generalizes to many parameters `proc foo[T, U, ...]`
19:47:25hmmmoh this is interesting
19:47:43hmmmso if I call it only with floats will make a version restricted to floats
19:47:44FromDiscord<nikki> you can actually leave out the `: SomeNumber` part, you can just never constrain your generics if you want. the errors will only happen if the code doesn't work when instantiating
19:47:57FromDiscord<nikki> eg. if you had a proc `proc add[T](a, b: T) = a + b`
19:48:08FromDiscord<nikki> it'll work on `add(2, 3)` but fail on `add("hi", "bye")`
19:48:09*jjido joined #nim
19:48:15FromDiscord<nikki> the failure will be because the `+` doesn't work
19:48:24FromDiscord<nikki> but if you said `T: SomeNumber` the failure message will be clearer -- by saying hey this wasn't a number
19:48:31FromDiscord<nikki> instead of saying "hey deep in this code the + didn't work"
19:48:57hmmmyea it's better Somenumber because the input need to be numbers
19:49:09FromDiscord<nikki> yeah it documents that + gives better error messages
19:49:09Zoom[m]<FromDiscord "<nikki> you can actually leave o"> But I think it's better to restrain, just to show your intention. For example, if you designed your code to only work on positive numbers, you better show it with the type system
19:49:17FromDiscord<nikki> + if there's definition checking (not there) it'll definition check
19:49:57FromDiscord<nikki> it does make it so that if you made a Vec2 type for 2d vectors with +, add just wouldn't work, even if you think it should've
19:50:02FromDiscord<nikki> because you prematurely constrained it
19:50:12FromDiscord<nikki> i tend to not constrain them, and only constrain when the need arises, but yeah, that's a subjective thing i guess
19:50:31FromDiscord<nikki> you can go the other way: constrain to the smallest set, and open the constraint as you go
19:50:41hmmmI think I'm still missing something because the compiler still complains about mismatch :"type mismatch: got <float64> but expected 'int literal"
19:50:57FromDiscord<nikki> hard to say what the issue is without looking at the code
19:51:09Zoom[m]It has to show you the line number
19:51:09hmmmha! I can show you that
19:51:28FromDiscord<nikki> (generally we can avoid this extra step by always posting the code for questions we ask)
19:51:44hmmmhttps://play.nim-lang.org/#ix=2Evw
19:52:20FromDiscord<nikki> first off you want `num: T` probably
19:52:44FromDiscord<nikki> this also gives me a different error from the one you posted in your message earlier
19:52:48FromDiscord<nikki> so i'm not sure what code that was about
19:53:01FromDiscord<Rebel> Is there a convenient way to list drives in Nim?
19:53:08hmmmit works if you put 200.00 instead of 200
19:53:18FromDiscord<nikki> yeah the reason is that all of the elements need to have the same type
19:53:22FromDiscord<nikki> and seqs infer their type based on the first element
19:53:28FromDiscord<nikki> try moving the 200 to be the second element
19:53:30FromDiscord<nikki> and not using 200.0
19:54:12hmmm:O
19:54:17hmmmit works
19:54:24FromDiscord<nikki> which thing
19:54:30FromDiscord<nikki> as always, idk what you're talking about :p
19:54:37hmmmand what if the first element is an int :o
19:55:03FromDiscord<nikki> seqs infer their type from the first elem. if the first is an int the rest need to be int
19:55:05FromDiscord<nikki> or convertible to
19:55:09FromDiscord<nikki> (implicitly convertible to)
19:55:44hmmm:o
19:56:32FromDiscord<Clownstick Von FuckFace> @shashlick aside from https://discord.com/channels/371759389889003530/371759389889003532/778343963710717983 though, i tried just cloning choosenim and building it on my windows box, and it throws errors w/ bzip + openssl
19:56:38FromDiscord<Clownstick Von FuckFace> building using nimble build
19:59:39Prestige". AnΒ immutableΒ view type is a view type that is not a mutable view type." Lol
20:00:35FromDiscord<nikki> Prestige: there seem to be some bugs with the view stuff enabled by `--experimental:views`
20:00:48FromDiscord<nikki> the enabled-by-default stuff seems to be working fine toh
20:01:24FromDiscord<nikki> but yeah that's a reason i'm just returning `ptr T` in my ecs wrapper stuff https://github.com/nikki93/ng-public/blob/9a989b537762a90dd4c1c1efab4ed5c42675ea03/src/engine/kernel.nim#L61
20:01:49FromDiscord<nikki> returning `lent T` makes eg. https://github.com/nikki93/ng-public/blob/9a989b537762a90dd4c1c1efab4ed5c42675ea03/src/main.nim#L165 do a copy
20:03:10hmmmnikki if something else in my program happens to pass the first element of my seq as int I can always just change it to float before I call my function and be smooth and happy like a baby right?
20:04:23FromDiscord<nikki> yeah and also a lot of the time you might just be making an empty `var blah: seq[float]` and filling it up
20:04:27FromDiscord<nikki> vs. using seq literals
20:04:36FromDiscord<nikki> (the `@[1, 2, 3]` format is called a literal)
20:05:41hmmmwhat is the difference between using one form or the other :o
20:06:10FromDiscord<nikki> try them out and see
20:06:39hmmmvar blah seq float means I need too find an append method?
20:06:56FromDiscord<nikki> yeah that's just `blah.add(2)`
20:06:59FromDiscord<nikki> for example
20:07:01hmmmperfect
20:07:02hmmmI'll try
20:09:49FromDiscord<shashlick> @Clownstick Von FuckFace what's your error
20:10:36disruptekwho wants to write me a simple macro useful enough that it could end up in, say, fusion? 😁
20:12:24FromDiscord<shashlick> @Clownstick Von FuckFace your project compiled and ran just fine for me
20:12:44FromDiscord<nikki> i think they said that they had it working
20:12:56FromDiscord<nikki> and were just posting it for reference
20:13:39*luis__ quit (Remote host closed the connection)
20:15:01hmmmnikki what is the nim version of float(int)
20:15:35*NimBot joined #nim
20:15:42hmmmconverting an int to float
20:15:51FromDiscord<nikki> cast[float](...)
20:15:55FromDiscord<shashlick> meh
20:15:58FromDiscord<nikki> or .asFloat
20:16:00FromDiscord<nikki> actually the latter
20:16:02FromDiscord<nikki> sry
20:16:09hmmmperfect
20:16:10hmmmthanks
20:16:13FromDiscord<nikki> !eval echo 2.asFloat
20:16:15NimBotCompile failed: /usercode/in.nim(1, 7) Error: undeclared field: 'asFloat' for type system.int [declared in /playground/nim/lib/system/basic_types.nim(2, 3)]
20:16:21mipri!eval echo (4.float, float(4))
20:16:24FromDiscord<nikki> ugh it's toFloat
20:16:25NimBot(4.0, 4.0)
20:16:29FromDiscord<nikki> i think?
20:16:43FromDiscord<nikki> looks like the nim version of float(int) is float(int)
20:16:58hmmmhmm
20:17:01hmmmthat's convenient
20:17:10FromDiscord<nikki> only bc. you already know float(int) πŸ™‚
20:17:15hmmm:D
20:18:03FromDiscord<nikki> !eval echo 4.toFloat
20:18:06NimBot4.0
20:18:14FromDiscord<nikki> i like the toX versions
20:18:59miprihttps://github.com/nim-lang/Nim/blob/version-1-4/lib/system.nim#L1436
20:20:08mipri!eval echo (toInt(4.5), int(4.5)) # meanwhile
20:20:11NimBot(5, 4)
20:20:55FromDiscord<nikki> i tend to explicitly round or floor when doing that
20:23:40hmmmnikki what is the nim version of "if type(7) == int: do something"
20:23:57mipris/==/is/
20:25:23planetis[m]when typepof(T):
20:25:45hmmmthanks planetis <:
20:25:45planetis[m]forgot the `== int`
20:25:55hmmmI think there is an anime called like you
20:26:08planetis[m]i've seen it
20:26:12hmmmpretty good
20:26:21planetis[m]agreed
20:27:35*lf_araujo joined #nim
20:30:33FromGitter<sealmove> wow I run into a stupid problem. my module exposes a symbol that has the same name as the module
20:30:51FromGitter<sealmove> and when i try to use the symbol, nim assumes i mean the module namespace
20:30:59FromGitter<sealmove> don't know how to get around this
20:31:30FromDiscord<Recruit_main707> rename one of the two
20:32:28planetis[m]is it a proc?
20:32:41FromGitter<sealmove> it's a tuple of 2 procs
20:32:45FromDiscord<Recruit_main707> probably a type
20:33:11planetis[m]bc i remembered defining a proc with the same name with module and it worked
20:33:24FromDiscord<Recruit_main707> using uppercase in one and lowercase in the other one can fix it
20:33:41FromGitter<sealmove> oh that's a smart idea, will probably go with this
20:33:53lf_araujoHi all, I am setting up Nimdow, anyone willing to share dots for the statuses (right hand side of the panel). I wanted something to use as a base
20:33:58*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:37:31FromDiscord<Clownstick Von FuckFace> @shashlick https://pastebin.com/c1YkzyKh
20:38:41FromDiscord<shashlick> @Clownstick Von FuckFace i don't see that when i compile - what's in C:\Users\User\nimcache\nimterop\nimopenssl
20:38:53FromDiscord<shashlick> there should be a json file - if you can share that
20:39:18FromDiscord<Clownstick Von FuckFace> yup! 1 sec
20:41:26FromDiscord<Rebel> I am trying to get the logical drives and am not sure what I am doing wrong, before I switch to GetLogicalDriveStringsW just curious is it because of how I am shifting bits? https://play.nim-lang.org/#ix=2EvR
20:41:34Prestigelf_araujo: hey, what would you like in your status?
20:42:11lf_araujovolume status
20:43:31PrestigeI use pamixer for that, one moment
20:44:24FromDiscord<shashlick> @Clownstick Von FuckFace most likely, your issue is that your mingw version is pretty old
20:44:51FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=
20:45:05FromDiscord<Clownstick Von FuckFace> im using hte mingw installed by choosenim πŸ˜„
20:45:17lf_araujo<Prestige> thanks
20:45:25Prestigelf_araujo: https://0x0.st/i59W.bin
20:45:39FromDiscord<Clownstick Von FuckFace> (edit)
20:45:41FromDiscord<shashlick> @Clownstick Von FuckFace what's the output of `gcc --version`
20:46:05FromDiscord<shashlick> then its mostly cause you don't have some msvc runtime installed
20:46:08*narimiran quit (Ping timeout: 260 seconds)
20:46:11FromDiscord<shashlick> https://www.freebasic.net/forum/viewtopic.php?t=26422
20:46:11PrestigeTo refresh on volume change, I have my hotkey daemon kill the sleep in the while loop when I change volume
20:46:11FromDiscord<Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2EvV
20:46:23PrestigeThere's probably a better solution with dwmblocks
20:46:31FromDiscord<shashlick> @Clownstick Von FuckFace i'm running 9.3.0 on my machine
20:47:10FromDiscord<Clownstick Von FuckFace> that is super old you're right
20:47:32FromDiscord<shashlick> try getting a newer mingw, if that also doesn't work then might need to see which msvc runtime you are missing
20:47:33lf_araujo<Prestige> can you confirm the link, it is pointing to a file, it seems
20:47:51PrestigeYeah, it's just a shell script I just wrote
20:47:57FromDiscord<Clownstick Von FuckFace> yeah looks like choosenim bundles an old mingw
20:48:10FromDiscord<ElegantBeef> @Rebel i dont know how to solve your problem, but just wanted to show this https://play.nim-lang.org/#ix=2EvY
20:48:10FromDiscord<shashlick> i'm testing on win10 1909 which is quite recent
20:48:25FromDiscord<Clownstick Von FuckFace> how did you install nim btw?
20:48:41Prestigelf_araujo: https://pastebin.com/NfvjWmAD if that's better for you
20:48:44FromDiscord<Clownstick Von FuckFace> choosenim is fine right?
20:48:45lf_araujo<Prestige> ok, got it, thanks
20:49:05FromDiscord<shashlick> i use choosenim, yes - but install mingw before nim
20:49:09FromDiscord<shashlick> i use scoop to install gcc
20:49:12lf_araujo<Prestige> How do I call it from the toml?
20:49:28FromDiscord<shashlick> 6.3.0 is the version of gcc posted on nim-lang.org
20:49:35FromDiscord<shashlick> that should get upgraded at some point
20:49:52FromDiscord<Clownstick Von FuckFace> gotcha
20:49:52Prestigeyou can put it it the autostart lf_araujo https://github.com/avahe-kellenberger/nimdow/blob/master/config.default.toml#L23
20:50:06lf_araujogreat, thanks
20:50:08Prestigejust make sure to chmod +x the script
20:52:05Prestigeyou can check out https://dwm.suckless.org/status_monitor/ for more status stuff, dwm and nimdow work the same in that regard
20:52:37lf_araujowill do, thanks
20:55:48*lf_araujo quit (Quit: WeeChat 2.9)
21:00:58*haxscramper quit (Remote host closed the connection)
21:04:03*bung joined #nim
21:08:13*bung quit (Ping timeout: 246 seconds)
21:15:22*luis1 joined #nim
21:22:06hmmmcough cough
21:22:55hmmmso I've implemented both the literal @[1,2,3] and seq[float] seqs but still see no difference, they both work :o
21:23:24FromDiscord<nikki> the difference isn't that one of them doesn't work
21:23:52FromDiscord<nikki> the literal case is for when you have the element list literally in your code
21:23:59hmmmaaaaah ok
21:24:01hmmmI see
21:25:18*luis1 quit (Quit: WeeChat 2.9)
21:27:59hmmmwell if it's true that a seq can only be of one type I can just revert back to the simpler non generic float proc and just make some logic to check what gets added in the seq, if it's an int convert it first to float
21:28:36FromDiscord<nikki> the seq is of one type -- `seq[T]`
21:28:53FromDiscord<nikki> what you're getting at is that all the elements are of one type
21:29:02hmmmbut I can specify seq[float] and all the elements will be float right?
21:29:09hmmmyea!
21:29:18FromDiscord<nikki> that's what it means when you say `seq[float]`, yeah
21:29:31hmmmlol sorry I'm a bit of a caveman
21:30:44FromDiscord<Clownstick Von FuckFace> @shassard same error. Can you link me where you installed mingw from?
21:31:06FromDiscord<shashlick> https://scoop.sh
21:31:09FromDiscord<shashlick> scoop install gcc
21:31:26FromDiscord<shashlick> but better to check msvc runtimes
21:31:30FromDiscord<shashlick> what version of windows
21:31:40*natrys quit (Ping timeout: 246 seconds)
21:33:19FromDiscord<Clownstick Von FuckFace> windows 10 deval
21:35:06FromDiscord<Clownstick Von FuckFace> did you install nim via choose nim?
21:35:48FromDiscord<shashlick> yes
21:36:04FromDiscord<shashlick> but since i install gcc before nim, choosenim doesn't install mingw as well
21:36:10FromDiscord<shashlick> it detects it in the path and moves on
21:36:30FromDiscord<shashlick> you can simply download the x64 version of nim from the website and unzip, add to path
21:44:24*natrys joined #nim
21:45:05*natrys quit (Client Quit)
21:45:48*jjido joined #nim
21:55:06disruptekhttp://ix.io/2Ewr/nim
21:56:38FromGitter<sealmove> is there a way to control the endian used by system.read[T]?
22:00:06FromDiscord<Clownstick Von FuckFace> @shashlick you beautiful fucking wizard πŸ˜„
22:03:48FromGitter<sealmove> Oh wow I found a gimmick
22:04:16FromGitter<sealmove> If you have a single-fielded tuple, then the syntax `(val)` doesn't construct a tuple
22:04:26FromGitter<sealmove> a workaround is using `(val),`
22:04:42FromGitter<sealmove> sorry `(val,)` *
22:04:59FromGitter<sealmove> maybe this is mentioned in docs, not sure
22:06:26FromGitter<sealmove> yup it is apparently: https://nim-lang.org/docs/manual.html#types-tuples-and-object-types
22:10:41*PMunch quit (Quit: leaving)
22:11:12FromDiscord<shashlick> Did it work?
22:16:41*hmmm quit ()
22:17:49*hmmm joined #nim
22:31:32*astronavt quit (Quit: ...)
22:32:01*astronavt joined #nim
22:32:05FromDiscord<Rebel> What is the equivalent in Nim to Python's `\` have a pretty long multi level ternary that will look horrendous on one line
22:32:25FromDiscord<ElegantBeef> We dont have that, we just newline between operators
22:32:40FromDiscord<Rebel> alright it will just look really bad that is fine
22:32:42FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2EwF
22:32:47FromDiscord<Rebel> oh
22:33:12FromDiscord<ElegantBeef> the whole `\` just ugh imo
22:36:02*astronavt quit (Remote host closed the connection)
22:36:03*luis1 joined #nim
22:37:06*luis1 quit (Client Quit)
22:37:18*astronavt joined #nim
22:39:17hmmmhmmm
22:39:33FromDiscord<Clownstick Von FuckFace> @shashlick it did πŸ˜„
22:39:45FromDiscord<martinium> are there plans to add a REPL to NIM?
22:39:50FromDiscord<Clownstick Von FuckFace> and i also got libcurl to work πŸ˜„
22:39:56FromDiscord<ElegantBeef> It has one, but we also have inim
22:39:59FromDiscord<nikki> @martinium inim is a repl
22:40:01FromDiscord<ElegantBeef> `nim secret`
22:40:14FromDiscord<martinium> boom
22:40:17FromDiscord<martinium> nim secret
22:40:19FromDiscord<martinium> love it
22:40:24FromDiscord<martinium> thanks
22:40:30FromDiscord<ElegantBeef> Iirc it's nimscript, so you may want to use inim
22:40:42FromDiscord<Clownstick Von FuckFace> @shashlick πŸ₯³
22:41:17FromDiscord<martinium> iNim wins
22:41:53*Vladar quit (Remote host closed the connection)
22:43:22FromDiscord<shashlick> @Clownstick Von FuckFace πŸ‘
22:44:43FromDiscord<Clownstick Von FuckFace> wonder if theres a way to cross compile w/ win. for another time πŸ˜„
22:44:52FromDiscord<Clownstick Von FuckFace> (edit) "win." => "wine."
22:45:05FromDiscord<Clownstick Von FuckFace> (edit) "w/ wine." => "from linux."
22:52:10*bung joined #nim
22:54:15hmmmwhat do fmReadWrite, fmReadWriteExisting do different from fmWrite
22:55:12FromDiscord<ElegantBeef> readwrite allows both reading/writing, readwriteexisting doesnt clear the file if it exists
22:55:59FromDiscord<ElegantBeef> https://github.com/nim-lang/Nim/blob/version-1-4/lib/system/io.nim#L23
22:56:28FromDiscord<nikki> the docs / comments answer a lot of your questions hmmm
22:56:36*bung quit (Ping timeout: 240 seconds)
22:56:49FromDiscord<Rebel> Am I missing something very silly? Trying to create a pair of new headers and just basing it off the example in httpclient `newHttpHeaders({ "Content-Type": "application/json" })` https://play.nim-lang.org/#ix=2Ex0
22:56:50hmmmty both :>
23:02:02hmmmthose comments are actually very informative
23:02:14*bung joined #nim
23:17:30FromDiscord<nikki> you can learn a ton by browsing around the docs and the comments in the code; highly recommend it
23:21:24hmmmsome are pretty fun: "returns the file handle of the file ``f``.Note that on Windows this doesn't return the Windows-specific handle,but the C library's notion of a handle, whatever that means.Use `getOsFileHandle` instead."
23:21:31*tane quit (Quit: Leaving)
23:21:47hmmmsome are way over my level tho
23:22:03FromDiscord<nikki> every word you don't understand can be googled ;D
23:22:15FromDiscord<nikki> also quick q -- is there a way to mark all symbols as exported?
23:22:18FromDiscord<nikki> or like push exported or something
23:22:31FromDiscord<nikki> i have a module with a bunch of types for which all of the code is in other files
23:28:22FromDiscord<exelotl> This is a really excellent thread comparing the landing page and tutorials of various programming languages: https://twitter.com/ChevyRay/status/1328763798388236291
23:29:51FromDiscord<exelotl> maybe we could take some learnings from it to try and improve Nim's landing page in the future
23:42:30hmmmyou can define new procs inside the defining of a proc?
23:42:38hmmm:o
23:48:26FromDiscord<nikki> ya
23:48:49FromDiscord<nikki> hmmm: i'd suggest checking out some book or other organized introduction to nim -- "nim in action" is pretty good
23:49:09hmmmI've read tutorial 1
23:49:14hmmmtutorial 2 was pretty hard
23:49:24hmmmI'll try the book
23:55:29FromDiscord<Rebel> Is there a convenient way where if I have an array that has default values in it to just get a new array with non default values?
23:57:03FromDiscord<nikki> `let a = [1, 2, 3]`?
23:57:53FromDiscord<ElegantBeef> if it's not in the main body you can `var a {.noinit.}: array[3,int]` and that gives nice random data
23:58:49FromDiscord<ElegantBeef> Doesnt give non default 100%, just whatever was the previously
23:59:51disruptekexelotl: i looked at the landing page recently and tried to make a list of categories to highlight. the problem is that our concurrency story is pretty creepy.