<< 05-06-2016 >>

00:24:01*yglukhov joined #nim
00:28:25*yglukhov quit (Ping timeout: 250 seconds)
00:52:03*xet7 quit (Ping timeout: 240 seconds)
00:57:45mccflyx: the next time you are on i would like to ask you a question about nimyaml, i installed it on a windows machine (it runs under msys2) and when run it fails with an error
01:00:12*yglukhov joined #nim
01:02:58tautologico@[] is different from nil, right?
01:05:05*yglukhov quit (Ping timeout: 260 seconds)
01:09:09mcc@[] is an empty open array and it can be operated on and mutated so it must be different from nil
01:09:28*chemist69 quit (Ping timeout: 264 seconds)
01:22:23*chemist69 joined #nim
01:24:32*yglukhov joined #nim
01:29:03*yglukhov quit (Ping timeout: 240 seconds)
01:34:38*arnetheduck joined #nim
01:48:43*yglukhov joined #nim
01:53:27*yglukhov quit (Ping timeout: 276 seconds)
02:12:55*yglukhov joined #nim
02:17:01*yglukhov quit (Ping timeout: 240 seconds)
02:48:42*fgimian joined #nim
02:48:44fgimianhey there guys
02:48:54fgimiancan anyone assist me with iterating over a StringTableRef?
02:48:56fgimiani can't seem to find any examples of this
02:49:15*yglukhov joined #nim
02:53:28*yglukhov quit (Ping timeout: 252 seconds)
03:21:18mccWhat is the "best practices" way in Nim to represent something like an "Option"? Say, I have a value which I know will be either 0, 1, 2, 3 or Nothing.
03:22:18mccSo like ML I'd represent this as an "int option", and in Python I'd represent it as a variable containing either an int or None, and in C I'd special-case -1 as the "none" value and then feel gross about this
03:25:31*yglukhov joined #nim
03:27:22*fgimian quit (Quit: Textual IRC Client: www.textualapp.com)
03:29:52*yglukhov quit (Ping timeout: 260 seconds)
03:30:02tautologicoan actual option type would be nice
03:34:48*xet7 joined #nim
03:37:38mccYou could sort of do it with object variants.
03:37:49mccActually probably you could make a standard option with generics + variants
03:49:40*RushPL quit (Quit: No Ping reply in 180 seconds.)
03:52:04*RushPL joined #nim
04:01:52*yglukhov joined #nim
04:06:37*yglukhov quit (Ping timeout: 260 seconds)
04:08:19*RushPL quit (Quit: No Ping reply in 180 seconds.)
04:11:16*RushPL joined #nim
04:32:17fowltautologico, mcc, http://nim-lang.org/docs/options.html
04:33:03mccWell, that's straightforward.
04:38:06*yglukhov joined #nim
04:42:34*yglukhov quit (Ping timeout: 260 seconds)
05:14:08*chemist69 quit (Ping timeout: 258 seconds)
05:14:26*yglukhov joined #nim
05:14:36*chemist69 joined #nim
05:16:02*nsf quit (Quit: WeeChat 1.4)
05:18:57*yglukhov quit (Ping timeout: 260 seconds)
05:38:40*yglukhov joined #nim
05:43:27*yglukhov quit (Ping timeout: 260 seconds)
06:14:04*fgimian joined #nim
06:14:59*yglukhov joined #nim
06:19:10*yglukhov quit (Ping timeout: 244 seconds)
06:25:24*filwit quit (Quit: Konversation terminated!)
06:31:12*fgimian quit (Quit: Textual IRC Client: www.textualapp.com)
06:41:51*bjz joined #nim
06:42:33*bjz_ quit (Ping timeout: 240 seconds)
06:50:06*yglukhov joined #nim
06:54:37*yglukhov quit (Ping timeout: 260 seconds)
07:19:53*endragor joined #nim
07:28:43*bjz_ joined #nim
07:28:57*yglukhov joined #nim
07:29:25*bjz quit (Ping timeout: 244 seconds)
07:43:24*StarBrilliant joined #nim
07:54:41*yglukhov quit (Remote host closed the connection)
07:59:23*Greglefox joined #nim
08:13:11*Greglefox quit (Quit: Page closed)
08:23:59*nsf joined #nim
08:36:28*bjz joined #nim
08:38:42*bjz_ quit (Ping timeout: 272 seconds)
08:43:53*yglukhov joined #nim
08:44:58*Demon_Fox quit (Quit: Leaving)
08:46:32*mcc quit (Quit: Connection closed for inactivity)
08:48:50*yglukhov quit (Ping timeout: 272 seconds)
08:50:14*RushPL quit (Remote host closed the connection)
08:52:31*RushPL joined #nim
09:02:38*yglukhov joined #nim
09:09:02flyxmcc: I'm awake now, tell me about your nimyaml problems
09:09:18flyxah well, now he's gone
09:10:37*yglukhov_ joined #nim
09:10:37*yglukhov quit (Read error: Connection reset by peer)
09:12:56*Arrrr joined #nim
09:12:56*Arrrr quit (Changing host)
09:12:56*Arrrr joined #nim
09:35:39*yglukhov_ quit (Remote host closed the connection)
09:41:29*Ven joined #nim
09:43:05*chemist69 quit (Ping timeout: 250 seconds)
09:44:57*yglukhov joined #nim
09:45:42*Matthias247 joined #nim
09:47:30*chemist69 joined #nim
09:49:03*yglukhov quit (Ping timeout: 240 seconds)
09:50:00*rok joined #nim
09:53:35*Ven_ joined #nim
09:54:42*Ven quit (Ping timeout: 272 seconds)
09:56:55cheatfatelooks like somebody breaks something in shared memory alloc/dealloc
09:58:20*yglukhov joined #nim
10:03:33*yglukhov quit (Ping timeout: 276 seconds)
10:07:18*Mat4 joined #nim
10:09:47*Mat4 quit (Client Quit)
10:26:10*Ven joined #nim
10:26:35*nsf quit (Quit: WeeChat 1.4)
10:27:41*Ven_ quit (Ping timeout: 240 seconds)
10:40:04*Ven_ joined #nim
10:41:56cheatfatedom96, are you here
10:41:57cheatfate?
10:42:04*Ven quit (Ping timeout: 252 seconds)
10:42:06dom96yes
10:42:11cheatfateI found one bug in my `callSoon` and want to discuss it
10:42:44cheatfatei though it was allocShared/deallocShared
10:42:48cheatfatebut it is not
10:42:57cheatfatehttps://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1668
10:43:22cheatfatewhat do you think about this line and its modification to `proc callSoon*(cbproc: proc () {.closure,gcsafe.}) =`
10:45:06dom96sounds good I guess
10:51:34*desophos quit (Read error: Connection reset by peer)
10:52:04cheatfateok i will do some tests
10:52:08cheatfateand then i will make pr
10:52:28*Rush__ joined #nim
10:53:28*vqrs_ joined #nim
10:53:34*pigmej quit (Ping timeout: 260 seconds)
10:53:34*JStoker quit (Ping timeout: 260 seconds)
10:53:34*RushPL quit (Ping timeout: 260 seconds)
10:53:35*Xe quit (Ping timeout: 260 seconds)
10:53:36*heinrich5991 quit (Ping timeout: 260 seconds)
10:53:36*Sergio965 quit (Ping timeout: 260 seconds)
10:53:36*vqrs quit (Ping timeout: 260 seconds)
10:53:37*def- quit (Ping timeout: 260 seconds)
10:53:37*Jesin quit (Ping timeout: 260 seconds)
10:53:37*BitToAtom quit (Ping timeout: 260 seconds)
10:53:46*MonsterAbyss joined #nim
10:54:03*def- joined #nim
10:54:53*Sergio965 joined #nim
10:55:42*pigmej joined #nim
10:56:15*Xe joined #nim
10:56:38*heinrich5991 joined #nim
10:58:24*JStoker joined #nim
11:00:01*jivank quit (Ping timeout: 260 seconds)
11:00:46*Jesin joined #nim
11:01:41*jivank joined #nim
11:19:04*rok quit (Ping timeout: 258 seconds)
11:20:20*yglukhov joined #nim
11:20:20*TheLemonMan joined #nim
11:24:55*yglukhov quit (Ping timeout: 250 seconds)
11:26:54*yglukhov joined #nim
11:35:22*|meta joined #nim
11:37:27*jjido joined #nim
11:38:17*nsf joined #nim
11:39:14*jjido quit (Read error: Connection reset by peer)
11:40:36*|meta is now known as |sir
11:46:45*chemist69 quit (Ping timeout: 260 seconds)
11:49:49*chemist69 joined #nim
12:09:41cheatfateAraq, ahoy
12:09:57Araqservus
12:10:08*Ven_ quit (Read error: Connection reset by peer)
12:10:26cheatfateAraq, just one more question, if i use lwan tactic to build threaded server, then looks i dont need threadsafe selectors
12:10:41cheatfatebecause every thread will use it own poll()
12:11:32cheatfateand there no interaction between threads except for queue with sockets from acceptor thread
12:11:47*Ven joined #nim
12:11:52Araqpossible
12:13:14*yglukhov quit (Remote host closed the connection)
12:15:01cheatfatebecause this shared memory just hurts me
12:15:35Araqperformance-wise or what do you mean?
12:16:21cheatfateok i have on experiment, in windows part of asyncdispatch.nim i have replaced CustomOverlapped to use `shared memory` not `gc memory`
12:16:33cheatfatei mean PCustomOverlapped to be sure
12:17:23cheatfateand tasyncawait.nim test failed with SIGSEGV
12:17:56cheatfategc.nim(589) growObj
12:17:56cheatfatesystem.nim(343) growObj
12:17:56cheatfateSIGSEGV: Illegal storage access. (Attempt to read from nil?)
12:18:16Araqthat only means you screwed it up :P
12:18:32cheatfateYeah i know :)
12:18:35cheatfatelooks like
12:18:39Araqwith -d:useSysAssert -d:useGcAssert
12:18:47Araqit should tell you what's wrong
12:21:01cheatfatenot really :( https://gist.github.com/cheatfate/9374002073d930b365ce8d59ce85b43b
12:23:05*chemist69 quit (Ping timeout: 258 seconds)
12:23:24*chemist69 joined #nim
12:23:28cheatfateso i think to remove all shared memory staff from my project and skip threadsafe feature...
12:23:57cheatfatebecause after all this bugs i dont think somebody will ever use it
12:23:58Araqtasyncawait.nim(34) readMessagesIter
12:24:09Araqis the problem
12:24:34cheatfatevar line = await recvLine(client)
12:24:44cheatfateit becomes problem only when i start to use shared memory
12:25:14*yglukhov joined #nim
12:25:47cheatfatei think i'm smashing gc memory
12:25:49*Ven quit (Read error: Connection reset by peer)
12:25:53cheatfatebut i dont know how
12:26:16*GangstaCat quit (Ping timeout: 264 seconds)
12:26:19cheatfatei will start from the beginning
12:26:36cheatfatethis will be i think 10th start from the beginning
12:27:22Araqomg, no.
12:27:36Araqkeep this version around but disable it.
12:27:50Araqone day I will look into it and fix it.
12:28:48*Ven joined #nim
12:29:26*yglukhov quit (Ping timeout: 244 seconds)
12:31:26*yglukhov joined #nim
12:35:52*yglukhov quit (Ping timeout: 260 seconds)
12:36:08cheatfateAraq, main problem that this bug affected all OSes
12:37:36cheatfateI think when i pushed `callSoon` PR i have made something wrong with this `{.closure,gcsafe.}` pragmas
12:38:14cheatfateits ok when callback data all stored in `gc memory`
12:38:37cheatfatebut when i move it to `shared memory` and then move back to `gc memory` something becomes wrong
12:39:14cheatfatemaybe it loosing it environment parameter
12:40:18*Ven quit (Read error: Connection reset by peer)
12:43:53*bjz_ joined #nim
12:45:01*bjz quit (Ping timeout: 240 seconds)
12:45:55*Ven joined #nim
12:48:11*GangstaCat joined #nim
12:52:05*xet7 quit (Ping timeout: 260 seconds)
12:56:04*Ven quit (Read error: Connection reset by peer)
13:03:39*Arrrr quit (Quit: WeeChat 1.4)
13:05:49*Ven joined #nim
13:06:06*endragor_ joined #nim
13:07:23*fredrik92 joined #nim
13:14:23*fastrom quit (Quit: Leaving.)
13:15:03*endragor_ quit (Remote host closed the connection)
13:20:21*rok joined #nim
13:26:29flyxseems like fieldPairs correctly iterates only over current fields of a variant object. is this correct for all cases?
13:26:46cheatfateok i have made this thing again on current devel version of asyncdispatch.nim
13:26:56cheatfateand i got sigsegv again
13:31:10*endragor quit (Ping timeout: 260 seconds)
13:33:32Araqflyx: I don't think fieldPairs works with case objects at all
13:33:42Araqbut maybe I've implemented that :P
13:41:52flyxthe output of my code implies that it does
13:47:27*Gonzih quit (Read error: Connection reset by peer)
13:49:35cheatfateLooking for help :) https://gist.github.com/cheatfate/65e3b11ba492fe44fd721ab0cc272c62/revisions
13:50:10cheatfatethis works fine on windows when compiled with `nim c tests/async/tasyncawait.nim"
13:50:34cheatfateand makes SIGSEGV when compiled with `nim c --threads:on tests/async/tasyncawait.nim`
13:53:17cheatfatebut ^^^ this is not compiler bug... its tasyncawait.exe's SIGSEGV
14:13:30*yglukhov joined #nim
14:17:57*yglukhov quit (Ping timeout: 260 seconds)
14:19:54*jjido joined #nim
14:22:14*_stowa joined #nim
14:22:20Araqcheatfate: already busy with your template bug
14:22:59cheatfateAraq, lol
14:30:04*_stowa quit (K-Lined)
14:36:27Araqcheatfate: but I found that. sooooo ....
14:42:16flyxhow can I get the name of a type from an nnkSym NimNode?
14:43:03flyxtypetraits.name only works on typedesc, but not on a NimNode, and getType does not return the name
14:43:52AraqgetType does return the name
14:44:50flyxtreeRepr on getType yields:
14:44:53flyxEnumTy
14:44:53flyx EnumTy
14:44:53flyx Sym "fooInt"
14:44:54flyx Sym "fooBool"
14:44:55flyx Sym "fooNone"
14:45:07flyxthere's no name in there
14:46:15*yglukhov joined #nim
14:51:22Araqflyx: https://github.com/nim-lang/Nim/blob/devel/tests/macros/tgettypeinst.nim
14:53:11Araqcheatfate: for data*: CompletionData # you need to protect the callback
14:54:14Araqvia system.protect and then you need to free it via system.dispose
14:59:20flyxAraq: not sure how that helps me, but I found a better way of doing stuff, so I don't need it anymore
14:59:26*|sir is now known as |2701
15:26:08*Gonzih joined #nim
15:27:53*xet7 joined #nim
15:30:44*abruanese joined #nim
15:36:42*yglukhov quit (Remote host closed the connection)
15:37:14*yglukhov joined #nim
15:38:23*yglukhov quit (Remote host closed the connection)
15:39:12*yglukhov joined #nim
15:43:40*yglukhov quit (Ping timeout: 264 seconds)
15:49:54*Arrrr joined #nim
15:53:33*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
16:01:23*yglukhov joined #nim
16:01:51*yglukhov quit (Remote host closed the connection)
16:04:42*jjido quit (Ping timeout: 260 seconds)
16:10:30*Ven quit (Read error: Connection reset by peer)
16:17:36*Trustable joined #nim
16:26:20*rok quit (Quit: rok)
16:34:03*Ven joined #nim
16:40:43*Ven quit (Read error: Connection reset by peer)
16:41:00cheatfateAraq, i suspect callbacks, but i can't find system.protect and system.dispose functions
16:42:09*nsf quit (Quit: WeeChat 1.4)
16:43:37*Ven joined #nim
16:53:59*zahary joined #nim
16:55:10*fastrom joined #nim
16:55:31cheatfateAraq, it looks like you send me to something not implemented yet :(
16:55:57*Ven quit (Read error: Connection reset by peer)
17:03:22*Ven joined #nim
17:10:51*Ven quit (Read error: Connection reset by peer)
17:20:10*endragor joined #nim
17:21:52*vendethiel joined #nim
17:22:51*Ven joined #nim
17:25:05*endragor_ joined #nim
17:26:11*Ven quit (Read error: Connection reset by peer)
17:26:30cheatfateahhh, i have found it in gc.nim
17:27:44*endragor quit (Ping timeout: 244 seconds)
17:34:47cheatfateAraq, i need to protect CompletionData because of callback stored in it? because i dont understand why i need to protect object which stored in `shared` memory
17:35:15Araqcompletiondata contains a .closure proc
17:35:32Araqa closure proc consists of (fn, env) pair
17:35:49Araqthat 'env' points to gc'ed memory and is what needs to be protected
17:40:23*endragorr joined #nim
17:41:24cheatfateso i need to protect callback not whole object?
17:42:49*Ven joined #nim
17:43:45*endragor_ quit (Ping timeout: 276 seconds)
17:46:41Araqthe 'env' pointer which can be accessed via system.rawEnv()
17:46:53Araqthat's what you need to protect.
17:48:40flyxdom96: I wonder, does this dual-naming in nimble even work for nimyaml? I just renamed nimyaml.nimble to yaml.nimble in my repo. does nimble still find the file if the package is accessed as `nimyaml` instead of `yaml`?
17:50:34flyxwell it seems like it works
17:53:22*|2701 quit (Quit: Connection closed for inactivity)
17:56:38*yglukhov joined #nim
17:59:10flyxon Windows, does Nim bootstrap with Visual Studio or with MinGW? or with whatever it finds?
17:59:34cheatfatecc = "vcc" will use visual studio, but by default it uses "gcc" - mingw
17:59:50cheatfateyou need to have visual studio compiler in path for proper working
18:01:16flyxthe instructions on the homepage just yield „unknown operating system: cygwin_nt-10.0-wow“
18:01:32Araqmingw is not cygwin.
18:01:36flyxI know, I know
18:02:01Araqwe support cygwin, but not building from source for it.
18:02:28Araqsomebody should read about cross compiling.
18:02:28*yglukhov quit (Remote host closed the connection)
18:03:02Araqand I'm as usual open for suggestions about this constant "nobody reads the docs" problem.
18:04:45flyxwell I tried cc="vcc" like cheatfate told me, but this doesn't seem to work with the bootstrap script
18:04:58flyxdo I need MinGW for bootstrapping?
18:05:36cheatfateyou need to use mingw for building nim from source
18:05:46cheatfatebut after that you can use vcc
18:06:39flyxokay, then I'll try getting MinGW
18:06:48cheatfateAraq, i think it would be bad idea to store ForeignCell in CompletionData?
18:08:50Araqcheatfate: no, that's exactly what you need to do
18:09:00cheatfateAraq, thanks ok
18:10:54*Ven quit (Read error: Connection reset by peer)
18:11:57flyxwith mingw, I get „unknown operating system: msys_nt-10.0“
18:12:54*Ven joined #nim
18:13:57Araqla la la
18:14:35Araqwhy not use the .bat files like we say you should?
18:14:43dom96flyx: even if it doesn't work right now I am planning on adding a special syntax for package renames, so that Nimble is aware of it.
18:15:29dom96Araq: Likely because the bootstrap.sh script isn't aware of it
18:17:18*nsf joined #nim
18:17:21Araqdom96: we don't say to use bootstrap.sh on windows either.
18:17:27flyxAraq: nobody said anything about a .bat file. anyway, the mingw shell does not know how to run a .bat file
18:18:38dom96Araq: These little files seem to create quite a bit of problems.
18:18:48dom96But I guess they are still nice for CI
18:18:59dom96flyx: just use cmd.exe
18:19:10flyxI can try to add all necessary mingw binaries to my cmd PATH, but that does seem to be a lot of wrok
18:20:06dom96flyx: is it not just a case of adding "C:\Program Files\MINGW\bin" or something like that?
18:20:11Araqflyx: use the official installer to get a working mingw + Nim.
18:20:20flyxI am trying
18:20:21cheatfateflyx, you only need to put path to gcc to your windows path
18:20:23Araqand then cross compile like documented.
18:20:30dom96in fact, when you install MINGW it adds itself to PATH IIRC
18:20:40Araqand *THEN* if it causes problems, report them as bugs :P
18:21:00Araqdom96: what little fixes do you mean?
18:21:17flyxdom96: well it did not for me, but that mingw_64w which is suggested on the download page has multiple installers, not sure I downloaded the one with which it works
18:21:53dom96Araq: You mean little files? bootstrap.sh, install.txt, install_nimble.nims, start.bat (what even is this?)
18:22:03flyxokay, I'll try to download the release and then compile devel
18:22:37dom96I added some improvements to the download page already: https://github.com/nim-lang/Nim/blob/devel/web/download.rst
18:22:49dom96but I guess we need more for people who want to bootstrap on Windows
18:23:26dom96(Feedback welcome)
18:24:01dom96oh, and we are planning on releasing today btw
18:24:13dom96so if there is something that needs to be desperately merged/fixed let us know
18:26:16*Ven quit (Read error: Connection reset by peer)
18:29:14*ics joined #nim
18:29:36*xet7 quit (Ping timeout: 246 seconds)
18:32:26*Ven joined #nim
18:33:40Arrrr0.14 ?
18:33:54*fowl wouldn't mess with path on Windows, just use the cmd link provided or bash shell or whatever you get
18:33:55dom96It appears so
18:34:23fowlBut idk on my last Windows I ended up with 6 or 8 different c compilers installed
18:34:33ArrrrThe number of showstoppers has been reduced a lot
18:35:56*yglukhov joined #nim
18:40:57*yglukhov quit (Ping timeout: 276 seconds)
18:44:36*TheLemonMan joined #nim
18:45:54flyxhum, I updated devel and now my code is broken. has something changed to nnkObjectTy?
18:46:32cheatfateAraq, `ol.data.cell = system.protect(cast[pointer](rawEnv(ol.data.cb)))` now problem is here
18:48:15cheatfateouch i understand
18:48:23cheatfateAraq, forget it
19:01:10*tautologico quit (Quit: Connection closed for inactivity)
19:03:21*abruanese quit (Quit: ZNC 1.7.x-nightly-20160225-9b31a077 - http://znc.in)
19:06:23Araqflyx: no, but getType() changed
19:06:52flyxAraq: thought so. I already fixed it
19:07:06*elrood joined #nim
19:07:40flyxI guess that could have been the error mcc got earlier
19:08:20flyxwell, this concludes my Windows adventure
19:09:40Araqflyx: what does the change look like?
19:09:48Araqwe need to document the changed behaviour
19:10:16flyxthe result of getType now has three children instead of two, the last one being the recList
19:10:53flyxthe first two are empty in my case, I am not sure what goes in there. a parent type probably, and something else
19:11:41flyxso my code crashed when I accessed tDesc[1] and assumed it was the reclist
19:12:46ArrrrGood luck with the release, Team Nim
19:12:47*Arrrr quit (Quit: WeeChat 1.4)
19:15:48*askatasuna quit (Ping timeout: 246 seconds)
19:18:01*Mat4 joined #nim
19:18:09Mat4hello
19:19:25Araqhi Mat4. we're busy preparing 0.14
19:19:44cheatfateAraq, thanks for your help, it really helps...
19:19:54Mat4ok, good to know
19:24:16*askatasuna joined #nim
19:28:22cheatfateAraq, is there any progress in my templates issue?
19:28:35AraqI fixed it and pushed the fix
19:28:49AraqI thought you were aware, sorry.
19:29:03Araqactually ... I did tell you. see the logs of today.
19:29:13*tautologico joined #nim
19:29:34cheatfate`cheatfate: but I found that. sooooo ....` ?
19:30:08Araqyes.
19:30:40cheatfatei even don't understand it :) TTTHanks
19:35:15*Jesin quit (Quit: Leaving)
19:37:31*Jesin joined #nim
19:56:40*PMunch joined #nim
20:04:01dom96Didn't we get rid of this error? https://gist.github.com/dom96/6df15671924ed52cc3bf5c2140f74c74
20:04:10dom96(`File exists` when doing copyFile())
20:06:14Araqwe cannot. windows locks the exe file
20:07:55dom96huh, I'm not on Windows nor am I copying any exes
20:08:18Araqwell then I don't know about this error
20:08:34dom96hrm
20:08:48dom96actually, it might be because it's trying to copy a directory
20:09:04*mcc joined #nim
20:10:32dom96yeah, that's a pretty confusing error for that
20:10:50mccHello in this little sample program both breakList and breakList2 fail on the line li.head = nil, the first one fails because it says li.head cannot be assigned to, the second one fails because it says "li" is an "illegal capture". I don't understand either of these errors (rather i don't understand why li is immutable in the first case and i don't
20:10:50mccunderstand why li is an "illegal capture" in the second case)
20:11:00mcchttps://gist.github.com/mcclure/1c3e12cee16bd748c3499603d2479c5c
20:11:03mccWhat am I missing?
20:12:28mcclike i get that parameters are immutable in nim but i am confused why that also applies to members of parameters
20:14:31mccI guess.. SinglyLinkedList[T] is an object and not a ref object and that means it gets passed by value not reference?
20:17:10*yglukhov joined #nim
20:18:26mccIf that's the case then it seems like I ought to be typing breakList[T]() as breakList[T](li: ref SinglyLinkedList[T]) but in the expanded version of that gist it then gets upset when I pass a particular SinglyLinkedList var in (I'm having trouble making a test case)
20:23:34Araqmcc: breakList2 captures a 'var T' which is illegal
20:23:54AraqbreakList fails because the object param is immutable
20:24:48*yglukhov_ joined #nim
20:25:27*yglukhov quit (Ping timeout: 246 seconds)
20:26:53*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:29:41flyxmcc: you might want to try NimYAML again, I fixed a problem with current Nim devel earlier
20:29:51*yglukhov joined #nim
20:31:21Araqdon't use an anon proc for trivial stuff and the problem disappears.
20:31:40*yglukhov_ quit (Ping timeout: 264 seconds)
20:33:02dom96mcc: in your `istail` proc just use the argument you pass into it: `n` instead of capturing the `li` argument from the outer proc.
20:33:25dom96(you should be able to make the `istail` proc's argument a 'var')
20:35:48*yglukhov quit (Read error: Connection reset by peer)
20:37:25*fowl quit (Ping timeout: 250 seconds)
20:39:53*yglukhov joined #nim
20:41:57*yglukhov quit (Read error: Connection reset by peer)
20:42:09*yglukhov joined #nim
20:44:14*yglukhov quit (Read error: Connection reset by peer)
20:44:45*yglukhov joined #nim
20:47:21*yglukhov quit (Read error: Connection reset by peer)
20:49:57*endragorr quit (Ping timeout: 246 seconds)
20:50:08*yglukhov joined #nim
20:50:43cheatfateand when can we wait 0.14.0?
20:50:46cheatfatetomorrow?
20:51:13dom96today, hopefully
20:53:50*yglukhov quit (Read error: Connection reset by peer)
20:53:52mccOkay-- so let's say I take out the inner proc. I now wind up with : https://gist.github.com/mcclure/dc60d39040ea85f814986e7ecf6f32a4 I find if I declare the variable as "var" it works fine, but if I declare it as "ref" it gets upset that I am not passing in a ref at the call site (incompatible type). I would like to be able to pass objects to functions and
20:53:52mccallow the function to modify the object without modifying which object is pointed to. Is this misunderstanding something about nim's model?
20:54:22mccI get that initSinglyLinkedList is returning an object and not a ref object, but I'm not sure how to turn "stack" into a ref to stack.
20:54:53*Mat4 quit (Quit: Leaving)
20:54:54dom96you shouldn't, you should use a 'var'
20:56:31cheatfatedom96, there is a problem in nim-0.13.0 x64 distro
20:56:42cheatfatedom96, for some reason it has 32bit gdb
20:56:57cheatfatei mean windows version
20:57:45mccdom96: Okay. Granting that "var" is the preferred way to do this in nim and I should not try to fight the language-- let's say at some point in the future I *do* need to turn a T into a ref T. How does one do this? I see there's "addr" but that's for ptrs not refs.
20:58:25mccAlso, I'm still a little confused what the difference is between a T and a ref T-- would it be correct to say that T is allocated "on the stack" and is passed around as a whole structure by value, whereas "ref" is an allocated object managed by the garbage collector?
20:58:33dom96mcc: You can't. At least not in the traditional sense.
20:58:49mccIe, "T" is like a struct in C# and "ref T" is like an object in C#?
20:58:50dom96For example, in Java, how do you turn an primitive type into an object?
20:59:06cheatfate^^^ somebody needs to write issue about Nim's memory model
20:59:31*dom96 hopes his book explains it fairly well
21:00:28*yglukhov joined #nim
21:00:48*fowl joined #nim
21:00:57mccWell, in Java, you would not because last I checked it does not have value record/product types. In C# however if you had an object-type record and wanted a value-type record you would create a new value-type record by copying all the values out of the object-type record.
21:01:33mccSo I guess I'm trying to figure out what the Nim equivalent of X x; X *x2 = new x; memcpy(x2, &x, sizeof(X)); would be.
21:01:35cheatfatedom96, i dont think book helps, just because its not free...
21:01:35*Demon_Fox joined #nim
21:02:02mccIs the book available currently? :O
21:02:18tautologicoyes, as a MEAP
21:02:22*couven92 joined #nim
21:02:36tautologicolook at the nim-lang.org site, there is a link to the book
21:02:41mccThanks
21:03:02Araqcheatfate: that's because I only got 32 bit GDB to work at all.
21:03:43dom96mcc: you could wrap it in a 'ref' type: type FooRef = ref object; foo: Foo
21:03:57dom96And yes, in Java you can't define your own value types.
21:04:01dom96But value types do exist
21:04:12cheatfateAraq, we can get it from http://mingw-w64.org/doku.php/download
21:04:44dom96Java provides "wrapped" versions of each of them though AFAIK
21:04:47Araqwell I wanted to have a GDB that doesn't include a whole fucking Python distro
21:04:55dom96So 'int' exists as an 'Integer'
21:05:01dom96so that you can use it in generics
21:05:29dom96I wonder if lldb works on Windows yet
21:05:31Araqmcc: new(x); x[] = y
21:05:46mccAraq: Ohh, I see.
21:06:02cheatfatedom96, not works
21:06:13Araqcheatfate: we can however decide to not ship GDB at all then.
21:06:25dom96cheatfate: what doesn't?
21:06:37cheatfatedom96, lldb still not working on windows
21:06:54dom96ahh
21:07:10cheatfateAraq, but why?
21:07:18*fowl quit (Ping timeout: 272 seconds)
21:07:43dom96Araq: Let's just tell people they need to use Visual Studio :P
21:09:05cheatfatedom96, Its very hard to debug in Visual Studio... just because you debugging not nim files but C files
21:09:43*fowl joined #nim
21:10:32TheLemonManone could produce sourcemaps along with the c file...
21:10:47mccflyx: Hello, thanks, I just did `nimble refresh && nimble install nimyaml` (is there a better way to update an existing package?), it says I now have yaml-0.5.1, I still see the `c:\users\andi\.nimble\pkgs\nimyaml-0.4.0\yaml.nim(542, 45) Error: undeclared identifier: 'JsonNode'` error however. A thing that is interesting to me is that I can check out nimyaml
21:10:47mccfrom github and when I run the tests they run fine, so maybe I have just misconfigured something :(
21:11:30cheatfateTheLemonMan, you can but it not very useful, because you watching not nim variables but c variables
21:11:40dom96mcc: you might need to install the HEAD: nimble install yaml@#head
21:11:50dom96by default nimble installs the latest tagged version
21:11:55TheLemonManwell it's still better than nothing heh
21:12:23cheatfateTheLemonMan, mostly unusable.... as gdb...
21:12:30dom96I wasn't really serious about Visual Studio, but to be fair I doubt GDB is much better.
21:12:43dom96somebody should step up and maintain ENDB ;D
21:12:48TheLemonMandon't be so negative
21:13:37mccdom96: hm. when i enter that command it says "yaml-0.5.1 already exists. Overwrite? [y/N]". which implies 0.5.1 is head?
21:14:24dom96mcc: hrm, you're right it does imply it. They likely share the same version, but they're not the same.
21:14:31dom96I guess Nimble needs to be smarter here
21:14:44mccat any rate saying "yes" and installing over 0.5.1 left the problem the same.
21:15:14mccHere is a question. When I say "import yaml", how is it performing the search by which it eventually finds nimyaml? It just sorta somehow... finds anything nim installs, but I don't know how to tell it where to find my own packages.
21:15:31mcci mean anything nimble installs
21:15:33dom96I bet it's because nimyaml was renamed to yaml recently.
21:15:49dom96The way it works is that Nimble installs packages to ~/.nimble/pkgs
21:15:59mcci did not have this problem with the other package i have so far installed via nimble (sdl2)
21:16:05dom96C:/Users/name/.nimble or something on Windows
21:16:28dom96you might find that there are now both `nimyaml` and `yaml` in there
21:17:20dom96As for how Nim finds those: its configuration file contains "--nimblePath:~/.nimble/pkgs", which instructs it to scan that directory for packages.
21:17:23mccI ls /c/Users/Andi/.nimble/pkgs/ and get "nimble-0.7.0 nimPNG-0.1.5 nimyaml-0.4.0 sdl2-1.1 yaml-0.5.1"
21:17:44dom96try removing nimyaml-0.4.0
21:17:52*fowl quit (Ping timeout: 250 seconds)
21:17:56mccok
21:19:15mcchah! `c:\users\andi\.nimble\pkgs\yaml-0.5.1\yaml.nim(555, 45) Error: undeclared identifier: 'JsonNode' ` So, progress, the error is now occurring on a different line.
21:19:50dom96At least now you can be sure that it's using the right package :)
21:20:14dom96In the future Nimble will prevent this from happening.
21:20:29dom96In your case both `nimyaml` and `yaml` export a `yaml` module.
21:20:51dom96This obviously leads to a problem as you saw, too bad your error still isn't fixed :\
21:21:03mcci see! :O
21:22:48mccthe thing that puzzles me here is that if I grep the yaml-0.5.1 directory, there is in fact no "JsonNode" type declared anywhere that I can see. unless i'm getting tripped up by nim's case insensitivity thing.
21:23:05mccso this implies to me that JsonNode is vended by some other module which perhaps nimble should have installed but did not get installed?
21:23:45dom96JsonNode is defined in the standard library module `json`
21:24:34dom96maybe you need to `import json`?
21:24:52dom96do you see a "instantiation from here" above the error message?
21:25:21mcc...oh, WOW
21:25:25mcci found the problem and it's WEIRD
21:25:45mccso, i added to the top of *my* program "import json"
21:25:49mccI got the error "a module cannot import itself"
21:25:59dom96ahhh
21:26:02mccThe file containing the source of the program I was trying to run was "json.nim"
21:26:05dom96you named your module 'json'?
21:26:08dom96yeah...
21:26:13mccI renamed it to "unjson.nim" and everything worked fine
21:26:26dom96the compiler needs to handle these cases better
21:26:34mccApparently, I was trying to import yaml, which imported another module of which I was unaware, but which namespace collided with one of my own modules
21:27:08dom96mcc: which version of Nim are you using?
21:27:56flyxmcc: you need to run at latest Nim devel, otherwise nimyaml does not work.
21:28:06mccuhh, i built it myself from source because i needed some sort of thread-related fix that isn't in a released version. git commit 0ef391b4ccda5d9 ?
21:28:13flyxmcc: JsonNode is from Nim's json package which saw some changes since the last Nim release
21:28:44mccflyx it looks like the problem was i named my source file json.nim. if i rename my source file it works.
21:29:04flyxah, that's unfortunate
21:29:12mcci think i am going to file this as an issue on Nim
21:29:16dom96mcc: There were some recent changes to path handling of modules
21:29:40mcci think i might have also seen this problem with the nim i installed from the website however
21:29:45dom96Could you revert the name, update Nim to the latest from devel, bootstrap the compiler and try again?
21:29:52dom96It's possible that this was fixed
21:30:04mccokay. does "recent" mean "more recent than may 30"?
21:30:08dom96yeah
21:30:10mccok
21:31:40mcc`git clean -xffd && ./koch.exe boot -d:release` should do it right?
21:31:45flyxI'm off to bed, but if you encounter more yaml errors, just post them here, I'll see them tomorrow
21:31:52mccthank you very much flyx
21:32:15*yglukhov quit (Remote host closed the connection)
21:32:21dom96hrm, not sure what 'clean' does exactly. I would just do: `git pull origin devel'
21:32:29dom96then: ./koch boot -d:release
21:32:37fredrik92no, mcc you're right!
21:32:55mccno, sorry. i mean, the git clean will delete the compiler i already built
21:33:00fredrik92put on -n
21:33:05mcc(assuming pull already done)
21:33:13fredrik92but yes, it will! :)
21:33:18dom96you don't need to do that
21:33:29dom96./koch boot will overwrite the compiler anyway
21:35:16mccok good to know
21:35:38Araqyup, that bug mcc experienced was finally fixed.
21:35:40mccmaybe I'm a little overly paranoid about building compilers without cleaning them D:
21:36:07Araqthough originally it was a feature that you could override the stdlib's modules.
21:36:51fredrik92mcc, know what you mean... I do that all the time as well! :-D
21:36:57dom96Araq: does this mean that I can finally create a module called 'system.nim'? :P
21:37:08Araqpossibly.
21:37:12*|2701 joined #nim
21:37:18Araqyeah, I think so.
21:37:20mccthat sounds like a potentially nice feature but probably one that needs protection to make sure it is not triggered by accident.
21:37:21fredrik92(and always with -n first to see if I don't delete sth important... :D )
21:37:55dom96For the past 5 years Nim has been bootstrapping fine without the need to clean for me ;)
21:38:08mcc...yeah... the git clean was not a super good idea... it deleted koch :P
21:38:12dom96But I can imagine that some projects may have problems with that...
21:39:30mccokay! building with a june 5 nim checkout it works now. thanks :O
21:39:30fredrik92Well... It's a trick I picked up at university, the CS TAs generally want their hand-ins with source code only and no binaries... git clean before handin usually does the trick
21:40:00mcchere is a question though. *why* did that work? Like, are the stdlib modules just special cased now?
21:41:08mccIn other words, let's say I install a package from nimble "fizz" which happens to export a module "buzz", but I do not know this, and I name my program "buzz.json" and buzz.json does import fizz. Will the compiler get confused about buzz.nim in my local directory and buzz.nim in ~/.nimble/pkg?
21:41:30dom96fredrik92: just make sure not to `git add` the binaries? better yet, ensure they are in your .gitignore? :P
21:42:29dom96mcc: it shouldn't anymore, I think the bug fix that Araq did solved this problem.
21:43:02fredrik92dom96, of course, but we hand in via some god-awful thing called Fronter where we upload a .zip (or .tar.gz if you'd favor that)
21:43:19dom96mcc: this seems to be the line in the news for it: https://github.com/nim-lang/Nim/blob/devel/web/news/version_0_14_released.rst.todo#L41
21:43:22mccok cool thanks
21:43:29dom96We need to add more info to that I think, or at least a link...
21:43:53mccfredrik92 / dom96 I am pretty sure there is a git command that exports the repository (but only checked in files) as a .zip. I forget what it is because I use hg mostly.
21:43:59mccin hg it's hg archive...
21:44:05dom96Maybe if you search around for those keywords on github you will find something, please give me a link if you do :)
21:45:16mccthank you for the help dom96
21:45:23dom96np
21:45:27cheatfateAraq, currently we have {.passC.} {.passL.} to pass options to C compiler, could we have something for Nim itself too?
21:45:31mccalso looks like after upgrading math.round now returns a float64 and not an int *_* ok
21:45:32dom96It was fun :)
21:45:47dom96yeah, that's one of the breaking changes I'm afraid
21:45:52mccok
21:46:06mccare breaking changes between nim releases common?
21:46:24mccmaybe i should start documenting in my projects which version of nim i compiled with.
21:46:48cheatfateAraq, so i can use in my source something like {.passNim: "--path:"$projectdir".}
21:47:00fredrik92mcc, you could of course always use `git ls-files` to call the respective tar command...
21:47:09dom96not really, definitely less than with other projects. But sometimes it's just easier to break something rather than spending time cluttering up the stdlib with more deprecated things.
21:47:40dom96In general we do try to deprecate things though, even though we're still not at 1.0
21:47:57mccnodnod
21:48:16dom96cheatfate: we do have something, but not in the source, create a file.nim.cfg file and place the options in there.
21:48:51cheatfatedom96, i know about .nim.cfg... the problem is i need to create many .nim.cfg files for every file i'm trying to use
21:49:11cheatfateso it will be very nice to have {.passNim.} macro
21:49:27dom96cheatfate: but you'll end up putting it in every file anyway
21:49:36dom96the nim.cfg files are project-wide
21:49:42*yglukhov joined #nim
21:51:11Araqcheatfate: no you don't, you only need a single nim.cfg
21:51:23Araqthat's used for every *.nim file in the same dir
21:52:22cheatfateAraq, ^^^^ its something better than filename.nim.cfg, but {.passNim.} would be better just because you dont need to switch from editor to something else
21:52:47Araqagreed and it would be very useful for Nimble builds
21:53:11Araqso that a Nimble package can influence compilation more rather than relying on the importer to fixup his config
21:54:48*yglukhov quit (Ping timeout: 272 seconds)
21:55:55dom96that's true, that would be a good use case for it
22:03:26*akaisora_ joined #nim
22:03:29akaisora_hello
22:04:51*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
22:05:09dom96hi akaisora_
22:08:39*elrood quit (Quit: Leaving)
22:12:32akaisora_dom96: hi!
22:12:59Araqdom96: so ... do I need to ensure 2 nimble paths work?
22:13:05Araqfor the upcoming release?
22:13:15*PMunch quit (Ping timeout: 260 seconds)
22:13:34dom96Araq: I think I just did, they seem to be working
22:13:38dom96you can double check if you want
22:13:44dom96I'm a tad stuck
22:14:00dom96I'm not entirely sure how the AUR script works
22:14:10akaisora_do you use tcc?
22:14:20akaisora_i'm having a general look at nim's source
22:14:44Araqdom96: ah cool, I now see clearly that my code should work. great, nothing to change.
22:15:44mcc... so... here is a question. I am using "nimlime" in sublime text. at the moment, when i save something in sublime text, i get about 10 warnings. when i run nim at the command line, i get 0 warnings. if i intentionally add warn-worthy code i start getting warnings at the command line, so i think this is because nimlime is using an older version of nim and
22:15:44mccthe newer version has stopped considering these 10 warnings warnings.
22:15:48mcc(they do seem a little spurious.)
22:16:28*fowl joined #nim
22:16:43mccAny idea how nimlime finds its nim executable?
22:17:54*yglukhov joined #nim
22:18:00cheatfatemcc, NimLime uses "nim c --verbosity:2 yourfile.nim"
22:18:18cheatfatemcc, you can check "check.on_save.verbosity" parameter in NimLime.sublime-settings
22:18:55cheatfateso you can run nim c --verbosity:2 yourfile.nim to get same list of warnings
22:19:06mcccool.
22:19:21cheatfatewhat happens with Varriount, i miss him
22:20:03mccthat did it yeah
22:20:41mcc...also i am more than a little confused how it found nim since it is not in the Windows system %PATH%, only in my msys2 $PATH. maybe since i launched sublime from msys it inherited the env vars D:
22:20:50*couven92 quit (Ping timeout: 260 seconds)
22:21:58cheatfatemcc, just add nim\bin path to your system path
22:22:06cheatfatesystem PATH variable
22:22:12cheatfateor user PATH variable
22:22:13mccoh! it's not bad, it's just mysterious :)
22:22:16*yglukhov quit (Ping timeout: 250 seconds)
22:22:23dom96akaisora_: we don't really use it nowadays
22:22:55*Trustable quit (Remote host closed the connection)
22:23:03*fredrik92 quit (Ping timeout: 240 seconds)
22:23:33mccso-- i have many warnings at verbosity:2 warning various function call sites are "not GC safe". all the call sites seem to be at the nim toplevel (ie just sitting out there in the .nim file). Is that bad for some reason? :O
22:24:42mccI mean, the warnings I need are the ones that tell me that I called a GC-unsafe function from a thread other than the main thread. But it seems like the top level must be the main thread...?
22:25:06Araqwell these are procs that won't compose later on
22:25:19Araqso it's a warning for --verbosity:2
22:25:34mccokay, i see
22:25:38Araqthere is a reason --verbosity:1 is the default.
22:25:47mccunderstood
22:27:35mcc...okay and i see calling a gc-unsafe function from a gcsafe function *is* a verbosity-1 warning. cool.
22:37:28*fastrom quit (Quit: Leaving.)
22:42:27*yglukhov joined #nim
22:44:22*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:46:41*yglukhov quit (Ping timeout: 240 seconds)
22:52:36cheatfateSo, we get {.passNim.} someday?
22:52:45cheatfateOr i need to create issue future request?
22:54:24Araqwe to think it through
22:57:06mccI wonder how hard it would be to get NimLime to where if you cursor over a symbol, it tells you the type in the status bar.
22:57:19mccThe TypeScript plugin (and I think the ocaml plugin?) has that feature and it's super nice.
22:59:33dom96sounds cool
22:59:39*dom96 might attempt to add that into Aporia
22:59:57mccwhat is aporia?
23:00:17dom96The Nim "IDE": http://github.com/nim-lang/Aporia
23:00:21mccah
23:02:38cheatfatemcc, you can ask Varriount on forum, he is still active there
23:02:49mcccool
23:03:29mccdo you think poking on forum or filing a github issue would be more likely to reach him?
23:04:16cheatfatemcc, i think its better to try both :)
23:06:53mcc'k
23:06:59*bjz joined #nim
23:08:42*bjz quit (Max SendQ exceeded)
23:09:24*bjz joined #nim
23:17:04*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:18:44*yglukhov joined #nim
23:21:59*|2701 quit (K-Lined)
23:23:11*yglukhov quit (Ping timeout: 258 seconds)
23:28:34cheatfatei dont know why everybody so like this `clang`... compiled executables becomes much slower, than `gcc` with same code
23:29:40*xet7 joined #nim
23:30:35cheatfateBSD's kqueue is faster, than linux's epoll by design, but `clang` usage make it even slower than epoll
23:33:40dom96def-: why not post your Nim articles here? :)
23:34:59*Matthias247 quit (Read error: Connection reset by peer)
23:35:55def-dom96: I'm not sure if it's good. I wrote most of it 1.5 years ago and found it again today and finished it up
23:36:42dom96def-: looks good, although i'm too tired to read it all now. I posted it to HN btw.
23:36:50def-ah, thanks
23:37:18dom96and tweeted about it :)
23:42:39cheatfatedef-, its a nice article, but for some reason everybody just omit to show power of simple templates
23:43:32cheatfatedef-, i think, it would be good to show how to use and make templates like `withLock`...
23:44:10def-cheatfate: sounds like a 3-liner
23:44:22cheatfate3-liner?
23:44:33def-implementing withLock
23:45:47def-but it's a good idea, i'll see if I can come up with something nice
23:45:55cheatfateyeah, i know but it shows some power of templates, and you not find any information about this
23:48:15cheatfatedef-, https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/sharedtables.nim#L48-L99 this is not 3-liner
23:48:36def-hah, looks exactly like what I just wrote :)
23:52:21cheatfatei think `macros` is like surgical scalpel, you can do with them almost everything but it takes time, `templates` are like simple knife, so you can cut your `bread` much easily
23:54:08cheatfatealso i think we need an issue about interaction between `shared` and `gc` memory... because this `protect & dispose` functions never covered even in manual...
23:55:04*yglukhov joined #nim