00:09:02 | * | ng0 quit (Remote host closed the connection) |
00:10:04 | * | ng0 joined #nim |
00:16:33 | * | rnrwashere joined #nim |
00:24:14 | * | Kls joined #nim |
00:26:13 | * | Kls quit (Client Quit) |
00:33:07 | * | leorize joined #nim |
00:33:39 | FromDiscord_ | <juan_carlos> Latest Docker image is 0.19.0 :( |
00:43:33 | * | stefanos82 quit (Remote host closed the connection) |
00:48:31 | * | zachk quit (Read error: Connection reset by peer) |
00:49:08 | * | zachk joined #nim |
00:51:53 | * | leorize quit (Ping timeout: 256 seconds) |
00:54:49 | * | leorize joined #nim |
01:02:35 | * | zachk quit (Quit: Leaving) |
01:05:35 | * | seni quit (Quit: Leaving) |
01:06:56 | * | rnrwashere quit (Remote host closed the connection) |
01:08:02 | shashlick | for some reason, using loadLib() spawns a thread |
01:11:05 | * | rnrwashere joined #nim |
01:21:25 | leorize | shashlick: it might be due to how the libc implements it? |
01:25:59 | * | Tyresc quit (Quit: WeeChat 2.4-dev) |
01:45:18 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
02:15:05 | * | sealmove quit (Quit: WeeChat 2.3) |
03:02:29 | * | banc quit (Quit: Bye) |
03:03:51 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:08:35 | * | Senketsu_ quit (Ping timeout: 259 seconds) |
03:10:32 | * | Senketsu_ joined #nim |
03:24:03 | * | banc joined #nim |
03:51:08 | * | rnrwashere quit (Remote host closed the connection) |
03:55:08 | * | rnrwashere joined #nim |
03:57:37 | * | nsf joined #nim |
04:01:24 | * | dddddd quit (Read error: Connection reset by peer) |
04:35:01 | * | noeontheend joined #nim |
04:38:42 | * | Ven`` joined #nim |
04:47:24 | * | Ven`` quit (Ping timeout: 250 seconds) |
05:17:48 | * | rnrwashere quit (Remote host closed the connection) |
05:18:23 | * | noeontheend quit (Ping timeout: 245 seconds) |
05:26:06 | ryukoposting | hold on, do i see someone in the chat named Senketsu_ |
05:28:50 | * | Cthalupa quit (Ping timeout: 244 seconds) |
05:31:26 | * | Cthalupa joined #nim |
05:35:13 | * | leorize quit (Ping timeout: 256 seconds) |
05:35:55 | * | vlad1777d joined #nim |
05:38:37 | * | rnrwashere joined #nim |
05:42:43 | * | rnrwashere quit (Ping timeout: 250 seconds) |
06:06:59 | * | leorize joined #nim |
06:07:59 | * | narimiran joined #nim |
07:01:11 | * | krux02 joined #nim |
07:32:59 | * | narimiran quit (Read error: Connection reset by peer) |
07:33:14 | * | narimiran joined #nim |
07:58:55 | * | aguspiza joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:03:06 | * | kobi7 joined #nim |
08:03:40 | kobi7 | Hi guys - a quick question: does Nim have a proc isUtf or isUnicode or even identifyEncoding for a string? |
08:04:54 | * | gmpreussner joined #nim |
08:04:57 | kobi7 | I am migrating data, and some is utf8 and some another encoding, will it be fine to convert blindly to utf8, or should I do it discriminately to just some? |
08:05:27 | kobi7 | performance is not really important since it's a one time tool |
08:06:08 | kobi7 | oh, I see the encodings module requires the source encoding. |
08:06:55 | kobi7 | Is there a library similar to mozilla's universal charset detector for Nim? |
08:07:40 | kobi7 | or perhaps encodings relies on a binding? I think I saw iconv mentioned, so perhaps just export more functions from that binding, with that functionality |
08:07:54 | kobi7 | Has anybody tackled this before? |
08:10:18 | leorize | I think not |
08:11:03 | kobi7 | I can port an old library called UDE from c# (itself, a port from another lang) |
08:11:13 | leorize | maybe you could wrap it? |
08:11:43 | kobi7 | for international users, this is a common thing to run into. I'm suprised nim doesn't have it, since main devs are german if i understand correctly |
08:12:03 | kobi7 | how is wrapping done? |
08:12:12 | leorize | most of the time they only have to deal with utf8 and/or utf16 |
08:12:34 | * | Jesin quit (Ping timeout: 257 seconds) |
08:13:55 | leorize | kobi7: you use c2nim or the newer nimterop |
08:14:57 | kobi7 | nimterop? do u have a link? |
08:15:06 | * | Jesin joined #nim |
08:15:10 | leorize | github.com/genotrance/nimterop |
08:15:47 | * | PMunch joined #nim |
08:17:09 | leorize | the best way would be to rewrite this in Nim :P https://github.com/mozilla/gecko-dev/tree/master/extensions/universalchardet/src/base |
08:17:16 | leorize | but that might be too far fetched |
08:20:38 | kobi7 | I lack in c++ knowledge |
08:21:12 | kobi7 | I'll see how nimterop works for me |
08:23:16 | kobi7 | so nimterop is supposed to be even better than c2nim - more support? |
08:23:18 | * | aguspiza quit (Ping timeout: 258 seconds) |
08:24:09 | leorize | yea |
08:24:17 | leorize | if you have any problem, just ask shashlick |
08:24:34 | kobi7 | I get a compile error with the nimble install |
08:24:46 | leorize | would you mind sharing the log? |
08:25:07 | narimiran | kobi7: what nim version are you on? |
08:25:52 | kobi7 | 0.19.9 |
08:26:21 | narimiran | then it is not that :) |
08:26:41 | kobi7 | I think it comes from nimble |
08:26:57 | leorize | you should also use bleeding edge nimble |
08:27:03 | kobi7 | Error: Could not read package info file in /home/kobi7/apps/nimterop/nimterop.nimble; |
08:27:03 | kobi7 | ... Reading as ini file failed with: |
08:27:03 | kobi7 | ... Invalid section: . |
08:27:15 | leorize | please don't paste here |
08:27:19 | leorize | use a pastebin instead |
08:27:25 | kobi7 | ok |
08:27:28 | kobi7 | sorry |
08:27:35 | leorize | also, try the --verbose flag |
08:29:40 | kobi7 | it's just the nimble package had some code after the cfg configuration part |
08:29:53 | kobi7 | it worked when commented out. |
08:30:11 | leorize | that code is needed to bootstrap nimterop... |
08:30:20 | leorize | try this walkaround: |
08:30:28 | leorize | clone nimterop git repo locally |
08:30:34 | leorize | run nimble install there |
08:31:24 | leorize | oh, and you'd need ~/.nimble/bin in PATH for nimterop to install properly |
08:31:42 | kobi7 | I get ...mypath.../Nim/lib/pure/bitops.nim(52, 39) Error: cannot evaluate 'sizeof' because its type is not defined completely. |
08:31:57 | leorize | what version is your nimble? |
08:32:16 | kobi7 | v0.9.0 |
08:32:45 | kobi7 | oh i see. there's a mismatch? |
08:32:59 | leorize | no, try to reinstall nimble perhaps? |
08:33:10 | leorize | your nimble might be using an older compiler version as the backend |
08:33:18 | kobi7 | yes, yes, good find. |
08:33:41 | leorize | see when was your nimble last built vs nim |
08:33:41 | kobi7 | I am using nim from git, but nimble from another directory. let me see if it works after I fix that. |
08:33:58 | leorize | oh, just use ./koch nimble :P |
08:35:32 | kobi7 | awesome it worked! thanks a lot |
08:35:54 | kobi7 | now: how to use nimterop |
08:36:53 | kobi7 | what I did: changed the order in ~/.bashrc so that the .nimble/bin dir is before the nim git dir |
08:49:57 | * | narimiran_ joined #nim |
08:53:06 | * | narimiran quit (Ping timeout: 250 seconds) |
08:53:32 | * | PMunch quit (Remote host closed the connection) |
08:58:31 | * | kobi7 quit (Quit: Leaving) |
09:06:36 | * | floppydh joined #nim |
09:09:59 | * | leorize quit (Ping timeout: 256 seconds) |
09:11:49 | * | narimiran_ is now known as narimiran |
09:13:32 | * | leorize joined #nim |
09:18:38 | * | sealmove joined #nim |
09:25:21 | * | kapil____ joined #nim |
09:43:25 | * | PMunch joined #nim |
09:49:05 | * | lritter joined #nim |
09:53:26 | * | Vladar joined #nim |
09:55:26 | * | neceve joined #nim |
09:58:16 | * | Senketsu_ quit (Quit: WeeChat 2.3) |
09:59:30 | * | Senketsu joined #nim |
10:01:59 | * | sealmove quit (Quit: WeeChat 2.3) |
10:02:00 | * | lritter quit (Read error: Connection reset by peer) |
10:04:01 | * | dom96_w joined #nim |
10:11:56 | * | Arrrrrrrrr joined #nim |
10:23:22 | FromGitter | <alehander42> what do people use instead of multiple inheritance in nim usually |
10:25:48 | Arrrrrrrrr | type MyObj = tuple[a: Obj1, b: Obj2] |
10:27:50 | Zevv | Is Arrrrrrrrr Araq when he's mad? |
10:28:44 | Arrrrrrrrr | He is always mad |
10:32:52 | * | PMunch_ joined #nim |
10:32:58 | FromGitter | <alehander42> composition |
10:36:19 | * | leorize quit (Remote host closed the connection) |
10:36:42 | * | PMunch quit (Ping timeout: 258 seconds) |
10:36:49 | Araq | lol |
10:37:13 | * | solitudesf quit (Quit: ZNC - https://znc.in) |
10:38:11 | * | solitudesf joined #nim |
10:39:46 | FromGitter | <mratsim> monads :P |
10:40:11 | Zevv | you want to get banned? because that is how you get banned! |
10:54:21 | Arrrrrrrrr | I tested the incremental compilation once, and it was very slow. And lately it seems that compiling is slower in general. |
11:00:26 | Araq | sure you used -d:release to build your compiler? |
11:02:45 | Zevv | haha, just imagine, building a debugging compiler and then wonder for a few days why stuff is so slow. that would *never* happen to me |
11:03:46 | livcd | I am really curious if he did or did not lol |
11:06:53 | * | vlad1777d quit (Remote host closed the connection) |
11:09:05 | * | vlad1777d joined #nim |
11:09:28 | narimiran | Zevv: yeah, imagine those fools!! that *also* *never* happened to me! |
11:10:17 | Arrrrrrrrr | Now I can't remember, but I always define release, so I guess that time wasn't any different. |
11:11:00 | Arrrrrrrrr | I gave for granted it wasn't optimized yet |
11:11:54 | Arrrrrrrrr | But computer is very old, but I'm talking relative to how fast it was before I mean. |
11:11:59 | Arrrrrrrrr | *My |
11:12:25 | livcd | ryukoposting: what is that editor you are using in your nimcast ? |
11:13:04 | Araq | the stdlib also keeps growing and so what used to be 1000 lines is now 2000 lines, yay |
11:14:16 | Arrrrrrrrr | Yes, that too. The incremental compilation tho. |
11:14:27 | Arrrrrrrrr | Yes, that too. The incremental compilation tho. |
11:17:35 | narimiran | livcd: he's using Kate (and that's the most frequent question asked about his video :D) |
11:24:03 | * | stefanos82 joined #nim |
11:36:55 | * | ng0 joined #nim |
11:41:37 | * | PMunch__ joined #nim |
11:44:33 | * | PMunch_ quit (Ping timeout: 258 seconds) |
11:45:29 | * | Vladar quit (Remote host closed the connection) |
11:45:56 | * | Vladar joined #nim |
11:49:11 | * | syniseth joined #nim |
11:49:16 | * | PMunch__ is now known as PMunch |
11:49:22 | syniseth | Hello nimble navigators. |
11:52:26 | * | vlad1777d quit (Remote host closed the connection) |
11:52:34 | FromGitter | <mratsim> Hello |
11:54:28 | * | vlad1777d joined #nim |
12:02:17 | * | nsf quit (Quit: WeeChat 2.3) |
12:03:32 | * | vlad1777d quit (Remote host closed the connection) |
12:04:22 | * | vlad1777d joined #nim |
12:10:05 | * | vlad1777d quit (Remote host closed the connection) |
12:10:16 | * | abm joined #nim |
12:10:54 | * | vlad1777d joined #nim |
12:13:52 | FromGitter | <mratsim> @Araq Is there a way to generate multiple C files from a Nim AST and pass different cflags to each? using maybe compiler/cgen and compiler/extccomp? ⏎ For example from an AST of `+`(x, y) I want to generate add(x, y), add_sse(x, y), add_avx(x, y), add_avx512(x, y). |
12:18:00 | Araq | does it have to be in different C files? cause that's kinda tough |
12:21:24 | Zevv | Could you generate 1 file and enable one block at a go with CPP? |
12:22:34 | Araq | you can .emit #ifdef and compile the file multiple times, maybe, probably not though |
12:23:51 | Araq | I keep thinking about adding NimScript support to the codegen but so far it's just a vague idea |
12:23:56 | FromGitter | <mratsim> it has to be, for example there is a new SSE encoding called VEX coding that is incompatible with old CPU, if you pass a new instruction flag like AVX the whole file will use VEX coding. |
12:25:18 | FromGitter | <mratsim> alternatively I cna restrict compilers to GCC/Clang and use their "function multi versioning" which requires using __attribute(targer='avx') void myfunction(float\* a, float\* b){...} |
12:25:21 | Calinou | Arrrrrrrrr: perhaps you can gain back some performance by building the compiler with LTO enabled (--passc:-flto), this also results in smaller binaries |
12:25:30 | Calinou | although I'm not sure how beneficial it is with the Nim compiler (I haven't benchmarked it) |
12:25:47 | Calinou | if you use MSVC you'll have to find the equivalent flag, -flto is for GCC |
12:26:22 | FromGitter | <mratsim> but last time I tried to use __attribute features on proc it overrided stuff like NIMCALL |
12:27:55 | FromGitter | <mratsim> I'll open an example in the tracker |
12:32:39 | syniseth | why does nim -> js compiled file so long |
12:32:52 | * | dddddd joined #nim |
12:33:09 | syniseth | all I did was echo "hello world" and the js outputfile has 77 lines |
12:34:44 | * | sknebel quit (Remote host closed the connection) |
12:35:58 | * | sknebel joined #nim |
12:36:20 | shashlick | kobi7: did nimterop work for you? |
12:38:44 | FromGitter | <mratsim> @syniseth, because the JS generator is not an optimizing compiler, it translates Nim internal representation to JS. You can pass the output to Google Closure COmpiler |
12:40:28 | * | syniseth quit (Ping timeout: 245 seconds) |
12:48:56 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:49:35 | FromGitter | <mratsim> @Araq, this is the simpler alternative blocker to multiple C file per Nim Node: https://github.com/nim-lang/Nim/issues/10682. Not ideal because it's only supported by GCC and CLang compatible compilers though. |
12:52:54 | FromDiscord_ | <PusiteGA> just tryed python for first time in my life, tryed that flask thingy, cant figure out why bit i thinked Nim was more fluid for me |
12:56:34 | xace_ | livcd: my best guess just based on the video is that he is using KDE's kate as a editor |
13:00:19 | FromGitter | <alehander42> the nim compiler should compile to javascript quickly |
13:01:00 | Araq | he complained about the 77 lines output, not about the compilation speed, I think |
13:04:44 | FromGitter | <alehander42> well they mostly define boilerplate and helpers i guess |
13:05:06 | Araq | it's Nim's error handling |
13:05:22 | Araq | and it's only 77 lines, nothing to worry about |
13:06:50 | FromGitter | <alehander42> yes |
13:07:39 | * | enow joined #nim |
13:07:41 | enow | Hi guys |
13:18:02 | PMunch | Hi |
13:24:36 | livcd | i need to update the compiler i tried the hello world and got this: Error: 'getCurrentException' is not GC-safe as it accesses 'lastJSError' which is a global using GC'ed memory |
13:26:08 | * | dom96_w joined #nim |
13:46:10 | Arrrrrrrrr | Thank you Calinou i'll check it out eventually |
13:49:36 | * | Cthalupa quit (Ping timeout: 246 seconds) |
13:51:11 | * | Cthalupa joined #nim |
13:55:16 | * | floppydh quit (Quit: WeeChat 2.3) |
13:57:42 | * | lritter joined #nim |
14:02:27 | * | PMunch quit (Remote host closed the connection) |
14:06:12 | * | aguspiza joined #nim |
14:09:01 | * | Snircle joined #nim |
14:36:51 | * | aguspiza quit (Ping timeout: 246 seconds) |
14:38:54 | * | leorize joined #nim |
14:49:38 | * | Cthalupa quit (Ping timeout: 245 seconds) |
14:50:17 | * | Cthalupa joined #nim |
15:03:07 | enow | How well do asynchronous code and threads mix |
15:03:55 | enow | If I wait for a channel in the asynchronous code (with a different thread on the other end) will it block |
15:05:10 | FromGitter | <mratsim> there is an example here: https://github.com/dom96/nim-in-action-code/tree/master/Chapter3/ChatApp/src |
15:05:35 | FromGitter | <mratsim> iirc the main issue is that both uses the spawn name :P |
15:06:11 | FromGitter | <mratsim> to be precise it's the client that uses both threadpool and async: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim |
15:08:17 | shashlick | leorize: actually, I've seen crashes in threads.nim so I don't think it is libc threads per se that is causing this. looking at loadLib() though, I don't see any threading going on there |
15:08:28 | shashlick | for now, putting a sleep after loadLib seems to make my crashes go away |
15:08:34 | shashlick | just bizarre stuff |
15:08:55 | shashlick | of course, I have another issue where unloading a lib doesn't really recover the memory associated with loading it |
15:10:09 | shashlick | private bytes keep going up indefinitely if i keep unloading and reloading |
15:10:56 | shashlick | not a realistic test case but I keep my text editor open all the time, it should release RAM it is done with |
15:13:16 | enow | oh thanks |
15:49:40 | Zevv | shashlick: what memory would you expect to free up after unloadinga lib? (assuming you are doing dlclose?) |
15:50:58 | * | rnrwashere joined #nim |
15:51:08 | * | Vladar quit (Remote host closed the connection) |
15:51:16 | shashlick | well, every time I load, ram goes up by 12mb and never comes back down |
15:51:28 | shashlick | so you do it 10 times and you now have 120mb |
15:51:33 | Zevv | running linux? |
15:51:36 | shashlick | Windows |
15:51:41 | Zevv | oh, sorry :( |
15:51:47 | * | Vladar joined #nim |
15:51:57 | Zevv | I was about to totally help you out here |
15:52:04 | shashlick | 😄 |
15:52:09 | Zevv | but on second thoughts I resign |
15:54:12 | * | solitudesf quit (Quit: ZNC - https://znc.in) |
15:55:04 | * | solitudesf joined #nim |
16:13:05 | * | drazan quit (Remote host closed the connection) |
16:14:25 | * | drazan joined #nim |
16:15:20 | * | Trustable joined #nim |
16:23:43 | * | abm quit (Ping timeout: 246 seconds) |
16:41:14 | * | zahary joined #nim |
16:41:36 | * | ptdel joined #nim |
17:06:01 | * | ryukothinkpad joined #nim |
17:11:55 | * | rnrwashere quit () |
17:20:26 | * | ryukothinkpad quit (Quit: leaving) |
17:31:26 | * | neceve quit (Remote host closed the connection) |
17:34:03 | * | abm joined #nim |
17:35:09 | * | ptdel quit (Remote host closed the connection) |
17:42:21 | * | rnrwashere joined #nim |
17:53:16 | * | natrys joined #nim |
17:56:46 | * | Cthalupa quit (Ping timeout: 258 seconds) |
17:58:10 | * | Cthalupa joined #nim |
18:01:41 | * | tefter joined #nim |
18:03:02 | shashlick | phew, finally got to a point where I can push my changes |
18:04:31 | * | Cthalupa quit (Ping timeout: 246 seconds) |
18:06:10 | * | Cthalupa joined #nim |
18:08:59 | * | syniseth joined #nim |
18:09:20 | * | syniseth quit (Client Quit) |
18:12:17 | * | rnrwashere quit (Remote host closed the connection) |
18:14:01 | * | Jesin quit (Quit: Leaving) |
18:18:30 | * | Arrrrrrrrr quit (Quit: Page closed) |
18:27:30 | * | Cthalupa quit (Ping timeout: 246 seconds) |
18:28:43 | * | Cthalupa joined #nim |
18:38:44 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:41:53 | * | MatrixBridge joined #nim |
18:41:55 | * | MatrixBridge left #nim ("User left") |
18:42:22 | * | MatrixBridge joined #nim |
18:42:24 | * | MatrixBridge left #nim ("User left") |
18:43:01 | * | MatrixBridge joined #nim |
18:43:03 | * | MatrixBridge left #nim ("User left") |
18:43:23 | * | fanta7531 joined #nim |
18:45:10 | FromGitter | <Varriount> Shashlick: Hm. I seen to recall that some Windows APIs will spawn background threads for things like Window messages and such. |
18:45:31 | FromGitter | <Varriount> Are you able to get a stack trace of the extra thread? |
18:49:47 | * | MatrixBridge joined #nim |
18:49:50 | * | MatrixBridge left #nim ("User left") |
18:50:13 | * | MatrixBridge joined #nim |
18:50:16 | * | MatrixBridge left #nim ("User left") |
18:56:50 | * | federico3[m] joined #nim |
18:59:26 | * | MatrixBridge joined #nim |
18:59:29 | * | MatrixBridge left #nim ("User left") |
18:59:34 | * | MatrixBridge joined #nim |
18:59:37 | * | MatrixBridge left #nim ("User left") |
18:59:41 | * | MatrixBridge joined #nim |
18:59:43 | * | MatrixBridge left #nim ("User left") |
19:02:32 | * | lritter quit (Ping timeout: 272 seconds) |
19:05:45 | shashlick | yes, points to line 472 in threads.nim |
19:06:07 | shashlick | but nothing above that so I don't know how it even gets there |
19:07:28 | * | Jesin joined #nim |
19:16:04 | * | rnrwashere joined #nim |
19:18:13 | * | rnrwashere quit (Remote host closed the connection) |
19:24:24 | * | rnrwashere joined #nim |
19:27:29 | * | rnrwashere quit (Remote host closed the connection) |
19:34:18 | * | ptdel joined #nim |
19:34:25 | * | a_chou joined #nim |
19:34:25 | * | a_chou quit (Client Quit) |
19:34:50 | * | a_chou joined #nim |
19:35:56 | * | a_chou quit (Client Quit) |
19:36:15 | * | a_chou joined #nim |
19:36:28 | * | a_chou quit (Client Quit) |
19:36:45 | * | NimBot joined #nim |
19:37:03 | * | a_chou joined #nim |
19:37:42 | * | a_chou quit (Client Quit) |
19:38:10 | * | a_chou joined #nim |
19:38:19 | * | a_chou quit (Client Quit) |
19:38:45 | * | a_chou joined #nim |
19:39:21 | * | a_chou quit (Client Quit) |
19:54:06 | * | ryukoposting quit (Quit: WeeChat 1.6) |
19:57:01 | * | ryukoposting joined #nim |
20:02:15 | * | tefter quit (Remote host closed the connection) |
20:03:15 | ryukoposting | https://github.com/dom96/jester/issues/185 friend of mine is having issues building docs for jester, just making sure that this bug report has been seen |
20:04:24 | * | rnrwashe_ joined #nim |
20:04:31 | * | nsf joined #nim |
20:08:55 | * | ptdel quit (Remote host closed the connection) |
20:09:52 | ryukoposting | anyone :( |
20:12:28 | * | abm quit (Ping timeout: 258 seconds) |
20:13:48 | * | cyraxjoe quit (Ping timeout: 245 seconds) |
20:15:05 | Araq | ryukoposting: I know about it and a fix is not far away |
20:17:20 | ryukoposting | thanks Araq! |
20:18:42 | ryukoposting | another thing, while you're here- I've been working on making some screencasts about nim. Do you have anything you think would be worth including? Target audience is software professionals who haven't necessarily seen nim before |
20:22:18 | * | cyraxjoe joined #nim |
20:24:02 | * | narimiran_ joined #nim |
20:25:53 | * | narimiran quit (Ping timeout: 258 seconds) |
20:26:48 | * | cyraxjoe quit (Ping timeout: 244 seconds) |
20:30:48 | * | rnrwashe_ quit (Remote host closed the connection) |
20:31:39 | * | rnrwashere joined #nim |
20:33:37 | * | cyraxjoe joined #nim |
20:35:24 | * | rnrwashere quit (Remote host closed the connection) |
20:46:36 | * | ptdel joined #nim |
20:52:17 | * | narimiran_ is now known as narimiran |
20:58:09 | * | kapil____ quit (Quit: Connection closed for inactivity) |
21:02:02 | FromGitter | <brentp> is there much cost to `defer` in nim? |
21:05:40 | * | Trustable quit (Remote host closed the connection) |
21:09:46 | * | aguspiza joined #nim |
21:11:52 | FromGitter | <brentp> some: https://gist.github.com/brentp/dabc239aad992ccc9bc12ccb20451951 |
21:13:45 | * | Vladar quit (Remote host closed the connection) |
21:14:26 | * | nsf quit (Quit: WeeChat 2.3) |
21:27:51 | * | zachk joined #nim |
21:30:54 | Araq | ryukoposting: what's your area of expertise? |
21:31:55 | Araq | brentp: use 'nim cpp' and the overhead should be gone |
21:33:30 | FromGitter | <brentp> @Araq. indeed. 25X faster compared to `nim c` |
21:34:13 | Araq | :-) |
21:43:08 | shashlick | Wow should we start using Nim cpp by default already? |
21:43:54 | Araq | it doesn't hurt, test suite is green with it too |
21:51:34 | shashlick | Araq: how do you typically debug runtime crashes in nim programs that don't print a stack trace or have anything useful in a gdb back trace |
21:52:57 | * | Kfc_ joined #nim |
21:53:11 | * | dorelix joined #nim |
21:53:27 | * | Kfc_ quit (Client Quit) |
21:56:53 | Araq | oh interesting, I usually use 'echo' for debugging |
21:57:18 | FromGitter | <GULPF> @Araq: why the disapproving emoji for https://github.com/nim-lang/Nim/issues/10679#issuecomment-463993280? I think it's a good idea |
21:57:33 | Araq | but if even gdb fails then you may have a stack corruption |
21:58:45 | Araq | GULPF: just give me the milliseconds of a Duration, I don't want to be bothered with 'convert' |
21:59:31 | Araq | and since the accessors are already taken, we could have the names 'inX', dur.inMilliseconds |
21:59:36 | Araq | dur.inHours |
21:59:40 | Araq | etc. |
22:02:36 | FromGitter | <GULPF> convert(dur, Milliseconds) isn't that awful. I wish there wasn't so many symbols in the times module, it makes the docs unusable |
22:03:06 | FromGitter | <kayabaNerve> My project has C++ libs so I just use C++ on the entire project :thinking: |
22:03:32 | FromGitter | <kayabaNerve> It's been great |
22:07:34 | * | kapil____ joined #nim |
22:12:03 | Araq | GULPF: Well it started out as a tiny wrapper around Ansi C's time.h |
22:12:20 | Araq | now it's big and it's all your fault ;-) |
22:18:21 | FromGitter | <kayabaNerve> Since Linux finally solved the 2032 time problem, is Nim next? |
22:18:32 | FromGitter | <kayabaNerve> *2038 |
22:20:11 | FromGitter | <kayabaNerve> Just while we're discussing the time lib |
22:20:33 | FromGitter | <kayabaNerve> I'd love to see it solved before 1.0 tbh |
22:21:01 | Araq | there is nothing to solve, the data types are abstract enough |
22:21:07 | Araq | we can widen them anytime |
22:22:32 | FromGitter | <kayabaNerve> So will Nim widen them before 1.0? |
22:24:02 | Araq | I doubt it needs to, ask GULPF |
22:41:46 | ryukoposting | hey, sorry Araq, had to take off for a bit |
22:44:49 | ryukoposting | my areas of expertise are primarily embedded systems, ARM, and C programming, as that's the stuff I do professionally, but I dabble in web backend, and more general systems software development |
22:46:17 | ryukoposting | specifically wr/t nim, I've goofed around with a whole bunch of different stuff in the language. I wouldn't call myself a master of the language, but I know my way around most stuff |
22:46:38 | Araq | ok, then show how to use Nim instead of C for everything, esp, & is addr and stuff like that |
22:47:11 | ryukoposting | First video was just a basic intro to iterators. Gonna record one tonight that will be a look at using iterators as infinite data structures |
22:48:05 | Araq | I would do this: |
22:48:11 | ryukoposting | my goal is to show nim from a lot of different angles. I have a later video planned where I will implement Protothread using iterators and macros, since Protothread is suuuuper important in embedded |
22:48:38 | Araq | - explain how you can write Nim as you can write C. |
22:48:56 | Araq | - explain how parameter passing uses pointers under the hood so that you don't have to. |
22:49:29 | Araq | - explain that 'var T' is used for mutability control and parameter passing semantics are not burdened with speed considerations because of this |
22:49:50 | ryukoposting | also, if you'd like to watch the first one, it's here http://ryuk.ooo/res/videos/cut0.mp4 |
22:49:53 | * | Tyresc joined #nim |
22:50:12 | Araq | and with 'sink T' we actually got parameter passing 100% right. And no other language did, ymmv |
22:50:34 | ryukoposting | I'll admit I have not looked at sink yet |
22:50:44 | Araq | it's becoming my favorite part of Nim, all the newer stuff can built on top of this solid foundation |
22:52:54 | ryukoposting | you had an article about that, right? I recall reading something from you about sink |
22:52:58 | Araq | iterators are pretty slow so they might be disappointing for a protothread implementation |
22:53:28 | ryukoposting | I see, that's unfortunate |
22:53:55 | * | thomasross joined #nim |
22:54:21 | ryukoposting | they still have some massive advantages, though. In protothread, you basically sacrifice the stack to be just a call stack since every time you yield, everything else gets clobbered |
22:55:06 | Araq | interesting, I had the same idea once |
22:55:08 | * | abm joined #nim |
22:55:29 | ryukoposting | so with closure iterators, you don't have to make everything into a massive blob of global variables |
22:55:46 | ryukoposting | or local statics, i guess, but you get the idea |
22:55:57 | Araq | sure, they transform the stack frame into a frame on the heap |
22:57:33 | ryukoposting | aaaah interesting. The way I preserve protothread state in C is really hideous, it's either a bunch of local statics that make everything non-reentrant, or I hand-write an unholy number of structs that get read/written on function entrance/yield/exit |
22:58:49 | ryukoposting | ultimately the latter method is "better" in the sense that it doesn't fling around global state willy-nilly, but it's still just a tangled mess of boilerplate |
23:00:06 | Araq | well Nim does that under the hood I guess |
23:00:29 | ryukoposting | that was my guess, looking at how closure iterators appear to work |
23:01:18 | ryukoposting | A couple of these videos will have kind of a dual purpose |
23:02:08 | ryukoposting | they'll be educational, of course, but I also want to do some things with Nim that will turn some heads at my (german!) employer |
23:04:50 | Araq | yay |
23:04:56 | Araq | does that mean you speak German? |
23:05:04 | ryukoposting | sadly, no |
23:05:35 | ryukoposting | They have German lessons, though, and I plan on taking them when the new round starts up this summer |
23:07:10 | Araq | ah ok |
23:09:40 | ryukoposting | Obviously I can't make any promises, but I'm gonna push Nim at work and see what happens, I think it has a good chance to make a huge impact there |
23:10:44 | * | natrys quit (Quit: natrys) |
23:11:48 | Araq | mention that we're getting better for embedded since that's our focus these days |
23:12:13 | FromDiscord_ | <exelotl> that's good to hear :D |
23:12:25 | ryukoposting | how has that been going? I'm really hoping to see more stuff about using nim without the GC |
23:14:52 | Araq | well I know about roughly 3 different ways how to make a Nim without GC and keeping the memory safety |
23:15:19 | Araq | and now I know too much |
23:15:30 | Araq | and can't decide |
23:16:04 | ryukoposting | I know dom has a simple Nim kernel example, I haven't looked at that closely but my guess is that it wouldn't be using the GC |
23:16:54 | Araq | sure, you write 'ptr' instead of 'ref', array[40, char] instead of 'string' and ptr UncheckedArray[T] instead of seq[T] and there you go |
23:17:17 | FromDiscord_ | <exelotl> I've been just about getting Nim to do what I want on the GBA but things like the --gc:none situation worry me because random shit doesn't work and none of the other options are light enough. So yeah I'm excited to see things get better here |
23:18:21 | Araq | ryukoposting: but then you lose .closure iterators without a good replacement unless you use the undocumented .liftLocals transformation |
23:18:51 | ryukoposting | It would be immensely helpful if the stdlib documentation showed what things use GC and what things don't require it, though I'm sure that's easier said than done |
23:19:02 | Araq | exelotl: you need to be more precise, --gc:none is bad indeed, but what's in system that sucks |
23:19:09 | FromGitter | <iffy> Can I have a proc return either one enum or another? I'm trying `proc myproc(): (VmState|VmUnstableState) =` where `VmState` and `VmUnstableState` are enums |
23:19:23 | Araq | that's easy, the stdlib uses the GC everywhere |
23:19:36 | Araq | everywhere. |
23:19:43 | Araq | for everything :D |
23:19:53 | ryukoposting | Araq so does getting rid of the GC kill off all closure iterators then? oof |
23:20:18 | Araq | I'm working day and night for a solution, ryukoposting |
23:20:36 | Araq | and I have one that works without having to rewrite the stdlib |
23:21:09 | ryukoposting | I imagine that is a huge task |
23:22:50 | Araq | it's easier than you think :-) |
23:23:55 | ryukoposting | In my head, it's as simple as "codegen spits out a struct that preserves the state of closure iterators between calls" but I'm sure it goes a lot deeper than that |
23:23:58 | Araq | iffy: it's not really possible, but you can do this proc myproc(T: typedesc[VmState|VmUnstableState]): T |
23:24:38 | FromGitter | <iffy> hmmm... k, I'll take a look |
23:24:39 | ryukoposting | as for the stdlib, I wouldn't be able to say since I don't know too much about what most of it is really doing behind the scenes |
23:25:13 | Araq | imagine programmers using Nim like they Python and you have a pretty accurate picture of the stdlib |
23:25:22 | Araq | *like they use |
23:25:50 | ryukoposting | lol |
23:26:31 | ryukoposting | I've come across a decent number of python devs who like nim because "it's like python but compiled and with types!" |
23:26:41 | Araq | it's also a social problem as much as it is a technical problem. |
23:27:07 | Araq | we don't teach Nim's lower level constructs well |
23:27:46 | ryukoposting | It's interesting, I'd really love to see greater support for the JS toolchain as well (e.g. somehow making the JS toolchain work wth asynchttpclient), yet moving things towards embedded mgiht contradict that |
23:28:23 | * | aguspiza quit (Ping timeout: 245 seconds) |
23:28:25 | ryukoposting | one of the goals of my videos is to show that Nim is more than just "python with types" |
23:29:39 | ryukoposting | ironically, one of my planned demonstrations of templates is implementing python's := |
23:30:42 | ryukoposting | (side note: who is in carge of maintaining the Nim dockerhub image? looks like it hasn't been touched in a long time and I'd like to use it) |
23:31:25 | * | narimiran quit (Ping timeout: 258 seconds) |
23:34:35 | FromDiscord_ | <exelotl> Araq: the biggest problem with gc:none is that the unicode module and various code that uses string slices fails to compile, which renders much of the standard library unusable even at compile time. |
23:34:41 | FromDiscord_ | <exelotl> But I understand that you've previously said it's poorly designed and needs to go, so what I'm hopeful for is that whatever comes next (destructors) is just as light and viable for embedded. |
23:35:09 | Araq | ryukoposting: ldlework maybe? |
23:35:52 | Araq | exelotl: the point is, why can't you use --gc:refc instead? |
23:36:14 | Araq | (the default setting) |
23:36:25 | ryukoposting | I'm certainly no docker expert, but I know people who know that stuff |
23:37:26 | ryukoposting | I just like to use GitLab CI for my projects, and right now I'm just wget'ing and building the compiler every time I push to a remote branch |
23:39:05 | * | rnrwashere joined #nim |
23:39:51 | FromDiscord_ | <exelotl> because every other gc option produces a lot of junk e.g. arrays of NimNodes in the generated C code, even for a totally empty program, while my target platform only has 32kb RAM |
23:49:12 | Araq | exelotl: I removed some of this junk |
23:49:24 | Araq | and we can remove more |
23:49:47 | Araq | but if you have 32kb RAM why would you use unicode? |
23:49:56 | Araq | the unicode tables are huge too |
23:54:55 | FromDiscord_ | <exelotl> I'm not intending to use any of it at runtime, I was hoping to e.g. use the JSON module to parse map and animation data at compile time and turn it into simple structures/arrays that the game can use. |
23:56:41 | FromDiscord_ | <exelotl> but I've ended up having to write a whole separate program that reads the JSONs and produces C code, and then in the game itself I import variables from that C code into Nim |
23:56:57 | Araq | ok, so the unicode tables are optimized away but the RTTI isn't? |