<< 09-04-2020 >>

00:01:57*dsrw joined #nim
00:02:26FromDiscord<__ibrahim__> hello!
00:02:26FromDiscord<__ibrahim__> how hard is it for a c++/python noob to try nim opengl
00:02:44FromDiscord<__ibrahim__> i literally just found nim xD
00:08:28*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:13:27companion_cubeAraq: what do you think of `yield from`?
00:16:17FromDiscord<konsumlamm> you actually could implement that as a macro
00:16:30FromDiscord<konsumlamm> or template even
00:16:43companion_cubeI'm trying a template right now
00:16:48companion_cube(could still be in the stdlib!)
00:17:06FromDiscord<konsumlamm> fair, but it doesnt need tp be a builtin
00:17:14FromDiscord<konsumlamm> fair, but it doesnt need to be a builtin
00:17:17companion_cubeno, that's cool
00:17:51number_two__ibrahim__: Difficulty of actually learning how to use it is about the same as any other language. You're essentially using the same library as C's openGL. But Nim abstracts a lot of the complexity away from C, so I guess it may be a little easier
00:18:21number_twoUnfortunately means that if you're looking at tutorials, you do needa do a little bit of fiddling to fond the equivalent of doing stuff in Nim
00:19:29companion_cubeok idk how to write that
00:19:55companion_cubetried https://paste.isomorphis.me/OeZ
00:20:38*dsrw joined #nim
00:21:47*Tlongir joined #nim
00:24:14*number_two quit (Ping timeout: 240 seconds)
00:26:55leorize[m]companion_cube: isn't that just a for loop?
00:27:17leorize[m]also you don't need quote
00:28:13FromDiscord<__ibrahim__> @gitterirc Thanks for your answer! Makes sense. I'll fiddle away then
00:28:28companion_cubewrong kind, it seems…
00:30:48*Tlongir is now known as number_one
00:39:59*Zectbumo joined #nim
00:45:39*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:50:41*number_one is now known as number_two
00:55:03FromDiscord<InventorMatt> I'm trying to use the httpclient library but when I compile my code I get "could not load: (libcrypto-1_1-x64|libeay64).dll" both of those libraries are found in my nim bin and they are on my path. does anyone know what is causing this or how to fix it. I am using windows 10 and nim 1.2
01:01:01number_twoInventorMatt: I think you can use '-d:nimDebugDlOpen'. I might give you more info
01:03:30FromDiscord<InventorMatt> number_two: I've tried that but I getting an error for that as well saying "argument for command line option expected: '-d'"
01:04:25number_twoInventorMatt: Can you paste your call to nim here, please?
01:06:17FromDiscord<InventorMatt> nim compile --verbosity:0 -d:nimDebugDlOpen --run "c:\Users\matth\My_Projects\nim_scripts\http_tests\http_tests.nim"
01:10:06number_twoInventorMatt Which command line app are you using? ie command prompt, powershell, git bash etc?
01:11:41number_twoThat seems to run fine on bash, but I'm also on linux.
01:14:29FromDiscord<InventorMatt> number_two: I'm using powershell. I tried it on command prompt and the command runs but the output isn't any different from the usual and its the same error as well
01:17:07*oculux joined #nim
01:17:57*chemist69 quit (Ping timeout: 260 seconds)
01:18:02*oculuxe quit (Ping timeout: 265 seconds)
01:19:55*chemist69 joined #nim
01:19:57number_twoInventorMatt: Hmm, that's weird. Can you try making a bat script that executes it? Or, better yet, add a config.nims file to the root directory of the project and add 'task build, "build me": exec "nim compile --verbosity:0 -d:nimDebugDlOpen --run \"c:\Users\matth\My_Projects\nim_scripts\http_tests\http_tests.nim\"' to it
01:20:02number_twoMaybe that helps
01:20:14*dsrw joined #nim
01:22:52*dsrw quit (Client Quit)
01:26:48*dsrw joined #nim
01:36:40FromDiscord<InventorMatt> number_two: I got that to run and the output was this "Error: unhandled exception: FAILED: nim compile --verbosity:0 --hints:off -d:nimDebugDlOpen --run c:/Users/matth/My_Projects/nim_scripts/http_tests/http_tests.nim [OSError]"
01:36:53FromDiscord<InventorMatt> with a few more tracebacks
01:37:38FromDiscord<InventorMatt> as well as the same failed load error from before
01:37:38number_twoInventorMatt: Oooh, anything interesting in the tracebacks? Maybe pastebin it?
01:38:09FromDiscord<InventorMatt> ould not load: (libcrypto-1_1-x64|libeay64).dll
01:38:09FromDiscord<InventorMatt> Error: execution of an external program failed: 'c:\Users\matth\My_Projects\nim_scripts\http_tests\http_tests.exe '
01:38:10FromDiscord<InventorMatt> stack trace: (most recent call last)
01:38:10FromDiscord<InventorMatt> C:\Users\matth\scoop\apps\nim\current\lib\system\nimscript.nim(401, 18)
01:38:10FromDiscord<InventorMatt> c:\Users\matth\My_Projects\nim_scripts\http_tests\config.nims(2, 10) buildTask
01:38:12FromDiscord<InventorMatt> C:\Users\matth\scoop\apps\nim\current\lib\system\nimscript.nim(260, 7) exec
01:38:16FromDiscord<InventorMatt> C:\Users\matth\scoop\apps\nim\current\lib\system\nimscript.nim(260, 7) Error: unhandled exception: FAILED: nim compile --verbosity:0 --hints:off -d:nimDebugDlOpen --run c:/Users/matth/My_Projects/nim_scripts/http_tests/http_tests.nim [OSError]
01:38:23FromDiscord<InventorMatt> just that
01:38:32*lritter quit (Ping timeout: 256 seconds)
01:39:18*lritter joined #nim
01:42:54FromGitter<mhessler97> ould not load: (libcrypto-1_1-x64|libeay64).dll ⏎ Error: execution of an external program failed: 'c:\Users\matth\My_Projects\nim_scripts\http_tests\http_tests.exe ' ⏎ stack trace: (most recent call last) ⏎ C:\Users\matth\scoop\apps\nim\current\lib\system\nimscript.nim(401, 18) ⏎ c:\Users\matth\My_Projects\nim_scripts\http_tests\config.nims(2, 10) buildTask ... [https:
01:42:54FromGitter... //gitter.im/nim-lang/Nim?at=5e8e7d9e9316f34b8d8cf646]
01:44:43*opal quit (Ping timeout: 240 seconds)
01:46:34*endragor joined #nim
01:48:13number_twoInventorMatt: Can you try just compiling the code and not running it?
01:48:26number_twoUsing the command line
01:52:04*zacharycarter quit (Ping timeout: 256 seconds)
01:52:47FromDiscord<InventorMatt> number_two: it compiles successfully without any errors. the errors only show up when it is run
02:00:24number_twoInventorMatt, Are you using SSL in your code?
02:01:56FromDiscord<InventorMatt> import httpClient
02:01:56FromDiscord<InventorMatt> var client = newHttpClient()
02:01:56FromDiscord<InventorMatt> discard client.getContent("https://covid.ourworldindata.org/data/ecdc/total_cases.csv")
02:02:04FromDiscord<InventorMatt> here is all the code has
02:02:05number_twoInventorMatt maybe you need the -d:ssl flag?
02:02:25number_twoso 'nim c -r <file>'?
02:02:28number_twoSorry
02:02:33number_two'nim c -d:ssl -r <file>'
02:03:22FromDiscord<InventorMatt> I just tried that and I am still getting the same result
02:04:02number_twoSorry, I don't debug DLL imports often (if ever XD). Try putting the DLL's in the same directory as the exe maybe?
02:09:59FromDiscord<InventorMatt> number_two: well that solved it. thanks for your help. I just wish there was an easier way to point to it so I don't have to copy those file into every folder I need that library
02:13:05number_twoInventorMatt: Huzzah! I'm sure there a way. It sounds like an issue with your PATH without context. If it's in the same dir as nim.exe and you can just call nim, then that implies that it in in the PATH...
02:14:05number_twoInventorMatt: Is your %PATH% big? I saw a post where there was another version of pcre64.dll that was being loaded from another folder in the path (but it's an invalid version, so it couldn't load it)
02:14:23number_twoInventorMatt: Try moving the DLL's back and moving nim's directory to the very front of your %PATH%
02:14:46number_twohttps://github.com/nim-lang/Nim/issues/5541 for reference. Could be the same issue?
02:20:05*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:22:35FromDiscord<InventorMatt> I tried moving the path up the front and still nothing. my path length is about 31. I don't know if that is considered too large of an amount
02:25:20number_twoInventorMatt: Any chance you could post your path? If there's not anything sensitive on there
02:25:53*zacharycarter joined #nim
02:26:59FromDiscord<InventorMatt> there is nothing sensitive in there
02:27:00FromDiscord<InventorMatt> C:\Users\matth\scoop\apps\nim\1.2.0\bin;C:\Users\matth\scoop\apps\gcc\current\bin;C:\Users\matth\scoop\shims;C:\Users\matth\AppData\Roaming\Python\Python37\Scripts;C:\Users\matth\AppData\Roaming\Python\share\applications;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShel
02:27:03*number_two is now known as number_one
02:28:08number_oneNothing wrong with the path length. Looks OK to me...
02:30:08FromDiscord<InventorMatt> I'm pretty sure on an earlier version of nim I got the script to work. but that was using 1.06 so maybe the transition to 1.2 messed something up
02:30:50*zacharycarter quit (Ping timeout: 264 seconds)
02:30:52*muffindrake quit (Ping timeout: 260 seconds)
02:32:53*muffindrake joined #nim
02:40:40number_oneInventorMatt: Ok, one last thing. Maybe try passing a direct path to the DLL's with the `-p` argument?
02:41:07number_oneie nim c --path:"C:\Users\matth\scoop\apps\nim\1.2.0\bi" -r <file>
02:41:14number_one* ie nim c --path:"C:\Users\matth\scoop\apps\nim\1.2.0\bin" -r <file>
02:42:17leorizeuhmmm, that's not how you do it, ever
02:42:37leorizeusually it should just work with the DLL in your PATH
02:42:50leorizenote that the DLL must be in the same architecture as your executable
02:45:53*oculux quit (Ping timeout: 258 seconds)
02:50:19*nekits joined #nim
02:51:35FromDiscord<Varriount> leorize: My guess is that the DLL and executable are for 32 and 64 bit respectively (or vice-versa)
02:56:57FromDiscord<Varriount> InventorMatt: If you have Python installed (which it looks like you do) you can use this script: https://raw.githubusercontent.com/tgandor/meats/master/missing/arch_of.py
02:57:15FromDiscord<Varriount> @InventorMatt ^
03:00:38FromDiscord<KingDarBoja> Oh noes! https://ziglang.org/
03:00:53FromDiscord<KingDarBoja> Another programming language lol
03:01:08*waleee-cl quit (Quit: Connection closed for inactivity)
03:01:32*zacharycarter joined #nim
03:03:24FromDiscord<InventorMatt> @Varriount I just ran the script and got x64. everything should be 64 bit as far as I know
03:03:39*oculux joined #nim
03:03:57FromDiscord<Varriount> Did you run the script against your compiled program?
03:05:03FromDiscord<InventorMatt> yes, I did
03:06:15leorize@KingDarBoja: wait only now you realize that it exists? :P
03:06:57*zacharycarter quit (Ping timeout: 256 seconds)
03:07:47FromDiscord<Varriount> InventorMatt: Did you modify your path (such as add the Nim path) after you had your terminal window open?
03:08:07FromDiscord<Varriount> In your system settings
03:08:35FromDiscord<KingDarBoja> Oh yes...
03:08:58FromDiscord<KingDarBoja> Everyday I know something new
03:11:47leorizewell zig is a pretty cool language
03:11:51leorizethough I wouldn't use it :P
03:12:00FromDiscord<Varriount> @InventorMatt Or rather, I should say, try closing your terminal, reopening it, and compiling.
03:12:06FromDiscord<InventorMatt> @Varriount that I forgot to do and it seems to be working now. thank you so much for seeing that.
03:12:30FromDiscord<Varriount> (finally my years of developing on Windows bears fruit)
03:12:50FromGitter<awr1> what is `nnkExprColonExpr`
03:12:52FromDiscord<KingDarBoja> Win4Life
03:12:52FromDiscord<Varriount> *bares
03:13:02FromGitter<awr1> i don't see it mentioned in the macro docs
03:13:36FromGitter<awr1> oh nvm
03:13:42FromDiscord<Varriount> awr: Might be part of the AST when dealing with `for` blocks and such?
03:54:03FromGitter<awr1> i realized what it was
04:06:01*supakeen quit (Quit: WeeChat 1.9.1)
04:06:41*supakeen joined #nim
04:17:30FromDiscord<KingDarBoja> 🙂
04:19:44*narimiran joined #nim
04:24:00FromGitter<awr1> encountered this strangeness just now
04:24:01FromGitter<awr1> https://github.com/nim-lang/Nim/issues/13932
04:24:17FromGitter<awr1> curiously `repr()` gives the correct result
04:26:16*rockcavera quit (Remote host closed the connection)
04:30:30leorizelooks like astGenExpr didn't process type data correctly
04:49:09FromGitter<awr1> it's not only astGenRepr, navigating down the tree, it is a intlit
04:49:39dongbeihmm
04:49:50dongbeileorize thanks for the answers from before
04:50:21leorizeyou're welcome :)
04:50:30dongbeianyone know how chang the cpp compiler version from gnu++14
04:50:42dongbeistring_view doesn't exist for me lol
04:50:59leorize--passC:-std=<version here>
04:51:09dongbeiyou'd think that would work
04:51:30leorizeso what's your issue? :P
04:52:00dongbeinim cpp --passC:-std=c++17 --cincludes:"uWebSockets/uSockets/src/" hello.nim
04:52:19dongbeithe
04:52:20dongbeiError: execution of an external compiler program 'g++ -c -w -w -fpermissive -std=gnu++17 -std=gnu++14 -funsigned-char -I/home/parallels/.choosenim/toolchains/nim-1.2.0/lib -I/home/parallels/work/scratch/nim/uWebSockets/uSockets/src/ -I/home/parallels/work/scratch/nim -o /home/parallels/.cache/nim/hello_d/@mhello.nim.cpp.o /home/parallels/.cache/nim/hello_d/@mhello.nim.cpp' failed with exit code: 1
04:52:29dongbeiessentially both flags are in there
04:52:37dongbeignu++14 and gnu++17
04:52:44dongbeic++17 also doesn't work
04:53:04*narimiran quit (Ping timeout: 256 seconds)
04:53:35dongbeiso gcc++ doesn't recognize string_view as a member of std
04:53:35leorizelooks like Nim passes that by default
04:53:40dongbeiyah
04:54:11leorizetry this then --gcc.cpp.options.always:-std=gnu++17
04:55:03dongbeisame error as before
04:55:25dongbeishould I compile nim myself with extccomp.nim modified or something?
04:55:34leorizetry putting `{.passC: "-std=gnu++17".}` in your .nim file
04:56:09dongbeichecking
04:56:28*lritter quit (Ping timeout: 256 seconds)
04:58:00dongbeiError: expression 'staticExec "gcc-c additionalfile.cpp --flags ", "", ""' is of type 'string' and has to be discarded;
04:58:15dongbeifirst day, doing this, I'm probably including it wrong.
04:58:21dongbeii didn't include the back ticks
04:58:29leorizeyou don't need them
04:58:32dongbeik
04:58:33leorizehow did you put them in?
04:58:57dongbeione sec, pastebinning
04:59:21dongbeihttps://pastebin.com/zdCq9mNL
05:00:36dongbeioh
05:00:38dongbeiOH
05:01:18dongbeii need to check this error, one minute, thank you
05:01:30leorizethe error was simple
05:01:40leorizestaticExec returns a string, and you didn't handle it
05:01:47leorizealso that concatenation is faulty
05:02:02dongbeiyeah
05:02:11leorizealso, do you know that we have a `{.compile.}` pragma?
05:02:19leorizethough it might not be what you want
05:02:47dongbeino, googling it
05:04:59*narimiran joined #nim
05:08:13dongbeiok so instead of using emit I'm using `{.compile: "uWebSockets/src/App.h".}` and instead of the cli option passing I'm using {.passc: "-std=c++17".}
05:08:27dongbeibut the default gnu++14 problem persists
05:08:39*zacharycarter joined #nim
05:08:41dongbeinice that I can avoid the emit I think
05:08:55leorizeI'd say raise an issue on the compiler tracker for not being able to override -std=gnu++14
05:09:11leorizeand also that's not how you use compile :P
05:09:55dongbeibut it gave me the same error lol
05:10:07dongbeii'll change it back to emit and see what happens
05:10:12dongbeihttps://github.com/nim-lang/Nim is the tracker?
05:10:15leorizeyep
05:10:50leorizewe do have a websockets library that you might want to use: https://github.com/niv/websocket.nim
05:11:08dongbeinot as fast
05:11:14dongbeiI've been benchmarking with wrk
05:11:55leorizecan you share the benchmark? :)
05:12:14dongbeithe interoperation of nim and c++ seems like it would be a complete winner in my usecase
05:13:02leorizeyes, but you gotta know how to use it :)
05:13:02*chemist69 quit (Ping timeout: 260 seconds)
05:13:03*zacharycarter quit (Ping timeout: 260 seconds)
05:13:23dongbeithat's my strugle right now lol
05:13:39dongbeigimme a bit and I'll post the bench
05:13:46dongbeiyou want it here or on a gist or something?
05:13:53*chemist69 joined #nim
05:13:55leorizea gist would be nice
05:13:57dongbeikk
05:18:14*oculux quit (Quit: blah)
05:18:59*oculux joined #nim
05:20:13*oculux quit (Client Quit)
05:20:41*oculux joined #nim
05:22:54dongbeiissue created, getting the bench
05:24:34*thomasross quit (Ping timeout: 256 seconds)
05:34:48dongbeihey before i go any further, the fastest compilation options are nim c -d:danger --gc:markAndSweep nimsocket.nim, right? I'm only doing a hello world and I don't want this to be skewed
05:35:31dongbeii tried --gc:none and --gc:arc but that causes errors with asynchttpserver or something
05:36:06dongbeioh what, none works now
05:36:13dongbeiignore me pls
05:45:38dongbeiok
05:45:41dongbeihttps://gist.github.com/ibsusu/0ffd8a3effcaf701e070b17d3ded9c6a
05:45:55dongbeibarebones simple hello world test
05:46:04dongbeiuWebsockets is over twice the speed
05:46:38dongbeiI tried using both arc and none for gc
05:46:58dongbeiif there's another technique I don't know about I can try again
05:48:34dongbeigonna go try and build nim to get past my previous bug, let me know what your thoughts after you take a look pls
05:48:38dongbeii don't want to miss anything
06:09:30*solitudesf joined #nim
06:10:41leorizedongbei: he fastest are -d:danger
06:12:16FromGitter<gogolxdong> What 's this exception `/mnt/c/Nim/lib/system/refs_v2.nim(139) nimDecRefIsLast`
06:12:30leorizedongbei: you can't really compare a websocket server and an http server :P
06:12:36leorizebut I'll try to tinker with this :)
06:12:51leorize@gogolxdong: are you using arc?
06:13:08FromGitter<gogolxdong> using regions
06:13:36leorizeyou should use arc
06:13:46leorizeregion is deprecated and it doesn't even work correctly
06:14:25FromGitter<gogolxdong> the project is based on gc:regions, impossible to migrate in couples of days.
06:14:44FromGitter<gogolxdong> which version should I use with gc:regions?
06:15:38leorizeyou might want to see this: https://github.com/nim-lang/Nim/pull/11920
06:16:56leorizeif 1.2 doesn't work, try switching to an older version
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:56*gmpreussner joined #nim
07:13:31FromGitter<faulander> stupid question: ⏎ filename = filename.strip(chars={'\x00', '\"', '*', '/', ':', '<', '>', '?', '\\', '^', '|'}) ⏎ doesn't strip the chars, why?
07:14:06FromGitter<faulander> (and i know there's a const for it, just used it this way for testing)
07:22:47FromGitter<faulander> https://play.nim-lang.org/#ix=2hj1
07:23:58FromGitter<Vindaar> @faulander what do you expect to happen?
07:24:09FromGitter<Vindaar> `strip` only removes characters from the beginning or end of the string
07:24:30FromGitter<faulander> aaaaaaah sure! i need to use replace!
07:24:40FromGitter<faulander> thats why i said "stupid question" :)
07:26:19FromGitter<Vindaar> Ah, don't say that. It's fine to ask something like that
07:27:39FromGitter<Vindaar> but usually it's a good idea to state not only what you're doing, but actually what you expect the end result to be. Because I saw your message (before you posted the example), but didn't understand your problem :)
07:31:39FromGitter<faulander> you're right of course
07:31:47FromGitter<faulander> and now i am struggling mit multireplace :)
07:34:06*aEverr quit (Remote host closed the connection)
07:34:07FromGitter<faulander> proc multiReplace(s: string; replacements: varargs[(string, string)]): string {...}
07:34:20FromGitter<Vindaar> by how to use it?
07:34:28FromGitter<faulander> yes
07:34:35*aEverr joined #nim
07:34:44FromGitter<faulander> i want to replace all chars in the filename which are invalid with ""
07:38:35FromGitter<faulander> ah got it: ⏎ filename = multiReplace(filename, [("?", ""), (":", "")]) ⏎ (and so on)
07:39:32FromGitter<Vindaar> yep, that's how to do it
07:51:28Araq+1 for multiReplace
07:54:03FromGitter<Vindaar> @Araq: have you seen https://github.com/nim-lang/Nim/issues/13913? Just wondering if this is really a bug or simply not supported
08:02:21*Vladar joined #nim
08:03:54FromGitter<faulander> i have a question (again). i have a seq of Table. can i directly access the key:values of the table? Currently i do: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e8ed6eafea5216d6969600d]
08:04:49FromGitter<faulander> seq[i]["title"] isn't working
08:05:12FromGitter<Vindaar> @faulander it should work though. Can you post a more complete example?
08:05:39*moerm joined #nim
08:05:46moermhello
08:06:03FromGitter<faulander> i presumed it should work ... let me try again and otherwise create an example on playground
08:07:25FromGitter<Vindaar> ok!
08:08:31FromGitter<faulander> hahaha, now it works. i tried it yesterday before writing the workaround code and it didn't. I must've messed up somewhere else :)
08:11:10*dddddd quit (Ping timeout: 256 seconds)
08:11:40FromGitter<Vindaar> good to hear
08:15:02*tml[m] joined #nim
08:19:31Yardanico"nim c --cpu:arm -d:release -d:danger --cc:zig --passC:"-target arm-linux-musleabi" --passL:"-target arm-linux-musleabi" main.nim" :P
08:20:09Yardanicoah forgot, no need for -d:release here anymore
08:20:16Yardanicobut yeah, Zig as C compiler works just fine
08:20:29Yardanicoit's better than manually cross-compiling a GCC musl toolchain :P
08:48:59*hax-scramper quit (Ping timeout: 265 seconds)
08:52:27AraqYardanico, nice that it works
08:55:12Zevvwhat is this fuzz about the zig compiler
08:55:29Zevvis it just a packaged cross compiler with sysroot built in or someting like that?
09:00:08FromGitter<faulander> i get could not load: (libcrypto-1_1-x64|libeay64).dll when running the compiled exe outside of the source directory ⏎ i a compiling with -d:ssl option and running windows10
09:05:43YardanicoZevv: well they package 30+ different libcs with headers for different linux targets, libclang itself (and of course Zig compiler too)
09:06:00Yardanicoand it's only a ~40mb tarball
09:06:05Yardanico(tar.xz)
09:06:10Zevvsounds pretty pragmatical
09:06:33Yardanicohttps://ziglang.org/#Zig-ships-with-libc
09:06:57Zevvso I can finally get rid of this pain: http://zevv.nl/div/toolchains.png :)
09:07:13Yardanicouh-oh
09:07:23Yardanicowell, it doesn't have uclibc sadly
09:07:28Yardanicoglibc and musl
09:07:39Zevvaw that kind of defeats the purpose for me :/
09:19:10dongbeianyone know wha tthe equivalent for c++ lambdas are?
09:19:38dongbeii'm trying to pass a proc to a c++ function that I'm importing with importcpp
09:20:54dongbeii'm nearly able to run my hello world in nim (๑˃ᴗ˂)ﻭ
09:22:14*uvegbot quit (Ping timeout: 256 seconds)
09:22:29FromDiscord<mratsim> proc map[T](x: seq[T], lambda: proc(x: T): T): seq[T]
09:22:43*uvegbot joined #nim
09:22:55FromDiscord<mratsim> if it's a C++ function you might have to proc map[T](x: seq[T], lambda: proc(x: T): T{.cdecl.}): seq[T]
09:23:34dongbeiwhat is this wizardry
09:23:40dongbeiok, gonna try
09:28:13moermbye, have a nice day
09:28:25dongbeibye
09:28:36dongbeiu2
09:29:22*moerm quit (Quit: Leaving)
09:31:27dom96Yardanico, cool that Zig works, we may wish to consider enabling the download of it for choosenim
09:33:45Yardaniconow I need to figure out how to build libressl with "zig cc" and then use it to cross-compile a static nim binary which uses SSL (via httpclient) :P
09:34:42Yardanicooh well zig cc worked for libressl cross-compilation just fine
09:36:52*oculuxe joined #nim
09:37:25*oculux quit (Ping timeout: 264 seconds)
09:42:05dom96This is actually pretty genius of the Zig creator, lots of C programmers will download it just to use it as a C compiler.
09:42:11dom96Trying out Zig then becomes easy
09:42:43*couven92 joined #nim
09:42:54Yardanico:P
09:43:16FromGitter<faulander> out of options on my compiling problem. tried putting the dll inside the exe dir and inside windows/system32 directory - still get the same error when running my program :(
09:43:34Yardanico@faulander maybe some DLLs have wrong bitness?
09:43:42Yardanicolike if you're mixing 64 binary with 32-bit dlls
09:43:52Yardanicoor these DLLs have dependencies themselves too, in that case they wouldn't get loaded too
09:44:00Yardanicounresolved dependencies I mean
09:44:43FromGitter<faulander> i would prefer having all requirements inside the exe, but have no clue about compiling and linking since i am coming from python and not been using a compiler since 30 years or so.
09:45:29FromGitter<faulander> the exe works fine inside the src directory btw, just not on another directory like c:\tmp
09:46:05FromGitter<faulander> so which dlls do i need to use when compiling with -d:ssl option to run it on windows?
09:46:25FromGitter<faulander> windows 10, 64bit that is
09:49:09*hax-scramper joined #nim
10:08:41FromDiscord<kodkuce> can Nim mix GC like make 1 library thats gc:none and then an main.nim that uses default gc or whatwer
10:12:02FromDiscord<clyybber> Vindaar: Looks like a valid bug
10:12:34FromDiscord<clyybber> @kodkuce Yeah
10:13:47FromGitter<Vindaar> @Clyybber: ah, thanks! Glad to hear that this should work
10:14:04*NimBot joined #nim
10:20:06*natrys joined #nim
10:35:06*xcm joined #nim
10:37:26*narimiran quit (Ping timeout: 256 seconds)
10:40:10*neceve joined #nim
10:41:19*neceve quit (Client Quit)
10:41:45*neceve joined #nim
10:42:17FromDiscord<clyybber> Vindaar: Oh, actually. Could it be that you have multiple overloads of sqrt imported?
10:42:48FromGitter<Vindaar> Yes, that's the point
10:43:07FromDiscord<clyybber> Yeah, they probably should count as typed
10:44:41FromGitter<Vindaar> Essentially I want to look at all possible overloads of different procs. If there's only one match I use it to extract type information. If there's multiple I check if there's no ambiguity given certain possible arguments.
10:45:36FromGitter<Vindaar> using `dynamicBindSym` I could do the same in the actual untyped macro. But without that I have to delegate that to another macro I call
10:48:06FromGitter<Vindaar> the actual application is that in ggplotnim if a user writes `f{mean(c"someCol")}` I can just look at possible `mean` to decide if this returns a value or a seq / tensor
10:52:38Araqkodkuce: don't see how that would be possible
10:53:01FromDiscord<clyybber> Araq: Huh, should be possible no?
10:53:13FromDiscord<clyybber> If the library doesn't use strings and seqs?
10:53:56AraqI think there is some confusion about what 'library' means
10:54:20Araqif you mean some binary, then yes it's possible
10:54:35Araqif you mean "Nimble package A combined with B"
10:54:52Araqthen the answer is "no", they have to agree on the MM strategy
10:56:08dongbeiI can't seem to make lambdas work
10:56:15dongbeibeen at this for a couple of hours
10:57:06FromDiscord<Rika> what's the issue
10:57:38dongbeiI'm trying to create a lambda in nim that I pass to a c++ method I'm importing
10:57:57dongbeiI've tried importcpp and emit
10:58:04dongbeikinda lost
10:58:54dongbeicalling methods on objects that have class methods works just fine but i can't seem to get the lambda right
11:07:44*tane joined #nim
11:10:38*Vladar quit (Quit: Leaving)
11:13:56Araqdongbei, you mean C++ lambdas?
11:16:03dongbeicorrect
11:26:38*Zectbumo quit (Remote host closed the connection)
11:34:51*liblq-dev joined #nim
11:35:56FromDiscord<kodkuce> Araq: so package A + packageB cant work, but if i compile packageA with gc:none and use it from PackageB like c# dll(if that even possible duno?) ?
11:36:40dadadais zig support in nim 1.20?
11:38:16FromDiscord<kodkuce> can Nim make lib files like c# dlls at all or would i be foreced to call it like process and read stdouts or whatewer
11:39:15FromDiscord<Recruit_main707> more like a c dll, but probably it will work
11:44:40Yardanicodadada: no
11:44:49Yardanicoit was merged after 1.2 release
11:45:11Yardanicohttps://github.com/nim-lang/Nim/pull/13757
11:45:34FromDiscord<Rika> DAMN zig support in nim
11:45:47FromDiscord<Recruit_main707> whats zig?
11:45:57Yardanico@Rika well Zig exposes "zig cc" which acts almost like clang
11:46:16Yardanico@Recruit_main707 a programming language
11:46:30Yardanicowhich also happens to distribute a toolchain for easy cross-compilation
11:46:32FromDiscord<Recruit_main707> and how is that?
11:46:36FromDiscord<Recruit_main707> we compile to zig?
11:46:41Yardanicono, we compile to C
11:46:57YardanicoZig already bundles libclang so they just made it so "zig cc" acts almost like clang
11:47:06FromDiscord<Rika> That would be insane though lmao
11:47:09Yardanico(With some zig extra options for cross compilation)
11:47:24Yardanico@Rika not really, Zig can translate C code to Zig actually
11:48:11Yardanicoso to compile a nim app to arm (with musl, statically) you can do nim c -d:danger --cpu:arm --cc:zig --passC:"-target arm-linux-musleabi" --passL:"-target arm-linux-musleabi"
11:48:20FromDiscord<Rika> Zig has "less" features than c right?
11:48:22Yardanicowith no need to manually find and compile a toolchain and stuff
11:48:29Yardanico@Rika I'm not sure what do you mean by that
11:48:43FromDiscord<Rika> Me neither :)
11:49:01FromDiscord<Recruit_main707> i guess its a simpler language
11:49:05Yardaniconot really
11:49:14Yardanicoyou can write C-like Zig code anyway
11:49:32Yardanicosame goes for Nim too
11:51:43*raz joined #nim
11:55:44*jjido joined #nim
12:01:38FromDiscord<Recruit_main707> is nim big endian or little endian
12:03:37FromDiscord<Rika> both
12:03:43FromDiscord<Rika> i dont seem to understand
12:04:43FromDiscord<clyybber> a language is not big or little endian
12:04:47FromDiscord<clyybber> a processor is..
12:04:56FromDiscord<clyybber> or a file
12:04:57FromDiscord<Recruit_main707> i have issues passing an integrer from python to nim (theorically using my machine´s endian), but not working:
12:04:57FromDiscord<Recruit_main707> 98005 this should be received,
12:04:58FromDiscord<Recruit_main707> 2 but i recceive this
12:05:34FromDiscord<Rika> how are you passing it
12:05:57FromDiscord<Recruit_main707> `struct.pack("@i", my_len)`
12:06:02FromDiscord<Recruit_main707> and then sending it
12:06:02*supakeen quit (Quit: WeeChat 1.9.1)
12:06:43*supakeen joined #nim
12:07:21FromDiscord<Recruit_main707> https://docs.python.org/3/library/struct.html this could be helpful, i think i am doing it as i should, but idk
12:07:45*narimiran joined #nim
12:08:40FromDiscord<Rika> print that in python, then also `echo result.repr` in nim
12:09:10*dongbei quit (Quit: leaving)
12:09:25FromDiscord<Recruit_main707> that number was the python number, i will try .repr
12:11:27FromGitter<awr1> zig is okay
12:13:12FromGitter<awr1> feature wise it's kind of a middle point between C++ and D
12:13:17FromDiscord<Recruit_main707> seems to print the same think Rika
12:14:01FromDiscord<Rika> it shouldnt show a box but the escaped bytes thing
12:15:10FromGitter<Vindaar> @Recruit_main707: do you try to read the data as int32 or int64? Because `i` in the context of python's `struct` is a 4 byte integer
12:15:40*dadada quit (Ping timeout: 265 seconds)
12:15:45FromDiscord<Recruit_main707> `rootsocket.recv(4)`, thats right isnt it?
12:16:40FromGitter<awr1> i think if you try to compare zig and nim, nim has a more ambitious set of goals
12:17:20*dadada joined #nim
12:17:23FromGitter<Vindaar> I think if you do "rootsocket.recv(4).parseInt32" it'd work, but not if you use `parseInt` on the result
12:17:25FromGitter<awr1> for instance zig has some compile time flexibility (kinda similar to `const` and `static` in nim)
12:17:43*dadada is now known as Guest46432
12:17:49FromGitter<awr1> but it holds itself back from having a fuller macro system (by design)
12:17:53FromGitter<Vindaar> ah wait
12:18:41FromDiscord<Recruit_main707> Vindaar, parseInt32 doesnt exist :/
12:18:54FromDiscord<Rika> parseInt
12:19:04FromDiscord<Rika> ah
12:19:09FromDiscord<Rika> thats the strutils one
12:19:19FromDiscord<Rika> hm i dont know what to do for converting a bytes string to an int
12:20:19FromDiscord<Recruit_main707> a few months ago i asked a guy in here, and he gave me some roll and unroll bytes, which worked, but now my header is so big i cant fit it into an uint16 :p
12:20:32FromDiscord<Recruit_main707> bytes functions*
12:20:49FromDiscord<Rika> you can prolly adapt those functions
12:20:53FromGitter<Vindaar> If you had a stream you would just use `s.readInt32()`
12:21:11*someunknownuser joined #nim
12:21:19FromDiscord<Rika> you can convert the string into a StringStream
12:21:56FromDiscord<Recruit_main707> readint32 doesnt seem to exist either
12:22:01FromDiscord<Rika> https://nim-lang.org/docs/streams.html
12:22:03FromDiscord<Rika> it does
12:22:11FromGitter<Vindaar> https://nim-lang.github.io/Nim/streams.html#readInt32%2CStream
12:22:31FromDiscord<Recruit_main707> should i import something?
12:22:39FromDiscord<Rika> `import streams`
12:22:50FromDiscord<Recruit_main707> ah ok, i thought this was stdlib
12:23:00FromGitter<Vindaar> it is stdlib
12:23:05FromGitter<Vindaar> just not system
12:23:19FromDiscord<Recruit_main707> ok
12:23:41FromDiscord<Recruit_main707> ok, how do i convert it into an stream?
12:23:50FromDiscord<Rika> newStringStream(theString)
12:24:26FromDiscord<Recruit_main707> fingers crossed
12:26:52FromDiscord<Recruit_main707> well, now my header seems to be bigger than it should be :p
12:26:58FromDiscord<Recruit_main707> but at least its an actual number
12:28:04FromDiscord<Rika> so, um, why is stringstream not available for JS?
12:29:26FromDiscord<clyybber> didn't make it work yet :p
12:29:35FromDiscord<clyybber> I made it work for CT js at least
12:32:12FromDiscord<Recruit_main707> working :D, (but so fricking slow its useless) but well see what i can do about that, thanks
12:32:46FromDiscord<clyybber> @Recruit_main707 how did you build your compiler?
12:33:00FromDiscord<clyybber> if you say ./koch boot then I know why its so fricking slow
12:34:03*xcm quit (Remote host closed the connection)
12:34:06FromDiscord<Recruit_main707> its probably the 14000 characters python needs to send :p
12:34:32FromDiscord<Rika> AKA it's prolly python?
12:34:50FromDiscord<clyybber> @Recruit_main707 yeah, but did you build your compiler using ./koch boot ? Or did you install the binary?
12:34:58FromDiscord<Recruit_main707> installed
12:35:06FromDiscord<clyybber> ah ok
12:35:33FromDiscord<clyybber> @Rika you could try removing the {.compileTime.} from the procs that are in the `when defined(js)` branch
12:35:44FromDiscord<clyybber> I can't quite remember whats missing
12:36:35*xcm joined #nim
12:37:54*SunDwarf quit (Ping timeout: 240 seconds)
12:38:56FromDiscord<Recruit_main707> how realistically possible is that by using nim sockets in the python part it will go faster?
12:40:22*rockcavera joined #nim
12:40:52FromDiscord<Rika> @Clyybber twas just a question, I'm not using js backent
12:41:09FromDiscord<clyybber> ah ok
12:42:15Zevvyayk
12:42:20ZevvI won another Nim soul today
12:42:24Zevvthat makes three
12:42:28ZevvI did my part
12:42:28FromDiscord<clyybber> ha nice!
12:42:43ZevvEvery day I check the exponential graphs of Nim growth
12:43:32FromDiscord<Recruit_main707> i got someone into nim, but he is a bit busy so he hasnt started yet
12:43:35FromDiscord<mratsim> Aren't you supposed to do that for COVID?
12:44:05Zevvnah, I stopped caring about that. After two weeks I decided my life is pretty much unchaged.
12:44:09FromDiscord<mratsim> @Recruit_main707 Nim sockets are just raw system sockets, I suppose Python is the same.
12:44:22FromDiscord<Recruit_main707> probably
12:50:43*Vladar joined #nim
13:00:19*zacharycarter joined #nim
13:10:49*waleee-cl joined #nim
13:12:00*dsrw joined #nim
13:15:46*dsrw quit (Client Quit)
13:17:04*leorize quit (Remote host closed the connection)
13:17:20*xcm quit (Read error: Connection reset by peer)
13:17:34*rockcavera quit (Ping timeout: 240 seconds)
13:19:16*xcm joined #nim
13:20:45*leorize joined #nim
13:29:11*rockcavera joined #nim
13:36:40*dsrw joined #nim
13:40:42federico3https://news.ycombinator.com/item?id=22820852
13:41:22*dsrw quit (Client Quit)
13:41:40*letto_ quit (Quit: Konversation terminated!)
13:43:34*letto joined #nim
13:45:05dom96TIL Swift has an interpreter
13:46:35dom96Sounds like they should hire Andreas
13:47:59Yardanicolol :D
13:48:27dom96They literally hired the creator of Swift, and asked him to do something
13:48:41dom96They then evaluated other languages and no surprise here, chose Swift for their project
13:49:34FromGitter<alehander92> its interesting because the creator of Rust
13:49:38FromGitter<alehander92> went to work on Swift iirc
13:49:53dom96Lots of different programming language creators went to work on Swift
13:50:12shashlick$$$
13:50:19dom96Not sure about the creator of Rust, but Slava (creator of Factor) is one example
13:51:01FromGitter<alehander92> ah interesting
13:51:28FromGitter<alehander92> well, graydon said he burnt out
13:51:37FromGitter<alehander92> which is also possible: working on the same thing for years is so hard
13:51:59dom96AFAIK creator of Clay also works at Apple on Swift
13:52:06Yardanico@alehander92 I wonder how 4raq manages to do it :P
13:52:15FromGitter<alehander92> well, people are different :P
13:53:13FromGitter<alehander92> i always thought microsoft is a cool place to work
13:53:16FromGitter<alehander92> for language design
13:53:32FromGitter<alehander92> as they often have those random research langs/os-es
13:53:32FromDiscord<mratsim> Well Swift creator left Swift to work at Google
13:54:07FromDiscord<mratsim> and then he left GOogle
13:54:24FromGitter<alehander92> no, he left for Tesla
13:54:45dom96Nice, so soon we'll have a programming language suited for car programming
13:55:25FromGitter<alehander92> no, he left Tesla for Google
13:55:41FromGitter<alehander92> and now it seems he is in SiFive which is cool
13:56:22FromGitter<alehander92> sorry mratsim yeah you're right for the second thing
13:59:44Yardanicoalso, an unrelated question - recently a guy I know on Telegram has been pursuading me towards reading SICP - is it worth it ? :)
14:08:53Araqso you're asking on IRC for confirmation on something you heard on Telegram
14:09:13Yardanicowell I trust IRC more, people seem to be more professional here :D
14:09:19zacharycarterthere's one way to find out
14:12:15zacharycarterhttps://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book.html
14:12:52Yardanicoyeah I already read the introduction and did some first excersises :P
14:13:07FromGitter<alehander92> its very famous
14:13:31*drewr joined #nim
14:13:34FromGitter<alehander92> i am not entirely sure why its so famous
14:14:00FromGitter<alehander92> but it seems cool if you're learning lisp
14:14:13zacharycarterI think it actually focuses mostly on scheme
14:14:19FromGitter<alehander92> yeah sorry
14:14:20Yardanicoyeah, but scheme is lisp :P
14:14:34zacharycarterlisp is like the C++ of scheme
14:14:36FromGitter<alehander92> but i guess some ideas kinda translates to other lisps
14:14:43FromGitter<alehander92> i think its the opposite
14:14:47FromGitter<alehander92> lisp was there before scheme
14:14:49zacharycarterno
14:14:53FromGitter<alehander92> so scheme is like the Go of .. C++ ?
14:14:57FromGitter<alehander92> yes
14:15:00*drewr quit (Remote host closed the connection)
14:15:05Yardanicozacharycarter: lisp is when it all started :)
14:15:11FromGitter<alehander92> its a dialect
14:15:13companion_cubewhen you say lisp you mean common lisp?
14:15:15zacharycarterbut scheme is simpler than lisp
14:15:23zacharycarterscheme dialects can be tiny
14:15:37FromGitter<alehander92> you're right lisp it is kinda like C++ to scheme
14:15:45*drewr joined #nim
14:16:29Yardanicoone thing I don't like is that if you want to have some good editor support for any lisp-like language you have to use emacs (or DrRacket for Racket)
14:16:35zacharycarterokay so lisp predates scheme, scheme is just a minimal dialect of lisp - my bad I needed to wiki
14:17:29FromGitter<alehander92> no problem
14:17:34FromGitter<alehander92> i enjoyed
14:17:41FromGitter<alehander92> an article about restarts in common lisp iirc
14:17:57Yardanicoalthough that guy on telegram is also a very heavy zealot about emacs and lisp :D
14:17:59FromGitter<alehander92> it seems as an interesting construct tho i am not sure fully that i'd use it in nim
14:18:10narimiranYardanico: https://susam.in/blog/lisp-in-vim-with-slimv-or-vlime/ - you can use vim too ;)
14:18:19Yardanicoxdd
14:18:57Yardanicoand what about *dare I say* vscode or something which doesn't require me to use keyboard that much? I mean I can kinda get away with simple editor functionality with emacs already (with doom configuration)
14:19:17narimirani would guess there's some extension for it
14:19:27Yardanicoonly for syntax highlighting
14:19:42Yardanicono fancy auto suggestions or LSP
14:22:09narimiranalternatively, you do SICP using Nim and whatever editor you like :)
14:22:15Yardanicolol
14:25:56*dsrw joined #nim
14:28:06*dsrw quit (Client Quit)
14:29:56FromGitter<alehander92> yes
14:30:39*dsrw joined #nim
14:35:27*jjido quit (Quit: Connection closed for inactivity)
14:38:47FromDiscord<kodkuce> i would like to get auto suggestion for micro but duno how 🙂
14:39:15FromDiscord<kodkuce> i find neovim wasting too much time thinking how to do stuff i want then doing it
14:39:35Yardanicocreate a nim plugin for it :P
14:40:49FromDiscord<kodkuce> i can invest stome time trying
14:43:32FromDiscord<kodkuce> hmm from what i see they dont have lsp implemented
14:44:12Yardanicois "nimlsp" good now? :P
14:44:27FromGitter<faulander> can someone explain to me, why getHomeDir is not getting the correct homedir at runtime? Its trying to access MY homedir (i compiled it) when run on another machine.
14:44:42Yardanicowdym?
14:44:48YardanicogetHomeDir gets a home directory of the user who ran the binary
14:44:52Yardaniconot *the developer*
14:45:09Yardanicoah
14:45:14Yardanicomaybe you've used "const" instead of "let"?
14:45:32Yardanico"const" means "calculate at compile-time" so maybe that's why it saves your own home directory
14:46:02FromGitter<faulander> no
14:46:31FromGitter<faulander> ah, yes. i used const
14:46:40FromGitter<faulander> you're a genius
14:47:11Yardanicowell it's important to understand the difference between const and var/let in nim, it's different (and IMO more correct) than in other languages because it literally means "a constant"
14:47:22FromGitter<mratsim> maybe the doc of getHomeDir needs a caveat
14:47:44Yardanico@mratsim most procs from "os" module will need that then :P
14:48:05FromGitter<mratsim> who needs files anyway ;)
14:48:14YardanicoI think it's not an issue, just need to tell new Nim programmers the difference between var/let and const early on
14:48:22FromGitter<faulander> i was wondering what the difference between let and const is - now it makes alot of sense.
14:48:49Yardanico@faulander it's actually in the tutorial https://nim-lang.org/docs/tut1.html#constants
14:48:55Yardanico"The compiler must be able to evaluate the expression in a constant declaration at compile time"
14:49:35YardanicoAlso I really suggest superb https://narimiran.github.io/nim-basics/
14:49:47FromGitter<faulander> yeah, but that sentence is maybe understood by a science professor, not a self taught developer.
14:50:54FromGitter<faulander> i got it now. let's see if my first finished product now runs on that other machine. i still have no clue how to get the compiler setting -d:ssl work on windows. my workaround is to install openSSL binaries. but that's not what i want, this should be a REAL standalone program.
14:51:42Yardanicowell, your options are: 1) use some "exe packer" (a tool which packs an executable with other files into a single .exe) or 2) compile and link openssl statically
14:52:10Yardanicoas for 2 I really don't know how you would go about that on windows, probably by using mingw and building static openssl yourself
14:53:00Yardanicobut really there's no problem in shipping .dll's with your .exe, it should work
14:53:15Yardanicomost apps do this - they have an .exe and a bunch of .dlls in the same directory
14:53:34FromGitter<faulander> it doesn't. i tried to have it in the exe dir, also in win/system32
14:53:49Yardanicowhat .dlls did you use?
14:54:05YardanicoDid you try DLLs from https://nim-lang.org/download/dlls.zip ?
14:54:08FromGitter<faulander> even after a restart it didn't work, only the installation of the OpenSSL package worked finally
14:54:17Yardanicoand how did you install nim itself?
14:54:46FromGitter<faulander> no, i used the official ones. i might give it another try with the nim packaged ones.
14:55:22Yardanicowell you should really try nim own openssl .dlls since they're properly separated into 32 and 64- bit
14:55:33FromGitter<faulander> i used scoop to install nim
14:55:43Yardanicowell not sure if it installs the dlls too
14:56:14FromGitter<faulander> i think it did. the exe worked in the src directory where it was compiled
14:56:23FromGitter<faulander> then i moved it to .temp and there i got the errors
14:56:29Yardanicowell that's expected
14:56:37Yardanicoyou need to distribute the dlls together with an .exe
14:56:45Yardanicoin an archive for example, or create an installator for your program
14:57:01Yardanicoand these DLLs are located where "nim.exe" is, but you can also get them from https://nim-lang.org/download/dlls.zip
14:57:02FromGitter<kaushalmodi> @faulander may be the table here helps distinguish among `let`, `const`, `var`: https://scripter.co/notes/nim/#variable-types
14:57:13FromGitter<faulander> i would have preferred a single exe without installation, but if that's the only possibility i'll choose that path.
14:57:39Yardanicowell I described the two of your options above about single exe
14:58:31Yardanico@kaushalmodi s/evallable/evaluable :P
14:58:54FromGitter<kaushalmodi> Yardanico: Yes! I will fix that
14:58:57FromGitter<faulander> yes, thanks. i'll ship it with dll's
14:59:05FromGitter<kaushalmodi> I meant to write something like *eval'able*
14:59:23FromGitter<faulander> if i only need to copy them, its no problem. the target machines are VERY restrictive with installers, so thats not an option.
14:59:44Yardanicoyeah, you can just bundle your exe and the DLLs into an archive or something (I suppose you're allowed to unzip ZIP files? :)
14:59:59FromGitter<faulander> yes, i can do that with ansible ;)
15:00:29Yardanicoby default windows searches DLLs for your app in the current folder and in $PATH AFAIK
15:00:51FromGitter<faulander> yes, i know that. must have been the wrong versions of dll i used.
15:04:50FromGitter<faulander> true that. deleted all installations, put the dlls into the dir and it worked - at least on my machine.
15:05:30FromDiscord<Skaruts> I'm having this problem where I'm storing closures for later use in a for loop, and using `i` as parameter for them, but then when I call them they all have the same value.
15:05:34FromDiscord<Skaruts> Here's an example: https://play.nim-lang.org/#ix=2hlz
15:05:47Yardanicoyou need capture
15:05:57Yardanicoi'll find it :P
15:06:06FromDiscord<Skaruts> I can't for the life of me remember how to do that (someone told me once)
15:06:33Yardanicoit's in sugar module
15:06:40Yardanicohttps://nim-lang.org/docs/sugar.html#capture.m%2Cvarargs%5Btyped%5D%2Cuntyped
15:07:22FromDiscord<Skaruts> oh!
15:07:29FromDiscord<Skaruts> thanks 🙂
15:13:20FromDiscord<Skaruts> hmm, is `capture` a recent addition to nim? On nim-playground it works, but not in my project. It's undeclared identifier 'capture', even though I imported sugar
15:13:32Yardanicodo you have 1.2?
15:13:42Yardanicohttps://github.com/nim-lang/Nim/pull/12712
15:13:57FromDiscord<Skaruts> ah no, I'm still on 1.0.4...
15:14:01Yardanicolol :P
15:14:23FromDiscord<Skaruts> but I solved this issue before though, is there no other way?
15:14:44FromGitter<kaushalmodi> I'd upgrade Nim
15:14:58Yardanico@Skaruts you can always just copy "capture" to your code, but better update Nim :)
15:15:03FromDiscord<Skaruts> I'd like to be lazy about updating nim for another day or two...
15:15:10FromDiscord<Skaruts> 🙂
15:15:16FromGitter<Vindaar> `closureScope` was available before 1.2, no?
15:15:20FromGitter<Vindaar> maybe that's enough for you
15:16:29FromGitter<Vindaar> https://play.nim-lang.org/#ix=2hlG
15:19:01FromDiscord<Skaruts> yea that was the way I was told once. (found it in the irc logs now, as it rang a bell in my head)
15:19:05FromDiscord<Skaruts> thanks
15:19:13FromDiscord<clyybber> or just copy capture
15:19:29FromDiscord<Skaruts> or that...
15:24:08FromDiscord<Skaruts> gonna go with closureScope for the moment, as copying capture still doesn't work (some othe stuff is new too)
15:24:24Yardanicodid you forget to import macros?
15:24:26Yardanicomaybe
15:24:38FromDiscord<Skaruts> no I copied that too from there
15:24:52FromDiscord<Skaruts> both the imports
15:25:33FromDiscord<Skaruts> it's working though, I'll update Nim later and replace it, no big deal
15:56:26FromGitter<faulander> do you know of a good datetime lib for nim like pendulum for python? https://github.com/sdispater/pendulum
15:57:56Yardanico"times" stdlib module
15:59:30YardanicoNim stdlib is quite usable ;)
16:00:06FromGitter<faulander> i have to work through the standardlib i see. that times module is quite useable :)
16:01:42FromGitter<Vindaar> the `times` module is awesome. @GULPF did amazing work (he's responsible for most of the changes in the last couple of years, afaik)
16:01:50Yardanicoyeah you're right
16:04:15*Trustable joined #nim
16:10:22FromGitter<Vindaar> so as someone who has to work with sql databases like for the first time every starting today... is there a good reason why e.g. the stdlib db modules don't use any types / provide type safe access to data? Having done so much work on data frames lately, it just makes me want to write a sql table -> DF proc and work on that instead (the database I have to work with is small)
16:10:39FromGitter<Vindaar> *the first time ever
16:10:53Yardanicoyeah, I too had to work with mysql (mariadb) a bit recently
16:11:00Yardanicoit looks too unsafe without proper ORMs
16:11:16YardanicoThere's Norm, ormin and a couple of other Nim ORMs, but none of them support MySQL :D
16:12:35FromGitter<Vindaar> Yeah, I currently have to deal with a mysql db too. ⏎ I saw those modules, but didn't even check which databases are supported. First gotta acclimate myself to this weird new world :D
16:13:49Yardanicoseems like https://github.com/nanoant/nim-orm has mysql support, but it's quite old (from 2015)
16:13:56Yardanicoand it's not a full-blown ORM
16:14:53FromGitter<Vindaar> not sure how much work adding mysql support to e.g. ormin would be. Can't imagine too much?
16:16:39*xcm quit (Remote host closed the connection)
16:16:54Yardanicooh, found https://github.com/encorehu/nim-orm fork of that nim-orm
16:18:26FromGitter<Vindaar> the db specific files in ormin are only 200-300 lines. So doesn't sound too bad. Well, I'll keep it simple for now. Might try to add support at some point
16:24:32*xcm joined #nim
16:31:28*opal joined #nim
16:40:29*thomasross joined #nim
16:47:58*couven92 quit (Read error: Connection reset by peer)
16:49:27FromGitter<alehander92> type safe access would be useful
16:49:38FromGitter<alehander92> especially with checking schema on compile time
16:49:45FromGitter<alehander92> somebody wanted that ^ i think
16:50:06FromGitter<alehander92> but some people dont like the idea
16:50:17Yardanicoornim does that AFAIK
16:50:20Yardanicoand Norm too
16:50:57Yardanicosince in Norm you have to define a type for the table as an object (with some additional annotation fields available)
16:52:03*opal quit (Ping timeout: 240 seconds)
16:52:33FromGitter<alehander92> yeah but
16:52:42FromGitter<alehander92> you can generate the table from the orm
16:52:58FromGitter<alehander92> but the other option is to just check that the existing schema is compatible with the types
16:53:10FromGitter<alehander92> ormin i think was loading ? the types from the database schema
16:53:14FromGitter<alehander92> which i guess is maybe the same
16:53:38FromGitter<alehander92> otherwise i've used norm for one library, they both seem good
16:54:29*waleee-cl quit (Quit: Connection closed for inactivity)
16:58:29*opal joined #nim
17:05:10FromDiscord<Varriount> I'm wondering if I will ever understand javascript viewpoints: https://github.com/airbnb/javascript/issues/1271
17:06:20FromDiscord<Varriount> Especially this comment: https://github.com/airbnb/javascript/issues/1271#issuecomment-283424710
17:06:50Yardanicolol
17:07:13Yardanicoof course continue/break can be avoided, but then code can become much uglier
17:08:10FromDiscord<Varriount> Yardanico: It especially puzzles me, because I've working with path parsing code for a recent project, and it's full of breaks and continues
17:08:41FromDiscord<Varriount> Trying to write code that doesn't use them would make the code even harder to reason about. Or at least a lot longer
17:09:10Yardanicoalso slower :P
17:10:40kungtotteCargo cult programming is bad: news at 11 :P
17:11:03Yardanico"@binoculars you use some, every, find, findIndex, or you simply don't - break is goto, and that's not good for anyone. If you provide me an example of something you think you need break for, I'll be happy to show you a better alternative."
17:11:19Yardanico"Performance is the least important thing when coding. If you're not iterating over millions of results, it's not going to matter at all."
17:11:21Yardanicolmao
17:11:31kungtotteSounds like something a JS dev would say ;P
17:11:34FromDiscord<Varriount> Also: "performance isn't important. It's easy to make clean code fast; it's hard to make fast code clean."
17:11:46zacharycarterdo threads work with --gc:arc currently?
17:12:00kungtotteThe second sentence is correct there though. Write the good code first, the fast code second.
17:12:03kungtotte*After* profiling.
17:12:04FromDiscord<Varriount> zacharycarter: I believe they work, however the existing restrictions still apply.
17:12:07Araqwell every time it comes up, 'break' and 'continue' destroy my analysis. So I'm definitely in the "yeah, it's goto, it sucks" camp
17:12:25Yardanicozacharycarter: I don't think so :(
17:12:34Araqthreads do work with --gc:arc
17:12:42Yardanicohmm I had some error with them, weird
17:12:53Araqand with --threads:on the default is shared allocation, enjoy
17:12:56Yardanicoseems fine now
17:12:59YardanicoAraq: yay
17:13:09zacharycarterokay - I'm getting a sigsev when calling `createThread` so I'll investigate further since they're supposed to be working
17:13:12FromDiscord<Varriount> Araq: But is reference counting atomic?
17:13:29Araqanyhow. here is what you know for 'while B: body'. you know 'not B' holds.
17:13:38Araqhere is what you know when the body has a break: nothing.
17:13:58Araq(actually you know more than that but it's tricky and gets ugly)
17:15:12AraqVarriount: no, you have to 'move' stuff around completely
17:15:13Araqbll
17:15:15Araqbll
17:15:16Araqbbl
17:15:25Yardanicolol
17:19:02FromDiscord<Varriount> Araq: I would like to note that `egrep '\b(break|continue)\b' --recursive nim/compiler/ | wc -l` results in `455`. 😜
17:20:01Amun_Rais foo(x, y: int; z: cint) ever be preferred over foo(x, y: int, z: cint)?
17:20:42Yardanicoyou mean , vs ; ?
17:21:10FromDiscord<Varriount> Amun_Ra: It's completely up to you.
17:21:28FromDiscord<Varriount> Personally, I can't be bothered, but would gladly allow a linter to add the `;` for me.
17:21:53FromDiscord<clyybber> Araq: When the body has a break you know everything you know in the breaks scope
17:22:09FromDiscord<Varriount> (Has anyone written a linter for Nim yet?)
17:22:13Yardanicowait so about arc and threads - what exactly does "shared heap" mean?
17:22:17Yardanico@Varriount "nimpretty"?
17:22:21Yardanicoah sorry "nim check"
17:22:43FromDiscord<Varriount> That checks more for syntactic and semantic patterns, not textual ones.
17:22:46Amun_RaYardanico: yes
17:22:49Yardanicoah actually --styleCheck:error
17:22:56Yardanicoor --styleCheck:hint
17:23:32zacharycarterwell - I get a SIGSEV on devel when calling createThread in a loop with gc:arc
17:23:39zacharycarterI'll try to reproduce in a minimal example
17:23:44Yardanicowell I mean the shared heap question
17:23:58Yardanicocan I use and modify GCd variables from different threads at the same time in ARC?
17:24:00FromDiscord<mratsim> not a good start for weave compat with gc:aarc
17:24:01Yardanicowith arc*
17:25:08*hax-scramper85 joined #nim
17:26:32*nsf joined #nim
17:26:55leorizeYardanico: yes
17:27:17zacharycarterhttps://gist.github.com/zacharycarter/dbee66c50a6c26e7f187512235c4ed1f
17:27:21zacharycarterAraq ^
17:27:23*hax-scramper85 quit (Remote host closed the connection)
17:27:51Yardanicoleorize: so I tried to declare a global string and modify it inside a thread proc, but the compiler complains about gc safety, maybe I understood something wrongly?
17:28:01Yardanicowith --gc:arc
17:28:10Yardanicono globals maybe
17:28:32leorizeit's an old requirement and hasn't been phased out
17:28:43leorize`{.thread.}` literally means `{.gcsafe.}`
17:28:51Yardanicooh lol
17:30:00leorizenote that you'd still need a lock to safely modify the string
17:30:07leorizebut it's possible now
17:30:53zacharycarteris there a specific branch or something where threading works with --gc:arc. because I run into that error in the gist I posted on latest devel
17:30:56Yardanicowell I still wonder how :D
17:31:15Yardanicohttps://gist.github.com/Yardanico/f61c67d9700733c907925f2591c9da1d this errors because of gc safety
17:31:29Yardanicoif I remove {.thread.} - createThread complains, maybe I can modify it, hmm
17:32:22leorizeuse a `{.gcsafe.}` block to tell the compiler to shut up
17:32:37Yardanicodoesn't work :D
17:32:39Yardanico"Error: 'threadFunc' is not GC-safe as it accesses 'mystr' which is a global using GC'ed memory"
17:32:41FromDiscord<Chiqqum_Ngbata> Is there a way to disable all inferred .noSideEffect.
17:32:59Yardanico@Chiqqum_Ngbata what for? it's automatically when the proc doesn't have any side effects
17:33:04Yardanicoautomatically added*
17:33:16FromDiscord<Chiqqum_Ngbata> I have a case where it's erroneously added
17:33:30Yardanicowell, can you post an example please? and maybe make a bug report
17:33:46FromDiscord<Chiqqum_Ngbata> Maybe because I'm accessing a non-const?
17:34:04FromDiscord<Chiqqum_Ngbata> I'll try to create minimal example in a bit
17:34:08leorizeYardanico: this works: https://play.nim-lang.org/#ix=2hmv
17:34:19Yardanicoleorize: oh
17:34:22Yardaniconice
17:34:41*waleee-cl joined #nim
17:34:43leorizezacharycarter: can you file a bug report?
17:34:51zacharycartersure
17:35:09Yardanicoalthough it doesn't for me xd
17:35:15Yardanicoseems to run forever
17:35:36Yardanicowith no CPU usage
17:35:52Yardanicoand I get SIGSEGV with -d:danger
17:36:05Yardanicowith -d:release too
17:39:58leorizesame :P
17:40:03*Guest85 joined #nim
17:40:16Yardanicoso I guess they don't work just yet or there was some code change in devel that broke them
17:40:56zacharycarterI don't think `--gc:arc` is out of devel yet is it?
17:41:00Yardanicoit's in 1.2
17:41:03zacharycarteroh
17:41:03Yardanicobut not default ofc
17:41:08Yardaniconot *yet* :D
17:41:11zacharycarterlet me try on 1.2
17:41:19Yardanicocan also try on playground
17:41:36Yardanicoah, no, can't modify compiler opts, forgot
17:44:48zacharycarteryeah, still present on 1.2
17:44:55*Guest85 is now known as octetta
17:49:27*endragor quit (Remote host closed the connection)
17:49:39FromDiscord<mratsim> I have a crash on my test for my very simple channel: https://github.com/mratsim/weave/blob/master/weave/channels/channels_spsc_single.nim
17:49:47FromDiscord<mratsim> with gc:arc
17:52:13Yardanicoyeah it seems borked rn :/
17:53:07Yardanico@mratsim also, about weave - can I use it for making a lot of threads which will call into a .so library (it's proprietary), and the calls are blocking? the thing I want is ability to timeout threads , I tried to do it with normal nim threads but kinda failed
17:53:38someunknownuserwhat is a method lock level?
17:53:50Yardanicosomeunknownuser: ?
17:54:26someunknownuserI am getting the following warning and was wondering what it is. Warning: method has lock level <unknown>, but another method has 0
17:54:41leorizemethod lock level is how many locks that the method uses iirc
17:54:59leorizeit's underdeveloped and the warning is a hit and miss
17:55:05leorize99% of the time it's meaningless
17:55:17someunknownuserok, so I should not be worried about it?
17:55:22leorizeyep
17:55:27someunknownuserok, thank you
17:57:21FromDiscord<mratsim> @Yardanico, you can but don't block your main thread
17:57:47FromDiscord<mratsim> Weave doesn't support timeout though
17:57:53FromDiscord<mratsim> it's for compute not IO
17:59:18Yardanicowell I would use async if I was able to, but this lib is blocking :P
17:59:21FromDiscord<Varriount> Hm, one thing that will require threading at some point is the subprocess library I'm planning...
17:59:51FromDiscord<mratsim> isn't async supposed to handle blocking?
17:59:56Yardanicois it?
17:59:57FromGitter<alehander92> no
18:00:14FromDiscord<mratsim> for long running process that can blcok just use createThread, like usual to handle the terminal?
18:00:18FromDiscord<Varriount> mratsim: Well, I guess, however I'd like to make it framework agnostic.
18:00:45Yardanico@mratsim well I thought about how to implement timeouts - one "watch" thread for every working threaD?
18:00:58FromDiscord<mratsim> if you can describe your scenario in an issue in Weave I'll think if it makes sense to allow that
18:01:11FromDiscord<Varriount> You get these situations where the parent process is trying to write or read from the child process, and the child process is trying to write or read from the parent process, and things deadlock due to buffers becoming full.
18:01:23FromGitter<alehander92> async can be made to auto-create threads, but this is probably better to be explicit
18:01:35FromDiscord<mratsim> shouldn't you use the Erlang stuff, the restarter/manager trees?
18:01:52FromDiscord<Varriount> Are you talking to me, or alehander92?
18:01:55FromDiscord<mratsim> Supervision tree: https://erlang.org/doc/design_principles/des_princ.html
18:02:00FromGitter<alehander92> e.g. if we add "blocking" type/effect inference, one can change async to auto-spawn a thread when it "awaits" a blocking call
18:02:08FromDiscord<mratsim> I think that should be a library
18:02:21FromDiscord<mratsim> @Varriount the supervision trees are for you
18:02:23FromGitter<alehander92> but this might be too implicit
18:02:34FromGitter<alehander92> and unexpected for the user
18:04:04FromDiscord<Varriount> mratsim: Wouldn't that dictate the kind of pattern that users could use the (theoretical) library with? I was imaging more something like execProcess or Python's Popen
18:16:16FromDiscord<Kiloneie> Does anyone have the definition of what exactly Impure libraries in Nim mean ? Im getting a little lost trying to explain them along with Wrappers...
18:16:34FromDiscord<mratsim> It seems to work for Erlang and they have been using that in critical system that cannot have any downtime for the past 30 years
18:16:45FromDiscord<mratsim> (i.e. for telephone and communication backend)
18:17:02FromDiscord<mratsim> "impure" means depending on C/C++/JS
18:17:05FromDiscord<mratsim> pure is pure Nim
18:17:25Yardanico@Kiloneie also see https://nim-lang.org/docs/lib.html#impure-libraries
18:17:29Yardanicohttps://nim-lang.org/docs/lib.html
18:17:44Yardanico"Pure libraries do not depend on any external *.dll or lib*.so binary while impure libraries do. A wrapper is an impure library that is a very low-level interface to a C library."
18:18:08Yardanicoso for example db_mysql is an impure library, and "mysql" module is a wrapper
18:18:40Araqzacharycarter: try with an 'array' of Threads please
18:18:59FromDiscord<Varriount> Hm, do iterators support forward declarations?
18:19:16YardanicoAraq: what about https://play.nim-lang.org/#ix=2hmv
18:19:22Yardanicois this supposed to ever work? :P
18:19:35FromDiscord<Kiloneie> okay thanks, i will work with that
18:21:21AraqYardanico: it's supposed to work already
18:21:38zacharycarterAraq: sure
18:22:24YardanicoAraq: well maybe it's some regression but it doesn't on latest devel, in default debug mode it seems to hang forever, in -d:release or -d:danger it SIGSEGVs
18:23:37Yardanicooh seems like it always SIGSEGVs when stacktraces are disabled
18:24:02zacharycartersame error with an array Araq
18:24:05Araqstrange, I remember this code being part of the test suite :P
18:24:13YardanicoGDB says it crashes at nim/lib/system/avltree.nim:74
18:24:52Araqmaybe Zevv messed up the new alloc() interface :P
18:29:15AraqYardanico: please check if the calls pass through allocShared() and friends
18:29:25Yardanicothey pass through deallocShared
18:29:37YardanicoI mean the backtrace
18:29:44Yardanicohttps://gist.github.com/Yardanico/a381a09b943b2618de534e49a99ed0a8
18:30:56Yardanicoif I replace that string addition with echo "ok" it prints "ok" 3 times and then SIGSEGVs
18:31:04Yardanicoah, 4 times
18:31:09Yardanicoso it runs the threads but crashes after that
18:31:36Yardanicoor not, seems like it crashes after 4 "ok"s even if I do array of size 150
18:31:55Yardanicoah it behaves differently each time
18:34:07FromDiscord<Varriount> Hm, who worked on adding Nim to the compiler explorer? I'm wondering how hard it would be to implement the "reveal linked code" functionality.
18:34:17FromDiscord<Varriount> (https://godbolt.org/)
18:34:39FromGitter<alehander92> some people
18:34:49Yardanicoinitial https://github.com/mattgodbolt/compiler-explorer/pull/1753
18:34:54FromGitter<alehander92> https://github.com/mattgodbolt/compiler-explorer/pull/1753
18:35:03FromGitter<alehander92> what do you call
18:35:06FromGitter<alehander92> reveal linked code
18:35:19Yardanico@alehander92 probably the feature when you can see how source code is mapped to assembly
18:35:23FromDiscord<Varriount> Yes
18:35:38FromGitter<alehander92> ah i think it worked
18:35:41FromDiscord<Varriount> If you right click on a line in the editor, there's an option to reveal linked code.
18:35:43FromGitter<alehander92> at one point
18:36:14FromDiscord<Varriount> Ah! Got it.
18:36:17Yardanicoit works with "--debugger:native"
18:36:21FromDiscord<Varriount> Adding `--debugger:native`
18:36:27Yardanicolol
18:36:35FromGitter<alehander92> yes you need to add it to options
18:36:57Yardaniconow we need to add nlvm to godbolt :P
18:37:01Yardanicoto check LLVM IR
18:37:07FromGitter<alehander92> wow this is a good point
18:37:19FromGitter<alehander92> we might need to add it to codetracer just as a cool target
18:37:36FromGitter<alehander92> probably godbolt can just follow the rust/zig modes
18:37:39FromGitter<alehander92> for nlvm
18:39:57FromDiscord<Chiqqum_Ngbata> Unfortunately I can't distill my erroneous .noSideEffects. problem, but I'd still like to know if there is a way to disable, either with runtime flag, pragma, whatever
18:40:24Yardanicoadd some effect or tag to your proc?
18:40:28FromDiscord<Chiqqum_Ngbata> Possibly the reason it's adding .noSideEffects. is because the side effect is predicated upon a C binding
18:40:36Yardanicolike proc myproc: string {.tags: [IO].} = discard
18:40:40Yardanicohttps://nim-lang.org/docs/manual.html#effect-system-tag-tracking
18:42:06*nsf quit (Quit: WeeChat 2.7)
18:45:10FromDiscord<Chiqqum_Ngbata> Still getting a type mismatch on a proc type annotated with .nimcall.
18:46:32FromDiscord<Chiqqum_Ngbata> Maybe I can touch something (else) global, let's see
18:49:29leorizewhat's your problem?
18:50:36FromDiscord<Chiqqum_Ngbata> (That did work)
18:51:55FromDiscord<Chiqqum_Ngbata> leorize: A proc is being inferred as .noSideEffect. erroneously, possibly because of the side effect's dependence on C binding (just guessing; a global var is created via call into another library and accessed in proc)
18:52:45leorizeuse `{.sideEffect.}` to counter that :P
18:55:50FromDiscord<Chiqqum_Ngbata> That had me excited for a hot second but it's not working for me, going to try some things
18:56:03FromDiscord<Varriount> Yardanico: This is interesting. The source -> assembly mapping gets confused if Nim functions are too close together. The return logic in assembly gets mapped to the line of the following procedure.
18:56:36leorize@Chiqqum_Ngbata: if you got a reproducible example I might be able to help
18:57:51*lritter joined #nim
18:58:47*someunknownuser quit (Remote host closed the connection)
19:00:51*someunknownuser joined #nim
19:03:12*dsrw quit (Read error: Connection reset by peer)
19:11:27*nekits quit (Remote host closed the connection)
19:12:24zacharycartermratsim: are there any benchmarks / examples of a job queue in weave?
19:23:16FromDiscord<Varriount> mratsim: You have a benchmarking library, don't you?
19:33:13ZevvAraq: possible, but not likely after 3 months, is it
19:34:14*neceve quit (Ping timeout: 256 seconds)
19:37:59*endragor joined #nim
19:42:03*Zectbumo joined #nim
19:51:48*endragor quit (Ping timeout: 256 seconds)
20:16:05*NimBot joined #nim
20:35:00Zevvgo
20:36:24*narimiran quit (Ping timeout: 265 seconds)
20:48:19*casaca joined #nim
20:55:38FromGitter<dawkot> Is Karax broken for anyone else? https://github.com/pragmagic/karax/issues/138
20:57:07*krux02 joined #nim
21:06:49*rockcavera quit (Ping timeout: 264 seconds)
21:20:58*lritter quit (Quit: Leaving)
21:21:19*lritter joined #nim
21:26:43FromGitter<iffy> I'm calling a C function which expects a `uint8 *buffer`I've done `let s = newString(expected_len)`, so which of the following do I pass in? ⏎ ⏎ 1) `s[0].unsafeAddr` ⏎ 2) `s.cstring.unsafeAddr` ⏎ 3) `s.unsafeAddr` ... [https://gitter.im/nim-lang/Nim?at=5e8f93131aaf8e4b8e71a499]
21:27:23FromGitter<dawkot> `s[0].unsafeAddr` should work
21:27:30leorizeyou pass in s.cstring
21:27:45FromGitter<dawkot> Oh, because of GC?
21:28:01leorizenah, it's shorter :P
21:30:00*Vladar quit (Quit: Leaving)
21:31:51FromGitter<iffy> They both work! I had been doing something else wrong -- thank you!
21:33:26*solitudesf quit (Ping timeout: 265 seconds)
21:39:32*rockcavera joined #nim
21:39:32*rockcavera quit (Changing host)
21:39:32*rockcavera joined #nim
21:40:26FromGitter<sealmove> guys, I get "stdlib_io.nim.c:(.text+0x725): undefined reference to `__builtin_saddll_overflow'"
21:40:32FromGitter<sealmove> anyone has any idea what this is?
21:40:39leorizedo you have a recent gcc?
21:40:44*tiorock joined #nim
21:40:44*tiorock quit (Changing host)
21:40:44*tiorock joined #nim
21:40:44*rockcavera quit (Killed (kornbluth.freenode.net (Nickname regained by services)))
21:40:44*tiorock is now known as rockcavera
21:40:57FromGitter<sealmove> oh
21:40:59FromGitter<sealmove> hmm
21:41:22leorizeit's used to speed up overflow checks, requires gcc > 5 iirc
21:41:44*tiorock joined #nim
21:41:45*tiorock quit (Changing host)
21:41:45*tiorock joined #nim
21:41:45*rockcavera is now known as Guest33770
21:41:45*Guest33770 quit (Killed (tepper.freenode.net (Nickname regained by services)))
21:41:45*tiorock is now known as rockcavera
21:41:57FromGitter<sealmove> no idea, I get this error on travis, not my local pc
21:42:20leorizeif you don't have a new gcc, use `-d:nimEmulateOverflowChecks`
21:42:43Araqconfig travis to use software released after 1990
21:43:36FromGitter<sealmove> this is my config: https://pastebin.com/brb8jUgr
21:44:19FromGitter<sealmove> `compiler: gcc` is wrong?
21:45:40leorizethe wrong part here is that you use travis
21:45:50leorizecheck if they finally have a newer ubuntu version
21:47:12Araqthe wrong part here is also that GCC versions are tied to a Linux distribution...
21:47:48FromDiscord<Varriount> Araq: Or that you can't install multiple versions.
21:48:06*tane quit (Quit: Leaving)
21:48:22*rockcavera quit (Ping timeout: 256 seconds)
21:48:23leorizeyou can on travis actually
21:48:24AraqI think you can but then you need to call gcc-$version
21:52:43leorizeAraq: I think we can just use a conditional to test gcc version
21:53:00leorizegcc 5 introduced these functions
21:54:17leorizeclang has these since 3.5
21:54:25Araqyeah but some builds of gcc 5 lack them
21:54:34Araqbecause some distros like patching gcc
21:54:40leorizethen they can use the flag
21:54:49Araqfair enough
21:55:25Araqaligns well with my plans to remove nimbase.h from Nim
21:58:17leorizeso do you want me to make addNimDefines generates some ifdefs, or do you want me to put it in nimbase.h?
21:58:41*liblq-dev quit (Quit: WeeChat 2.7.1)
21:58:49*natrys quit (Quit: natrys)
22:06:19AraqI want you to patch the codegen to not generate #include "nimbase.h"
22:06:38Araqinstead the codegen should emit the declarations it needs
22:06:55Araqfixes that niminst regression issue
22:07:25dom96You're getting rid of nimbase.h?
22:08:56FromDiscord<__ibrahim__> <number_two> fortunately, it didn't take much fiddling to get opengl to work. 35 loc with glfw3 and glad and that's it! i ❤️ Nim
22:09:03leorizeit's about time we do so
22:09:09Araqdom96: yeah
22:10:17dom96hm, won't that create lots of needless duplication? :)
22:12:08FromGitter<dawkot> Any idea what to look for when VSCode stopped highlighting warnings and errors in Nim code?
22:12:19FromGitter<dawkot> nimsuggest seems to work fine on commandline
22:12:32FromGitter<dawkot> and auto-completion is there in the editor
22:12:45leorizewhen it stopped doing that, you kill all nimsuggest instance and hope that it restarts :)
22:13:05leorizeyou will be amazed of how many problems that restarting nimsuggest solves
22:13:30FromGitter<dawkot> Unfortunely, I even tried reboot and it didn't work
22:15:08dom96Best thing to look for is another VS Code extension, better yet, create a better one :)
22:16:07FromGitter<dawkot> I don't even know if it's the extension, I tried previous versions and it didn't work either
22:16:22*someunknownuser quit (Remote host closed the connection)
22:16:39FromGitter<dawkot> And I literally didn't do anything in the meantime other than use the editor
22:17:41Araqdom96: yeah but I don't have a better idea
22:17:43*rockcavera joined #nim
22:23:39FromGitter<dawkot> Looks like importing asyncjs hides warning/errors, despite `nimble build` working...
22:23:49FromGitter<dawkot> So, yeah, it's the extension's fault
22:37:52FromGitter<dawkot> How do you make nimsuggest assume js is the backend?
22:38:10FromGitter<dawkot> I would like to fix this
22:44:07FromGitter<dawkot> I guess it's `-d:js`
22:47:31leorizethat works, but not the best
22:47:50leorizethere are VM changes in JS mode too, and -d:js won't emulate that
22:48:01leorizebut it will give you suggestions, so it's good enough :P
22:48:02*Trustable quit (Remote host closed the connection)
23:05:38FromDiscord<KingDarBoja> Awr1, are you there?
23:10:44FromGitter<awr1> hello
23:10:45FromGitter<awr1> i am now
23:10:49FromGitter<awr1> was busy all day
23:11:27FromDiscord<KingDarBoja> ❤️
23:11:36FromDiscord<KingDarBoja> https://github.com/nim-lang/Nim/issues/13922
23:11:42FromDiscord<KingDarBoja> we got an answer
23:13:17*rockcavera quit (Remote host closed the connection)
23:14:25FromDiscord<__ibrahim__> tried running the stuff from this repo: https://github.com/rafaelvasco/nimrod-glfw
23:14:25FromDiscord<__ibrahim__> it works fine on mac.
23:14:26FromDiscord<__ibrahim__> windows gives this error: could not load: glfw3.dll
23:14:26FromDiscord<__ibrahim__> now trying on centos8
23:15:51shashlick@zacharycarter was trying junkers on osx and it crashes even with 0.4.4
23:18:02zacharycartershashlick: with what flags?
23:18:30shashlickToast flags? Nothing really
23:18:50zacharycarterhow are you running it and are you getting any type of error on crash?
23:19:31shashlickSigabrt
23:20:06zacharycarterweird - it's working fine for me with the verison that gets installed with `nimble install nimterop`
23:20:21FromGitter<alehander92> Araq: many issues can be hard to fix because we need to find the root cause, what if we just find potential bugs by looking for invalid invariants and ways to trigger them and prevent those => after this checking how many issues does this fix
23:20:33zacharycarterif I use the head vesion I need to do the headers flag but then it works fine
23:20:39FromGitter<awr1> should i close the issue then
23:20:46FromDiscord<KingDarBoja> No
23:21:01FromDiscord<KingDarBoja> I am not okay at all with it
23:21:10FromDiscord<KingDarBoja> Just tried it and couldn't instantiate it lol
23:21:18shashlickI reverted to 0.4.4 cause it was failing even with -H
23:21:20FromGitter<awr1> okie
23:21:27zacharycarterweird...
23:21:36zacharycarterlet me try checking it out and submodules and running ti
23:22:29FromDiscord<KingDarBoja> Unless I am doing something wrong
23:22:53FromDiscord<KingDarBoja> If I wanted to export the proc, I should put the * after the name
23:23:05zacharycartergit clone https://github.com/zacharycarter/junkers.git junkers_test
23:23:21FromDiscord<KingDarBoja> But now that it is instantiated, putting it in front of the name before or after the [] brackets yields error
23:23:33zacharycartercd junkers_test && git submodule update --init -recursive
23:23:39zacharycarternim c -r src/junkers.nim
23:23:47zacharycartereverything runs fine :/
23:24:01shashlickhttps://ix.io/2hoB
23:24:53zacharycarterI'm using nim 1.2
23:24:57shashlickOk was on 1.0.6
23:25:44zacharycarteralso - I wonder what all those errors are from the linker
23:25:52zacharycarterld: warning: text-based stub file /System/Library/Frameworks//Metal.framework/Metal.tbd and library file /System/Library/Frameworks//Metal.framework/Metal are out of sync. Falling back to library file for linking.
23:26:11shashlickI'm on 10.13
23:26:13zacharycarterI have a feeling it's failing because of that maybe
23:26:30FromDiscord<KingDarBoja> https://imgur.com/uGEczkH awr1
23:26:45shashlickCan't go any further since this machine is 8 years old
23:26:47zacharycarterhttps://stackoverflow.com/questions/51314888/ld-warning-text-based-stub-file-are-out-of-sync-falling-back-to-library-file
23:26:56zacharycarterI'm on 10.14.6
23:28:27shashlickI don't have xcode either
23:29:07zacharycarterme either
23:29:14shashlickSame with 1.2.0
23:29:15zacharycarteroh - you will probably need xcode command line tools
23:31:30FromGitter<awr1> your issue might be something else @KingDarBoja
23:31:35FromGitter<awr1> https://play.nim-lang.org/#ix=2hoI
23:31:43shashlickOk I fixed those errors but still see the crash
23:32:24shashlickhttps://ix.io/2hoJ
23:33:07FromGitter<awr1> try `[T :Node; N :seq[T] or T]`
23:33:53shashlick@zacharycarter a windows shows up for 1/2 a second
23:33:59shashlickThen aborts
23:35:10FromGitter<awr1> https://play.nim-lang.org/#ix=2hoM @KingDarBoja
23:35:27FromDiscord<KingDarBoja> On it
23:35:33zacharycarterlooks like it's the call to - `sapp_metal_get_device()`
23:36:22*endragor joined #nim
23:37:36FromDiscord<KingDarBoja> Definitively there is something wrong
23:37:43zacharycarterseems like the `MTLCreateSystemDefaultDevice()` call is faliing
23:37:44FromDiscord<KingDarBoja> Still same error 🤔
23:39:35FromGitter<awr1> it works with a default parameter
23:39:35FromGitter<awr1> https://play.nim-lang.org/#ix=2hoN
23:40:08FromGitter<awr1> shave off the extra params and see if you can isolate the issue
23:41:35FromDiscord<KingDarBoja> I was doing the same on the playground lol
23:41:36FromDiscord<KingDarBoja> On it
23:41:50FromGitter<awr1> looking at the rest of your code, have you changed the body accordingly
23:42:00FromGitter<awr1> e.g. `nodesCopy`
23:42:23FromDiscord<KingDarBoja> Shaving off the default parameter make it work
23:42:31FromDiscord<KingDarBoja> made it*
23:42:39FromDiscord<KingDarBoja> But I didn't changed the body 🤔
23:44:59FromDiscord<KingDarBoja> Changing the body, e.g. `nodesCopy` to be `seq[T]` doesn't seem to work
23:48:55shashlick@zacharycarter any ideas? Is it the same as what you originally reported
23:50:03zacharycarterno this is different
23:50:35zacharycarterI have a feeling it is something with your mac - for some reason the metal device isn't getting created
23:51:51FromDiscord<KingDarBoja> Definitively removing the default parameter solves this but that isn't what it should be
23:54:05*endragor quit (Ping timeout: 265 seconds)
23:54:44*krux02 quit (Remote host closed the connection)
23:58:48*rockcavera joined #nim