00:05:06 | FromGitter | <ynfle> It seems like there is an issue with reassigning an array that is `var` with values from it self |
00:05:29 | FromDiscord | <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:50 | FromDiscord | <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:15 | FromGitter | <ynfle> You mean `mixin` & `bind`? |
00:06:58 | FromGitter | <ynfle> I think you are looking for one of those |
00:07:08 | FromDiscord | <nikki> _looks this up_ |
00:08:26 | FromGitter | <ynfle> https://nim-lang.org/docs/manual.html#generics-mixin-statement |
00:08:36 | FromGitter | <ynfle> https://nim-lang.org/docs/manual.html#symbol-lookup-in-generics-open-and-closed-symbols |
00:10:29 | Zoom[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:38 | FromGitter | <sealmove> opinion? https://github.com/sealmove/n4n6 |
00:13:43 | FromGitter | <ynfle> Use BackwardIndex |
00:13:52 | FromGitter | <ynfle> `x[1..^1]` |
00:14:17 | FromGitter | <ynfle> The reason is, I think, because no postfix operators |
00:15:33 | * | ehmry joined #nim |
00:17:50 | Zoom[m] | @ynfle , thanks |
00:17:59 | FromGitter | <ynfle> π |
00:18:41 | * | gangstacat joined #nim |
00:33:17 | jonjitsu[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:56 | FromDiscord | <Clownstick Von FuckFace> how can you statically link openssl to a nim binary on windows? |
00:51:10 | * | abm quit (Quit: Leaving) |
00:51:48 | FromDiscord | <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:47 | FromDiscord | <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:35 | FromDiscord | <juan_carlos> using |
00:59:23 | FromDiscord | <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:48 | FromDiscord | <nikki> so you wanna do `let a2 = a; let b2 = b;` and then use `a2`, `b2` instead |
01:01:41 | FromDiscord | <Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Eqk |
01:01:56 | FromDiscord | <Clownstick Von FuckFace> namely, with the -d:ssl flag. |
01:02:29 | FromGitter | <ynfle> Many compiled binaries work without nim |
01:04:17 | FromDiscord | <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:30 | FromDiscord | <nikki> and i want to show a nice trace for the other NimNode's instantiation |
01:04:32 | FromDiscord | <Clownstick Von FuckFace> right but anytime i compile with -d:ssl i get libcrypto-1_1-x64.dll was not found |
01:04:39 | FromDiscord | <Clownstick Von FuckFace> that dll is setup when choosenim is run |
01:04:48 | FromGitter | <ynfle> Static linking was just asked |
01:04:58 | FromGitter | <ynfle> I'm not sure about it too much but it can be done |
01:05:10 | FromGitter | <ynfle> @nikki, just add the let to you template |
01:05:21 | FromDiscord | <nikki> ynfle: yeah i'm going with that for now |
01:05:28 | FromGitter | <ynfle> π |
01:05:38 | FromGitter | <ynfle> You won't see it anyways so it doesn't make a difference |
01:07:10 | FromDiscord | <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:34 | FromDiscord | <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:06 | FromDiscord | <Rika> its kinda complicated, a few things need to be done to do such |
01:33:28 | FromDiscord | <Rika> especially that youre on windows, i have no idea how to compile statically on windows |
02:09:16 | FromDiscord | <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:14 | FromDiscord | <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:31 | FromDiscord | <emizzle> sent a code paste, see https://play.nim-lang.org/#ix=2Eqz |
02:14:57 | * | apahl joined #nim |
02:15:27 | FromDiscord | <Rika> remove the r before the "" |
02:16:53 | FromDiscord | <emizzle> Ah, of course, thanks! |
02:19:18 | FromDiscord | <Clownstick Von FuckFace> not being able to compile standalone apps with ssl seems like a huge blocking factor to nim becoming popular |
02:19:51 | FromDiscord | <Rika> well you deffo can |
02:19:55 | FromDiscord | <Rika> i just dont know how on windows |
02:44:36 | FromDiscord | <nikki> @Clownstick Von FuckFace have you tried shipping the dll with the application? a lot of windows games and apps do that |
02:44:52 | FromDiscord | <nikki> but yeah personally i use a CMake setup that just statically incorporates all of my dependencies |
02:45:12 | FromDiscord | <nikki> https://github.com/nikki93/ng-public <-- CMakeLists.txt + run.sh here should show how it works |
02:46:25 | FromDiscord | <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:14 | FromDiscord | <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:34 | FromDiscord | <Clownstick Von FuckFace> soryr, I am having a lot of trouble w/ this, thanks a buch for the help! |
03:16:05 | FromDiscord | <Clownstick Von FuckFace> i think linking directly against those binaries is the move |
03:16:10 | FromDiscord | <Clownstick Von FuckFace> do you have an example for how to do that? |
03:16:24 | FromDiscord | <Clownstick Von FuckFace> and I cannot ship all the dlls w/ the app, has ot be standalone π |
03:17:44 | FromDiscord | <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:17 | FromDiscord | <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:24 | FromDiscord | <nikki> the link from the openssl wiki above contains links to find openssl '.lib' binaries i believe |
03:22:27 | FromDiscord | <nikki> you can statically link with those |
03:22:40 | FromDiscord | <nikki> i'm not at a windows computer right now so i can't try it out |
03:22:55 | FromDiscord | <Clownstick Von FuckFace> with `--passL:blah.a`? |
03:23:12 | FromDiscord | <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:39 | FromDiscord | <nikki> windows libraries usually end in '.lib' as just mentioned |
03:23:48 | FromDiscord | <nikki> so probably `--passL:blah.lib` |
03:23:56 | FromDiscord | <nikki> but, could be that they end in '.a' in this case due to mingw |
03:24:07 | FromDiscord | <Clownstick Von FuckFace> kk just wana makse sure i got the syntax right. Thanks! |
03:24:10 | FromDiscord | <Clownstick Von FuckFace> illgive it a try |
03:24:11 | FromDiscord | <nikki> er `--passL:-lblah.lib` |
03:24:16 | FromDiscord | <nikki> are you using mingw as nim's compiler? |
03:24:17 | FromDiscord | <nikki> or msvc |
03:24:21 | FromDiscord | <nikki> (aka vcc) |
03:24:22 | FromDiscord | <Clownstick Von FuckFace> mingw |
03:24:31 | FromDiscord | <nikki> cool, yeah `-l` should work |
03:24:32 | FromDiscord | <Clownstick Von FuckFace> ideally trying to cross compile on my ubuntu box |
03:24:39 | * | cgfuh quit (Quit: WeeChat 2.9) |
03:25:29 | FromDiscord | <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:32 | FromDiscord | <Clownstick Von FuckFace> hmm still having trouble |
04:13:34 | FromDiscord | <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:13 | FromDiscord | <Clownstick Von FuckFace> `--passL:-lcrypto --passL:-lssl ` flags crash the program |
04:14:23 | FromDiscord | <Clownstick Von FuckFace> (edit) "--passL:-Lpath/home/kbsec/openssl/libssl.dll.a" => "--passL:-Lpath/home/me/openssl/libssl.dll.a" |
04:15:14 | FromDiscord | <nikki> make sure to use the static version |
04:15:26 | FromDiscord | <nikki> .dll.a may be the static part of a dynamic combo or sth |
04:15:49 | FromDiscord | <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:52 | FromDiscord | <Clownstick Von FuckFace> it just doesn't do aything |
04:16:11 | FromDiscord | <Clownstick Von FuckFace> So i actually compilled openssl from src for mingw |
04:16:58 | * | fowl joined #nim |
04:17:24 | FromDiscord | <Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2EqS |
04:17:36 | FromDiscord | <Clownstick Von FuckFace> tried both |
04:18:14 | * | hpyc9 quit (Quit: 420) |
04:18:47 | FromDiscord | <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:11 | FromDiscord | <Clownstick Von FuckFace> the file size is the same |
04:19:39 | * | hpyc9 joined #nim |
04:20:06 | FromDiscord | <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:44 | FromDiscord | <shashlick> @Clownstick Von FuckFace please see choosenim nims file |
04:29:25 | FromDiscord | <Clownstick Von FuckFace> https://github.com/dom96/choosenim/blob/master/src/choosenim.nim ? this just drops the dlls on disk |
04:29:39 | FromDiscord | <Clownstick Von FuckFace> I want to ship a single binary |
04:37:42 | FromDiscord | <nikki> @Clownstick Von FuckFace the `-L` needs the linker path, not path to the file itself |
04:38:18 | FromDiscord | <nikki> also one time you said crash the program, the other time you said crash compilation -- which one is it? |
04:38:26 | FromDiscord | <Clownstick Von FuckFace> ahh sorry |
04:38:44 | FromDiscord | <Clownstick Von FuckFace> theres a distinction: sompilation won't work if I pass `-lscrypto` and `-lssl` |
04:38:46 | FromDiscord | <nikki> you need to do `--passL:-L<path to where libs are>` |
04:38:56 | FromDiscord | <Clownstick Von FuckFace> but if i don't, then it doens't get linked |
04:39:03 | FromDiscord | <nikki> and then `--passL:-l<name of lib without path>` |
04:39:27 | FromDiscord | <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:36 | FromDiscord | <nikki> let's focus on fixing it π |
04:39:42 | FromDiscord | <Clownstick Von FuckFace> β€οΈ |
04:39:47 | FromDiscord | <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:52 | FromDiscord | <Rika> statically building anything on windows sounds like a pain |
04:40:02 | FromDiscord | <nikki> it's pretty easy for me with cmake haha |
04:40:38 | FromDiscord | <nikki> actually. scratch that. it's not easy lmao. but once you have it working it basically seems to keep working |
04:40:47 | FromDiscord | <Rika> thats true |
04:41:00 | FromDiscord | <Rika> just copy paste and change some stuff for other libs |
04:41:08 | FromDiscord | <Clownstick Von FuckFace> so that command works fine for linux with libssl-dev installed |
04:41:22 | FromDiscord | <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:28 | FromDiscord | <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:10 | FromDiscord | <nikki> this is all pretty general. do you have some '.a' files, and a path they're at? |
04:42:18 | FromDiscord | <nikki> if so you can do -L<path> and -l<per lib> |
04:42:34 | FromDiscord | <nikki> make sure to use the same compiler as the one nim uses |
04:42:40 | FromDiscord | <nikki> msvc and mingw are allegedly compatible but yeah |
04:43:11 | FromDiscord | <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:51 | FromDiscord | <nikki> i've never really tried that but -- maybe? |
04:44:02 | FromDiscord | <nikki> the way i 'hard code' it personally is by having nim only generate C output and then compiling that myself xD |
04:44:34 | FromDiscord | <nikki> are you able to eg. just build a hello world windows executable and run it on windows / wine? |
04:44:56 | FromDiscord | <Clownstick Von FuckFace> oh yeah that all works |
04:45:04 | FromDiscord | <Clownstick Von FuckFace> my application works flawleslly without -d:ssl enabled |
04:45:14 | FromDiscord | <nikki> so you're already using a windows-compatible compiler with nim right |
04:45:19 | FromDiscord | <Clownstick Von FuckFace> yup! |
04:45:21 | FromDiscord | <nikki> then it makes sense to use that to build ssl |
04:45:39 | FromDiscord | <nikki> once you've done that, do the equiv of -L and -l with the resulting libs |
04:45:44 | FromDiscord | <nikki> making sure to build them with static flags and not shared |
04:45:48 | FromDiscord | <nikki> .dll.a is suspicious |
04:46:03 | FromDiscord | <nikki> the makefile might have some flags to enable static build |
04:48:05 | FromDiscord | <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:07 | FromDiscord | <Clownstick Von FuckFace> like so? |
04:48:36 | FromDiscord | <nikki> so in the wall of text above |
04:48:43 | FromDiscord | <nikki> the thing i was trying to clarify is that -L takes the directory |
04:48:46 | FromDiscord | <nikki> not the file |
04:48:56 | FromDiscord | <Clownstick Von FuckFace> ohhhhhhh |
04:49:08 | FromDiscord | <Clownstick Von FuckFace> so if both of my libs are in 1 folder i only need 1 passL |
04:49:36 | FromDiscord | <nikki> https://discord.com/channels/371759389889003530/371759389889003532/778117153521401866 |
04:49:58 | FromDiscord | <Clownstick Von FuckFace> ...sorry my brains kinda fried right now π
|
04:50:01 | FromDiscord | <Clownstick Von FuckFace> that you did |
04:50:28 | FromDiscord | <nikki> -L<path where libs are> -l<lib1Name> -l<lib2Name> |
04:51:23 | FromDiscord | <nikki> i wonder how `-d:ssl` and `--dynlibOverride:ssl` interact with all this. never used those / not familiar with them |
04:52:13 | FromDiscord | <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:45 | FromDiscord | <Clownstick Von FuckFace> hmm |
04:54:59 | FromDiscord | <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:40 | FromDiscord | <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:42 | FromDiscord | <nikki> in what you pasted there are no spaces in the passL sstuff |
04:57:13 | FromDiscord | <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:28 | FromDiscord | <nikki> there are 3 options to pass |
04:57:28 | FromDiscord | <shashlick> @Clownstick Von FuckFace wrong file - https://github.com/dom96/choosenim/blob/master/src/choosenim.nims |
04:57:55 | FromDiscord | <nikki> `--passL:-L/path/to/where/libs/are --passL:-lcrypto --passL:-lssl` |
04:58:33 | FromDiscord | <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:44 | FromDiscord | <shashlick> during the build process |
04:58:51 | FromDiscord | <shashlick> choosenim is distributed as a standalone binary |
05:01:54 | FromDiscord | <nikki> how much is `--exceptions:goto` supported btw? seems to have codegen errors with 'std/json' |
05:02:11 | FromDiscord | <ElegantBeef> Isnt that used for arc? |
05:02:33 | FromDiscord | <Clownstick Von FuckFace> so it does compile but i still get `could not load: (libssl-1_1-x64|ssleay64|libssl64).dll` |
05:02:46 | FromDiscord | <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:48 | FromDiscord | <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:14 | FromDiscord | <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:28 | FromDiscord | <ElegantBeef> Where is are pure nim ssl stuff π |
05:03:33 | FromDiscord | <ElegantBeef> (edit) "are" => "our" |
05:03:38 | FromDiscord | <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:18 | FromDiscord | <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:33 | FromDiscord | <Clownstick Von FuckFace> so thats the good news |
05:04:50 | FromDiscord | <Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Er1 |
05:04:56 | FromDiscord | <Clownstick Von FuckFace> which means it is finding the names correctly |
05:05:00 | FromDiscord | <shashlick> see the nims file dude, there's a known bug in nim that's worked around |
05:05:11 | FromDiscord | <Clownstick Von FuckFace> checking |
05:05:17 | FromDiscord | <shashlick> #15220 |
05:05:19 | disbot | https://github.com/nim-lang/Nim/issues/15220 -- 3OpenSSL static linking on Windows ; snippet at 12https://play.nim-lang.org/#ix=2Er2 |
05:05:33 | FromDiscord | <Rika> i think exceptions goto doesnt give any useful benefits on c++ |
05:05:50 | * | vicfred joined #nim |
05:06:04 | FromDiscord | <nikki> @Rika hmm word. i was mostly enabling it bc. in the emscripten build i disable exceptions for c++ / it does that |
05:06:09 | FromDiscord | <nikki> but in any case i don't care that much. down for a crash lol |
05:08:48 | FromDiscord | <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:12 | FromDiscord | <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:46 | FromDiscord | <shashlick> note how dynliboverride calls have a `-` at the end |
05:10:55 | FromDiscord | <shashlick> and the sslVersion define |
05:11:05 | FromDiscord | <shashlick> see the issue linked above for the reason its broken on windows |
05:11:29 | FromDiscord | <shashlick> ssl.nim is to download the static libs and link them in - not essential but just easy |
05:11:41 | FromDiscord | <shashlick> but note that nimterop doesn't work in cross-compile scenario |
05:11:45 | FromDiscord | <shashlick> so -d:mingw will break it |
05:15:45 | * | thomasross quit (Ping timeout: 240 seconds) |
05:16:08 | FromDiscord | <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:11 | FromDiscord | <Clownstick Von FuckFace> https://media.discordapp.net/attachments/371759389889003532/778126310962626588/unknown.png |
05:16:48 | FromDiscord | <Clownstick Von FuckFace> thanks for the tip @shashlick π |
05:17:07 | FromDiscord | <Clownstick Von FuckFace> were you directing me to the choosenim because of the extra falgs? |
05:17:19 | FromDiscord | <shashlick> yes in the nims file |
05:17:57 | FromDiscord | <Clownstick Von FuckFace> so this is really close! |
05:18:06 | FromDiscord | <Clownstick Von FuckFace> the only thing missing i think is its not actually adding `libssl-3-x64.dll` for some reason |
05:18:41 | FromDiscord | <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:38 | FromDiscord | <shashlick> just not cross compile capable |
05:21:30 | FromDiscord | <shashlick> do you have libssl.a and libcrypto.a for windows on your system |
05:21:40 | FromDiscord | <Clownstick Von FuckFace> yup! |
05:21:55 | FromDiscord | <Clownstick Von FuckFace> and it works if i drop the dlls for the associated libraries |
05:22:13 | FromDiscord | <shashlick> that simply means that it didn't statically link |
05:22:18 | FromDiscord | <Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Er4 |
05:22:49 | FromDiscord | <Clownstick Von FuckFace> yup! gathered that much π the dlls weren't included for in the binary |
05:23:05 | FromDiscord | <shashlick> why do you have -Bstatic for passL |
05:24:11 | FromDiscord | <Clownstick Von FuckFace> blindly referencing https://github.com/nim-lang/Nim/issues/15220 |
05:24:12 | disbot | β₯ OpenSSL static linking on Windows ; snippet at 12https://play.nim-lang.org/#ix=2Er2 |
05:25:33 | FromDiscord | <shashlick> hmm\ |
05:27:12 | FromDiscord | <Clownstick Von FuckFace> https://play.nim-lang.org/#ix=2Er2 appears to have the same issue |
05:28:26 | FromDiscord | <Clownstick Von FuckFace> the refs are overwritten, but it still expects dlls on the box |
05:28:58 | FromDiscord | <shashlick> no need to copy it over |
05:29:14 | FromDiscord | <shashlick> well, maybe you do |
05:29:50 | FromDiscord | <shashlick> do you have a mingw version of ldd |
05:29:56 | FromDiscord | <shashlick> well, even that won't heo |
05:29:59 | FromDiscord | <shashlick> (edit) "heo" => "help" |
05:30:17 | FromDiscord | <shashlick> what version of nim you using |
05:30:47 | FromDiscord | <Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Er5 |
05:33:13 | FromDiscord | <Rika> man im glad i dont need static bins for my projects |
05:33:52 | FromDiscord | <nikki> i love static bins |
05:34:19 | FromDiscord | <PizzaFox> whats `--asm` do |
05:37:33 | FromDiscord | <Clownstick Von FuckFace> to confirm does not work on windows either |
05:37:35 | FromDiscord | <Clownstick Von FuckFace> https://media.discordapp.net/attachments/371759389889003532/778131697530437642/unknown.png |
05:37:39 | FromDiscord | <shashlick> @Clownstick Von FuckFace `nim c -d:mingw -d:ssl -d:noOpenSSLHacks --dynlibOverride:ssl- -d:sslVersion:"(" a.nim` worked for me |
05:38:17 | FromDiscord | <shashlick> it complains at link time that it couldn't find the openssl symbol i have in a.nim |
05:38:46 | FromDiscord | <nikki> what's a quick way to iterate from 0 to n moving up by 2 each time |
05:38:54 | FromDiscord | <nikki> is it just a while loop? |
05:40:06 | bung_ | in testament how to do errmsg sub ? |
05:40:21 | FromDiscord | <nikki> actually i have a better way |
05:41:45 | FromDiscord | <Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Er6 |
05:41:57 | FromDiscord | <Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix= |
05:42:31 | FromDiscord | <shashlick> ya cause it doesn't try to link the ssl static libs |
05:42:41 | FromDiscord | <shashlick> now if you passL, it should pick it up |
05:42:48 | FromDiscord | <nikki> nice |
05:42:50 | FromDiscord | <nikki> this is what you want to see |
05:42:56 | FromDiscord | <nikki> it's asking you for static libs |
05:43:10 | FromDiscord | <shashlick> and your windows command also is not covering the `-` suffix for dynlibOverride and the other things mentioned in the issue |
05:44:20 | FromDiscord | <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:23 | FromDiscord | <shashlick> just create a config.nims with that choosenim.nims contents - why fight with the command line |
05:46:51 | FromDiscord | <Clownstick Von FuckFace> @nikki `--passL:-L/home/kbsec/openssl --passL:-lssl --passL:-lcrypto ` is supposed pass the static libs right? |
05:47:05 | FromDiscord | <Clownstick Von FuckFace> it does this but it doesn't bake the dlls refrenced in openssl/ into it |
05:47:07 | FromDiscord | <Clownstick Von FuckFace> namely |
05:47:28 | FromDiscord | <Clownstick Von FuckFace> libssl-3-x64.dll libcrypto-3-x64.dll |
05:47:41 | FromDiscord | <Clownstick Von FuckFace> can i force nim to pack them into the resulting exe? |
05:48:46 | FromDiscord | <shashlick> instead of that, simply pass the full paths to the .a files to passL |
05:49:06 | FromDiscord | <nikki> you shouldn't be thinking about the dlls anymore at all |
05:49:13 | FromDiscord | <shashlick> `--passL:"/path/to/libssl.a /path/to/libcrypto.a"` |
05:51:39 | * | Adeon quit (Ping timeout: 272 seconds) |
05:53:40 | FromDiscord | <Clownstick Von FuckFace> different error this time |
05:53:41 | FromDiscord | <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:53 | FromDiscord | <Clownstick Von FuckFace> out of curiousity |
05:55:00 | FromDiscord | <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:00 | FromDiscord | <Rika> i believe there is no difference |
06:00:39 | FromDiscord | <shashlick> That must be a windows symbol |
06:03:35 | FromDiscord | <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:04 | FromDiscord | <Clownstick Von FuckFace> do i need the `--passl:-lcrypto --passl:-lssl` and `--dynlibOverride:crypto-`? |
06:04:21 | FromDiscord | <Clownstick Von FuckFace> @shashlick thinks for the help btw. i know im being obtuse af. |
06:05:52 | FromDiscord | <nikki> https://github.com/openssl/openssl/issues/11373 |
06:05:53 | disbot | β₯ openssl issues: build on windows mingw |
06:05:54 | FromDiscord | <nikki> maybe relevant? |
06:10:19 | FromDiscord | <Clownstick Von FuckFace> π why is it so hard to just statically compile an https client |
06:10:58 | FromDiscord | <nikki> https is pretty complicated... |
06:11:42 | FromDiscord | <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:50 | FromDiscord | <nikki> you can do it π
|
06:12:02 | FromDiscord | <nikki> don't lose hope haha |
06:15:56 | FromDiscord | <Clownstick Von FuckFace> thanks @nikki ! I am a little nervous about changing openssl files :S |
06:17:08 | FromDiscord | <nikki> what if you do it and your program runs |
06:17:13 | FromDiscord | <nikki> would that make you feel better π |
06:17:18 | FromDiscord | <nikki> maybe that's what will happen :p |
06:18:35 | FromDiscord | <Clownstick Von FuckFace> this is true |
06:19:19 | FromDiscord | <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:57 | FromDiscord | <Clownstick Von FuckFace> ok added `#undef AI_PASSIVE` and am rebuilding openssl |
06:21:15 | FromDiscord | <Clownstick Von FuckFace> to crypto/bio/b_addr.c |
06:21:42 | FromDiscord | <Clownstick Von FuckFace> i didnt get an error when i built so i skpped that |
06:21:47 | FromDiscord | <Rika> Why even worry then |
06:21:51 | FromDiscord | <Rika> Fuck the users |
06:22:18 | FromDiscord | <nikki> you didn't get an error when you built so you skipped: what? |
06:22:25 | FromDiscord | <nikki> and yeah never worry. fear is the mind killer |
06:23:06 | FromDiscord | <Clownstick Von FuckFace> ", I manually changed the Makefile toβ΅PERL=/d/perl-5.24.0/bin/perl.exeβ΅β΅" |
06:23:15 | FromDiscord | <Clownstick Von FuckFace> well getting 1 less error π |
06:23:19 | FromDiscord | <Clownstick Von FuckFace> still more erors though |
06:23:49 | FromDiscord | <nikki> it helps to be as specific and informative as possible when describing issues :p |
06:26:45 | FromDiscord | <Clownstick Von FuckFace> π https://media.discordapp.net/attachments/371759389889003532/778144073051537448/message.txt |
06:26:48 | FromDiscord | <Clownstick Von FuckFace> so i am debugging right now |
06:26:52 | FromDiscord | <Clownstick Von FuckFace> it looks like its a cross compile issue |
06:30:00 | FromDiscord | <Clownstick Von FuckFace> https://stackoverflow.com/questions/44694954/cant-link-c-project-with-openssl-static-libraries |
06:30:13 | FromDiscord | <Clownstick Von FuckFace> maybe relevant |
06:30:45 | FromDiscord | <Clownstick Von FuckFace> yeah looks like its the same messed up imports |
06:31:00 | FromDiscord | <Clownstick Von FuckFace> how do i specify to link with -lws2_32. on nimc? |
06:31:55 | FromDiscord | <Clownstick Von FuckFace> tried adding `--passL:-lws2_32` |
06:34:34 | FromDiscord | <Clownstick Von FuckFace> haha giving up for tonight-- is late where I am. Thanks @nikki @shashlick for all the help! |
06:36:09 | FromDiscord | <Rebel> Are their negative indices for string slicing? |
06:36:15 | FromDiscord | <Rebel> (edit) "their" => "there" |
06:36:24 | FromDiscord | <Clownstick Von FuckFace> yeah, blah[^1] |
06:36:24 | FromDiscord | <nikki> @Rebel from end? you can use ^blah |
06:36:27 | FromDiscord | <Clownstick Von FuckFace> gives you the end |
06:36:37 | FromDiscord | <Rebel> π |
06:36:41 | FromDiscord | <nikki> π |
06:37:24 | FromDiscord | <Rebel> I wish all my questions about Nim were that sample to answer |
06:37:44 | FromDiscord | <Clownstick Von FuckFace> Same |
06:38:43 | FromDiscord | <Rebel> The next question would be able doing window syscalls in Nim with inline assembly and if that's even possible π |
06:40:45 | FromDiscord | <Clownstick Von FuckFace> l |
06:42:08 | FromDiscord | <Clownstick Von FuckFace> lots of support for windows sycalls actually, and you can specify assembly at compile time π |
06:43:52 | FromDiscord | <Rebel> π |
06:43:56 | FromDiscord | <Rebel> any examples lol |
06:44:03 | FromDiscord | <Rebel> What have you been reading? |
06:45:19 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:47:17 | FromDiscord | <Rika> maybe winlean? |
06:48:21 | FromDiscord | <Rika> or https://github.com/def-/nim-syscall/blob/master/src/linux_x86_64/call.nim |
06:49:05 | FromDiscord | <Rika> uh good luck |
06:50:33 | FromDiscord | <nikki> but if everything was simple, is it fun? |
06:51:47 | FromDiscord | <ElegantBeef> I'm simple, and clearly not fun |
06:53:15 | FromDiscord | <nikki> !eval import tables; echo("fun" in cast[Table[string]](0xbeef)) |
06:53:17 | NimBot | Compile failed: /usercode/in.nim(1, 40) Error: cannot instantiate Table |
06:53:29 | * | bunbunbunbunny joined #nim |
06:53:33 | FromDiscord | <nikki> !eval import sets; echo("fun" in cast[HashSet[string]](0xbeef)) |
06:53:35 | FromDiscord | <ElegantBeef> Tables have two types |
06:53:37 | NimBot | Traceback (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:39 | FromDiscord | <ElegantBeef> You failed! |
06:53:45 | FromDiscord | <nikki> i can confirm that you aren't fun |
06:54:10 | FromDiscord | <ElegantBeef> !eval import strutils; echo "ElegantBeef".contains("fun") |
06:54:14 | NimBot | false |
06:54:27 | FromDiscord | <nikki> no segfault? where's the fun in that! |
06:54:56 | FromDiscord | <nikki> @ElegantBeef also i am at the point of loading a large level that my c++ engine used to load |
06:54:57 | FromDiscord | <nikki> and it loads faster in nim |
06:55:10 | FromDiscord | <nikki> _holds back tears_ |
06:56:11 | FromDiscord | <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:32 | FromDiscord | <nikki> if you use rust, you never ship, so your program contains no bugs |
06:57:53 | FromDiscord | <ElegantBeef> The funny part is i dont think he's actually released any of his Rust code π |
06:57:58 | FromDiscord | <nikki> but at least it maybe will finish compiling soon! |
06:59:08 | FromDiscord | <nikki> @ElegantBeef check out my progress in #gamedev π |
06:59:24 | FromDiscord | <nikki> (the big level is not in the video bc. spoilerz lol) |
06:59:50 | FromDiscord | <ElegantBeef> The `ng` pragma is junk, it's so undescript π |
07:00:04 | FromDiscord | <nikki> that's the idea :p |
07:00:26 | FromDiscord | <ElegantBeef> What's it do.. no one knows, they just use it |
07:00:56 | FromDiscord | <nikki> it's non-descript until i figure out what it's describing π |
07:01:13 | FromDiscord | <ElegantBeef> Is it not actually doing anything atm? |
07:01:13 | FromDiscord | <nikki> but yeah it shud probably be called .gameplayComponent. |
07:01:30 | FromDiscord | <nikki> or .thisIsLongBecauseBeefToldMeTo. |
07:01:43 | FromDiscord | <nikki> it just registers the type as a component type for the game |
07:01:49 | FromDiscord | <nikki> for the entity component system |
07:01:55 | FromDiscord | <nikki> .comp. is probs good |
07:02:29 | FromDiscord | <nikki> it's basically aspects of data each game entity can have |
07:07:47 | bung_ | how to test compilation error https://github.com/nim-lang/Nim/pull/15098 |
07:07:47 | disbot | β₯ Fix #15097 Compiler crashes when referring to an undeclared gensymmedβ¦ |
07:20:53 | FromDiscord | <Rika> @ElegantBeef :facepalm1: |
07:22:32 | FromDiscord | <Rika> so why does your friend believe that |
07:23:04 | FromDiscord | <ElegantBeef> He doesnt like Nim and rationalizes it with his feelings instead of the facts |
07:23:25 | FromDiscord | <Rika> he jelly he learned the wrong language π |
07:23:37 | FromDiscord | <Rika> big salt |
07:30:40 | * | narimiran joined #nim |
07:36:22 | FromDiscord | <nikki> that's why it makes sense to learn multiple things |
07:36:40 | FromDiscord | <nikki> and choose the best tool for the particular context |
07:36:48 | FromDiscord | <nikki> but cognitive dissonance is more fun i guess |
07:37:12 | FromDiscord | <ElegantBeef> Facts dont care about your feelings, Nim is the best for everything, from brushing your teeth to wiping your ass |
07:37:17 | FromDiscord | <ElegantBeef> π |
07:38:07 | FromDiscord | <nikki> an elegantbeef that can code C and nim is better than an elegantbeef that only codes nim ;o |
07:38:29 | FromDiscord | <ElegantBeef> An elegant beef that actually codes is better than the version infront of you |
07:38:40 | FromDiscord | <nikki> lmao |
07:40:14 | FromDiscord | <nikki> @ElegantBeef what's the story behind ur name |
07:40:31 | * | PMunch joined #nim |
07:40:46 | FromDiscord | <ElegantBeef> Adjective + Noun, the way to live |
07:45:36 | FromDiscord | <Rika> how about you nikki |
08:01:49 | FromDiscord | <Rika> ok i guess you can just not respond as well |
08:02:45 | PMunch | I love getting on IRC in the morning and drop into a totally random conversation :P |
08:03:33 | FromDiscord | <Rika> lol |
08:03:54 | FromDiscord | <Rika> no one has spoken since 20 minutes ago, barring me |
08:07:44 | * | bunbunbunbunny quit (Quit: Lost terminal) |
08:08:24 | PMunch | First message I saw was ElegantBeefs last message |
08:12:59 | FromDiscord | <ElegantBeef> I'm sorry for your loss pmunch |
08:13:11 | FromDiscord | <ElegantBeef> Having to read anything i write is a diservice |
08:13:32 | PMunch | Haha, that's the beauty of IRC, I can only read when I'm online |
08:13:43 | PMunch | I mean I can check the logs |
08:15:29 | PMunch | Wow, just discovered a terrible design flaw on GitHub |
08:16:05 | Prestige | Which one? |
08:16:10 | PMunch | I got what looked like a notification identifier on my profile picture (instead of by the bell) |
08:16:20 | FromDiscord | <ElegantBeef> Yea i got that today aswell |
08:16:26 | FromDiscord | <ElegantBeef> It's due to a new feature |
08:16:32 | PMunch | Clicking on it just expanded the menu, with no indication of where the new thing was |
08:16:58 | PMunch | Had 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:11 | FromDiscord | <ElegantBeef> Yea i just started clicking until it disappeared |
08:17:24 | FromDiscord | <ElegantBeef> UX designed by a blind person |
08:17:29 | bung_ | yeah, today I found , I thought maybe feature preview, but I dont remenber the last feature |
08:17:48 | FromDiscord | <Rika> ux designed by a blind person for a blind person |
08:18:23 | bung_ | it maybe just a wrong message pass to notification |
08:18:27 | PMunch | They still haven't fixed their bunged up design changes made recently |
08:18:39 | PMunch | The experience on 4K monitors is pretty bad |
08:19:35 | Prestige | I'm waiting at least 5 years before I get a 4k monitor |
08:19:43 | FromDiscord | <Rika> The experience ~~on 4K monitors~~ is pretty bad |
08:20:22 | Prestige | Yeah, I miss the old design |
08:20:30 | Prestige | Microsoft been messing things up |
08:20:48 | FromDiscord | <lqdev> yes |
08:21:00 | PMunch | I have 4K monitors at work, not my choice.. |
08:21:03 | FromDiscord | <lqdev> how do they manage to fuck up everything they touch tho |
08:21:03 | PMunch | https://uploads.peterme.net/github_current.png |
08:21:12 | FromDiscord | <ElegantBeef> If you're cynical you could say it's EEE π |
08:21:26 | FromDiscord | <Rika> microsoft: the modern oracle? |
08:21:28 | PMunch | As you cad see the menu is all the way over to the side -_- |
08:21:34 | Prestige | PMunch: I asked for a 1080p monitor at work and everyone was confused. HahA |
08:22:05 | PMunch | Haha :P |
08:22:11 | PMunch | I mean I don't mind it |
08:22:34 | Prestige | Wait, how is nimdow on a hidpi monitor? |
08:22:37 | PMunch | I 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:54 | PMunch | Works fine, but that's the reason I discovered that the bar height option didn't work :P |
08:22:58 | FromDiscord | <ElegantBeef> Yea was going to ask, hows the font scaling on a 4k monitor |
08:23:25 | PMunch | @Elegant, why would font-scaling be an issue? |
08:24:39 | FromDiscord | <lqdev> i'm serious tho, so far microsoft has brought so much shit into the products they bought |
08:24:56 | PMunch | You sound surprised |
08:25:02 | FromDiscord | <lqdev> i'm not |
08:25:12 | FromDiscord | <lqdev> that's old news by this point |
08:25:26 | FromDiscord | <ElegantBeef> I mean the default font size π |
08:26:04 | FromDiscord | <lqdev> they screwed up minecraft by creating bedrock edition, and now they fucked up github's design |
08:26:37 | Prestige | Need I remind you about Banjo Threeie? |
08:26:56 | FromDiscord | <lqdev> first time i've heard about it :/ |
08:27:08 | FromDiscord | <lqdev> the only good thing they're providing is funding for those projects |
08:27:20 | FromDiscord | <lqdev> and that's where the good things end |
08:28:13 | FromDiscord | <lqdev> after all, microsoft is just another company focusing on their gOoD PR |
08:31:37 | PMunch | @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:45 | PMunch | But then again I like my fonts small |
08:32:01 | * | jjido joined #nim |
08:32:12 | FromDiscord | <shad0w> @PMunch β΅so, how much margin you want.β΅microsoft: YES |
08:34:13 | FromDiscord | <ache of head> xD |
08:34:46 | PMunch | I mean that site is more margin than content at this point |
08:49:33 | * | hmmmmm joined #nim |
08:49:45 | hmmmmm | hallo nimlets! |
08:50:27 | FromDiscord | <Rika> hello |
08:50:42 | FromDiscord | <Rika> nimlet lmao the more accepted words are nimion and nimmer |
08:56:57 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
08:57:53 | hmmmmm | since I'm low level nimmer I'm a nimlet |
08:59:24 | FromDiscord | <shad0w> someone must've max-width + margin: auto'd it avoid weird issues and wraps on wide screens |
08:59:35 | FromDiscord | <shad0w> i used to be frontend in a prev life |
09:00:44 | * | Tanger quit (Quit: Leaving) |
09:04:13 | FromDiscord | <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:49 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2ErR |
09:06:01 | FromDiscord | <fwsgonzo> (edit) "https://play.nim-lang.org/#ix=2ErR" => "https://play.nim-lang.org/#ix=2ErS" |
09:07:18 | FromDiscord | <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:20 | FromDiscord | <levovix> trying to connect nim and c++, i get link error: `undefined reference to Β«S::foo(char)Β»` |
09:28:30 | FromDiscord | <levovix> source code: https://media.discordapp.net/attachments/371759389889003532/778189810845876224/unknown.png |
09:28:33 | FromDiscord | <levovix> what am I doing wrong? |
09:33:37 | FromDiscord | <KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2ErZ |
09:34:29 | FromDiscord | <ElegantBeef> How dare... you feel ashamed to open another post π |
09:35:01 | PMunch | What does your template look like? |
09:35:21 | FromDiscord | <KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2Es0 |
09:36:25 | FromDiscord | <ElegantBeef> Thought templates were just code subsitution |
09:36:30 | FromDiscord | <Rika> `let it2` instead of `let it` then also on the last line use `it2` |
09:38:29 | FromDiscord | <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:47 | FromDiscord | <KnorrFG> (edit) "values(state.sessions):β΅ " => "values(state.sessions):" |
09:39:45 | FromDiscord | <ElegantBeef> Unrelated, just curious. Isnt the `: untyped` return completely useless for templates? |
09:40:00 | PMunch | I mean this works: https://play.nim-lang.org/#ix=2Es2 |
09:40:21 | FromDiscord | <KnorrFG> @ElegantBeef Probably, I just tried a lot of different things when it didnt work |
09:40:22 | FromDiscord | <lqdev> @ElegantBeef yes it's redundant, but it signals intent better |
09:41:08 | FromDiscord | <ElegantBeef> Actually it's not in this case, just tried with pmunchs example and without that it complains about the unhandled value |
09:41:48 | PMunch | Haha, yeah that's because you don't have a return type and you implicitly try to return something |
09:42:21 | FromDiscord | <ElegantBeef> Yea i got why, just have never returned from inside a template before i guess |
09:42:36 | FromDiscord | <ElegantBeef> Always just use them cause i go "fuck this is redundant" |
09:48:18 | planetis[m] | actually `template foo: untyped =` and `template foo =` are different |
09:48:29 | planetis[m] | i was confused a lot with this |
09:48:35 | PMunch | Different how? |
09:48:47 | planetis[m] | the last one returns void |
09:49:07 | PMunch | But it's a template.. |
09:49:30 | PMunch | Oh, the thing inside the template returns void? |
09:49:38 | planetis[m] | yes |
09:52:36 | planetis[m] | https://play.nim-lang.org/#ix=2Es5 |
09:53:51 | * | Tanger joined #nim |
09:55:27 | PMunch | Right |
09:55:56 | FromDiscord | <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:14 | PMunch | planetis[m], and similarly: https://play.nim-lang.org/#ix=2Es7 |
09:59:04 | PMunch | @KnorrFG, well something is odd here |
10:01:08 | PMunch | I mean this works, but the sequence produced isn't right: https://play.nim-lang.org/#ix=2Esa |
10:01:35 | PMunch | (Oh and that {.closure.} pragma isn't necessary, added it to try something) |
10:02:12 | PMunch | Oh, nvm, this works: https://play.nim-lang.org/#ix=2Esc |
10:02:33 | * | Tlangir joined #nim |
10:03:08 | FromDiscord | <KnorrFG> wait. Does that mean the template does not return an iterator but a function that returns an iterator? |
10:03:34 | FromGitter | <ynfle> A template is just code replacement |
10:03:40 | PMunch | Uhm, something like that |
10:03:50 | PMunch | Closure iterators are a bit, uhm, odd |
10:04:47 | PMunch | https://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:04 | FromDiscord | <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:12 | FromDiscord | <KnorrFG> should I just refrain from using iterators |
10:06:14 | FromDiscord | <KnorrFG> (edit) "iterators" => "iterators?" |
10:06:14 | PMunch | Basically you have to "call" an iterator to start it |
10:06:49 | PMunch | Well depends on what you need them for |
10:07:02 | FromGitter | <ynfle> You could try `zero-functional` |
10:07:11 | FromGitter | <ynfle> !repo zero-functional |
10:07:12 | disbot | https://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:32 | PMunch | Uhm, that's not the right repo :P |
10:07:43 | FromGitter | <ynfle> https://github.com/zero-functional/zero-functional |
10:08:35 | FromDiscord | <KnorrFG> but would somethign like `aHashSet --> map(...)` work with zerofunctional? |
10:09:15 | FromGitter | <ynfle> I don't see why not |
10:09:28 | FromDiscord | <KnorrFG> Oh, awesome, ok thanks! |
10:11:56 | PMunch | @levovix, could you share that code in a more copy-able format? |
10:13:23 | FromGitter | <ynfle> @Pmunch, Could you take a look at this before I file a bug report https://play.nim-lang.org/#ix=2EpY? |
10:14:05 | FromDiscord | <levovix> sent a code paste, see https://play.nim-lang.org/#ix=2Esf |
10:15:14 | FromDiscord | <levovix> (edit) "https://play.nim-lang.org/#ix=2Esf" => "https://play.nim-lang.org/#ix=2Esg" |
10:15:50 | PMunch | @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:17 | FromGitter | <ynfle> So I should file a bug report? |
10:16:29 | PMunch | Yeah, that shouldn't happen |
10:18:07 | PMunch | Hmm, where are you guys copying from that turns * into that weird symbol.. |
10:18:16 | FromGitter | <ynfle> π Thanks |
10:25:09 | PMunch | Compiling with this works: nim cpp --passL:-Lbuild --passL:-lcppbind -r main |
10:25:41 | PMunch | Not quite sure why the link pragma doesn't work |
10:27:08 | FromDiscord | <levovix> thanks |
10:27:43 | PMunch | Oh wait, that weird symbol is from the IRC bridge.. |
10:27:51 | PMunch | Where is Yardanico when you need him |
10:28:07 | PMunch | @levovix, no problem :) |
10:30:52 | * | xet7 quit (Remote host closed the connection) |
10:31:26 | FromGitter | <ynfle> Done https://github.com/nim-lang/Nim/issues/16017 |
10:31:28 | disbot | β₯ 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:19 | PMunch | Nice |
10:33:22 | FromGitter | <ynfle> Thanks |
10:33:40 | * | xet7 quit (Remote host closed the connection) |
10:34:03 | PMunch | @levovix, those could of course be put as a pragma instead of compiler options |
10:35:28 | * | xet7 joined #nim |
10:36:46 | PMunch | What a weird set of speeds to show examples for: http://ix.io/2Esm |
10:36:51 | PMunch | For context, I'm updating a server |
10:37:03 | PMunch | Who has a server on a 56k link :P |
10:42:03 | PMunch | Hmm, updating this server was a bit more pain than I expected.. |
10:59:12 | * | Vladar joined #nim |
11:14:17 | planetis[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:42 | planetis[m] | s/sitted/seated |
11:16:11 | planetis[m] | for my own services/protocols that is |
11:27:31 | PMunch | I'm pretty sure packedjson just keeps the original json string as the internal representation |
11:27:48 | PMunch | But it knows where in the string every field is, and what object/type it is |
11:28:12 | PMunch | So 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:42 | FromDiscord | <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:54 | FromDiscord | <Clyybber> its not an error :) |
11:37:35 | FromDiscord | <ache of head> wait, it isn't? |
11:37:55 | FromDiscord | <ache of head> damn you're right |
11:38:36 | planetis[m] | yeah it seems like it |
11:39:42 | planetis[m] | what else would i need though... seems perfect |
11:47:00 | planetis[m] | more like message pack |
11:48:34 | * | Zevv quit (Quit: Lost terminal) |
11:48:35 | planetis[m] | well no but with some changes... |
11:53:39 | PMunch | bson? |
11:54:57 | * | rockcavera joined #nim |
11:55:24 | PMunch | Or UBJSON |
11:56:47 | planetis[m] | the bah-son, the gah-son, Ol Dirty Bastard, Inspectah Deck, Raekwon the Chef |
11:56:47 | planetis[m] | U-God, Ghost Face Killer and the Method man |
11:56:56 | planetis[m] | man fuck all that! |
11:57:29 | PMunch | Huh? |
11:59:27 | planetis[m] | nothing sry, they remind me the Wu-Tang clan |
11:59:36 | planetis[m] | all these names |
12:00:39 | federico3 | "binary" json still needs sequential parsing - not a big improvement |
12:01:08 | PMunch | Depends 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:34 | ForumUpdaterBot | New thread by Miran: Nim's rst parser now supports markdown tables, see https://forum.nim-lang.org/t/7108 |
12:21:42 | hmmmmm | hmm |
12:21:51 | hmmmmm | narimiran r u there? |
12:21:55 | narimiran | hmmmmm: yeah |
12:22:01 | hmmmmm | nice! |
12:22:21 | hmmmmm | it seems we have a bug on our exerciese of yesterday :O |
12:22:39 | narimiran | ok, you got my attention |
12:23:20 | hmmmmm | I'll share some code but don't give me the solution I want to find it myself |
12:23:36 | narimiran | ok, easy-peasy for me then |
12:23:54 | hmmmmm | yes! |
12:24:59 | hmmmmm | why on playground I find someone else code |
12:25:05 | hmmmmm | :o |
12:25:22 | narimiran | because you don't use https://play.nim-lang.org/ |
12:25:30 | narimiran | but some link with some gibberish at the end |
12:25:34 | hmmmmm | oh |
12:25:45 | PMunch | It's not gibberish! :P |
12:25:56 | planetis[m] | uhm no sequential parsing, to get the next field, it reads everything |
12:26:01 | narimiran | :P |
12:26:23 | hmmmmm | https://play.nim-lang.org/#ix=2EsF |
12:26:43 | hmmmmm | if you run the code it gives you the start of the correct solution but not the entire thing |
12:26:49 | narimiran | using floats? that's a hard mode |
12:27:03 | hmmmmm | :O |
12:27:14 | narimiran | show your python version |
12:27:44 | hmmmmm | don'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:50 | hmmmmm | ok coming |
12:28:16 | planetis[m] | hmmmmm: are you working on the sums module? |
12:28:17 | narimiran | but i think i know where's the bug ;) |
12:28:48 | hmmmmm | https://paste.ofcode.org/trsa7CqXrkjrGstV46Duzs |
12:28:58 | narimiran | yep, i'm sure now |
12:29:09 | hmmmmm | ok can you give me a small hint |
12:29:16 | narimiran | line 12 |
12:29:23 | hmmmmm | hmm |
12:29:42 | * | xet7 quit (Remote host closed the connection) |
12:30:19 | narimiran | i didn't translate python's version correctly |
12:30:27 | hmmmmm | don't tell me more |
12:30:31 | hmmmmm | see you in six months |
12:30:35 | narimiran | :) |
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:03 | hmmm | nari nari |
13:22:31 | narimiran | yes? |
13:22:37 | hmmm | why on line 8 you use "result" and in the other lines you use "return" |
13:23:15 | narimiran | you can change it to return if you want |
13:23:20 | hmmm | its the same? |
13:23:29 | narimiran | here yes, generally no |
13:23:32 | hmmm | oh |
13:24:43 | narimiran | hmmm: but more importantly, do you know what's the bug in nim version of the code? |
13:24:52 | narimiran | what is different than in python version? |
13:25:05 | hmmm | I'm looking but I'm also preparing food so I'm doing both things and I'm slow :p |
13:25:18 | hmmm | shhh don't tell me |
13:26:00 | narimiran | i won't. but spotting a bug/difference is only the first step in correcting it |
13:26:05 | planetis[m] | hmmm: return is control flow, result is just a variable |
13:26:27 | hmmm | if instead of result I set it to molly it works the same? |
13:27:05 | FromGitter | <ynfle> `result` is implicitly initialized and implicitly returned |
13:27:21 | FromGitter | <ynfle> If there is no reached `return` statment |
13:27:37 | hmmm | it's like a package of "x=something and return it too" |
13:27:41 | hmmm | ? |
13:27:56 | narimiran | yeah, but you don't have to return immediately |
13:28:02 | hmmm | hmm |
13:28:52 | narimiran | now, go prepare/eat your food, don't worry about `result` |
13:28:57 | hmmm | :p |
13:30:34 | FromGitter | <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:09 | hmmm | so 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:22 | FromGitter | <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:48 | hmmm | ok and why return works here but not result? https://play.nim-lang.org/#ix=2Et0 |
13:39:54 | hmmm | oh I need to maybe do result = something |
13:40:02 | hmmm | haha it works |
13:45:13 | narimiran | hmmm: i think you should really start reading some tutorials |
13:45:51 | narimiran | otherwise, everything feels like tapping in dark |
13:47:29 | PMunch | hmmm, result is a automatically defined variable that is the type of your return value |
13:47:42 | PMunch | s/a/an |
13:47:43 | hmmm | I'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:24 | FromDiscord | <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:32 | PMunch | Problem with tutorials is that you can either make them super terse, or risk assuming that someone knows about something they don't |
13:49:11 | PMunch | You 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:13 | hmmm | the most interesting thing I've read in the tutorials is that nim procs can minipulate vars outside the proc scope |
13:50:42 | hmmm | I think python funcs can't do that |
13:51:01 | narimiran | hmmm: here is a part of a beginners tutorial regarding `result`: https://narimiran.github.io/nim-basics/#_result_variable |
13:51:03 | hmmm | oh I go eat cu later |
14:07:40 | FromDiscord | <Clownstick Von FuckFace> how does one build choosenim fom sourceon windows? |
14:09:20 | * | bung_ quit (Quit: Lost terminal) |
14:11:51 | FromDiscord | <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:40 | FromDiscord | <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:17 | FromDiscord | <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:46 | FromDiscord | <Clyybber> @0xfabe (vn-ki) yes it does |
14:20:06 | FromDiscord | <Clyybber> you can use ref objects/seqs/strings and all that jazz |
14:20:42 | PMunch | @Clownstick, it looks like you might have an outdated dependency or something |
14:20:52 | Zoom[m] | Hey, is `high` preferable for indexing over `^1`? |
14:21:14 | PMunch | Depends on what you're doing |
14:21:37 | FromDiscord | <notchris> good morning |
14:22:00 | PMunch | if you do `mySequenceOfInts[2..^1]` it's definitely not recommended to do `mySequenceOfInts[2..mySequenceOfInts.high]` |
14:22:04 | PMunch | Hi @notchrist |
14:22:07 | PMunch | Hi @notchris * |
14:22:15 | notchris | o/ |
14:23:08 | FromDiscord | <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:38 | FromDiscord | <0xfabe (vn-ki)> like, are the heap vars promoted to static, or are they heap intialized at startup |
14:24:12 | FromDiscord | <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:16 | FromDiscord | <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:38 | PMunch | Looks like bzip |
14:25:53 | PMunch | Just judging from filenames/procedure names |
14:26:21 | PMunch | Why are you trying to build it from scratch anyways? |
14:26:25 | hmmm | nari nari I found something suspicious on line 12 |
14:26:46 | narimiran | hmmm: still not pinging me with "nari nari", but ok |
14:26:59 | hmmm | it shouldn't be [0] because I want the full sequence not just the first value |
14:27:05 | narimiran | hmmm: bingo :) |
14:27:08 | hmmm | HA |
14:27:09 | hmmm | :D |
14:27:21 | hmmm | I don't ping you because I don't want to disturb you lol |
14:27:22 | narimiran | (but if you just delete `[0]`, it won't work) |
14:27:27 | hmmm | :O |
14:27:28 | Zoom[m] | I'm just looking at hmmm's paste here. Not really sure what is the goal here |
14:27:34 | FromDiscord | <Clownstick Von FuckFace> @PMunch https://github.com/dom96/choosenim |
14:27:40 | FromDiscord | <Clownstick Von FuckFace> i want to build this from source |
14:27:49 | FromDiscord | <Clownstick Von FuckFace> it statically embeds openssl |
14:27:49 | narimiran | Zoom[m]: he's learning and doesn't want us to tell him the answer :) |
14:27:53 | FromDiscord | <Clownstick Von FuckFace> and I want tofigure out how ti does that |
14:28:07 | narimiran | hmmm: why doesn't it work? any idea? |
14:29:17 | hmmm | let's see what kind of error I get |
14:30:35 | PMunch | @Clownstick, just how Nim statically links stuff? |
14:31:23 | FromDiscord | <Clownstick Von FuckFace> naw, specifically openssl |
14:31:33 | FromDiscord | <Clownstick Von FuckFace> I ahve been trying to make a standalone windows binary with -ssl |
14:31:44 | hmmm | ok 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:58 | FromDiscord | <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:04 | FromDiscord | <Clownstick Von FuckFace> Choosenim does this and I amtrying ot emlate that |
14:32:14 | FromDiscord | <Clownstick Von FuckFace> but when I try to build choosenim frm source, it still errors out π |
14:32:35 | narimiran | hmmm: what does `+` do in the python version? |
14:33:16 | hmmm | adds whatever is in list withv with the first element of the array result |
14:33:30 | hmmm | hmm kinds of concat the arrays/lists |
14:33:31 | narimiran | nope |
14:33:32 | Zoom[m] | Even the python version looks strange. Is it yours? |
14:33:33 | narimiran | yeg |
14:33:36 | narimiran | *yep |
14:33:53 | hmmm | so how I concat seqs in nim? Don't tell me |
14:33:56 | narimiran | "kinds of concat" -- here's the clue |
14:33:57 | hmmm | I will read the tutorial |
14:34:29 | narimiran | hmmm: you go here: https://nim-lang.github.io/Nim/lib.html and then type `concat` in the search box |
14:36:21 | hmmm | there is a suspicious entry with sequtils :o |
14:36:33 | narimiran | what does that mean? |
14:36:43 | Zoom[m] | Looks like one of the problem from Programming Perals, but not quite |
14:36:54 | Zoom[m] | * Looks like one of the problem from Programming Pearls, but not quite |
14:36:59 | hmmm | hmmm |
14:37:07 | hmmm | there is a concat function |
14:37:17 | hmmm | that adds seqs together |
14:37:19 | narimiran | hmmm: btw, is the order of the resulting seq important? if not, there's a very simple solution |
14:37:28 | hmmm | order of seqs is not important |
14:38:12 | hmmm | oh shi I have to go do some irl stuff |
14:38:13 | hmmm | cu later |
14:38:18 | * | hmmm quit () |
14:38:23 | narimiran | cu |
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:50 | FromDiscord | <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:15 | FromDiscord | <Xydium> (Specifically on the stdin handle0 |
15:12:17 | FromDiscord | <Xydium> ) |
15:13:00 | ForumUpdaterBot | New thread by Vitaliy: Empty proc body, see https://forum.nim-lang.org/t/7109 |
15:25:30 | FromDiscord | <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:24 | narimiran | hmmmmm: 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:37 | planetis[m] | narimiran: can you merge https://github.com/nim-lang/fusion/pull/40 ? π |
15:51:40 | disbot | β₯ Added macro dsl based on karaxdsl ; snippet at 12https://play.nim-lang.org/#ix=2EtN |
15:52:12 | narimiran | planetis[m]: let me try to fix CIs first |
15:57:36 | FromDiscord | <haxscramper> I made PR with CI fix |
15:58:34 | narimiran | eh, i'm fixing it differently |
15:58:44 | narimiran | like it was done here: https://github.com/nim-lang/Nim/pull/15892/files |
15:58:45 | disbot | β₯ 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:07 | planetis[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:53 | haxscramper | narimiran: 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:23 | narimiran | haxscramper: can you be more specific? what PR are we talking about? |
17:22:10 | narimiran | https://github.com/nim-lang/fusion/pull/34 ? |
17:22:11 | disbot | β₯ [!!!] Rename `*Table` types to `*Map` |
17:23:07 | haxscramper | My PR I'm talking about is https://github.com/nim-lang/fusion/pull/33 |
17:23:08 | disbot | β₯ Pattern matching implementation |
17:24:24 | haxscramper | But #34 also has conflicts to to changelog |
17:24:28 | narimiran | haxscramper: why does that PR contain changelog entry from #34? |
17:24:56 | disruptek | miran: i had a dream about you last night. |
17:25:02 | narimiran | disruptek: wet? |
17:25:13 | disruptek | did you have the same dream? |
17:25:19 | narimiran | maybe |
17:25:26 | disruptek | it's fate. |
17:25:40 | planetis[m] | every Pr that has merge conflict due to changelog.md |
17:25:40 | narimiran | Zevv: you hear this? |
17:26:03 | planetis[m] | I just wrote mine on top |
17:27:13 | narimiran | disruptek: what about your engagement with Zevv? |
17:27:19 | * | PMunch joined #nim |
17:27:25 | disruptek | what about it? |
17:28:06 | narimiran | disruptek: yesterday he was telling us how he was very in love with you. it would be shame to break his heart |
17:28:30 | disruptek | everybody lies, everybody fucks. |
17:29:02 | planetis[m] | is that the correct phrase? |
17:29:25 | * | luis__ quit (Quit: luis__) |
17:29:36 | narimiran | haxscramper: i resolved merge commits now |
17:30:09 | haxscramper | Thank you. Is it how it should be done, or should I pull master myself in the future if necessary? |
17:30:17 | haxscramper | Or there is no general recommendations |
17:31:26 | disruptek | prefer rebase to pull devel. |
17:31:31 | narimiran | ^ |
17:31:56 | disruptek | only 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:16 | hmmmmm | hallo! |
17:46:50 | * | Vladar joined #nim |
17:55:37 | * | jjido joined #nim |
17:58:49 | supakeen | Hey. |
17:59:55 | Zoom[m] | Eh, how do you modify contents of option with map directly? Is there mapIt for option? |
18:00:34 | Zoom[m] | hmmmmm: I've translated your subsetsum to Nim |
18:01:02 | planetis[m] | you spoil him dont give it |
18:01:51 | Zoom[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:41 | hmmmmm | ZOOM! |
18:06:48 | hmmmmm | you used concat? :o |
18:07:21 | Zoom[m] | I used Vim |
18:07:52 | hmmmmm | :o |
18:08:14 | planetis[m] | Options has its own map implementation |
18:08:24 | * | bung quit (Ping timeout: 256 seconds) |
18:09:00 | hmmmmm | well I'm importing sequtils and trying concat hope the compiler doesn't explode in my face |
18:09:03 | Zoom[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:34 | planetis[m] | https://nim-lang.org/docs/options.html |
18:09:34 | Zoom[m] | You don't need sequtils to translate your version |
18:10:03 | Zoom[m] | Yeah, planetis, do you think I don't have it open right there? ;) |
18:10:18 | hmmmmm | ye nari told me so but it's the only tool I know right now so I'm trying it |
18:11:52 | Zoom[m] | hmmmmm: https://nim-lang.org/docs/system.html#system-module-seqs |
18:12:03 | Zoom[m] | Look there |
18:14:37 | * | hmmmm joined #nim |
18:14:38 | * | hmmmmm quit (Ping timeout: 256 seconds) |
18:14:58 | hmmmm | oh |
18:15:04 | hmmmm | there is a & operator :o |
18:15:14 | hmmmm | also can I use slices? |
18:17:38 | * | Vladar joined #nim |
18:17:43 | Zoom[m] | you already are, in what you had in the playground |
18:18:24 | hmmmm | oh right those are slices of seqs |
18:20:35 | Zoom[m] | I don't really get yet how to pass a closure into option.map |
18:22:31 | FromDiscord | <lqdev> `myOption.map(proc (value: YourType) = discard)` |
18:22:58 | Zoom[m] | It wants `proc (input: T){.closure.}` |
18:23:34 | Zoom[m] | But I have `proc (x: var seq[float]){.closure, noSideEffect, gcsafe, locks: 0.}` |
18:24:28 | FromDiscord | <lqdev> it's because you're passing `var seq[float]` |
18:24:40 | FromDiscord | <nikki> is seq[float] the value type in the option |
18:25:00 | * | astronavt quit (Quit: ...) |
18:25:03 | Zoom[m] | nikki, yep |
18:25:27 | FromDiscord | <nikki> you probs want non-var |
18:25:32 | FromDiscord | <nikki> but otherwise that should work right |
18:26:07 | Zoom[m] | But that's the tpoint, I'd like to modify the contents |
18:26:21 | Zoom[m] | It doesn't |
18:26:34 | FromDiscord | <lqdev> Zoom: https://nim-lang.org/docs/options.html#get%2COption%5BT%5D_2 |
18:26:47 | * | astronavt joined #nim |
18:26:51 | FromDiscord | <nikki> ya map is for reading and returning new contents |
18:26:53 | * | astronavt quit (Remote host closed the connection) |
18:26:57 | FromDiscord | <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:01 | FromDiscord | <nikki> yea and you can also so `theProc(x.get)` |
18:28:10 | FromDiscord | <nikki> if you meant you wanted to use a proc that already exists |
18:28:10 | Zoom[m] | Of course I could use get, but it's strange that you can't modify with map |
18:28:34 | FromDiscord | <nikki> it's not, map for any mappable literally always means return new value |
18:28:41 | FromDiscord | <lqdev> but why'd you want to use map anyways |
18:28:45 | FromDiscord | <nikki> the modification is by returning the new value in the proc |
18:28:49 | Zoom[m] | Does it change anything? If it doesn't let me :) |
18:28:53 | FromDiscord | <lqdev> it's less efficient because you're creating a closure |
18:29:04 | FromDiscord | <lqdev> so why use it when you can just `get` |
18:29:04 | FromDiscord | <nikki> like: foo.map(proc(x: int) = 2 x) |
18:29:10 | planetis[m] | I wonder if sugar.collect can work with option |
18:29:26 | FromDiscord | <lqdev> nikki more like `foo.map(proc (x: int): int = 2 x)` |
18:29:31 | FromDiscord | <mratsim> there is always an option to collect sugar |
18:29:32 | Zoom[m] | Yaah, nikki, you're right |
18:29:36 | FromDiscord | <nikki> yea i'm on mobile but u get the idea |
18:29:50 | FromDiscord | <nikki> https://discord.com/channels/371759389889003530/371759389889003532/778325292917587989 |
18:29:55 | FromDiscord | <nikki> did u read this msg or just skip it lol |
18:30:01 | planetis[m] | only if we define special syntax for it |
18:30:05 | FromDiscord | <nikki> oh wait ur on matrix |
18:30:11 | planetis[m] | Lol mratsim |
18:30:17 | hmmmm | woa I think it works now :O |
18:30:21 | Zoom[m] | I'm so used to move by default I still think this way |
18:30:32 | hmmmm | return s[0] & withv was the solution |
18:30:58 | hmmmm | thanks nari and zoom |
18:31:06 | FromDiscord | <nikki> in any language with mappable types (aka functors) the fn you pass to map is a -> b |
18:31:14 | FromDiscord | <nikki> not a -> void with modification |
18:32:03 | FromDiscord | <nikki> https://en.m.wikipedia.org/wiki/Functor_(functional_programming) |
18:33:00 | FromDiscord | <nikki> Zoom: one thing (the main thing even) this allows you to do is return a value of a different type |
18:33:14 | FromDiscord | <nikki> not possible by just modifying the param |
18:33:41 | FromDiscord | <nikki> eg. theOpt.map(proc(x: int): string = $x) |
18:33:59 | FromDiscord | <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:21 | FromDiscord | <mratsim> if you want to modify the input use applyIt template from sequtils |
18:36:00 | FromDiscord | <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:57 | Zoom[m] | I had a brainfart, really. What I want is flatMap |
18:37:58 | Zoom[m] | mratsim, thanks, but I think applyIt and mapIt are not implemented for options |
18:38:44 | FromDiscord | <nikki> i usually just use for loops and eg. foo.get = 3 or whatever even tho i've studied functional stuff :p |
18:38:51 | FromDiscord | <nikki> .keepItIf is rly useful tho |
18:39:14 | * | bung joined #nim |
18:40:13 | FromDiscord | <nikki> Zoom: even flatMap doesn't let you just modify the parameter |
18:40:33 | FromDiscord | <nikki> but yeah you can get another level of optionality with flatmap (returning a new option) |
18:40:57 | Zoom[m] | Yeah, I see it |
18:41:04 | FromDiscord | <mratsim> flatmap is Option[Option[T]] -> Option[U] no? |
18:41:22 | FromDiscord | <mratsim> or I'm missing something |
18:42:22 | Zoom[m] | Nope, that's just flatten. |
18:42:25 | Zoom[m] | https://doc.rust-lang.org/std/option/enum.Option.html#method.and_then |
18:42:26 | Zoom[m] | It's and_then in Rust |
18:42:43 | Zoom[m] | I want that :D |
18:43:11 | FromDiscord | <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:22 | FromDiscord | <nikki> you get none if the original was none or if the fn returned none |
18:43:23 | FromDiscord | <mratsim> isn't that just map |
18:43:34 | FromDiscord | <nikki> no map applies T -> U fn |
18:43:56 | FromDiscord | <nikki> you are just able to also return none in the fn in flatMap |
18:43:58 | FromDiscord | <mratsim> ok |
18:44:19 | * | bung quit (Ping timeout: 272 seconds) |
18:44:25 | FromDiscord | <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:41 | FromDiscord | <nikki> the compiler agrees lol |
18:44:53 | FromDiscord | <nikki> it's nice for streams tho |
18:44:55 | FromDiscord | <mratsim> I can read functional code, but I can't name all the concepts :p |
18:45:05 | Zoom[m] | I'm just hooked |
18:45:25 | FromDiscord | <nikki> yea i had a pretty solid hooked phase which is when i picked up the concepts π |
18:45:36 | FromDiscord | <nikki> Zoom u write any Haskell / ML? |
18:45:50 | * | jjido joined #nim |
18:45:58 | Zoom[m] | Nope, I get headaches from reading Nix, though. |
18:46:06 | FromDiscord | <nikki> lmao |
18:46:32 | FromDiscord | <nikki> mratsim: one cool application of flatMap is for "errors" |
18:46:38 | Zoom[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:42 | FromDiscord | <nikki> like imagine if each step can error among a chain of transforms |
18:46:51 | FromDiscord | <nikki> if any early one errors you bail |
18:47:11 | FromDiscord | <nikki> each step has to be allowed to return Option[K] for whatever K |
18:47:35 | ForumUpdaterBot | New 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:59 | FromDiscord | <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:52 | FromDiscord | <mratsim> I remember instance type for my Haskell days, and I do use Result monads for error handling in Nim |
18:49:14 | FromDiscord | <nikki> nice. what context do you end up doing the error handling in? |
18:49:21 | FromDiscord | <mratsim> blockchain |
18:49:27 | FromDiscord | <nikki> makes sense |
18:49:48 | FromDiscord | <nikki> my main work is in ui or games lol where i still can't decide what the meaningful error system is |
18:50:03 | FromDiscord | <nikki> it's usually just something like exceptions with reporting at toplevel |
18:50:50 | FromDiscord | <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:04 | FromDiscord | <nikki> agree with that def |
18:51:14 | FromDiscord | <nikki> if i'm writing a library, i need to give the lib user the control over errors |
18:51:35 | FromDiscord | <nikki> zig's error system was kiiinda nice when i tried it |
18:51:44 | FromDiscord | <nikki> it's result enums with some syntax sugar |
18:51:53 | FromDiscord | <mratsim> Example: https://github.com/status-im/nimbus-eth2/blob/master/beacon_chain/fork_choice/fork_choice.nim#L172-L179 |
18:52:15 | FromDiscord | <nikki> looks sensible |
18:52:43 | FromDiscord | <mratsim> THe "?" is a template shortcut that does early return on an error Result |
18:53:07 | FromDiscord | <nikki> great. nim's flexibility is so good regarding such things |
18:53:28 | FromDiscord | <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:57 | FromDiscord | <nikki> yea saw that. one interesting version is also an infix variant that returns the left else the right |
18:54:33 | FromDiscord | <nikki> parseSomething() orElse defaultValue |
18:58:49 | Zoom[m] | So, I changed my mind. I want a map with a sink. |
19:01:46 | FromDiscord | <nikki> Zoom: why not just use normal things like = |
19:01:55 | FromDiscord | <Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2Eva |
19:01:59 | FromDiscord | <nikki> Zoom: assigning to things, using if else and loops π |
19:02:35 | FromDiscord | <nikki> @Clownstick Von FuckFace lmao uhhh |
19:02:49 | FromDiscord | <nikki> if you echo sth in the when does it get executed |
19:02:58 | FromDiscord | <nikki> aka is that actually the main module |
19:02:58 | Zoom[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:15 | FromDiscord | <Clownstick Von FuckFace> yeah, if i manually put the dlls there it works |
19:03:20 | FromDiscord | <nikki> yeah but those variables are sensible to have. they are actually documentation imo |
19:03:30 | FromDiscord | <nikki> otherwise you can just write things pointfree with SKI if you want :p |
19:03:44 | FromDiscord | <nikki> @Clownstick Von FuckFace you answered a diff question from the one i asked |
19:04:00 | Zoom[m] | hmmmm: what did you end up with? |
19:04:20 | FromDiscord | <Recruit_main707> bruh |
19:04:42 | FromDiscord | <nikki> @Clownstick Von FuckFace highly recommend static linking tho ;o |
19:04:44 | FromDiscord | <Recruit_main707> (discord related) |
19:04:50 | Zoom[m] | nikki93: SKI? |
19:06:25 | FromDiscord | <nikki> Zoom: https://en.m.wikipedia.org/wiki/SKI_combinator_calculus |
19:06:34 | FromDiscord | <nikki> look, no intermediate variables!!!! |
19:09:08 | FromDiscord | <Clownstick Von FuckFace> @nikki you;re right but im out of time for a deadline :/ |
19:09:14 | * | hmmm joined #nim |
19:09:20 | FromDiscord | <Clownstick Von FuckFace> now all i want ot do is just write the dlls to the cwd when the binary runs |
19:09:37 | FromDiscord | <Clownstick Von FuckFace> butt it seems seems to crash before it can write them |
19:09:39 | FromDiscord | <nikki> that might be ... too late |
19:09:40 | * | luis__ joined #nim |
19:09:41 | FromDiscord | <nikki> yeah |
19:09:56 | FromDiscord | <nikki> you can write two exes |
19:10:07 | FromDiscord | <nikki> have one exe that writes the real exe and the dlls |
19:10:11 | FromDiscord | <nikki> then executes the real exe |
19:10:12 | FromDiscord | <nikki> and exits |
19:10:14 | FromDiscord | <nikki> lol |
19:11:34 | FromDiscord | <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:08 | hmmm | hallo :> |
19:13:20 | hmmm | nari nari you there :o |
19:14:09 | Prestige | hello |
19:14:10 | FromDiscord | <Clownstick Von FuckFace> π’ |
19:14:22 | FromDiscord | <Clownstick Von FuckFace> nim + ssl is brutal man |
19:14:38 | hmmm | hi prestige |
19:14:40 | FromDiscord | <ache of head> What even is your username |
19:15:13 | Prestige | sup hmmm |
19:15:55 | * | bung joined #nim |
19:16:28 | hmmm | I finally have a proc working that takes some floats and output some floats |
19:16:39 | hmmm | what if I want to take some floats and ints? |
19:16:50 | hmmm | how do I abstract the proc to work with any number |
19:17:11 | FromDiscord | <lqdev> use SomeNumber instead of `float` |
19:17:19 | hmmm | oh |
19:17:27 | hmmm | I'll look in the tutorials |
19:17:47 | FromDiscord | <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:08 | hmmm | I'll look into it |
19:18:10 | FromDiscord | <nikki> @Clownstick Von FuckFace it really isn't. most people are fine either sending dlls or they figure out static linking |
19:18:36 | FromDiscord | <Clownstick Von FuckFace> @nikki I too am fine sneding dlls now π |
19:18:40 | FromDiscord | <Clownstick Von FuckFace> well more or less infe |
19:18:51 | FromDiscord | <Clownstick Von FuckFace> I just want to write bytes bfore trying to load the library |
19:19:42 | FromDiscord | <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:48 | FromDiscord | <nikki> lets just |
19:20:05 | Zoom[m] | hmmm, show what you ended up with for sybsetsum |
19:20:17 | hmmm | oh it works like a charm |
19:20:17 | FromDiscord | <nikki> @Clownstick Von FuckFace try the installer exe approach maybe |
19:20:19 | hmmm | I'll show you |
19:20:34 | * | bung quit (Ping timeout: 265 seconds) |
19:21:05 | hmmm | https://play.nim-lang.org/#ix=2Evf |
19:21:18 | hmmm | now I need it to take ints too |
19:21:24 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
19:22:16 | hmmm | but don't tell me, I'm looking into this T thing |
19:23:31 | Zoom[m] | hmmm: look: https://play.nim-lang.org/#ix=2Evh |
19:23:55 | Zoom[m] | Do you see the difference? |
19:25:30 | hmmm | it'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:28 | planetis[m] | man stop confusing hmmm |
19:26:32 | narimiran | +1 |
19:26:35 | hmmm | yea do it |
19:26:45 | planetis[m] | if i was a noob i wouldn't understand that stuff either |
19:26:58 | narimiran | Zoom[m]: is your version a try to overwhelm a newcomer? |
19:27:02 | Zoom[m] | At least look at the superfluous branching |
19:27:04 | hmmm | and you wouldn't be a noob half as big as me |
19:27:26 | planetis[m] | nah im sure i was |
19:27:32 | hmmm | nono 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:34 | narimiran | no need for `Option` there |
19:27:43 | Zoom[m] | narimiran in no way, I'd like to show what's possible |
19:28:48 | narimiran | Zoom[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:49 | FromDiscord | <shashlick> @Clownstick Von FuckFace it won't work for dlls since they are loaded by Nim before your main function is called |
19:29:00 | hmmm | aaaaa |
19:29:03 | hmmm | :| |
19:29:03 | Zoom[m] | I'm a noob too, I don't say I have the correct way or anything like that |
19:29:03 | FromDiscord | <shashlick> Tried pinging on telegram but it's broken for me |
19:29:19 | Zoom[m] | narimiran, He mentioned other types after I wrote that |
19:29:20 | FromDiscord | <shashlick> i made nimdeps for the same use case |
19:29:22 | narimiran | Zoom[m]: showing him (1) sink, (2) openarray, (3) Option is way too much |
19:29:36 | Zoom[m] | I don't see how generics are easier for a noob than an option. |
19:29:36 | FromDiscord | <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:48 | FromDiscord | <shashlick> but openssl.nim doesn't have support for either |
19:30:03 | Zoom[m] | I wanted to start with the obvious - the comparisons |
19:30:23 | narimiran | oh, and (4) if expression |
19:30:56 | Zoom[m] | hmmm: look, you have 2 branches of your first if that return exactly the same thing |
19:31:39 | FromDiscord | <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:46 | FromDiscord | <Clownstick Von FuckFace> and it still drops dlls onto disk but for now this will have to do |
19:32:02 | FromDiscord | <nikki> lolol |
19:32:08 | narimiran | Zoom[m]: "you have two branches, let me fix that by introducing 4 new concepts" :P :D |
19:32:17 | Zoom[m] | hmmm: AND you compare a variable with 0 and right after that make sure it's < 1. |
19:32:19 | FromDiscord | <Clownstick Von FuckFace> also my bad. ive been up for like... 3 days and im a zombie |
19:32:24 | FromDiscord | <shashlick> Can you share your code and build steps |
19:32:26 | FromDiscord | <Clownstick Von FuckFace> sorry if i wasn't easy to help |
19:32:49 | FromDiscord | <Clownstick Von FuckFace> @shashlick yeah sure-- for openssl attempt at static linking, or for the dll workaround? |
19:32:51 | FromDiscord | <nikki> i think when asking for help the best you can do is share entire code snd steps etcth |
19:32:54 | Zoom[m] | narimiran: c'mon, it's not hard to explain them all one by one with that code. |
19:33:05 | FromDiscord | <shashlick> Static |
19:33:14 | FromDiscord | <Clownstick Von FuckFace> yeah sure thing. is a zip ok? |
19:33:16 | * | luis__ quit (Ping timeout: 240 seconds) |
19:33:17 | FromDiscord | <shashlick> You cannot use the dll method like I mentioned above |
19:33:18 | * | habamax quit (Ping timeout: 260 seconds) |
19:33:21 | FromDiscord | <shashlick> Ya |
19:33:23 | FromDiscord | <Clownstick Von FuckFace> 1 sec |
19:33:37 | narimiran | Zoom[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:01 | narimiran | do even regular nim users know about `sink`? |
19:34:28 | Zoom[m] | narimiran, I wasn't there :D |
19:34:42 | narimiran | that explains your optimism ;) |
19:35:03 | hmmm | yea but now I'm a result and return expert |
19:35:11 | hmmm | ask me anything |
19:35:13 | * | luis__ joined #nim |
19:35:19 | narimiran | bbl guys, good luck :) |
19:35:25 | hmmm | cu :> |
19:35:30 | Zoom[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:30 | FromDiscord | <nikki> u don't eveen need sink openArray |
19:35:32 | FromDiscord | <nikki> that doesn't do anything |
19:35:37 | FromDiscord | <nikki> an openArray is already a reference |
19:35:51 | FromDiscord | <nikki> er; is already a view really |
19:36:13 | FromDiscord | <nikki> you want sink if you're transferring the ownership of something inward |
19:37:02 | Zoom[m] | K, that's good to hear. |
19:37:12 | FromDiscord | <nikki> there |
19:37:17 | FromDiscord | <nikki> there's also not actually less branching? |
19:37:28 | Zoom[m] | I just don't have an intuition on when's any copying happen in nim |
19:37:32 | FromDiscord | <nikki> or just one fewer |
19:37:40 | FromDiscord | <nikki> Zoom: do you understand C? |
19:37:42 | FromDiscord | <nikki> if so you can look at the generated C code |
19:37:56 | FromDiscord | <nikki> that's what i've been doing usually |
19:37:59 | Prestige | I'm in the same boat as Zoom[m] |
19:38:08 | FromDiscord | <nikki> otherwise -- the main thing is that all types are copied, except view types which are just views |
19:38:23 | FromDiscord | <nikki> even references are copied (the data they point to is not copied) |
19:38:36 | Zoom[m] | Yeah, that's what I was afraid of when I put the superfluous sink there |
19:38:39 | FromDiscord | <nikki> you can mark =copy for any type as an error |
19:38:46 | FromDiscord | <nikki> openArray is a view type |
19:38:55 | Zoom[m] | I got that |
19:39:20 | Prestige | how does a 'view' work, a non-copied ref? |
19:40:07 | Zoom[m] | I also got away with seq concatenation and replaced it with growing |
19:40:23 | FromDiscord | <nikki> Prestige: underneath usually there's just a pointer. no incref/decref |
19:40:32 | FromDiscord | <nikki> a ref, when copied, involves an incref (and a decref when dropped) |
19:40:45 | FromDiscord | <nikki> moving a ref involves no inc/dec tho (so eg. if a ref is sunk) |
19:41:02 | FromDiscord | <Clownstick Von FuckFace> https://media.discordapp.net/attachments/371759389889003532/778343963525382164/ssl_test.7z |
19:41:11 | FromDiscord | <Clownstick Von FuckFace> @shashlick here is my setup |
19:41:26 | FromDiscord | <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:29 | Prestige | @nikki thanks - where's the literature on this btw? |
19:41:32 | FromDiscord | <Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix= |
19:41:55 | FromDiscord | <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:02 | FromDiscord | <nikki> and also just writing stuff and looking at the gen'd C (highly recommend that) |
19:42:31 | Prestige | ah ty ty |
19:42:37 | Prestige | I should learn C I guess |
19:42:40 | FromDiscord | <nikki> one thing that's π€ π€ in nim is that strings get copied a ton |
19:42:53 | FromDiscord | <nikki> or can be -- by default |
19:43:47 | hmmm | so 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:36 | FromDiscord | <nikki> hmmm: when you write `proc [T](... blah: T) = ... T ...` etc. |
19:44:52 | FromDiscord | <nikki> you're basically saying that `T` is a parameter just like the other normal parameters of a proc |
19:44:59 | FromDiscord | <nikki> except in this case it denotes a type (rather than a value) |
19:45:07 | hmmm | oh |
19:45:10 | FromDiscord | <nikki> er sorry `proc foo[T]` |
19:45:27 | FromDiscord | <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:31 | FromDiscord | <nikki> `SomeNumber` just says it has to be a number |
19:46:06 | FromDiscord | <nikki> this is useful to write procs that work over many different types (aka generics) |
19:46:13 | hmmm | yes I want that |
19:47:11 | FromDiscord | <nikki> nim will basically create a version of your proc for each type that you end up using it (called an 'instantiation') |
19:47:19 | FromDiscord | <nikki> this generalizes to many parameters `proc foo[T, U, ...]` |
19:47:25 | hmmm | oh this is interesting |
19:47:43 | hmmm | so if I call it only with floats will make a version restricted to floats |
19:47:44 | FromDiscord | <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:57 | FromDiscord | <nikki> eg. if you had a proc `proc add[T](a, b: T) = a + b` |
19:48:08 | FromDiscord | <nikki> it'll work on `add(2, 3)` but fail on `add("hi", "bye")` |
19:48:09 | * | jjido joined #nim |
19:48:15 | FromDiscord | <nikki> the failure will be because the `+` doesn't work |
19:48:24 | FromDiscord | <nikki> but if you said `T: SomeNumber` the failure message will be clearer -- by saying hey this wasn't a number |
19:48:31 | FromDiscord | <nikki> instead of saying "hey deep in this code the + didn't work" |
19:48:57 | hmmm | yea it's better Somenumber because the input need to be numbers |
19:49:09 | FromDiscord | <nikki> yeah it documents that + gives better error messages |
19:49:09 | Zoom[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:17 | FromDiscord | <nikki> + if there's definition checking (not there) it'll definition check |
19:49:57 | FromDiscord | <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:02 | FromDiscord | <nikki> because you prematurely constrained it |
19:50:12 | FromDiscord | <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:31 | FromDiscord | <nikki> you can go the other way: constrain to the smallest set, and open the constraint as you go |
19:50:41 | hmmm | I think I'm still missing something because the compiler still complains about mismatch :"type mismatch: got <float64> but expected 'int literal" |
19:50:57 | FromDiscord | <nikki> hard to say what the issue is without looking at the code |
19:51:09 | Zoom[m] | It has to show you the line number |
19:51:09 | hmmm | ha! I can show you that |
19:51:28 | FromDiscord | <nikki> (generally we can avoid this extra step by always posting the code for questions we ask) |
19:51:44 | hmmm | https://play.nim-lang.org/#ix=2Evw |
19:52:20 | FromDiscord | <nikki> first off you want `num: T` probably |
19:52:44 | FromDiscord | <nikki> this also gives me a different error from the one you posted in your message earlier |
19:52:48 | FromDiscord | <nikki> so i'm not sure what code that was about |
19:53:01 | FromDiscord | <Rebel> Is there a convenient way to list drives in Nim? |
19:53:08 | hmmm | it works if you put 200.00 instead of 200 |
19:53:18 | FromDiscord | <nikki> yeah the reason is that all of the elements need to have the same type |
19:53:22 | FromDiscord | <nikki> and seqs infer their type based on the first element |
19:53:28 | FromDiscord | <nikki> try moving the 200 to be the second element |
19:53:30 | FromDiscord | <nikki> and not using 200.0 |
19:54:12 | hmmm | :O |
19:54:17 | hmmm | it works |
19:54:24 | FromDiscord | <nikki> which thing |
19:54:30 | FromDiscord | <nikki> as always, idk what you're talking about :p |
19:54:37 | hmmm | and what if the first element is an int :o |
19:55:03 | FromDiscord | <nikki> seqs infer their type from the first elem. if the first is an int the rest need to be int |
19:55:05 | FromDiscord | <nikki> or convertible to |
19:55:09 | FromDiscord | <nikki> (implicitly convertible to) |
19:55:44 | hmmm | :o |
19:56:32 | FromDiscord | <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:38 | FromDiscord | <Clownstick Von FuckFace> building using nimble build |
19:59:39 | Prestige | ". AnΒ immutableΒ view type is a view type that is not a mutable view type." Lol |
20:00:35 | FromDiscord | <nikki> Prestige: there seem to be some bugs with the view stuff enabled by `--experimental:views` |
20:00:48 | FromDiscord | <nikki> the enabled-by-default stuff seems to be working fine toh |
20:01:24 | FromDiscord | <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:49 | FromDiscord | <nikki> returning `lent T` makes eg. https://github.com/nikki93/ng-public/blob/9a989b537762a90dd4c1c1efab4ed5c42675ea03/src/main.nim#L165 do a copy |
20:03:10 | hmmm | nikki 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:23 | FromDiscord | <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:27 | FromDiscord | <nikki> vs. using seq literals |
20:04:36 | FromDiscord | <nikki> (the `@[1, 2, 3]` format is called a literal) |
20:05:41 | hmmm | what is the difference between using one form or the other :o |
20:06:10 | FromDiscord | <nikki> try them out and see |
20:06:39 | hmmm | var blah seq float means I need too find an append method? |
20:06:56 | FromDiscord | <nikki> yeah that's just `blah.add(2)` |
20:06:59 | FromDiscord | <nikki> for example |
20:07:01 | hmmm | perfect |
20:07:02 | hmmm | I'll try |
20:09:49 | FromDiscord | <shashlick> @Clownstick Von FuckFace what's your error |
20:10:36 | disruptek | who wants to write me a simple macro useful enough that it could end up in, say, fusion? π |
20:12:24 | FromDiscord | <shashlick> @Clownstick Von FuckFace your project compiled and ran just fine for me |
20:12:44 | FromDiscord | <nikki> i think they said that they had it working |
20:12:56 | FromDiscord | <nikki> and were just posting it for reference |
20:13:39 | * | luis__ quit (Remote host closed the connection) |
20:15:01 | hmmm | nikki what is the nim version of float(int) |
20:15:35 | * | NimBot joined #nim |
20:15:42 | hmmm | converting an int to float |
20:15:51 | FromDiscord | <nikki> cast[float](...) |
20:15:55 | FromDiscord | <shashlick> meh |
20:15:58 | FromDiscord | <nikki> or .asFloat |
20:16:00 | FromDiscord | <nikki> actually the latter |
20:16:02 | FromDiscord | <nikki> sry |
20:16:09 | hmmm | perfect |
20:16:10 | hmmm | thanks |
20:16:13 | FromDiscord | <nikki> !eval echo 2.asFloat |
20:16:15 | NimBot | Compile 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:21 | mipri | !eval echo (4.float, float(4)) |
20:16:24 | FromDiscord | <nikki> ugh it's toFloat |
20:16:25 | NimBot | (4.0, 4.0) |
20:16:29 | FromDiscord | <nikki> i think? |
20:16:43 | FromDiscord | <nikki> looks like the nim version of float(int) is float(int) |
20:16:58 | hmmm | hmm |
20:17:01 | hmmm | that's convenient |
20:17:10 | FromDiscord | <nikki> only bc. you already know float(int) π |
20:17:15 | hmmm | :D |
20:18:03 | FromDiscord | <nikki> !eval echo 4.toFloat |
20:18:06 | NimBot | 4.0 |
20:18:14 | FromDiscord | <nikki> i like the toX versions |
20:18:59 | mipri | https://github.com/nim-lang/Nim/blob/version-1-4/lib/system.nim#L1436 |
20:20:08 | mipri | !eval echo (toInt(4.5), int(4.5)) # meanwhile |
20:20:11 | NimBot | (5, 4) |
20:20:55 | FromDiscord | <nikki> i tend to explicitly round or floor when doing that |
20:23:40 | hmmm | nikki what is the nim version of "if type(7) == int: do something" |
20:23:57 | mipri | s/==/is/ |
20:25:23 | planetis[m] | when typepof(T): |
20:25:45 | hmmm | thanks planetis <: |
20:25:45 | planetis[m] | forgot the `== int` |
20:25:55 | hmmm | I think there is an anime called like you |
20:26:08 | planetis[m] | i've seen it |
20:26:12 | hmmm | pretty good |
20:26:21 | planetis[m] | agreed |
20:27:35 | * | lf_araujo joined #nim |
20:30:33 | FromGitter | <sealmove> wow I run into a stupid problem. my module exposes a symbol that has the same name as the module |
20:30:51 | FromGitter | <sealmove> and when i try to use the symbol, nim assumes i mean the module namespace |
20:30:59 | FromGitter | <sealmove> don't know how to get around this |
20:31:30 | FromDiscord | <Recruit_main707> rename one of the two |
20:32:28 | planetis[m] | is it a proc? |
20:32:41 | FromGitter | <sealmove> it's a tuple of 2 procs |
20:32:45 | FromDiscord | <Recruit_main707> probably a type |
20:33:11 | planetis[m] | bc i remembered defining a proc with the same name with module and it worked |
20:33:24 | FromDiscord | <Recruit_main707> using uppercase in one and lowercase in the other one can fix it |
20:33:41 | FromGitter | <sealmove> oh that's a smart idea, will probably go with this |
20:33:53 | lf_araujo | Hi 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:31 | FromDiscord | <Clownstick Von FuckFace> @shashlick https://pastebin.com/c1YkzyKh |
20:38:41 | FromDiscord | <shashlick> @Clownstick Von FuckFace i don't see that when i compile - what's in C:\Users\User\nimcache\nimterop\nimopenssl |
20:38:53 | FromDiscord | <shashlick> there should be a json file - if you can share that |
20:39:18 | FromDiscord | <Clownstick Von FuckFace> yup! 1 sec |
20:41:26 | FromDiscord | <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:34 | Prestige | lf_araujo: hey, what would you like in your status? |
20:42:11 | lf_araujo | volume status |
20:43:31 | Prestige | I use pamixer for that, one moment |
20:44:24 | FromDiscord | <shashlick> @Clownstick Von FuckFace most likely, your issue is that your mingw version is pretty old |
20:44:51 | FromDiscord | <Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix= |
20:45:05 | FromDiscord | <Clownstick Von FuckFace> im using hte mingw installed by choosenim π |
20:45:17 | lf_araujo | <Prestige> thanks |
20:45:25 | Prestige | lf_araujo: https://0x0.st/i59W.bin |
20:45:39 | FromDiscord | <Clownstick Von FuckFace> (edit) |
20:45:41 | FromDiscord | <shashlick> @Clownstick Von FuckFace what's the output of `gcc --version` |
20:46:05 | FromDiscord | <shashlick> then its mostly cause you don't have some msvc runtime installed |
20:46:08 | * | narimiran quit (Ping timeout: 260 seconds) |
20:46:11 | FromDiscord | <shashlick> https://www.freebasic.net/forum/viewtopic.php?t=26422 |
20:46:11 | Prestige | To refresh on volume change, I have my hotkey daemon kill the sleep in the while loop when I change volume |
20:46:11 | FromDiscord | <Clownstick Von FuckFace> sent a code paste, see https://play.nim-lang.org/#ix=2EvV |
20:46:23 | Prestige | There's probably a better solution with dwmblocks |
20:46:31 | FromDiscord | <shashlick> @Clownstick Von FuckFace i'm running 9.3.0 on my machine |
20:47:10 | FromDiscord | <Clownstick Von FuckFace> that is super old you're right |
20:47:32 | FromDiscord | <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:33 | lf_araujo | <Prestige> can you confirm the link, it is pointing to a file, it seems |
20:47:51 | Prestige | Yeah, it's just a shell script I just wrote |
20:47:57 | FromDiscord | <Clownstick Von FuckFace> yeah looks like choosenim bundles an old mingw |
20:48:10 | FromDiscord | <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:10 | FromDiscord | <shashlick> i'm testing on win10 1909 which is quite recent |
20:48:25 | FromDiscord | <Clownstick Von FuckFace> how did you install nim btw? |
20:48:41 | Prestige | lf_araujo: https://pastebin.com/NfvjWmAD if that's better for you |
20:48:44 | FromDiscord | <Clownstick Von FuckFace> choosenim is fine right? |
20:48:45 | lf_araujo | <Prestige> ok, got it, thanks |
20:49:05 | FromDiscord | <shashlick> i use choosenim, yes - but install mingw before nim |
20:49:09 | FromDiscord | <shashlick> i use scoop to install gcc |
20:49:12 | lf_araujo | <Prestige> How do I call it from the toml? |
20:49:28 | FromDiscord | <shashlick> 6.3.0 is the version of gcc posted on nim-lang.org |
20:49:35 | FromDiscord | <shashlick> that should get upgraded at some point |
20:49:52 | FromDiscord | <Clownstick Von FuckFace> gotcha |
20:49:52 | Prestige | you can put it it the autostart lf_araujo https://github.com/avahe-kellenberger/nimdow/blob/master/config.default.toml#L23 |
20:50:06 | lf_araujo | great, thanks |
20:50:08 | Prestige | just make sure to chmod +x the script |
20:52:05 | Prestige | you can check out https://dwm.suckless.org/status_monitor/ for more status stuff, dwm and nimdow work the same in that regard |
20:52:37 | lf_araujo | will 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:06 | hmmm | cough cough |
21:22:55 | hmmm | so I've implemented both the literal @[1,2,3] and seq[float] seqs but still see no difference, they both work :o |
21:23:24 | FromDiscord | <nikki> the difference isn't that one of them doesn't work |
21:23:52 | FromDiscord | <nikki> the literal case is for when you have the element list literally in your code |
21:23:59 | hmmm | aaaaah ok |
21:24:01 | hmmm | I see |
21:25:18 | * | luis1 quit (Quit: WeeChat 2.9) |
21:27:59 | hmmm | well 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:36 | FromDiscord | <nikki> the seq is of one type -- `seq[T]` |
21:28:53 | FromDiscord | <nikki> what you're getting at is that all the elements are of one type |
21:29:02 | hmmm | but I can specify seq[float] and all the elements will be float right? |
21:29:09 | hmmm | yea! |
21:29:18 | FromDiscord | <nikki> that's what it means when you say `seq[float]`, yeah |
21:29:31 | hmmm | lol sorry I'm a bit of a caveman |
21:30:44 | FromDiscord | <Clownstick Von FuckFace> @shassard same error. Can you link me where you installed mingw from? |
21:31:06 | FromDiscord | <shashlick> https://scoop.sh |
21:31:09 | FromDiscord | <shashlick> scoop install gcc |
21:31:26 | FromDiscord | <shashlick> but better to check msvc runtimes |
21:31:30 | FromDiscord | <shashlick> what version of windows |
21:31:40 | * | natrys quit (Ping timeout: 246 seconds) |
21:33:19 | FromDiscord | <Clownstick Von FuckFace> windows 10 deval |
21:35:06 | FromDiscord | <Clownstick Von FuckFace> did you install nim via choose nim? |
21:35:48 | FromDiscord | <shashlick> yes |
21:36:04 | FromDiscord | <shashlick> but since i install gcc before nim, choosenim doesn't install mingw as well |
21:36:10 | FromDiscord | <shashlick> it detects it in the path and moves on |
21:36:30 | FromDiscord | <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:06 | disruptek | http://ix.io/2Ewr/nim |
21:56:38 | FromGitter | <sealmove> is there a way to control the endian used by system.read[T]? |
22:00:06 | FromDiscord | <Clownstick Von FuckFace> @shashlick you beautiful fucking wizard π |
22:03:48 | FromGitter | <sealmove> Oh wow I found a gimmick |
22:04:16 | FromGitter | <sealmove> If you have a single-fielded tuple, then the syntax `(val)` doesn't construct a tuple |
22:04:26 | FromGitter | <sealmove> a workaround is using `(val),` |
22:04:42 | FromGitter | <sealmove> sorry `(val,)` * |
22:04:59 | FromGitter | <sealmove> maybe this is mentioned in docs, not sure |
22:06:26 | FromGitter | <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:12 | FromDiscord | <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:05 | FromDiscord | <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:25 | FromDiscord | <ElegantBeef> We dont have that, we just newline between operators |
22:32:40 | FromDiscord | <Rebel> alright it will just look really bad that is fine |
22:32:42 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2EwF |
22:32:47 | FromDiscord | <Rebel> oh |
22:33:12 | FromDiscord | <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:17 | hmmm | hmmm |
22:39:33 | FromDiscord | <Clownstick Von FuckFace> @shashlick it did π |
22:39:45 | FromDiscord | <martinium> are there plans to add a REPL to NIM? |
22:39:50 | FromDiscord | <Clownstick Von FuckFace> and i also got libcurl to work π |
22:39:56 | FromDiscord | <ElegantBeef> It has one, but we also have inim |
22:39:59 | FromDiscord | <nikki> @martinium inim is a repl |
22:40:01 | FromDiscord | <ElegantBeef> `nim secret` |
22:40:14 | FromDiscord | <martinium> boom |
22:40:17 | FromDiscord | <martinium> nim secret |
22:40:19 | FromDiscord | <martinium> love it |
22:40:24 | FromDiscord | <martinium> thanks |
22:40:30 | FromDiscord | <ElegantBeef> Iirc it's nimscript, so you may want to use inim |
22:40:42 | FromDiscord | <Clownstick Von FuckFace> @shashlick π₯³ |
22:41:17 | FromDiscord | <martinium> iNim wins |
22:41:53 | * | Vladar quit (Remote host closed the connection) |
22:43:22 | FromDiscord | <shashlick> @Clownstick Von FuckFace π |
22:44:43 | FromDiscord | <Clownstick Von FuckFace> wonder if theres a way to cross compile w/ win. for another time π |
22:44:52 | FromDiscord | <Clownstick Von FuckFace> (edit) "win." => "wine." |
22:45:05 | FromDiscord | <Clownstick Von FuckFace> (edit) "w/ wine." => "from linux." |
22:52:10 | * | bung joined #nim |
22:54:15 | hmmm | what do fmReadWrite, fmReadWriteExisting do different from fmWrite |
22:55:12 | FromDiscord | <ElegantBeef> readwrite allows both reading/writing, readwriteexisting doesnt clear the file if it exists |
22:55:59 | FromDiscord | <ElegantBeef> https://github.com/nim-lang/Nim/blob/version-1-4/lib/system/io.nim#L23 |
22:56:28 | FromDiscord | <nikki> the docs / comments answer a lot of your questions hmmm |
22:56:36 | * | bung quit (Ping timeout: 240 seconds) |
22:56:49 | FromDiscord | <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:50 | hmmm | ty both :> |
23:02:02 | hmmm | those comments are actually very informative |
23:02:14 | * | bung joined #nim |
23:17:30 | FromDiscord | <nikki> you can learn a ton by browsing around the docs and the comments in the code; highly recommend it |
23:21:24 | hmmm | some 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:47 | hmmm | some are way over my level tho |
23:22:03 | FromDiscord | <nikki> every word you don't understand can be googled ;D |
23:22:15 | FromDiscord | <nikki> also quick q -- is there a way to mark all symbols as exported? |
23:22:18 | FromDiscord | <nikki> or like push exported or something |
23:22:31 | FromDiscord | <nikki> i have a module with a bunch of types for which all of the code is in other files |
23:28:22 | FromDiscord | <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:51 | FromDiscord | <exelotl> maybe we could take some learnings from it to try and improve Nim's landing page in the future |
23:42:30 | hmmm | you can define new procs inside the defining of a proc? |
23:42:38 | hmmm | :o |
23:48:26 | FromDiscord | <nikki> ya |
23:48:49 | FromDiscord | <nikki> hmmm: i'd suggest checking out some book or other organized introduction to nim -- "nim in action" is pretty good |
23:49:09 | hmmm | I've read tutorial 1 |
23:49:14 | hmmm | tutorial 2 was pretty hard |
23:49:24 | hmmm | I'll try the book |
23:55:29 | FromDiscord | <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:03 | FromDiscord | <nikki> `let a = [1, 2, 3]`? |
23:57:53 | FromDiscord | <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:49 | FromDiscord | <ElegantBeef> Doesnt give non default 100%, just whatever was the previously |
23:59:51 | disruptek | exelotl: 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. |