<< 15-02-2019 >>

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:39FromDiscord_<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:02shashlickfor some reason, using loadLib() spawns a thread
01:11:05*rnrwashere joined #nim
01:21:25leorizeshashlick: 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:06ryukoposting 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:40kobi7Hi 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:57kobi7I 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:27kobi7performance is not really important since it's a one time tool
08:06:08kobi7oh, I see the encodings module requires the source encoding.
08:06:55kobi7Is there a library similar to mozilla's universal charset detector for Nim?
08:07:40kobi7or 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:54kobi7Has anybody tackled this before?
08:10:18leorizeI think not
08:11:03kobi7I can port an old library called UDE from c# (itself, a port from another lang)
08:11:13leorizemaybe you could wrap it?
08:11:43kobi7for 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:03kobi7how is wrapping done?
08:12:12leorizemost of the time they only have to deal with utf8 and/or utf16
08:12:34*Jesin quit (Ping timeout: 257 seconds)
08:13:55leorizekobi7: you use c2nim or the newer nimterop
08:14:57kobi7nimterop? do u have a link?
08:15:06*Jesin joined #nim
08:15:10leorizegithub.com/genotrance/nimterop
08:15:47*PMunch joined #nim
08:17:09leorizethe best way would be to rewrite this in Nim :P https://github.com/mozilla/gecko-dev/tree/master/extensions/universalchardet/src/base
08:17:16leorizebut that might be too far fetched
08:20:38kobi7I lack in c++ knowledge
08:21:12kobi7I'll see how nimterop works for me
08:23:16kobi7so nimterop is supposed to be even better than c2nim - more support?
08:23:18*aguspiza quit (Ping timeout: 258 seconds)
08:24:09leorizeyea
08:24:17leorizeif you have any problem, just ask shashlick
08:24:34kobi7I get a compile error with the nimble install
08:24:46leorizewould you mind sharing the log?
08:25:07narimirankobi7: what nim version are you on?
08:25:52kobi70.19.9
08:26:21narimiranthen it is not that :)
08:26:41kobi7I think it comes from nimble
08:26:57leorizeyou should also use bleeding edge nimble
08:27:03kobi7 Error: Could not read package info file in /home/kobi7/apps/nimterop/nimterop.nimble;
08:27:03kobi7 ... Reading as ini file failed with:
08:27:03kobi7 ... Invalid section: .
08:27:15leorizeplease don't paste here
08:27:19leorizeuse a pastebin instead
08:27:25kobi7ok
08:27:28kobi7sorry
08:27:35leorizealso, try the --verbose flag
08:29:40kobi7it's just the nimble package had some code after the cfg configuration part
08:29:53kobi7it worked when commented out.
08:30:11leorizethat code is needed to bootstrap nimterop...
08:30:20leorizetry this walkaround:
08:30:28leorizeclone nimterop git repo locally
08:30:34leorizerun nimble install there
08:31:24leorizeoh, and you'd need ~/.nimble/bin in PATH for nimterop to install properly
08:31:42kobi7I get ...mypath.../Nim/lib/pure/bitops.nim(52, 39) Error: cannot evaluate 'sizeof' because its type is not defined completely.
08:31:57leorizewhat version is your nimble?
08:32:16kobi7v0.9.0
08:32:45kobi7oh i see. there's a mismatch?
08:32:59leorizeno, try to reinstall nimble perhaps?
08:33:10leorizeyour nimble might be using an older compiler version as the backend
08:33:18kobi7yes, yes, good find.
08:33:41leorizesee when was your nimble last built vs nim
08:33:41kobi7I am using nim from git, but nimble from another directory. let me see if it works after I fix that.
08:33:58leorizeoh, just use ./koch nimble :P
08:35:32kobi7awesome it worked! thanks a lot
08:35:54kobi7now: how to use nimterop
08:36:53kobi7what 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:22FromGitter<alehander42> what do people use instead of multiple inheritance in nim usually
10:25:48Arrrrrrrrrtype MyObj = tuple[a: Obj1, b: Obj2]
10:27:50ZevvIs Arrrrrrrrr Araq when he's mad?
10:28:44ArrrrrrrrrHe is always mad
10:32:52*PMunch_ joined #nim
10:32:58FromGitter<alehander42> composition
10:36:19*leorize quit (Remote host closed the connection)
10:36:42*PMunch quit (Ping timeout: 258 seconds)
10:36:49Araqlol
10:37:13*solitudesf quit (Quit: ZNC - https://znc.in)
10:38:11*solitudesf joined #nim
10:39:46FromGitter<mratsim> monads :P
10:40:11Zevvyou want to get banned? because that is how you get banned!
10:54:21ArrrrrrrrrI tested the incremental compilation once, and it was very slow. And lately it seems that compiling is slower in general.
11:00:26Araqsure you used -d:release to build your compiler?
11:02:45Zevvhaha, 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:46livcdI 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:28narimiranZevv: yeah, imagine those fools!! that *also* *never* happened to me!
11:10:17ArrrrrrrrrNow I can't remember, but I always define release, so I guess that time wasn't any different.
11:11:00ArrrrrrrrrI gave for granted it wasn't optimized yet
11:11:54ArrrrrrrrrBut computer is very old, but I'm talking relative to how fast it was before I mean.
11:11:59Arrrrrrrrr*My
11:12:25livcdryukoposting: what is that editor you are using in your nimcast ?
11:13:04Araqthe stdlib also keeps growing and so what used to be 1000 lines is now 2000 lines, yay
11:14:16ArrrrrrrrrYes, that too. The incremental compilation tho.
11:14:27ArrrrrrrrrYes, that too. The incremental compilation tho.
11:17:35narimiranlivcd: 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:22synisethHello nimble navigators.
11:52:26*vlad1777d quit (Remote host closed the connection)
11:52:34FromGitter<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:52FromGitter<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:00Araqdoes it have to be in different C files? cause that's kinda tough
12:21:24ZevvCould you generate 1 file and enable one block at a go with CPP?
12:22:34Araqyou can .emit #ifdef and compile the file multiple times, maybe, probably not though
12:23:51AraqI keep thinking about adding NimScript support to the codegen but so far it's just a vague idea
12:23:56FromGitter<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:18FromGitter<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:21CalinouArrrrrrrrr: perhaps you can gain back some performance by building the compiler with LTO enabled (--passc:-flto), this also results in smaller binaries
12:25:30Calinoualthough I'm not sure how beneficial it is with the Nim compiler (I haven't benchmarked it)
12:25:47Calinouif you use MSVC you'll have to find the equivalent flag, -flto is for GCC
12:26:22FromGitter<mratsim> but last time I tried to use __attribute features on proc it overrided stuff like NIMCALL
12:27:55FromGitter<mratsim> I'll open an example in the tracker
12:32:39synisethwhy does nim -> js compiled file so long
12:32:52*dddddd joined #nim
12:33:09synisethall 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:20shashlickkobi7: did nimterop work for you?
12:38:44FromGitter<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:35FromGitter<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:54FromDiscord_<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:34xace_livcd: my best guess just based on the video is that he is using KDE's kate as a editor
13:00:19FromGitter<alehander42> the nim compiler should compile to javascript quickly
13:01:00Araqhe complained about the 77 lines output, not about the compilation speed, I think
13:04:44FromGitter<alehander42> well they mostly define boilerplate and helpers i guess
13:05:06Araqit's Nim's error handling
13:05:22Araqand it's only 77 lines, nothing to worry about
13:06:50FromGitter<alehander42> yes
13:07:39*enow joined #nim
13:07:41enowHi guys
13:18:02PMunchHi
13:24:36livcdi 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:10ArrrrrrrrrThank 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:07enowHow well do asynchronous code and threads mix
15:03:55enowIf I wait for a channel in the asynchronous code (with a different thread on the other end) will it block
15:05:10FromGitter<mratsim> there is an example here: https://github.com/dom96/nim-in-action-code/tree/master/Chapter3/ChatApp/src
15:05:35FromGitter<mratsim> iirc the main issue is that both uses the spawn name :P
15:06:11FromGitter<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:17shashlickleorize: 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:28shashlickfor now, putting a sleep after loadLib seems to make my crashes go away
15:08:34shashlickjust bizarre stuff
15:08:55shashlickof course, I have another issue where unloading a lib doesn't really recover the memory associated with loading it
15:10:09shashlickprivate bytes keep going up indefinitely if i keep unloading and reloading
15:10:56shashlicknot a realistic test case but I keep my text editor open all the time, it should release RAM it is done with
15:13:16enowoh thanks
15:49:40Zevvshashlick: 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:16shashlickwell, every time I load, ram goes up by 12mb and never comes back down
15:51:28shashlickso you do it 10 times and you now have 120mb
15:51:33Zevvrunning linux?
15:51:36shashlickWindows
15:51:41Zevvoh, sorry :(
15:51:47*Vladar joined #nim
15:51:57ZevvI was about to totally help you out here
15:52:04shashlick😄
15:52:09Zevvbut 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:02shashlickphew, 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:10FromGitter<Varriount> Shashlick: Hm. I seen to recall that some Windows APIs will spawn background threads for things like Window messages and such.
18:45:31FromGitter<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:45shashlickyes, points to line 472 in threads.nim
19:06:07shashlickbut 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:15ryukopostinghttps://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:52ryukopostinganyone :(
20:12:28*abm quit (Ping timeout: 258 seconds)
20:13:48*cyraxjoe quit (Ping timeout: 245 seconds)
20:15:05Araqryukoposting: I know about it and a fix is not far away
20:17:20ryukopostingthanks Araq!
20:18:42ryukopostinganother 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:02FromGitter<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:52FromGitter<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:54Araqryukoposting: what's your area of expertise?
21:31:55Araqbrentp: use 'nim cpp' and the overhead should be gone
21:33:30FromGitter<brentp> @Araq. indeed. 25X faster compared to `nim c`
21:34:13Araq:-)
21:43:08shashlickWow should we start using Nim cpp by default already?
21:43:54Araqit doesn't hurt, test suite is green with it too
21:51:34shashlickAraq: 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:53Araqoh interesting, I usually use 'echo' for debugging
21:57:18FromGitter<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:33Araqbut if even gdb fails then you may have a stack corruption
21:58:45AraqGULPF: just give me the milliseconds of a Duration, I don't want to be bothered with 'convert'
21:59:31Araqand since the accessors are already taken, we could have the names 'inX', dur.inMilliseconds
21:59:36Araqdur.inHours
21:59:40Araqetc.
22:02:36FromGitter<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:06FromGitter<kayabaNerve> My project has C++ libs so I just use C++ on the entire project :thinking:
22:03:32FromGitter<kayabaNerve> It's been great
22:07:34*kapil____ joined #nim
22:12:03AraqGULPF: Well it started out as a tiny wrapper around Ansi C's time.h
22:12:20Araqnow it's big and it's all your fault ;-)
22:18:21FromGitter<kayabaNerve> Since Linux finally solved the 2032 time problem, is Nim next?
22:18:32FromGitter<kayabaNerve> *2038
22:20:11FromGitter<kayabaNerve> Just while we're discussing the time lib
22:20:33FromGitter<kayabaNerve> I'd love to see it solved before 1.0 tbh
22:21:01Araqthere is nothing to solve, the data types are abstract enough
22:21:07Araqwe can widen them anytime
22:22:32FromGitter<kayabaNerve> So will Nim widen them before 1.0?
22:24:02AraqI doubt it needs to, ask GULPF
22:41:46ryukopostinghey, sorry Araq, had to take off for a bit
22:44:49ryukopostingmy 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:17ryukopostingspecifically 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:38Araqok, then show how to use Nim instead of C for everything, esp, & is addr and stuff like that
22:47:11ryukopostingFirst 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:05AraqI would do this:
22:48:11ryukopostingmy 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:38Araq- explain how you can write Nim as you can write C.
22:48:56Araq- explain how parameter passing uses pointers under the hood so that you don't have to.
22:49:29Araq- explain that 'var T' is used for mutability control and parameter passing semantics are not burdened with speed considerations because of this
22:49:50ryukopostingalso, 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:12Araqand with 'sink T' we actually got parameter passing 100% right. And no other language did, ymmv
22:50:34ryukopostingI'll admit I have not looked at sink yet
22:50:44Araqit's becoming my favorite part of Nim, all the newer stuff can built on top of this solid foundation
22:52:54ryukopostingyou had an article about that, right? I recall reading something from you about sink
22:52:58Araqiterators are pretty slow so they might be disappointing for a protothread implementation
22:53:28ryukopostingI see, that's unfortunate
22:53:55*thomasross joined #nim
22:54:21ryukopostingthey 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:06Araqinteresting, I had the same idea once
22:55:08*abm joined #nim
22:55:29ryukopostingso with closure iterators, you don't have to make everything into a massive blob of global variables
22:55:46ryukopostingor local statics, i guess, but you get the idea
22:55:57Araqsure, they transform the stack frame into a frame on the heap
22:57:33ryukopostingaaaah 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:49ryukopostingultimately 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:06Araqwell Nim does that under the hood I guess
23:00:29ryukopostingthat was my guess, looking at how closure iterators appear to work
23:01:18ryukopostingA couple of these videos will have kind of a dual purpose
23:02:08ryukopostingthey'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:50Araqyay
23:04:56Araqdoes that mean you speak German?
23:05:04ryukopostingsadly, no
23:05:35ryukopostingThey have German lessons, though, and I plan on taking them when the new round starts up this summer
23:07:10Araqah ok
23:09:40ryukopostingObviously 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:48Araqmention that we're getting better for embedded since that's our focus these days
23:12:13FromDiscord_<exelotl> that's good to hear :D
23:12:25ryukopostinghow has that been going? I'm really hoping to see more stuff about using nim without the GC
23:14:52Araqwell I know about roughly 3 different ways how to make a Nim without GC and keeping the memory safety
23:15:19Araqand now I know too much
23:15:30Araqand can't decide
23:16:04ryukopostingI 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:54Araqsure, 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:17FromDiscord_<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:21Araqryukoposting: but then you lose .closure iterators without a good replacement unless you use the undocumented .liftLocals transformation
23:18:51ryukopostingIt 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:02Araqexelotl: you need to be more precise, --gc:none is bad indeed, but what's in system that sucks
23:19:09FromGitter<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:23Araqthat's easy, the stdlib uses the GC everywhere
23:19:36Araqeverywhere.
23:19:43Araqfor everything :D
23:19:53ryukopostingAraq so does getting rid of the GC kill off all closure iterators then? oof
23:20:18AraqI'm working day and night for a solution, ryukoposting
23:20:36Araqand I have one that works without having to rewrite the stdlib
23:21:09ryukopostingI imagine that is a huge task
23:22:50Araqit's easier than you think :-)
23:23:55ryukopostingIn 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:58Araqiffy: it's not really possible, but you can do this proc myproc(T: typedesc[VmState|VmUnstableState]): T
23:24:38FromGitter<iffy> hmmm... k, I'll take a look
23:24:39ryukopostingas 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:13Araqimagine programmers using Nim like they Python and you have a pretty accurate picture of the stdlib
23:25:22Araq*like they use
23:25:50ryukopostinglol
23:26:31ryukopostingI've come across a decent number of python devs who like nim because "it's like python but compiled and with types!"
23:26:41Araqit's also a social problem as much as it is a technical problem.
23:27:07Araqwe don't teach Nim's lower level constructs well
23:27:46ryukopostingIt'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:25ryukopostingone of the goals of my videos is to show that Nim is more than just "python with types"
23:29:39ryukopostingironically, one of my planned demonstrations of templates is implementing python's :=
23:30:42ryukoposting(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:35FromDiscord_<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:41FromDiscord_<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:09Araqryukoposting: ldlework maybe?
23:35:52Araqexelotl: the point is, why can't you use --gc:refc instead?
23:36:14Araq(the default setting)
23:36:25ryukopostingI'm certainly no docker expert, but I know people who know that stuff
23:37:26ryukopostingI 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:51FromDiscord_<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:12Araqexelotl: I removed some of this junk
23:49:24Araqand we can remove more
23:49:47Araqbut if you have 32kb RAM why would you use unicode?
23:49:56Araqthe unicode tables are huge too
23:54:55FromDiscord_<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:41FromDiscord_<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:57Araqok, so the unicode tables are optimized away but the RTTI isn't?