<< 22-12-2018 >>

00:04:52FromGitter<alehander42> @mratsim woiw
00:14:24*xet7 quit (Quit: Leaving)
00:18:38*fthe quit (Ping timeout: 268 seconds)
00:35:18*smitop joined #nim
00:35:56smitopHow can I use the Windows build environment to build Nim code, on Travis CI?
01:05:57*McSoFake quit (Ping timeout: 256 seconds)
01:34:58*abm joined #nim
01:47:23*rockcavera joined #nim
01:48:32*abm quit (Ping timeout: 250 seconds)
01:50:19*kapil____ joined #nim
01:54:59*abm joined #nim
02:12:08*kinkinkijkin quit (Quit: Leaving)
02:19:32*Tyresc quit (Quit: WeeChat 2.4-dev)
02:22:50*rockcavera quit (Remote host closed the connection)
02:23:14*rockcavera joined #nim
02:26:23*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:54:08PrimHeliosis there a way to make a hashtable that maps a string to a proc? i tried this (https://hastebin.com/uqohinifos.cs) but i get "Error: ordinal type expected"
03:00:03*banc quit (Quit: Bye)
03:01:38*zachk quit (Quit: Leaving)
03:04:50PrimHeliosoh, im a dummy, used a comma instead of a colon
03:15:45*banc joined #nim
03:35:34PrimHeliosalright, i'm trying to use this code (https://hastebin.com/qupuweheha.cs) to create a hashtable mapping strings to procs, but the code errors with "Error: type mismatch: got <Table[system.string, proc (){.gcsafe, locks: 0.}]> but expected 'Table[system.string, proc (){.closure.}]'". Is there a way to do this without using anonymous procedures?
03:43:29leorizeadd {.nimcall.} annotation to your proc type in the Table
03:47:55PrimHeliosJust figured that out myself lol. Thanks for confirming it. Is that because without any call convention pragmas, it defaults to closure?
03:53:56leorizeyea
03:54:20PrimHeliosty :)
04:04:53*smitop quit (Quit: Connection closed for inactivity)
04:05:07*nsf joined #nim
04:30:05PrimHelioswhy do some modules in the stdlib have procedures that just call another internal procedure? for instance, tables.add just calls an internal function called "addImpl". distros.detectOs does the same thing with "detectOsImpl"
04:59:22*kapil____ quit (Quit: Connection closed for inactivity)
05:27:25*abm quit (Ping timeout: 250 seconds)
06:14:27PrimHeliosdoes nim have a way to catch an error and do nothing, similar to python's "pass" statement?
06:44:12leorizeuse `discard`
06:44:21leorize`except Exception: discard`
06:46:49*kapil____ joined #nim
06:52:55*plushie quit (Quit: plushie)
07:05:52PrimHelios@leorize: thanks!
07:17:51*kapil joined #nim
07:53:07*kapil quit (Ping timeout: 240 seconds)
08:22:56FromGitter<Varriount> PrimHelios: addImpl is a template, right?
08:30:53*vlad1777d joined #nim
08:32:19*kapil joined #nim
08:43:51Araqgah I broke the appveyor build
08:50:39FromGitter<xmonader> Guys do you think it's a good thing to self publish Nim days or Should I check with some publisher, but with the same model of learn you a haskell or the rust book?
08:53:47*stefanos82 joined #nim
08:57:44*Trustable joined #nim
09:06:35*zakora joined #nim
09:15:03*zakora quit (Quit: WeeChat 2.2)
09:27:29*stephenw` quit (Remote host closed the connection)
09:47:39*kapil quit (Remote host closed the connection)
10:08:53*wildlander quit (Quit: Konversation terminated!)
10:31:21*nsf quit (Quit: WeeChat 2.3)
10:37:29FromGitter<Clyybber> Araq: What are you currently working on?
10:37:40FromGitter<Clyybber> Or what is the team currently working on?
10:45:38Araqregressions and the Christmas release
10:53:19FromGitter<Clyybber> Nice, have you figured out why appveyor is failing yet?
10:53:36Araqdifferent GCC version or something, already fixed it
10:54:25FromGitter<Clyybber> Ah okay, nice
11:09:08*Vladar joined #nim
11:17:31FromGitter<mratsim> Christmas release?
11:29:50FromGitter<alehander42> ruby style
12:12:08*dddddd quit (Ping timeout: 245 seconds)
12:16:06*Snircle joined #nim
12:24:23*nsf joined #nim
12:38:16*abm joined #nim
12:42:53*dddddd joined #nim
12:45:11FromGitter<alehander42> Araq: do I need to use both nimout & errormsg for multiline msgs
13:21:42FromGitter<zacharycarter> Araq and @krux02 - I liked the video, and you're both very relaxing to listen to
13:22:24FromGitter<zacharycarter> thanks for the update - I like the dev blog video format better, it feels much more personal and it's interesting to hear you guys go back and forth and explain things in detail
13:23:11*whaletechno quit (Quit: ha det bra)
13:25:35FromGitter<alehander42> just wanted to add that having also a short text summary article too would be always very nice too: videos are amazing, but many people can't (or don't want) to spend 50 minutes instead of 5
13:26:08FromGitter<zacharycarter> true
13:26:17FromGitter<zacharycarter> videos + transcriptions are the best - but also work
13:26:43FromGitter<alehander42> yes
13:35:54*JQ1I73 joined #nim
13:40:53*JQ1I73 quit (Quit: Page closed)
13:46:47*nsf quit (Quit: WeeChat 2.3)
14:04:31*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
14:05:04*abm quit (Quit: Leaving)
14:06:12*stephenwithav joined #nim
14:06:31*Snircle joined #nim
14:14:10*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
14:16:06*xet7 joined #nim
14:29:28*abeaumont quit (Remote host closed the connection)
14:40:14*stefanos82 quit (Remote host closed the connection)
14:40:29*abeaumont joined #nim
16:02:37PrimHeliosvarriount: yes, addImpl is a template. why not just call the template directly instead of having a function call that uses a template?
16:12:29*Ven`` joined #nim
16:22:38leorize@Varriount: ^
16:22:50*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:26:22leorizePrimHelios: Because that template is {.dirty.}
16:26:33leorizealso, it's used to implement more than one `add` function
16:27:57*PMunch joined #nim
16:30:00*Tyresc joined #nim
16:42:45PrimHeliosleorize: alright, thanks! still trying to figure out nim idioms :P
16:45:24*nsf joined #nim
16:46:25PMunchIs it still possible to build really old Nim versions?
16:46:43PMunchI'm trying to build 0.7.10 but it's giving me a bit of trouble
16:52:10*Trustable quit (Remote host closed the connection)
16:54:12dom96PMunch: Why are you trying this?
16:54:46PMunchIt's the first version with dynlib support (or at least the first version where lib/pure/dynlib.nim exists)
16:55:21dom96huh, that still exists https://nim-lang.org/docs/dynlib.html
16:55:23PMunchAnd I'm trying to figure out if this bug: github.com/nim-lang/Nim/issues/6886 has always been there, or if it was introduced at some point
16:55:35dom96oh
16:55:40PMunchYeah I know it still exists, but it trips up the GC
16:56:03PMunchSo I'm trying to figure out if that always happened or if some change in the GC made it start
16:56:34PMunchI've done some debugging with gdb and it looks like it's segfaulting from inside the GC code
16:56:51PMunchSo it's not that the GC have collected something it wasn't supposed to do as I first expected
16:57:07PMunchBut rather that it get's itself into a bad state
17:00:18PrimHeliosa dirty template just injects everything, right?
17:04:04leorizeyep
17:10:06*xet7 quit (Quit: Leaving)
17:15:36*leorize quit (Ping timeout: 252 seconds)
17:40:08PMunchHmm, I think what's happening is that the GC registers cells from the libraries and when you unload a library and the GC triggers a deallocation the memory is no longer in the program (since the lib that had allocated it is now unloaded)
17:42:51PMunchTried to add a GC_fullcollect() before unloading the library, but that appears to have messed up the memory
17:43:30PMunchAll of a sudden it tries to load the library "loading" which is another string in the program that is not what it should try to load
17:44:30*stefanos82 joined #nim
17:44:44PMunchMaking the array of library names to load a const (meaning it's not going to be treated the same way by the GC) solved that issue
17:45:28PMunchAnd now (with the GC_fullcollect) it runs just fine
17:48:33PMunchSo to summarise, the bug is caused by the GC keeping references to memory that is lost when the library is unloaded and then trying to access that memory. One solution is to use GC_fullcollect() before unloading the library, which let's the GC clear out those references before the library is unloaded (might not work if the library is actually keeping some state that can't be GC'ed, to actually fix it we need to find a way to let the GC know that everything
17:48:33PMunchfrom that lib can now be considered deallocated). But GC_fullcollect() seems to have it's own issues, as it shuffles some of the strings in the code around, whether this is a general bug or somehow caused by the dynlib or nimrtl stuff I'm not sure.
17:48:46PMunchPhew, finally making some headway on this bug :)
17:50:41AraqI wasn't aware we support lib unloading :P
17:52:26PMunchWhat? unloadLib has been part of dynlibs since the beginning :P
17:52:34PMunchOn Linux it maps to dlclose
18:03:04PMunchOh well, I'm off now. Have to investigate how this can be properly fixed later, but I have a feeling it won't be easy..
18:03:06*PMunch quit (Remote host closed the connection)
18:25:51*kapil____ quit (Quit: Connection closed for inactivity)
18:34:34*mu__ joined #nim
18:37:44mu__hi
18:38:38mu__I can't find any documentation on handling EOT characters from user input in nim. Anyone have an idea where I look?
18:41:26Araqsystem.endOfFile proc
18:57:26mu__thx Araq
19:01:45*dddddd quit (Remote host closed the connection)
19:10:49FromGitter<deech> Currently enums are default initialized to 0, is this expected behavior? For example: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ produces: `A`. [https://gitter.im/nim-lang/Nim?at=5c1e8c395a0a8058bef81b3e]
19:29:11Araqyes but it'll be changed
19:31:43*nsf quit (Quit: WeeChat 2.3)
19:33:08*zachk joined #nim
19:33:27*NimBot joined #nim
19:33:54*Jesin quit (Quit: Leaving)
19:34:36*zachk quit (Changing host)
19:34:36*zachk joined #nim
19:38:28*Jesin joined #nim
19:40:07*whaletechno joined #nim
19:50:46FromGitter<deansher> Can someone tell me why I get two different ASTs here?
19:52:30FromGitter<deansher> (Sorry, didn't mean to send that without my example.) ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c1e95fe92cf4d2242dc95f9]
19:53:09FromGitter<deansher> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c1e9625cac5bc2241d133cf]
20:00:16FromGitter<deansher> Oh! I think I've got it. ⏎ ⏎ ```proc quote(bl: typed; op = "``"): NimNode``` ⏎ ⏎ It's the fact that `bl` is `typed`, right? [https://gitter.im/nim-lang/Nim?at=5c1e97cf23323d58bd0cfdb2]
20:01:28*rockcavera quit (Remote host closed the connection)
20:03:11Araqright
20:24:06*Trustable joined #nim
20:47:27*mu__ quit (Remote host closed the connection)
20:56:21*xet7 joined #nim
20:57:36*tefter joined #nim
20:58:35*wildlander joined #nim
21:03:42FromGitter<deech> Are there existing projects that provide Nim bindings to "tricky" C++ API's, ie. templates, C++14 features etc. ?
21:07:30*theelous3 joined #nim
21:14:15FromGitter<zacharycarter> PMunch: IMO the dynlib stuff is not very useful until useNimRTL becomes useful
21:15:56*stefanos82 quit (Remote host closed the connection)
21:16:18FromGitter<alehander42> Araq: how would enum default change
21:16:47*theelous3 quit (Ping timeout: 240 seconds)
21:28:54*dddddd joined #nim
21:30:33*plushie joined #nim
21:33:21*Vladar quit (Remote host closed the connection)
22:08:12Araq<zacharycarter> PMunch I fixed DLLs for the C++ target and the tests are green too
22:10:03Araqand the heap is in nimrtl so I don't know why unloading should be an issue as long as you don't unload nimrtl.dll
22:14:00*kinkinkijkin joined #nim
22:14:46*kinkinkijkin quit (Client Quit)
22:14:58*kinkinkijkin joined #nim
22:17:24Araqdeech: There are bindings for Urho 3D, Unreal Engine and Godot. Only Godot being maintained afaik but it shows how it was done / can be done
22:17:34Araqbtw does anybody have access to https://www.sciencedirect.com/science/article/pii/S0020019010003108 ?
22:21:22*PrimHelios quit (Ping timeout: 250 seconds)
22:22:29*PrimHelios joined #nim
22:22:44PrimHelioswhen should i use ref object and when should i use just normal object?
22:25:12Araqin today's Nim: Use object when it's small, use ref object when it's big. When you come from Python, use ref because that's with the semantics you're used to
22:25:29Araqthe semantics are different and so they lead to different coding styles
22:25:45Araqin tomorrow's Nim: prefer object
22:26:59PrimHeliosalright, thanks
22:32:40dom96Araq: try sci-hub https://en.wikipedia.org/wiki/Sci-Hub
22:38:26FromGitter<Clyybber> Araq: To add to dom96's answer, heres the direct link: https://sci-hub.tw/https://doi.org/10.1016/j.ipl.2010.10.004
22:38:48Araqthanks...
22:39:22*tefter quit (Remote host closed the connection)
22:43:19FromGitter<zacharycarter> Araq: does that mean we no longer need to use `useNimRTL` with the cpp target? And does it also mean we shouldn't run into the potential issue related to multiple GCs?
22:43:41FromGitter<zacharycarter> I remember seeing an issue saying this was possible with the cpp target - but I couldn't get it working when i tried
22:47:43AraquseNimRtl and the cpp target are orthogonal but previously they were not tested in combination
22:47:47Araqnow they are
22:47:53Araqit doesn't mean much else
22:48:04Araqand as I said, I can only fix what's been reported
22:50:46FromGitter<zacharycarter> okay thanks - I will do some testing
22:56:59*abm joined #nim
23:08:10*deansher joined #nim
23:22:45*kapil____ joined #nim
23:41:26*xet7 quit (Quit: Leaving)
23:44:23*Trustable quit (Remote host closed the connection)
23:56:28*deech quit (Read error: No route to host)