00:01:57 | * | dsrw joined #nim |
00:02:26 | FromDiscord | <__ibrahim__> hello! |
00:02:26 | FromDiscord | <__ibrahim__> how hard is it for a c++/python noob to try nim opengl |
00:02:44 | FromDiscord | <__ibrahim__> i literally just found nim xD |
00:08:28 | * | dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:13:27 | companion_cube | Araq: what do you think of `yield from`? |
00:16:17 | FromDiscord | <konsumlamm> you actually could implement that as a macro |
00:16:30 | FromDiscord | <konsumlamm> or template even |
00:16:43 | companion_cube | I'm trying a template right now |
00:16:48 | companion_cube | (could still be in the stdlib!) |
00:17:06 | FromDiscord | <konsumlamm> fair, but it doesnt need tp be a builtin |
00:17:14 | FromDiscord | <konsumlamm> fair, but it doesnt need to be a builtin |
00:17:17 | companion_cube | no, that's cool |
00:17:51 | number_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:21 | number_two | Unfortunately 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:29 | companion_cube | ok idk how to write that |
00:19:55 | companion_cube | tried 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:55 | leorize[m] | companion_cube: isn't that just a for loop? |
00:27:17 | leorize[m] | also you don't need quote |
00:28:13 | FromDiscord | <__ibrahim__> @gitterirc Thanks for your answer! Makes sense. I'll fiddle away then |
00:28:28 | companion_cube | wrong 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:03 | FromDiscord | <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:01 | number_two | InventorMatt: I think you can use '-d:nimDebugDlOpen'. I might give you more info |
01:03:30 | FromDiscord | <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:25 | number_two | InventorMatt: Can you paste your call to nim here, please? |
01:06:17 | FromDiscord | <InventorMatt> nim compile --verbosity:0 -d:nimDebugDlOpen --run "c:\Users\matth\My_Projects\nim_scripts\http_tests\http_tests.nim" |
01:10:06 | number_two | InventorMatt Which command line app are you using? ie command prompt, powershell, git bash etc? |
01:11:41 | number_two | That seems to run fine on bash, but I'm also on linux. |
01:14:29 | FromDiscord | <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:57 | number_two | InventorMatt: 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:02 | number_two | Maybe that helps |
01:20:14 | * | dsrw joined #nim |
01:22:52 | * | dsrw quit (Client Quit) |
01:26:48 | * | dsrw joined #nim |
01:36:40 | FromDiscord | <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:53 | FromDiscord | <InventorMatt> with a few more tracebacks |
01:37:38 | FromDiscord | <InventorMatt> as well as the same failed load error from before |
01:37:38 | number_two | InventorMatt: Oooh, anything interesting in the tracebacks? Maybe pastebin it? |
01:38:09 | FromDiscord | <InventorMatt> ould not load: (libcrypto-1_1-x64|libeay64).dll |
01:38:09 | FromDiscord | <InventorMatt> Error: execution of an external program failed: 'c:\Users\matth\My_Projects\nim_scripts\http_tests\http_tests.exe ' |
01:38:10 | FromDiscord | <InventorMatt> stack trace: (most recent call last) |
01:38:10 | FromDiscord | <InventorMatt> C:\Users\matth\scoop\apps\nim\current\lib\system\nimscript.nim(401, 18) |
01:38:10 | FromDiscord | <InventorMatt> c:\Users\matth\My_Projects\nim_scripts\http_tests\config.nims(2, 10) buildTask |
01:38:12 | FromDiscord | <InventorMatt> C:\Users\matth\scoop\apps\nim\current\lib\system\nimscript.nim(260, 7) exec |
01:38:16 | FromDiscord | <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:23 | FromDiscord | <InventorMatt> just that |
01:38:32 | * | lritter quit (Ping timeout: 256 seconds) |
01:39:18 | * | lritter joined #nim |
01:42:54 | FromGitter | <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:54 | FromGitter | ... //gitter.im/nim-lang/Nim?at=5e8e7d9e9316f34b8d8cf646] |
01:44:43 | * | opal quit (Ping timeout: 240 seconds) |
01:46:34 | * | endragor joined #nim |
01:48:13 | number_two | InventorMatt: Can you try just compiling the code and not running it? |
01:48:26 | number_two | Using the command line |
01:52:04 | * | zacharycarter quit (Ping timeout: 256 seconds) |
01:52:47 | FromDiscord | <InventorMatt> number_two: it compiles successfully without any errors. the errors only show up when it is run |
02:00:24 | number_two | InventorMatt, Are you using SSL in your code? |
02:01:56 | FromDiscord | <InventorMatt> import httpClient |
02:01:56 | FromDiscord | <InventorMatt> var client = newHttpClient() |
02:01:56 | FromDiscord | <InventorMatt> discard client.getContent("https://covid.ourworldindata.org/data/ecdc/total_cases.csv") |
02:02:04 | FromDiscord | <InventorMatt> here is all the code has |
02:02:05 | number_two | InventorMatt maybe you need the -d:ssl flag? |
02:02:25 | number_two | so 'nim c -r <file>'? |
02:02:28 | number_two | Sorry |
02:02:33 | number_two | 'nim c -d:ssl -r <file>' |
02:03:22 | FromDiscord | <InventorMatt> I just tried that and I am still getting the same result |
02:04:02 | number_two | Sorry, 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:59 | FromDiscord | <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:05 | number_two | InventorMatt: 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:05 | number_two | InventorMatt: 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:23 | number_two | InventorMatt: Try moving the DLL's back and moving nim's directory to the very front of your %PATH% |
02:14:46 | number_two | https://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:35 | FromDiscord | <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:20 | number_two | InventorMatt: Any chance you could post your path? If there's not anything sensitive on there |
02:25:53 | * | zacharycarter joined #nim |
02:26:59 | FromDiscord | <InventorMatt> there is nothing sensitive in there |
02:27:00 | FromDiscord | <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:08 | number_one | Nothing wrong with the path length. Looks OK to me... |
02:30:08 | FromDiscord | <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:40 | number_one | InventorMatt: Ok, one last thing. Maybe try passing a direct path to the DLL's with the `-p` argument? |
02:41:07 | number_one | ie nim c --path:"C:\Users\matth\scoop\apps\nim\1.2.0\bi" -r <file> |
02:41:14 | number_one | * ie nim c --path:"C:\Users\matth\scoop\apps\nim\1.2.0\bin" -r <file> |
02:42:17 | leorize | uhmmm, that's not how you do it, ever |
02:42:37 | leorize | usually it should just work with the DLL in your PATH |
02:42:50 | leorize | note 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:35 | FromDiscord | <Varriount> leorize: My guess is that the DLL and executable are for 32 and 64 bit respectively (or vice-versa) |
02:56:57 | FromDiscord | <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:15 | FromDiscord | <Varriount> @InventorMatt ^ |
03:00:38 | FromDiscord | <KingDarBoja> Oh noes! https://ziglang.org/ |
03:00:53 | FromDiscord | <KingDarBoja> Another programming language lol |
03:01:08 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:01:32 | * | zacharycarter joined #nim |
03:03:24 | FromDiscord | <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:57 | FromDiscord | <Varriount> Did you run the script against your compiled program? |
03:05:03 | FromDiscord | <InventorMatt> yes, I did |
03:06:15 | leorize | @KingDarBoja: wait only now you realize that it exists? :P |
03:06:57 | * | zacharycarter quit (Ping timeout: 256 seconds) |
03:07:47 | FromDiscord | <Varriount> InventorMatt: Did you modify your path (such as add the Nim path) after you had your terminal window open? |
03:08:07 | FromDiscord | <Varriount> In your system settings |
03:08:35 | FromDiscord | <KingDarBoja> Oh yes... |
03:08:58 | FromDiscord | <KingDarBoja> Everyday I know something new |
03:11:47 | leorize | well zig is a pretty cool language |
03:11:51 | leorize | though I wouldn't use it :P |
03:12:00 | FromDiscord | <Varriount> @InventorMatt Or rather, I should say, try closing your terminal, reopening it, and compiling. |
03:12:06 | FromDiscord | <InventorMatt> @Varriount that I forgot to do and it seems to be working now. thank you so much for seeing that. |
03:12:30 | FromDiscord | <Varriount> (finally my years of developing on Windows bears fruit) |
03:12:50 | FromGitter | <awr1> what is `nnkExprColonExpr` |
03:12:52 | FromDiscord | <KingDarBoja> Win4Life |
03:12:52 | FromDiscord | <Varriount> *bares |
03:13:02 | FromGitter | <awr1> i don't see it mentioned in the macro docs |
03:13:36 | FromGitter | <awr1> oh nvm |
03:13:42 | FromDiscord | <Varriount> awr: Might be part of the AST when dealing with `for` blocks and such? |
03:54:03 | FromGitter | <awr1> i realized what it was |
04:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:41 | * | supakeen joined #nim |
04:17:30 | FromDiscord | <KingDarBoja> 🙂 |
04:19:44 | * | narimiran joined #nim |
04:24:00 | FromGitter | <awr1> encountered this strangeness just now |
04:24:01 | FromGitter | <awr1> https://github.com/nim-lang/Nim/issues/13932 |
04:24:17 | FromGitter | <awr1> curiously `repr()` gives the correct result |
04:26:16 | * | rockcavera quit (Remote host closed the connection) |
04:30:30 | leorize | looks like astGenExpr didn't process type data correctly |
04:49:09 | FromGitter | <awr1> it's not only astGenRepr, navigating down the tree, it is a intlit |
04:49:39 | dongbei | hmm |
04:49:50 | dongbei | leorize thanks for the answers from before |
04:50:21 | leorize | you're welcome :) |
04:50:30 | dongbei | anyone know how chang the cpp compiler version from gnu++14 |
04:50:42 | dongbei | string_view doesn't exist for me lol |
04:50:59 | leorize | --passC:-std=<version here> |
04:51:09 | dongbei | you'd think that would work |
04:51:30 | leorize | so what's your issue? :P |
04:52:00 | dongbei | nim cpp --passC:-std=c++17 --cincludes:"uWebSockets/uSockets/src/" hello.nim |
04:52:19 | dongbei | the |
04:52:20 | dongbei | Error: 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:29 | dongbei | essentially both flags are in there |
04:52:37 | dongbei | gnu++14 and gnu++17 |
04:52:44 | dongbei | c++17 also doesn't work |
04:53:04 | * | narimiran quit (Ping timeout: 256 seconds) |
04:53:35 | dongbei | so gcc++ doesn't recognize string_view as a member of std |
04:53:35 | leorize | looks like Nim passes that by default |
04:53:40 | dongbei | yah |
04:54:11 | leorize | try this then --gcc.cpp.options.always:-std=gnu++17 |
04:55:03 | dongbei | same error as before |
04:55:25 | dongbei | should I compile nim myself with extccomp.nim modified or something? |
04:55:34 | leorize | try putting `{.passC: "-std=gnu++17".}` in your .nim file |
04:56:09 | dongbei | checking |
04:56:28 | * | lritter quit (Ping timeout: 256 seconds) |
04:58:00 | dongbei | Error: expression 'staticExec "gcc-c additionalfile.cpp --flags ", "", ""' is of type 'string' and has to be discarded; |
04:58:15 | dongbei | first day, doing this, I'm probably including it wrong. |
04:58:21 | dongbei | i didn't include the back ticks |
04:58:29 | leorize | you don't need them |
04:58:32 | dongbei | k |
04:58:33 | leorize | how did you put them in? |
04:58:57 | dongbei | one sec, pastebinning |
04:59:21 | dongbei | https://pastebin.com/zdCq9mNL |
05:00:36 | dongbei | oh |
05:00:38 | dongbei | OH |
05:01:18 | dongbei | i need to check this error, one minute, thank you |
05:01:30 | leorize | the error was simple |
05:01:40 | leorize | staticExec returns a string, and you didn't handle it |
05:01:47 | leorize | also that concatenation is faulty |
05:02:02 | dongbei | yeah |
05:02:11 | leorize | also, do you know that we have a `{.compile.}` pragma? |
05:02:19 | leorize | though it might not be what you want |
05:02:47 | dongbei | no, googling it |
05:04:59 | * | narimiran joined #nim |
05:08:13 | dongbei | ok 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:27 | dongbei | but the default gnu++14 problem persists |
05:08:39 | * | zacharycarter joined #nim |
05:08:41 | dongbei | nice that I can avoid the emit I think |
05:08:55 | leorize | I'd say raise an issue on the compiler tracker for not being able to override -std=gnu++14 |
05:09:11 | leorize | and also that's not how you use compile :P |
05:09:55 | dongbei | but it gave me the same error lol |
05:10:07 | dongbei | i'll change it back to emit and see what happens |
05:10:12 | dongbei | https://github.com/nim-lang/Nim is the tracker? |
05:10:15 | leorize | yep |
05:10:50 | leorize | we do have a websockets library that you might want to use: https://github.com/niv/websocket.nim |
05:11:08 | dongbei | not as fast |
05:11:14 | dongbei | I've been benchmarking with wrk |
05:11:55 | leorize | can you share the benchmark? :) |
05:12:14 | dongbei | the interoperation of nim and c++ seems like it would be a complete winner in my usecase |
05:13:02 | leorize | yes, 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:23 | dongbei | that's my strugle right now lol |
05:13:39 | dongbei | gimme a bit and I'll post the bench |
05:13:46 | dongbei | you want it here or on a gist or something? |
05:13:53 | * | chemist69 joined #nim |
05:13:55 | leorize | a gist would be nice |
05:13:57 | dongbei | kk |
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:54 | dongbei | issue created, getting the bench |
05:24:34 | * | thomasross quit (Ping timeout: 256 seconds) |
05:34:48 | dongbei | hey 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:31 | dongbei | i tried --gc:none and --gc:arc but that causes errors with asynchttpserver or something |
05:36:06 | dongbei | oh what, none works now |
05:36:13 | dongbei | ignore me pls |
05:45:38 | dongbei | ok |
05:45:41 | dongbei | https://gist.github.com/ibsusu/0ffd8a3effcaf701e070b17d3ded9c6a |
05:45:55 | dongbei | barebones simple hello world test |
05:46:04 | dongbei | uWebsockets is over twice the speed |
05:46:38 | dongbei | I tried using both arc and none for gc |
05:46:58 | dongbei | if there's another technique I don't know about I can try again |
05:48:34 | dongbei | gonna 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:38 | dongbei | i don't want to miss anything |
06:09:30 | * | solitudesf joined #nim |
06:10:41 | leorize | dongbei: he fastest are -d:danger |
06:12:16 | FromGitter | <gogolxdong> What 's this exception `/mnt/c/Nim/lib/system/refs_v2.nim(139) nimDecRefIsLast` |
06:12:30 | leorize | dongbei: you can't really compare a websocket server and an http server :P |
06:12:36 | leorize | but I'll try to tinker with this :) |
06:12:51 | leorize | @gogolxdong: are you using arc? |
06:13:08 | FromGitter | <gogolxdong> using regions |
06:13:36 | leorize | you should use arc |
06:13:46 | leorize | region is deprecated and it doesn't even work correctly |
06:14:25 | FromGitter | <gogolxdong> the project is based on gc:regions, impossible to migrate in couples of days. |
06:14:44 | FromGitter | <gogolxdong> which version should I use with gc:regions? |
06:15:38 | leorize | you might want to see this: https://github.com/nim-lang/Nim/pull/11920 |
06:16:56 | leorize | if 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:31 | FromGitter | <faulander> stupid question: ⏎ filename = filename.strip(chars={'\x00', '\"', '*', '/', ':', '<', '>', '?', '\\', '^', '|'}) ⏎ doesn't strip the chars, why? |
07:14:06 | FromGitter | <faulander> (and i know there's a const for it, just used it this way for testing) |
07:22:47 | FromGitter | <faulander> https://play.nim-lang.org/#ix=2hj1 |
07:23:58 | FromGitter | <Vindaar> @faulander what do you expect to happen? |
07:24:09 | FromGitter | <Vindaar> `strip` only removes characters from the beginning or end of the string |
07:24:30 | FromGitter | <faulander> aaaaaaah sure! i need to use replace! |
07:24:40 | FromGitter | <faulander> thats why i said "stupid question" :) |
07:26:19 | FromGitter | <Vindaar> Ah, don't say that. It's fine to ask something like that |
07:27:39 | FromGitter | <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:39 | FromGitter | <faulander> you're right of course |
07:31:47 | FromGitter | <faulander> and now i am struggling mit multireplace :) |
07:34:06 | * | aEverr quit (Remote host closed the connection) |
07:34:07 | FromGitter | <faulander> proc multiReplace(s: string; replacements: varargs[(string, string)]): string {...} |
07:34:20 | FromGitter | <Vindaar> by how to use it? |
07:34:28 | FromGitter | <faulander> yes |
07:34:35 | * | aEverr joined #nim |
07:34:44 | FromGitter | <faulander> i want to replace all chars in the filename which are invalid with "" |
07:38:35 | FromGitter | <faulander> ah got it: ⏎ filename = multiReplace(filename, [("?", ""), (":", "")]) ⏎ (and so on) |
07:39:32 | FromGitter | <Vindaar> yep, that's how to do it |
07:51:28 | Araq | +1 for multiReplace |
07:54:03 | FromGitter | <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:54 | FromGitter | <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:49 | FromGitter | <faulander> seq[i]["title"] isn't working |
08:05:12 | FromGitter | <Vindaar> @faulander it should work though. Can you post a more complete example? |
08:05:39 | * | moerm joined #nim |
08:05:46 | moerm | hello |
08:06:03 | FromGitter | <faulander> i presumed it should work ... let me try again and otherwise create an example on playground |
08:07:25 | FromGitter | <Vindaar> ok! |
08:08:31 | FromGitter | <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:40 | FromGitter | <Vindaar> good to hear |
08:15:02 | * | tml[m] joined #nim |
08:19:31 | Yardanico | "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:09 | Yardanico | ah forgot, no need for -d:release here anymore |
08:20:16 | Yardanico | but yeah, Zig as C compiler works just fine |
08:20:29 | Yardanico | it's better than manually cross-compiling a GCC musl toolchain :P |
08:48:59 | * | hax-scramper quit (Ping timeout: 265 seconds) |
08:52:27 | Araq | Yardanico, nice that it works |
08:55:12 | Zevv | what is this fuzz about the zig compiler |
08:55:29 | Zevv | is it just a packaged cross compiler with sysroot built in or someting like that? |
09:00:08 | FromGitter | <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:43 | Yardanico | Zevv: well they package 30+ different libcs with headers for different linux targets, libclang itself (and of course Zig compiler too) |
09:06:00 | Yardanico | and it's only a ~40mb tarball |
09:06:05 | Yardanico | (tar.xz) |
09:06:10 | Zevv | sounds pretty pragmatical |
09:06:33 | Yardanico | https://ziglang.org/#Zig-ships-with-libc |
09:06:57 | Zevv | so I can finally get rid of this pain: http://zevv.nl/div/toolchains.png :) |
09:07:13 | Yardanico | uh-oh |
09:07:23 | Yardanico | well, it doesn't have uclibc sadly |
09:07:28 | Yardanico | glibc and musl |
09:07:39 | Zevv | aw that kind of defeats the purpose for me :/ |
09:19:10 | dongbei | anyone know wha tthe equivalent for c++ lambdas are? |
09:19:38 | dongbei | i'm trying to pass a proc to a c++ function that I'm importing with importcpp |
09:20:54 | dongbei | i'm nearly able to run my hello world in nim (๑˃ᴗ˂)ﻭ |
09:22:14 | * | uvegbot quit (Ping timeout: 256 seconds) |
09:22:29 | FromDiscord | <mratsim> proc map[T](x: seq[T], lambda: proc(x: T): T): seq[T] |
09:22:43 | * | uvegbot joined #nim |
09:22:55 | FromDiscord | <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:34 | dongbei | what is this wizardry |
09:23:40 | dongbei | ok, gonna try |
09:28:13 | moerm | bye, have a nice day |
09:28:25 | dongbei | bye |
09:28:36 | dongbei | u2 |
09:29:22 | * | moerm quit (Quit: Leaving) |
09:31:27 | dom96 | Yardanico, cool that Zig works, we may wish to consider enabling the download of it for choosenim |
09:33:45 | Yardanico | now 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:42 | Yardanico | oh 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:05 | dom96 | This 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:11 | dom96 | Trying out Zig then becomes easy |
09:42:43 | * | couven92 joined #nim |
09:42:54 | Yardanico | :P |
09:43:16 | FromGitter | <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:34 | Yardanico | @faulander maybe some DLLs have wrong bitness? |
09:43:42 | Yardanico | like if you're mixing 64 binary with 32-bit dlls |
09:43:52 | Yardanico | or these DLLs have dependencies themselves too, in that case they wouldn't get loaded too |
09:44:00 | Yardanico | unresolved dependencies I mean |
09:44:43 | FromGitter | <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:29 | FromGitter | <faulander> the exe works fine inside the src directory btw, just not on another directory like c:\tmp |
09:46:05 | FromGitter | <faulander> so which dlls do i need to use when compiling with -d:ssl option to run it on windows? |
09:46:25 | FromGitter | <faulander> windows 10, 64bit that is |
09:49:09 | * | hax-scramper joined #nim |
10:08:41 | FromDiscord | <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:02 | FromDiscord | <clyybber> Vindaar: Looks like a valid bug |
10:12:34 | FromDiscord | <clyybber> @kodkuce Yeah |
10:13:47 | FromGitter | <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:17 | FromDiscord | <clyybber> Vindaar: Oh, actually. Could it be that you have multiple overloads of sqrt imported? |
10:42:48 | FromGitter | <Vindaar> Yes, that's the point |
10:43:07 | FromDiscord | <clyybber> Yeah, they probably should count as typed |
10:44:41 | FromGitter | <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:36 | FromGitter | <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:06 | FromGitter | <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:38 | Araq | kodkuce: don't see how that would be possible |
10:53:01 | FromDiscord | <clyybber> Araq: Huh, should be possible no? |
10:53:13 | FromDiscord | <clyybber> If the library doesn't use strings and seqs? |
10:53:56 | Araq | I think there is some confusion about what 'library' means |
10:54:20 | Araq | if you mean some binary, then yes it's possible |
10:54:35 | Araq | if you mean "Nimble package A combined with B" |
10:54:52 | Araq | then the answer is "no", they have to agree on the MM strategy |
10:56:08 | dongbei | I can't seem to make lambdas work |
10:56:15 | dongbei | been at this for a couple of hours |
10:57:06 | FromDiscord | <Rika> what's the issue |
10:57:38 | dongbei | I'm trying to create a lambda in nim that I pass to a c++ method I'm importing |
10:57:57 | dongbei | I've tried importcpp and emit |
10:58:04 | dongbei | kinda lost |
10:58:54 | dongbei | calling 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:56 | Araq | dongbei, you mean C++ lambdas? |
11:16:03 | dongbei | correct |
11:26:38 | * | Zectbumo quit (Remote host closed the connection) |
11:34:51 | * | liblq-dev joined #nim |
11:35:56 | FromDiscord | <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:40 | dadada | is zig support in nim 1.20? |
11:38:16 | FromDiscord | <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:15 | FromDiscord | <Recruit_main707> more like a c dll, but probably it will work |
11:44:40 | Yardanico | dadada: no |
11:44:49 | Yardanico | it was merged after 1.2 release |
11:45:11 | Yardanico | https://github.com/nim-lang/Nim/pull/13757 |
11:45:34 | FromDiscord | <Rika> DAMN zig support in nim |
11:45:47 | FromDiscord | <Recruit_main707> whats zig? |
11:45:57 | Yardanico | @Rika well Zig exposes "zig cc" which acts almost like clang |
11:46:16 | Yardanico | @Recruit_main707 a programming language |
11:46:30 | Yardanico | which also happens to distribute a toolchain for easy cross-compilation |
11:46:32 | FromDiscord | <Recruit_main707> and how is that? |
11:46:36 | FromDiscord | <Recruit_main707> we compile to zig? |
11:46:41 | Yardanico | no, we compile to C |
11:46:57 | Yardanico | Zig already bundles libclang so they just made it so "zig cc" acts almost like clang |
11:47:06 | FromDiscord | <Rika> That would be insane though lmao |
11:47:09 | Yardanico | (With some zig extra options for cross compilation) |
11:47:24 | Yardanico | @Rika not really, Zig can translate C code to Zig actually |
11:48:11 | Yardanico | so 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:20 | FromDiscord | <Rika> Zig has "less" features than c right? |
11:48:22 | Yardanico | with no need to manually find and compile a toolchain and stuff |
11:48:29 | Yardanico | @Rika I'm not sure what do you mean by that |
11:48:43 | FromDiscord | <Rika> Me neither :) |
11:49:01 | FromDiscord | <Recruit_main707> i guess its a simpler language |
11:49:05 | Yardanico | not really |
11:49:14 | Yardanico | you can write C-like Zig code anyway |
11:49:32 | Yardanico | same goes for Nim too |
11:51:43 | * | raz joined #nim |
11:55:44 | * | jjido joined #nim |
12:01:38 | FromDiscord | <Recruit_main707> is nim big endian or little endian |
12:03:37 | FromDiscord | <Rika> both |
12:03:43 | FromDiscord | <Rika> i dont seem to understand |
12:04:43 | FromDiscord | <clyybber> a language is not big or little endian |
12:04:47 | FromDiscord | <clyybber> a processor is.. |
12:04:56 | FromDiscord | <clyybber> or a file |
12:04:57 | FromDiscord | <Recruit_main707> i have issues passing an integrer from python to nim (theorically using my machine´s endian), but not working: |
12:04:57 | FromDiscord | <Recruit_main707> 98005 this should be received, |
12:04:58 | FromDiscord | <Recruit_main707> 2 but i recceive this |
12:05:34 | FromDiscord | <Rika> how are you passing it |
12:05:57 | FromDiscord | <Recruit_main707> `struct.pack("@i", my_len)` |
12:06:02 | FromDiscord | <Recruit_main707> and then sending it |
12:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:43 | * | supakeen joined #nim |
12:07:21 | FromDiscord | <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:40 | FromDiscord | <Rika> print that in python, then also `echo result.repr` in nim |
12:09:10 | * | dongbei quit (Quit: leaving) |
12:09:25 | FromDiscord | <Recruit_main707> that number was the python number, i will try .repr |
12:11:27 | FromGitter | <awr1> zig is okay |
12:13:12 | FromGitter | <awr1> feature wise it's kind of a middle point between C++ and D |
12:13:17 | FromDiscord | <Recruit_main707> seems to print the same think Rika |
12:14:01 | FromDiscord | <Rika> it shouldnt show a box but the escaped bytes thing |
12:15:10 | FromGitter | <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:45 | FromDiscord | <Recruit_main707> `rootsocket.recv(4)`, thats right isnt it? |
12:16:40 | FromGitter | <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:23 | FromGitter | <Vindaar> I think if you do "rootsocket.recv(4).parseInt32" it'd work, but not if you use `parseInt` on the result |
12:17:25 | FromGitter | <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:49 | FromGitter | <awr1> but it holds itself back from having a fuller macro system (by design) |
12:17:53 | FromGitter | <Vindaar> ah wait |
12:18:41 | FromDiscord | <Recruit_main707> Vindaar, parseInt32 doesnt exist :/ |
12:18:54 | FromDiscord | <Rika> parseInt |
12:19:04 | FromDiscord | <Rika> ah |
12:19:09 | FromDiscord | <Rika> thats the strutils one |
12:19:19 | FromDiscord | <Rika> hm i dont know what to do for converting a bytes string to an int |
12:20:19 | FromDiscord | <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:32 | FromDiscord | <Recruit_main707> bytes functions* |
12:20:49 | FromDiscord | <Rika> you can prolly adapt those functions |
12:20:53 | FromGitter | <Vindaar> If you had a stream you would just use `s.readInt32()` |
12:21:11 | * | someunknownuser joined #nim |
12:21:19 | FromDiscord | <Rika> you can convert the string into a StringStream |
12:21:56 | FromDiscord | <Recruit_main707> readint32 doesnt seem to exist either |
12:22:01 | FromDiscord | <Rika> https://nim-lang.org/docs/streams.html |
12:22:03 | FromDiscord | <Rika> it does |
12:22:11 | FromGitter | <Vindaar> https://nim-lang.github.io/Nim/streams.html#readInt32%2CStream |
12:22:31 | FromDiscord | <Recruit_main707> should i import something? |
12:22:39 | FromDiscord | <Rika> `import streams` |
12:22:50 | FromDiscord | <Recruit_main707> ah ok, i thought this was stdlib |
12:23:00 | FromGitter | <Vindaar> it is stdlib |
12:23:05 | FromGitter | <Vindaar> just not system |
12:23:19 | FromDiscord | <Recruit_main707> ok |
12:23:41 | FromDiscord | <Recruit_main707> ok, how do i convert it into an stream? |
12:23:50 | FromDiscord | <Rika> newStringStream(theString) |
12:24:26 | FromDiscord | <Recruit_main707> fingers crossed |
12:26:52 | FromDiscord | <Recruit_main707> well, now my header seems to be bigger than it should be :p |
12:26:58 | FromDiscord | <Recruit_main707> but at least its an actual number |
12:28:04 | FromDiscord | <Rika> so, um, why is stringstream not available for JS? |
12:29:26 | FromDiscord | <clyybber> didn't make it work yet :p |
12:29:35 | FromDiscord | <clyybber> I made it work for CT js at least |
12:32:12 | FromDiscord | <Recruit_main707> working :D, (but so fricking slow its useless) but well see what i can do about that, thanks |
12:32:46 | FromDiscord | <clyybber> @Recruit_main707 how did you build your compiler? |
12:33:00 | FromDiscord | <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:06 | FromDiscord | <Recruit_main707> its probably the 14000 characters python needs to send :p |
12:34:32 | FromDiscord | <Rika> AKA it's prolly python? |
12:34:50 | FromDiscord | <clyybber> @Recruit_main707 yeah, but did you build your compiler using ./koch boot ? Or did you install the binary? |
12:34:58 | FromDiscord | <Recruit_main707> installed |
12:35:06 | FromDiscord | <clyybber> ah ok |
12:35:33 | FromDiscord | <clyybber> @Rika you could try removing the {.compileTime.} from the procs that are in the `when defined(js)` branch |
12:35:44 | FromDiscord | <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:56 | FromDiscord | <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:52 | FromDiscord | <Rika> @Clyybber twas just a question, I'm not using js backent |
12:41:09 | FromDiscord | <clyybber> ah ok |
12:42:15 | Zevv | yayk |
12:42:20 | Zevv | I won another Nim soul today |
12:42:24 | Zevv | that makes three |
12:42:28 | Zevv | I did my part |
12:42:28 | FromDiscord | <clyybber> ha nice! |
12:42:43 | Zevv | Every day I check the exponential graphs of Nim growth |
12:43:32 | FromDiscord | <Recruit_main707> i got someone into nim, but he is a bit busy so he hasnt started yet |
12:43:35 | FromDiscord | <mratsim> Aren't you supposed to do that for COVID? |
12:44:05 | Zevv | nah, I stopped caring about that. After two weeks I decided my life is pretty much unchaged. |
12:44:09 | FromDiscord | <mratsim> @Recruit_main707 Nim sockets are just raw system sockets, I suppose Python is the same. |
12:44:22 | FromDiscord | <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:42 | federico3 | https://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:05 | dom96 | TIL Swift has an interpreter |
13:46:35 | dom96 | Sounds like they should hire Andreas |
13:47:59 | Yardanico | lol :D |
13:48:27 | dom96 | They literally hired the creator of Swift, and asked him to do something |
13:48:41 | dom96 | They then evaluated other languages and no surprise here, chose Swift for their project |
13:49:34 | FromGitter | <alehander92> its interesting because the creator of Rust |
13:49:38 | FromGitter | <alehander92> went to work on Swift iirc |
13:49:53 | dom96 | Lots of different programming language creators went to work on Swift |
13:50:12 | shashlick | $$$ |
13:50:19 | dom96 | Not sure about the creator of Rust, but Slava (creator of Factor) is one example |
13:51:01 | FromGitter | <alehander92> ah interesting |
13:51:28 | FromGitter | <alehander92> well, graydon said he burnt out |
13:51:37 | FromGitter | <alehander92> which is also possible: working on the same thing for years is so hard |
13:51:59 | dom96 | AFAIK creator of Clay also works at Apple on Swift |
13:52:06 | Yardanico | @alehander92 I wonder how 4raq manages to do it :P |
13:52:15 | FromGitter | <alehander92> well, people are different :P |
13:53:13 | FromGitter | <alehander92> i always thought microsoft is a cool place to work |
13:53:16 | FromGitter | <alehander92> for language design |
13:53:32 | FromGitter | <alehander92> as they often have those random research langs/os-es |
13:53:32 | FromDiscord | <mratsim> Well Swift creator left Swift to work at Google |
13:54:07 | FromDiscord | <mratsim> and then he left GOogle |
13:54:24 | FromGitter | <alehander92> no, he left for Tesla |
13:54:45 | dom96 | Nice, so soon we'll have a programming language suited for car programming |
13:55:25 | FromGitter | <alehander92> no, he left Tesla for Google |
13:55:41 | FromGitter | <alehander92> and now it seems he is in SiFive which is cool |
13:56:22 | FromGitter | <alehander92> sorry mratsim yeah you're right for the second thing |
13:59:44 | Yardanico | also, an unrelated question - recently a guy I know on Telegram has been pursuading me towards reading SICP - is it worth it ? :) |
14:08:53 | Araq | so you're asking on IRC for confirmation on something you heard on Telegram |
14:09:13 | Yardanico | well I trust IRC more, people seem to be more professional here :D |
14:09:19 | zacharycarter | there's one way to find out |
14:12:15 | zacharycarter | https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book.html |
14:12:52 | Yardanico | yeah I already read the introduction and did some first excersises :P |
14:13:07 | FromGitter | <alehander92> its very famous |
14:13:31 | * | drewr joined #nim |
14:13:34 | FromGitter | <alehander92> i am not entirely sure why its so famous |
14:14:00 | FromGitter | <alehander92> but it seems cool if you're learning lisp |
14:14:13 | zacharycarter | I think it actually focuses mostly on scheme |
14:14:19 | FromGitter | <alehander92> yeah sorry |
14:14:20 | Yardanico | yeah, but scheme is lisp :P |
14:14:34 | zacharycarter | lisp is like the C++ of scheme |
14:14:36 | FromGitter | <alehander92> but i guess some ideas kinda translates to other lisps |
14:14:43 | FromGitter | <alehander92> i think its the opposite |
14:14:47 | FromGitter | <alehander92> lisp was there before scheme |
14:14:49 | zacharycarter | no |
14:14:53 | FromGitter | <alehander92> so scheme is like the Go of .. C++ ? |
14:14:57 | FromGitter | <alehander92> yes |
14:15:00 | * | drewr quit (Remote host closed the connection) |
14:15:05 | Yardanico | zacharycarter: lisp is when it all started :) |
14:15:11 | FromGitter | <alehander92> its a dialect |
14:15:13 | companion_cube | when you say lisp you mean common lisp? |
14:15:15 | zacharycarter | but scheme is simpler than lisp |
14:15:23 | zacharycarter | scheme dialects can be tiny |
14:15:37 | FromGitter | <alehander92> you're right lisp it is kinda like C++ to scheme |
14:15:45 | * | drewr joined #nim |
14:16:29 | Yardanico | one 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:35 | zacharycarter | okay so lisp predates scheme, scheme is just a minimal dialect of lisp - my bad I needed to wiki |
14:17:29 | FromGitter | <alehander92> no problem |
14:17:34 | FromGitter | <alehander92> i enjoyed |
14:17:41 | FromGitter | <alehander92> an article about restarts in common lisp iirc |
14:17:57 | Yardanico | although that guy on telegram is also a very heavy zealot about emacs and lisp :D |
14:17:59 | FromGitter | <alehander92> it seems as an interesting construct tho i am not sure fully that i'd use it in nim |
14:18:10 | narimiran | Yardanico: https://susam.in/blog/lisp-in-vim-with-slimv-or-vlime/ - you can use vim too ;) |
14:18:19 | Yardanico | xdd |
14:18:57 | Yardanico | and 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:17 | narimiran | i would guess there's some extension for it |
14:19:27 | Yardanico | only for syntax highlighting |
14:19:42 | Yardanico | no fancy auto suggestions or LSP |
14:22:09 | narimiran | alternatively, you do SICP using Nim and whatever editor you like :) |
14:22:15 | Yardanico | lol |
14:25:56 | * | dsrw joined #nim |
14:28:06 | * | dsrw quit (Client Quit) |
14:29:56 | FromGitter | <alehander92> yes |
14:30:39 | * | dsrw joined #nim |
14:35:27 | * | jjido quit (Quit: Connection closed for inactivity) |
14:38:47 | FromDiscord | <kodkuce> i would like to get auto suggestion for micro but duno how 🙂 |
14:39:15 | FromDiscord | <kodkuce> i find neovim wasting too much time thinking how to do stuff i want then doing it |
14:39:35 | Yardanico | create a nim plugin for it :P |
14:40:49 | FromDiscord | <kodkuce> i can invest stome time trying |
14:43:32 | FromDiscord | <kodkuce> hmm from what i see they dont have lsp implemented |
14:44:12 | Yardanico | is "nimlsp" good now? :P |
14:44:27 | FromGitter | <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:42 | Yardanico | wdym? |
14:44:48 | Yardanico | getHomeDir gets a home directory of the user who ran the binary |
14:44:52 | Yardanico | not *the developer* |
14:45:09 | Yardanico | ah |
14:45:14 | Yardanico | maybe you've used "const" instead of "let"? |
14:45:32 | Yardanico | "const" means "calculate at compile-time" so maybe that's why it saves your own home directory |
14:46:02 | FromGitter | <faulander> no |
14:46:31 | FromGitter | <faulander> ah, yes. i used const |
14:46:40 | FromGitter | <faulander> you're a genius |
14:47:11 | Yardanico | well 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:22 | FromGitter | <mratsim> maybe the doc of getHomeDir needs a caveat |
14:47:44 | Yardanico | @mratsim most procs from "os" module will need that then :P |
14:48:05 | FromGitter | <mratsim> who needs files anyway ;) |
14:48:14 | Yardanico | I think it's not an issue, just need to tell new Nim programmers the difference between var/let and const early on |
14:48:22 | FromGitter | <faulander> i was wondering what the difference between let and const is - now it makes alot of sense. |
14:48:49 | Yardanico | @faulander it's actually in the tutorial https://nim-lang.org/docs/tut1.html#constants |
14:48:55 | Yardanico | "The compiler must be able to evaluate the expression in a constant declaration at compile time" |
14:49:35 | Yardanico | Also I really suggest superb https://narimiran.github.io/nim-basics/ |
14:49:47 | FromGitter | <faulander> yeah, but that sentence is maybe understood by a science professor, not a self taught developer. |
14:50:54 | FromGitter | <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:42 | Yardanico | well, 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:10 | Yardanico | as 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:00 | Yardanico | but really there's no problem in shipping .dll's with your .exe, it should work |
14:53:15 | Yardanico | most apps do this - they have an .exe and a bunch of .dlls in the same directory |
14:53:34 | FromGitter | <faulander> it doesn't. i tried to have it in the exe dir, also in win/system32 |
14:53:49 | Yardanico | what .dlls did you use? |
14:54:05 | Yardanico | Did you try DLLs from https://nim-lang.org/download/dlls.zip ? |
14:54:08 | FromGitter | <faulander> even after a restart it didn't work, only the installation of the OpenSSL package worked finally |
14:54:17 | Yardanico | and how did you install nim itself? |
14:54:46 | FromGitter | <faulander> no, i used the official ones. i might give it another try with the nim packaged ones. |
14:55:22 | Yardanico | well you should really try nim own openssl .dlls since they're properly separated into 32 and 64- bit |
14:55:33 | FromGitter | <faulander> i used scoop to install nim |
14:55:43 | Yardanico | well not sure if it installs the dlls too |
14:56:14 | FromGitter | <faulander> i think it did. the exe worked in the src directory where it was compiled |
14:56:23 | FromGitter | <faulander> then i moved it to .temp and there i got the errors |
14:56:29 | Yardanico | well that's expected |
14:56:37 | Yardanico | you need to distribute the dlls together with an .exe |
14:56:45 | Yardanico | in an archive for example, or create an installator for your program |
14:57:01 | Yardanico | and these DLLs are located where "nim.exe" is, but you can also get them from https://nim-lang.org/download/dlls.zip |
14:57:02 | FromGitter | <kaushalmodi> @faulander may be the table here helps distinguish among `let`, `const`, `var`: https://scripter.co/notes/nim/#variable-types |
14:57:13 | FromGitter | <faulander> i would have preferred a single exe without installation, but if that's the only possibility i'll choose that path. |
14:57:39 | Yardanico | well I described the two of your options above about single exe |
14:58:31 | Yardanico | @kaushalmodi s/evallable/evaluable :P |
14:58:54 | FromGitter | <kaushalmodi> Yardanico: Yes! I will fix that |
14:58:57 | FromGitter | <faulander> yes, thanks. i'll ship it with dll's |
14:59:05 | FromGitter | <kaushalmodi> I meant to write something like *eval'able* |
14:59:23 | FromGitter | <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:44 | Yardanico | yeah, 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:59 | FromGitter | <faulander> yes, i can do that with ansible ;) |
15:00:29 | Yardanico | by default windows searches DLLs for your app in the current folder and in $PATH AFAIK |
15:00:51 | FromGitter | <faulander> yes, i know that. must have been the wrong versions of dll i used. |
15:04:50 | FromGitter | <faulander> true that. deleted all installations, put the dlls into the dir and it worked - at least on my machine. |
15:05:30 | FromDiscord | <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:34 | FromDiscord | <Skaruts> Here's an example: https://play.nim-lang.org/#ix=2hlz |
15:05:47 | Yardanico | you need capture |
15:05:57 | Yardanico | i'll find it :P |
15:06:06 | FromDiscord | <Skaruts> I can't for the life of me remember how to do that (someone told me once) |
15:06:33 | Yardanico | it's in sugar module |
15:06:40 | Yardanico | https://nim-lang.org/docs/sugar.html#capture.m%2Cvarargs%5Btyped%5D%2Cuntyped |
15:07:22 | FromDiscord | <Skaruts> oh! |
15:07:29 | FromDiscord | <Skaruts> thanks 🙂 |
15:13:20 | FromDiscord | <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:32 | Yardanico | do you have 1.2? |
15:13:42 | Yardanico | https://github.com/nim-lang/Nim/pull/12712 |
15:13:57 | FromDiscord | <Skaruts> ah no, I'm still on 1.0.4... |
15:14:01 | Yardanico | lol :P |
15:14:23 | FromDiscord | <Skaruts> but I solved this issue before though, is there no other way? |
15:14:44 | FromGitter | <kaushalmodi> I'd upgrade Nim |
15:14:58 | Yardanico | @Skaruts you can always just copy "capture" to your code, but better update Nim :) |
15:15:03 | FromDiscord | <Skaruts> I'd like to be lazy about updating nim for another day or two... |
15:15:10 | FromDiscord | <Skaruts> 🙂 |
15:15:16 | FromGitter | <Vindaar> `closureScope` was available before 1.2, no? |
15:15:20 | FromGitter | <Vindaar> maybe that's enough for you |
15:16:29 | FromGitter | <Vindaar> https://play.nim-lang.org/#ix=2hlG |
15:19:01 | FromDiscord | <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:05 | FromDiscord | <Skaruts> thanks |
15:19:13 | FromDiscord | <clyybber> or just copy capture |
15:19:29 | FromDiscord | <Skaruts> or that... |
15:24:08 | FromDiscord | <Skaruts> gonna go with closureScope for the moment, as copying capture still doesn't work (some othe stuff is new too) |
15:24:24 | Yardanico | did you forget to import macros? |
15:24:26 | Yardanico | maybe |
15:24:38 | FromDiscord | <Skaruts> no I copied that too from there |
15:24:52 | FromDiscord | <Skaruts> both the imports |
15:25:33 | FromDiscord | <Skaruts> it's working though, I'll update Nim later and replace it, no big deal |
15:56:26 | FromGitter | <faulander> do you know of a good datetime lib for nim like pendulum for python? https://github.com/sdispater/pendulum |
15:57:56 | Yardanico | "times" stdlib module |
15:59:30 | Yardanico | Nim stdlib is quite usable ;) |
16:00:06 | FromGitter | <faulander> i have to work through the standardlib i see. that times module is quite useable :) |
16:01:42 | FromGitter | <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:50 | Yardanico | yeah you're right |
16:04:15 | * | Trustable joined #nim |
16:10:22 | FromGitter | <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:39 | FromGitter | <Vindaar> *the first time ever |
16:10:53 | Yardanico | yeah, I too had to work with mysql (mariadb) a bit recently |
16:11:00 | Yardanico | it looks too unsafe without proper ORMs |
16:11:16 | Yardanico | There's Norm, ormin and a couple of other Nim ORMs, but none of them support MySQL :D |
16:12:35 | FromGitter | <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:49 | Yardanico | seems like https://github.com/nanoant/nim-orm has mysql support, but it's quite old (from 2015) |
16:13:56 | Yardanico | and it's not a full-blown ORM |
16:14:53 | FromGitter | <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:54 | Yardanico | oh, found https://github.com/encorehu/nim-orm fork of that nim-orm |
16:18:26 | FromGitter | <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:27 | FromGitter | <alehander92> type safe access would be useful |
16:49:38 | FromGitter | <alehander92> especially with checking schema on compile time |
16:49:45 | FromGitter | <alehander92> somebody wanted that ^ i think |
16:50:06 | FromGitter | <alehander92> but some people dont like the idea |
16:50:17 | Yardanico | ornim does that AFAIK |
16:50:20 | Yardanico | and Norm too |
16:50:57 | Yardanico | since 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:33 | FromGitter | <alehander92> yeah but |
16:52:42 | FromGitter | <alehander92> you can generate the table from the orm |
16:52:58 | FromGitter | <alehander92> but the other option is to just check that the existing schema is compatible with the types |
16:53:10 | FromGitter | <alehander92> ormin i think was loading ? the types from the database schema |
16:53:14 | FromGitter | <alehander92> which i guess is maybe the same |
16:53:38 | FromGitter | <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:10 | FromDiscord | <Varriount> I'm wondering if I will ever understand javascript viewpoints: https://github.com/airbnb/javascript/issues/1271 |
17:06:20 | FromDiscord | <Varriount> Especially this comment: https://github.com/airbnb/javascript/issues/1271#issuecomment-283424710 |
17:06:50 | Yardanico | lol |
17:07:13 | Yardanico | of course continue/break can be avoided, but then code can become much uglier |
17:08:10 | FromDiscord | <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:41 | FromDiscord | <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:10 | Yardanico | also slower :P |
17:10:40 | kungtotte | Cargo cult programming is bad: news at 11 :P |
17:11:03 | Yardanico | "@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:19 | Yardanico | "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:21 | Yardanico | lmao |
17:11:31 | kungtotte | Sounds like something a JS dev would say ;P |
17:11:34 | FromDiscord | <Varriount> Also: "performance isn't important. It's easy to make clean code fast; it's hard to make fast code clean." |
17:11:46 | zacharycarter | do threads work with --gc:arc currently? |
17:12:00 | kungtotte | The second sentence is correct there though. Write the good code first, the fast code second. |
17:12:03 | kungtotte | *After* profiling. |
17:12:04 | FromDiscord | <Varriount> zacharycarter: I believe they work, however the existing restrictions still apply. |
17:12:07 | Araq | well 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:25 | Yardanico | zacharycarter: I don't think so :( |
17:12:34 | Araq | threads do work with --gc:arc |
17:12:42 | Yardanico | hmm I had some error with them, weird |
17:12:53 | Araq | and with --threads:on the default is shared allocation, enjoy |
17:12:56 | Yardanico | seems fine now |
17:12:59 | Yardanico | Araq: yay |
17:13:09 | zacharycarter | okay - I'm getting a sigsev when calling `createThread` so I'll investigate further since they're supposed to be working |
17:13:12 | FromDiscord | <Varriount> Araq: But is reference counting atomic? |
17:13:29 | Araq | anyhow. here is what you know for 'while B: body'. you know 'not B' holds. |
17:13:38 | Araq | here is what you know when the body has a break: nothing. |
17:13:58 | Araq | (actually you know more than that but it's tricky and gets ugly) |
17:15:12 | Araq | Varriount: no, you have to 'move' stuff around completely |
17:15:13 | Araq | bll |
17:15:15 | Araq | bll |
17:15:16 | Araq | bbl |
17:15:25 | Yardanico | lol |
17:19:02 | FromDiscord | <Varriount> Araq: I would like to note that `egrep '\b(break|continue)\b' --recursive nim/compiler/ | wc -l` results in `455`. 😜 |
17:20:01 | Amun_Ra | is foo(x, y: int; z: cint) ever be preferred over foo(x, y: int, z: cint)? |
17:20:42 | Yardanico | you mean , vs ; ? |
17:21:10 | FromDiscord | <Varriount> Amun_Ra: It's completely up to you. |
17:21:28 | FromDiscord | <Varriount> Personally, I can't be bothered, but would gladly allow a linter to add the `;` for me. |
17:21:53 | FromDiscord | <clyybber> Araq: When the body has a break you know everything you know in the breaks scope |
17:22:09 | FromDiscord | <Varriount> (Has anyone written a linter for Nim yet?) |
17:22:13 | Yardanico | wait so about arc and threads - what exactly does "shared heap" mean? |
17:22:17 | Yardanico | @Varriount "nimpretty"? |
17:22:21 | Yardanico | ah sorry "nim check" |
17:22:43 | FromDiscord | <Varriount> That checks more for syntactic and semantic patterns, not textual ones. |
17:22:46 | Amun_Ra | Yardanico: yes |
17:22:49 | Yardanico | ah actually --styleCheck:error |
17:22:56 | Yardanico | or --styleCheck:hint |
17:23:32 | zacharycarter | well - I get a SIGSEV on devel when calling createThread in a loop with gc:arc |
17:23:39 | zacharycarter | I'll try to reproduce in a minimal example |
17:23:44 | Yardanico | well I mean the shared heap question |
17:23:58 | Yardanico | can I use and modify GCd variables from different threads at the same time in ARC? |
17:24:00 | FromDiscord | <mratsim> not a good start for weave compat with gc:aarc |
17:24:01 | Yardanico | with arc* |
17:25:08 | * | hax-scramper85 joined #nim |
17:26:32 | * | nsf joined #nim |
17:26:55 | leorize | Yardanico: yes |
17:27:17 | zacharycarter | https://gist.github.com/zacharycarter/dbee66c50a6c26e7f187512235c4ed1f |
17:27:21 | zacharycarter | Araq ^ |
17:27:23 | * | hax-scramper85 quit (Remote host closed the connection) |
17:27:51 | Yardanico | leorize: 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:01 | Yardanico | with --gc:arc |
17:28:10 | Yardanico | no globals maybe |
17:28:32 | leorize | it's an old requirement and hasn't been phased out |
17:28:43 | leorize | `{.thread.}` literally means `{.gcsafe.}` |
17:28:51 | Yardanico | oh lol |
17:30:00 | leorize | note that you'd still need a lock to safely modify the string |
17:30:07 | leorize | but it's possible now |
17:30:53 | zacharycarter | is 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:56 | Yardanico | well I still wonder how :D |
17:31:15 | Yardanico | https://gist.github.com/Yardanico/f61c67d9700733c907925f2591c9da1d this errors because of gc safety |
17:31:29 | Yardanico | if I remove {.thread.} - createThread complains, maybe I can modify it, hmm |
17:32:22 | leorize | use a `{.gcsafe.}` block to tell the compiler to shut up |
17:32:37 | Yardanico | doesn't work :D |
17:32:39 | Yardanico | "Error: 'threadFunc' is not GC-safe as it accesses 'mystr' which is a global using GC'ed memory" |
17:32:41 | FromDiscord | <Chiqqum_Ngbata> Is there a way to disable all inferred .noSideEffect. |
17:32:59 | Yardanico | @Chiqqum_Ngbata what for? it's automatically when the proc doesn't have any side effects |
17:33:04 | Yardanico | automatically added* |
17:33:16 | FromDiscord | <Chiqqum_Ngbata> I have a case where it's erroneously added |
17:33:30 | Yardanico | well, can you post an example please? and maybe make a bug report |
17:33:46 | FromDiscord | <Chiqqum_Ngbata> Maybe because I'm accessing a non-const? |
17:34:04 | FromDiscord | <Chiqqum_Ngbata> I'll try to create minimal example in a bit |
17:34:08 | leorize | Yardanico: this works: https://play.nim-lang.org/#ix=2hmv |
17:34:19 | Yardanico | leorize: oh |
17:34:22 | Yardanico | nice |
17:34:41 | * | waleee-cl joined #nim |
17:34:43 | leorize | zacharycarter: can you file a bug report? |
17:34:51 | zacharycarter | sure |
17:35:09 | Yardanico | although it doesn't for me xd |
17:35:15 | Yardanico | seems to run forever |
17:35:36 | Yardanico | with no CPU usage |
17:35:52 | Yardanico | and I get SIGSEGV with -d:danger |
17:36:05 | Yardanico | with -d:release too |
17:39:58 | leorize | same :P |
17:40:03 | * | Guest85 joined #nim |
17:40:16 | Yardanico | so I guess they don't work just yet or there was some code change in devel that broke them |
17:40:56 | zacharycarter | I don't think `--gc:arc` is out of devel yet is it? |
17:41:00 | Yardanico | it's in 1.2 |
17:41:03 | zacharycarter | oh |
17:41:03 | Yardanico | but not default ofc |
17:41:08 | Yardanico | not *yet* :D |
17:41:11 | zacharycarter | let me try on 1.2 |
17:41:19 | Yardanico | can also try on playground |
17:41:36 | Yardanico | ah, no, can't modify compiler opts, forgot |
17:44:48 | zacharycarter | yeah, 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:39 | FromDiscord | <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:47 | FromDiscord | <mratsim> with gc:arc |
17:52:13 | Yardanico | yeah it seems borked rn :/ |
17:53:07 | Yardanico | @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:38 | someunknownuser | what is a method lock level? |
17:53:50 | Yardanico | someunknownuser: ? |
17:54:26 | someunknownuser | I am getting the following warning and was wondering what it is. Warning: method has lock level <unknown>, but another method has 0 |
17:54:41 | leorize | method lock level is how many locks that the method uses iirc |
17:54:59 | leorize | it's underdeveloped and the warning is a hit and miss |
17:55:05 | leorize | 99% of the time it's meaningless |
17:55:17 | someunknownuser | ok, so I should not be worried about it? |
17:55:22 | leorize | yep |
17:55:27 | someunknownuser | ok, thank you |
17:57:21 | FromDiscord | <mratsim> @Yardanico, you can but don't block your main thread |
17:57:47 | FromDiscord | <mratsim> Weave doesn't support timeout though |
17:57:53 | FromDiscord | <mratsim> it's for compute not IO |
17:59:18 | Yardanico | well I would use async if I was able to, but this lib is blocking :P |
17:59:21 | FromDiscord | <Varriount> Hm, one thing that will require threading at some point is the subprocess library I'm planning... |
17:59:51 | FromDiscord | <mratsim> isn't async supposed to handle blocking? |
17:59:56 | Yardanico | is it? |
17:59:57 | FromGitter | <alehander92> no |
18:00:14 | FromDiscord | <mratsim> for long running process that can blcok just use createThread, like usual to handle the terminal? |
18:00:18 | FromDiscord | <Varriount> mratsim: Well, I guess, however I'd like to make it framework agnostic. |
18:00:45 | Yardanico | @mratsim well I thought about how to implement timeouts - one "watch" thread for every working threaD? |
18:00:58 | FromDiscord | <mratsim> if you can describe your scenario in an issue in Weave I'll think if it makes sense to allow that |
18:01:11 | FromDiscord | <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:23 | FromGitter | <alehander92> async can be made to auto-create threads, but this is probably better to be explicit |
18:01:35 | FromDiscord | <mratsim> shouldn't you use the Erlang stuff, the restarter/manager trees? |
18:01:52 | FromDiscord | <Varriount> Are you talking to me, or alehander92? |
18:01:55 | FromDiscord | <mratsim> Supervision tree: https://erlang.org/doc/design_principles/des_princ.html |
18:02:00 | FromGitter | <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:08 | FromDiscord | <mratsim> I think that should be a library |
18:02:21 | FromDiscord | <mratsim> @Varriount the supervision trees are for you |
18:02:23 | FromGitter | <alehander92> but this might be too implicit |
18:02:34 | FromGitter | <alehander92> and unexpected for the user |
18:04:04 | FromDiscord | <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:16 | FromDiscord | <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:34 | FromDiscord | <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:45 | FromDiscord | <mratsim> (i.e. for telephone and communication backend) |
18:17:02 | FromDiscord | <mratsim> "impure" means depending on C/C++/JS |
18:17:05 | FromDiscord | <mratsim> pure is pure Nim |
18:17:25 | Yardanico | @Kiloneie also see https://nim-lang.org/docs/lib.html#impure-libraries |
18:17:29 | Yardanico | https://nim-lang.org/docs/lib.html |
18:17:44 | Yardanico | "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:08 | Yardanico | so for example db_mysql is an impure library, and "mysql" module is a wrapper |
18:18:40 | Araq | zacharycarter: try with an 'array' of Threads please |
18:18:59 | FromDiscord | <Varriount> Hm, do iterators support forward declarations? |
18:19:16 | Yardanico | Araq: what about https://play.nim-lang.org/#ix=2hmv |
18:19:22 | Yardanico | is this supposed to ever work? :P |
18:19:35 | FromDiscord | <Kiloneie> okay thanks, i will work with that |
18:21:21 | Araq | Yardanico: it's supposed to work already |
18:21:38 | zacharycarter | Araq: sure |
18:22:24 | Yardanico | Araq: 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:37 | Yardanico | oh seems like it always SIGSEGVs when stacktraces are disabled |
18:24:02 | zacharycarter | same error with an array Araq |
18:24:05 | Araq | strange, I remember this code being part of the test suite :P |
18:24:13 | Yardanico | GDB says it crashes at nim/lib/system/avltree.nim:74 |
18:24:52 | Araq | maybe Zevv messed up the new alloc() interface :P |
18:29:15 | Araq | Yardanico: please check if the calls pass through allocShared() and friends |
18:29:25 | Yardanico | they pass through deallocShared |
18:29:37 | Yardanico | I mean the backtrace |
18:29:44 | Yardanico | https://gist.github.com/Yardanico/a381a09b943b2618de534e49a99ed0a8 |
18:30:56 | Yardanico | if I replace that string addition with echo "ok" it prints "ok" 3 times and then SIGSEGVs |
18:31:04 | Yardanico | ah, 4 times |
18:31:09 | Yardanico | so it runs the threads but crashes after that |
18:31:36 | Yardanico | or not, seems like it crashes after 4 "ok"s even if I do array of size 150 |
18:31:55 | Yardanico | ah it behaves differently each time |
18:34:07 | FromDiscord | <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:17 | FromDiscord | <Varriount> (https://godbolt.org/) |
18:34:39 | FromGitter | <alehander92> some people |
18:34:49 | Yardanico | initial https://github.com/mattgodbolt/compiler-explorer/pull/1753 |
18:34:54 | FromGitter | <alehander92> https://github.com/mattgodbolt/compiler-explorer/pull/1753 |
18:35:03 | FromGitter | <alehander92> what do you call |
18:35:06 | FromGitter | <alehander92> reveal linked code |
18:35:19 | Yardanico | @alehander92 probably the feature when you can see how source code is mapped to assembly |
18:35:23 | FromDiscord | <Varriount> Yes |
18:35:38 | FromGitter | <alehander92> ah i think it worked |
18:35:41 | FromDiscord | <Varriount> If you right click on a line in the editor, there's an option to reveal linked code. |
18:35:43 | FromGitter | <alehander92> at one point |
18:36:14 | FromDiscord | <Varriount> Ah! Got it. |
18:36:17 | Yardanico | it works with "--debugger:native" |
18:36:21 | FromDiscord | <Varriount> Adding `--debugger:native` |
18:36:27 | Yardanico | lol |
18:36:35 | FromGitter | <alehander92> yes you need to add it to options |
18:36:57 | Yardanico | now we need to add nlvm to godbolt :P |
18:37:01 | Yardanico | to check LLVM IR |
18:37:07 | FromGitter | <alehander92> wow this is a good point |
18:37:19 | FromGitter | <alehander92> we might need to add it to codetracer just as a cool target |
18:37:36 | FromGitter | <alehander92> probably godbolt can just follow the rust/zig modes |
18:37:39 | FromGitter | <alehander92> for nlvm |
18:39:57 | FromDiscord | <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:24 | Yardanico | add some effect or tag to your proc? |
18:40:28 | FromDiscord | <Chiqqum_Ngbata> Possibly the reason it's adding .noSideEffects. is because the side effect is predicated upon a C binding |
18:40:36 | Yardanico | like proc myproc: string {.tags: [IO].} = discard |
18:40:40 | Yardanico | https://nim-lang.org/docs/manual.html#effect-system-tag-tracking |
18:42:06 | * | nsf quit (Quit: WeeChat 2.7) |
18:45:10 | FromDiscord | <Chiqqum_Ngbata> Still getting a type mismatch on a proc type annotated with .nimcall. |
18:46:32 | FromDiscord | <Chiqqum_Ngbata> Maybe I can touch something (else) global, let's see |
18:49:29 | leorize | what's your problem? |
18:50:36 | FromDiscord | <Chiqqum_Ngbata> (That did work) |
18:51:55 | FromDiscord | <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:45 | leorize | use `{.sideEffect.}` to counter that :P |
18:55:50 | FromDiscord | <Chiqqum_Ngbata> That had me excited for a hot second but it's not working for me, going to try some things |
18:56:03 | FromDiscord | <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:36 | leorize | @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:24 | zacharycarter | mratsim: are there any benchmarks / examples of a job queue in weave? |
19:23:16 | FromDiscord | <Varriount> mratsim: You have a benchmarking library, don't you? |
19:33:13 | Zevv | Araq: 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:00 | Zevv | go |
20:36:24 | * | narimiran quit (Ping timeout: 265 seconds) |
20:48:19 | * | casaca joined #nim |
20:55:38 | FromGitter | <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:43 | FromGitter | <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:23 | FromGitter | <dawkot> `s[0].unsafeAddr` should work |
21:27:30 | leorize | you pass in s.cstring |
21:27:45 | FromGitter | <dawkot> Oh, because of GC? |
21:28:01 | leorize | nah, it's shorter :P |
21:30:00 | * | Vladar quit (Quit: Leaving) |
21:31:51 | FromGitter | <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:26 | FromGitter | <sealmove> guys, I get "stdlib_io.nim.c:(.text+0x725): undefined reference to `__builtin_saddll_overflow'" |
21:40:32 | FromGitter | <sealmove> anyone has any idea what this is? |
21:40:39 | leorize | do 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:57 | FromGitter | <sealmove> oh |
21:40:59 | FromGitter | <sealmove> hmm |
21:41:22 | leorize | it'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:57 | FromGitter | <sealmove> no idea, I get this error on travis, not my local pc |
21:42:20 | leorize | if you don't have a new gcc, use `-d:nimEmulateOverflowChecks` |
21:42:43 | Araq | config travis to use software released after 1990 |
21:43:36 | FromGitter | <sealmove> this is my config: https://pastebin.com/brb8jUgr |
21:44:19 | FromGitter | <sealmove> `compiler: gcc` is wrong? |
21:45:40 | leorize | the wrong part here is that you use travis |
21:45:50 | leorize | check if they finally have a newer ubuntu version |
21:47:12 | Araq | the wrong part here is also that GCC versions are tied to a Linux distribution... |
21:47:48 | FromDiscord | <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:23 | leorize | you can on travis actually |
21:48:24 | Araq | I think you can but then you need to call gcc-$version |
21:52:43 | leorize | Araq: I think we can just use a conditional to test gcc version |
21:53:00 | leorize | gcc 5 introduced these functions |
21:54:17 | leorize | clang has these since 3.5 |
21:54:25 | Araq | yeah but some builds of gcc 5 lack them |
21:54:34 | Araq | because some distros like patching gcc |
21:54:40 | leorize | then they can use the flag |
21:54:49 | Araq | fair enough |
21:55:25 | Araq | aligns well with my plans to remove nimbase.h from Nim |
21:58:17 | leorize | so 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:19 | Araq | I want you to patch the codegen to not generate #include "nimbase.h" |
22:06:38 | Araq | instead the codegen should emit the declarations it needs |
22:06:55 | Araq | fixes that niminst regression issue |
22:07:25 | dom96 | You're getting rid of nimbase.h? |
22:08:56 | FromDiscord | <__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:03 | leorize | it's about time we do so |
22:09:09 | Araq | dom96: yeah |
22:10:17 | dom96 | hm, won't that create lots of needless duplication? :) |
22:12:08 | FromGitter | <dawkot> Any idea what to look for when VSCode stopped highlighting warnings and errors in Nim code? |
22:12:19 | FromGitter | <dawkot> nimsuggest seems to work fine on commandline |
22:12:32 | FromGitter | <dawkot> and auto-completion is there in the editor |
22:12:45 | leorize | when it stopped doing that, you kill all nimsuggest instance and hope that it restarts :) |
22:13:05 | leorize | you will be amazed of how many problems that restarting nimsuggest solves |
22:13:30 | FromGitter | <dawkot> Unfortunely, I even tried reboot and it didn't work |
22:15:08 | dom96 | Best thing to look for is another VS Code extension, better yet, create a better one :) |
22:16:07 | FromGitter | <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:39 | FromGitter | <dawkot> And I literally didn't do anything in the meantime other than use the editor |
22:17:41 | Araq | dom96: yeah but I don't have a better idea |
22:17:43 | * | rockcavera joined #nim |
22:23:39 | FromGitter | <dawkot> Looks like importing asyncjs hides warning/errors, despite `nimble build` working... |
22:23:49 | FromGitter | <dawkot> So, yeah, it's the extension's fault |
22:37:52 | FromGitter | <dawkot> How do you make nimsuggest assume js is the backend? |
22:38:10 | FromGitter | <dawkot> I would like to fix this |
22:44:07 | FromGitter | <dawkot> I guess it's `-d:js` |
22:47:31 | leorize | that works, but not the best |
22:47:50 | leorize | there are VM changes in JS mode too, and -d:js won't emulate that |
22:48:01 | leorize | but it will give you suggestions, so it's good enough :P |
22:48:02 | * | Trustable quit (Remote host closed the connection) |
23:05:38 | FromDiscord | <KingDarBoja> Awr1, are you there? |
23:10:44 | FromGitter | <awr1> hello |
23:10:45 | FromGitter | <awr1> i am now |
23:10:49 | FromGitter | <awr1> was busy all day |
23:11:27 | FromDiscord | <KingDarBoja> ❤️ |
23:11:36 | FromDiscord | <KingDarBoja> https://github.com/nim-lang/Nim/issues/13922 |
23:11:42 | FromDiscord | <KingDarBoja> we got an answer |
23:13:17 | * | rockcavera quit (Remote host closed the connection) |
23:14:25 | FromDiscord | <__ibrahim__> tried running the stuff from this repo: https://github.com/rafaelvasco/nimrod-glfw |
23:14:25 | FromDiscord | <__ibrahim__> it works fine on mac. |
23:14:26 | FromDiscord | <__ibrahim__> windows gives this error: could not load: glfw3.dll |
23:14:26 | FromDiscord | <__ibrahim__> now trying on centos8 |
23:15:51 | shashlick | @zacharycarter was trying junkers on osx and it crashes even with 0.4.4 |
23:18:02 | zacharycarter | shashlick: with what flags? |
23:18:30 | shashlick | Toast flags? Nothing really |
23:18:50 | zacharycarter | how are you running it and are you getting any type of error on crash? |
23:19:31 | shashlick | Sigabrt |
23:20:06 | zacharycarter | weird - it's working fine for me with the verison that gets installed with `nimble install nimterop` |
23:20:21 | FromGitter | <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:33 | zacharycarter | if I use the head vesion I need to do the headers flag but then it works fine |
23:20:39 | FromGitter | <awr1> should i close the issue then |
23:20:46 | FromDiscord | <KingDarBoja> No |
23:21:01 | FromDiscord | <KingDarBoja> I am not okay at all with it |
23:21:10 | FromDiscord | <KingDarBoja> Just tried it and couldn't instantiate it lol |
23:21:18 | shashlick | I reverted to 0.4.4 cause it was failing even with -H |
23:21:20 | FromGitter | <awr1> okie |
23:21:27 | zacharycarter | weird... |
23:21:36 | zacharycarter | let me try checking it out and submodules and running ti |
23:22:29 | FromDiscord | <KingDarBoja> Unless I am doing something wrong |
23:22:53 | FromDiscord | <KingDarBoja> If I wanted to export the proc, I should put the * after the name |
23:23:05 | zacharycarter | git clone https://github.com/zacharycarter/junkers.git junkers_test |
23:23:21 | FromDiscord | <KingDarBoja> But now that it is instantiated, putting it in front of the name before or after the [] brackets yields error |
23:23:33 | zacharycarter | cd junkers_test && git submodule update --init -recursive |
23:23:39 | zacharycarter | nim c -r src/junkers.nim |
23:23:47 | zacharycarter | everything runs fine :/ |
23:24:01 | shashlick | https://ix.io/2hoB |
23:24:53 | zacharycarter | I'm using nim 1.2 |
23:24:57 | shashlick | Ok was on 1.0.6 |
23:25:44 | zacharycarter | also - I wonder what all those errors are from the linker |
23:25:52 | zacharycarter | ld: 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:11 | shashlick | I'm on 10.13 |
23:26:13 | zacharycarter | I have a feeling it's failing because of that maybe |
23:26:30 | FromDiscord | <KingDarBoja> https://imgur.com/uGEczkH awr1 |
23:26:45 | shashlick | Can't go any further since this machine is 8 years old |
23:26:47 | zacharycarter | https://stackoverflow.com/questions/51314888/ld-warning-text-based-stub-file-are-out-of-sync-falling-back-to-library-file |
23:26:56 | zacharycarter | I'm on 10.14.6 |
23:28:27 | shashlick | I don't have xcode either |
23:29:07 | zacharycarter | me either |
23:29:14 | shashlick | Same with 1.2.0 |
23:29:15 | zacharycarter | oh - you will probably need xcode command line tools |
23:31:30 | FromGitter | <awr1> your issue might be something else @KingDarBoja |
23:31:35 | FromGitter | <awr1> https://play.nim-lang.org/#ix=2hoI |
23:31:43 | shashlick | Ok I fixed those errors but still see the crash |
23:32:24 | shashlick | https://ix.io/2hoJ |
23:33:07 | FromGitter | <awr1> try `[T :Node; N :seq[T] or T]` |
23:33:53 | shashlick | @zacharycarter a windows shows up for 1/2 a second |
23:33:59 | shashlick | Then aborts |
23:35:10 | FromGitter | <awr1> https://play.nim-lang.org/#ix=2hoM @KingDarBoja |
23:35:27 | FromDiscord | <KingDarBoja> On it |
23:35:33 | zacharycarter | looks like it's the call to - `sapp_metal_get_device()` |
23:36:22 | * | endragor joined #nim |
23:37:36 | FromDiscord | <KingDarBoja> Definitively there is something wrong |
23:37:43 | zacharycarter | seems like the `MTLCreateSystemDefaultDevice()` call is faliing |
23:37:44 | FromDiscord | <KingDarBoja> Still same error 🤔 |
23:39:35 | FromGitter | <awr1> it works with a default parameter |
23:39:35 | FromGitter | <awr1> https://play.nim-lang.org/#ix=2hoN |
23:40:08 | FromGitter | <awr1> shave off the extra params and see if you can isolate the issue |
23:41:35 | FromDiscord | <KingDarBoja> I was doing the same on the playground lol |
23:41:36 | FromDiscord | <KingDarBoja> On it |
23:41:50 | FromGitter | <awr1> looking at the rest of your code, have you changed the body accordingly |
23:42:00 | FromGitter | <awr1> e.g. `nodesCopy` |
23:42:23 | FromDiscord | <KingDarBoja> Shaving off the default parameter make it work |
23:42:31 | FromDiscord | <KingDarBoja> made it* |
23:42:39 | FromDiscord | <KingDarBoja> But I didn't changed the body 🤔 |
23:44:59 | FromDiscord | <KingDarBoja> Changing the body, e.g. `nodesCopy` to be `seq[T]` doesn't seem to work |
23:48:55 | shashlick | @zacharycarter any ideas? Is it the same as what you originally reported |
23:50:03 | zacharycarter | no this is different |
23:50:35 | zacharycarter | I have a feeling it is something with your mac - for some reason the metal device isn't getting created |
23:51:51 | FromDiscord | <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 |