<< 28-03-2016 >>

00:06:41*nicktick quit (Quit: Leaving.)
00:15:14*mahasamoot quit (Ping timeout: 244 seconds)
00:20:04*vendethiel joined #nim
00:23:17Varriountcheatfate: https://gist.github.com/Varriount/1c93a6e1e9beb774def4
00:27:18*mahasamoot joined #nim
00:43:42*vendethiel quit (Ping timeout: 248 seconds)
00:44:11*Demon_Fox quit (Quit: Leaving)
00:50:03*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
01:03:14*gokr quit (Quit: Leaving.)
01:14:11*vendethiel joined #nim
01:18:47*perturbation quit (Quit: Leaving)
01:34:26*yglukhov joined #nim
01:38:44*yglukhov quit (Ping timeout: 250 seconds)
01:40:26*bjz joined #nim
02:09:47*filwit quit (Quit: Leaving)
02:16:59*vendethiel quit (Ping timeout: 260 seconds)
02:38:39*BitPuffin|osx quit (Ping timeout: 276 seconds)
02:46:02*Demon_Fox joined #nim
03:09:43*desophos quit (Read error: Connection reset by peer)
03:15:19*bjz_ joined #nim
03:16:15*bjz quit (Ping timeout: 246 seconds)
03:36:02*yglukhov joined #nim
03:40:37*yglukhov quit (Ping timeout: 260 seconds)
03:44:27*brson joined #nim
04:03:12*bjz_ quit (Ping timeout: 268 seconds)
04:09:07*bjz joined #nim
04:52:03*endragor joined #nim
04:59:46*bjz_ joined #nim
05:00:26*bjz quit (Ping timeout: 244 seconds)
05:03:44*lqdc joined #nim
05:05:46*sarlalian quit (Ping timeout: 252 seconds)
05:10:50*sarlalian joined #nim
05:12:48*lqdc quit (Ping timeout: 250 seconds)
05:25:06*brson quit (Quit: leaving)
05:31:05*Varriount quit (Disconnected by services)
05:31:05*Varriount_ joined #nim
05:35:39*endragor quit (Remote host closed the connection)
05:37:31*yglukhov joined #nim
05:38:19*endragor joined #nim
05:41:33*yglukhov quit (Ping timeout: 240 seconds)
05:50:07*Demos quit (Ping timeout: 260 seconds)
06:15:38*endragor_ joined #nim
06:18:58*endragor quit (Ping timeout: 244 seconds)
06:28:04*Demos joined #nim
06:30:28*endragor_ quit (Remote host closed the connection)
06:30:56*endragor joined #nim
06:33:08*Demon_Fox quit (Quit: Leaving)
06:41:58*rok joined #nim
07:34:37cheatfateVarriount_, add "var a = initQueue[int]()" to the end of your file and try to compile your code with "--threads:on"
07:38:05Varriount_cheatfate: Updated. I forgot to add some type parameters.
07:38:14*Varriount_ is now known as Varriount
07:42:30cheatfateVarriount, if you are using createShared, why you are not using freeShared
07:45:30cheatfateallocShared/deallocShared and createShared/freeShared
07:45:31Varriountcheatfate: At least current, both deallocShared and freeShared are the same thing.
07:45:51cheatfatebut createShared and allocShared are also the same thing
07:46:50cheatfateSo i think its better to use functions from on family then from both, even if they are equal
07:47:03*fredrik92 joined #nim
07:47:18cheatfate*from one family
07:48:42Varriountcheatfate: They all allocate from the same memory pool. The reason I use createShared is that it does the casting and size calculation for you.
07:49:20VarriountI kept in deallocShared because that is what was originally used.
07:49:41*dorei joined #nim
07:49:57*couven92 joined #nim
07:51:20cheatfateVarriount, if you look standart library for "createShared" the only place, where you will find it, is - system.nim
07:52:29Varriountcheatfate: Yes. So?
07:53:44cheatfateVarriount, my code was taken from here https://github.com/nim-lang/Nim/blob/crazy_concurrency/lib/pure/collections/sharedlist.nim
07:53:51*fredrik92 quit (Read error: Connection reset by peer)
07:54:08*fredrik92 joined #nim
07:54:19*boopsies is now known as boopsiesisaway
07:55:05*yglukhov joined #nim
07:55:12cheatfateVarriount, look line 67
07:56:15Varriountcheatfate: Ok...? All I see is an equivalent, if slightly more verbose and complex procedure.
07:59:47cheatfateVarriount, forget it, my english is too bad, to try to to explain my minds about styles of code
08:01:27*endragor quit (Remote host closed the connection)
08:09:09cheatfateVarriount, but how to make this Queue GC friendly because currently default GC could not work properly with lists
08:09:26cheatfateVarriount, i mean singlethreaded variant
08:15:39*endragor joined #nim
08:17:52cheatfateVarriount, about GC friendly https://github.com/nim-lang/Nim/issues/3793
08:33:28*irrequietus joined #nim
08:33:37*irrequietus quit (Changing host)
08:33:38*irrequietus joined #nim
08:38:24*lqdc joined #nim
08:39:16*rok quit (Quit: rok)
08:40:01*irrequietus quit ()
08:52:46*chrisheller quit (Remote host closed the connection)
08:52:56*Arrrr joined #nim
08:55:30*fredrik92 quit (Ping timeout: 268 seconds)
09:01:46*nicktick joined #nim
09:19:24*veganskaway is now known as vegansk
09:19:33*wuehlmaus joined #nim
09:39:35cheatfateAraq, is it possible to have items() iterator for sharedtables.nim like it was made in sharedlists.nim / tables.nim?
09:40:14Araqcheatfate: sure thing. I implemented what I needed for sharedtables
09:40:36Araqhowever,as I said lots of things are also missing to discourage races
09:42:13cheatfateYesterday you give me nice idea about deadlock i have, but currently i'm adopting simple select() (when no epoll/kqueue/iocp available) and this mechanism doesnt return any identifiers so i need to iterate over all my descriptros and FD_ISSET them with result of select
09:46:51*filcuc joined #nim
09:46:59Araqvegansk: good news. seems like your closure bug is next on my list ;-)
09:47:30veganskAraq, glad to hear it!! :-)
09:48:38filcucstupid question, when return the string for dynlib is there a way for giving two options?
09:48:57filcuclike "mylib.dll|libMyLib.dll"
09:49:38Araqfilcuc: exactly like you propose except you need ()
09:50:12Araqor you can simplify it: "(mylib|libMylib).dll"
09:50:51Araqbut I would beat the crap out of the people who think Win needs a pahetic "lib" prefix like on Poonix
09:58:37*yglukhov quit (Remote host closed the connection)
09:59:55*yglukhov joined #nim
10:33:45*alexsystemf_ quit (Quit: Connection closed for inactivity)
10:42:15*filcuc quit (Ping timeout: 276 seconds)
11:04:04*endragor quit (Remote host closed the connection)
11:14:40*autumnl_ joined #nim
11:17:49*vendethiel joined #nim
11:20:19*Arrrr quit (Ping timeout: 252 seconds)
11:24:53*endragor joined #nim
11:27:33*couven92 quit (Ping timeout: 240 seconds)
11:37:50*Arrrr joined #nim
11:41:08*couven92 joined #nim
11:41:23*vendethiel quit (Ping timeout: 248 seconds)
11:43:49*freddy92 joined #nim
11:46:00*nicktick1 joined #nim
11:46:36*Arrrr quit (Ping timeout: 276 seconds)
11:46:56*couven92 quit (Ping timeout: 268 seconds)
11:49:33*nicktick quit (Ping timeout: 240 seconds)
11:53:36*Arrrr joined #nim
11:54:18*couven92 joined #nim
11:55:25*vendethiel joined #nim
11:57:52*freddy92 quit (Ping timeout: 244 seconds)
12:14:10*BitPuffin joined #nim
12:23:46*Gonzih joined #nim
12:46:48*darkf quit (Quit: Leaving)
12:49:07*arnetheduck joined #nim
12:51:24*nicktick1 quit (Read error: Connection reset by peer)
12:53:05*chrisheller joined #nim
12:57:40*chrisheller quit (Ping timeout: 252 seconds)
13:07:52*Ven joined #nim
13:28:54*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:41:58*Matthias247 joined #nim
13:49:36*filcuc joined #nim
14:04:01*saml joined #nim
14:08:04*autumnl_ quit (Ping timeout: 260 seconds)
14:18:37*pregressive joined #nim
14:21:50*pregressive quit (Remote host closed the connection)
14:23:08*pregressive joined #nim
14:45:39Varriountcheatfate: Then use dynamic arrays.
14:46:19cheatfateVarriount, you mean seqs?
14:46:48VarriountPossibly.
14:48:45*pregressive quit (Read error: Connection reset by peer)
14:49:11*pregressive joined #nim
14:59:15*arnetheduck quit (Ping timeout: 244 seconds)
15:16:24cheatfateVarriount, but you cannot use seqs because they using gc'ed non-shared memory
15:20:28*yglukhov quit (Remote host closed the connection)
15:28:36*dorei quit (Quit: Page closed)
15:28:36*Trustable joined #nim
15:32:11*filcuc quit (Quit: Konversation terminated!)
15:37:01*pregressive quit (Remote host closed the connection)
15:40:42*Ven joined #nim
15:56:18couven92how do I write a when that checks the build configuration that is specified with nim -d:<configuration>?
15:57:30*pregressive joined #nim
15:59:35*chrisheller joined #nim
15:59:50couven92when debug: does seem to work... :O
16:00:41couven92ah, no... when debug: does NOT work... :-/
16:00:42dom96couven92: when defined(release)
16:01:06couven92dom96, ah! Thx :-)
16:12:44dom96np :)
16:19:42*ozra joined #nim
16:20:16*sorakun joined #nim
16:24:34*Trustable quit (Remote host closed the connection)
16:25:20*Trustable joined #nim
16:25:50*pregressive quit (Remote host closed the connection)
16:27:28*pregressive joined #nim
16:28:45dom96Anybody got experience with GNU's build system? https://twitter.com/d0m96/status/714488850786164736
16:33:56ArrrrI had a bad experience
16:40:33cheatfateyeah make is something from the hell, and this guys dont like nim's 2 spaces :D
16:52:57*couven92 quit (Quit: Shutting down . . .)
16:54:22*brson joined #nim
16:58:56*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:01:12*endragor quit (Ping timeout: 246 seconds)
17:02:28dom96:)
17:02:34dom96I beat it into submission
17:07:00*Demon_Fox joined #nim
17:07:57ArrrrDid i imported this function in a wrong way?
17:08:01Arrrrproc SetConsoleCursorInfo(fl: cint, info: var (int, bool)): int {.stdcall, dynlib: "kernel32", importc.}
17:08:05Arrrrhttps://msdn.microsoft.com/en-us/library/windows/desktop/ms686019(v=vs.85).aspx
17:08:29ArrrrIm calling it with:
17:08:38Arrrrvar info = (1, false);SetConsoleCursorInfo getFileHandle(stdOut), info
17:13:07dom96Arrrr: The tuple looks problematic
17:13:14dom96define an object
17:14:10Arrrrmm ok ill try
17:15:10*desophos joined #nim
17:16:11Arrrrno changes, i dont know what's the matter
17:17:17dom96also try ptr T instead of var T
17:18:59ArrrrNothing, i put ptr in the signature and callit it with addr(info)
17:19:40cheatfateArrrr, try to do sizeof(info) before you passing it to function
17:19:44*dorei joined #nim
17:20:21Arrrrok
17:20:24cheatfatebecasue nim's bool != windows bool... BOOL = cint
17:20:44Arrrryes, but i defined it with int32
17:21:03cheatfatei saw this: proc SetConsoleCursorInfo(fl: cint, info: var (int, bool)): int {.stdcall, dynlib: "kernel32", importc.}
17:21:09Arrrrit gives me 8
17:21:33ArrrrWell, int. In my computer int == int32
17:21:56dom96You sure dword == int?
17:22:11cheatfatedword = int32
17:22:14cheatfatebool = dword
17:22:41ArrrrIn nim is defined like that https://github.com/nim-lang/Nim/blob/devel/lib/windows/winlean.nim#L36
17:23:13dom96You should use the types defined in winlean anyway
17:23:32cheatfateyeah, but DWORD = uint32 not int32
17:24:03cheatfateArrrr, do you use mingw?
17:26:13Arrrryeo
17:26:17cheatfateArrrr, and what you get with GetLastError()?
17:26:33cheatfateor you get exception?
17:28:11ArrrrI get nothing, and i didnt try with getLasError
17:28:26Arrrrbut i can see what returns
17:29:17cheatfatethere was a problem with mingw alignment of structure members but this is too simple structure to worry about
17:29:59cheatfateSo we need to check result and getlasterror() maybe you dont have enough access rights on your `fl`
17:31:49ArrrrYes, i get 0, i'll check what gtlasterror says
17:32:34cheatfateAraq, is it possible to `break` from this iterator https://gist.github.com/cheatfate/3c672edeb590ad93990f
17:33:06dom96Arrrr: Does the procedure simply do nothing?
17:33:10dom96is that the problem?
17:33:24*enthus1ast1 joined #nim
17:33:26Arrrrmmm invalid handle i get
17:33:38ArrrrThat's what getlasterror tells me
17:33:58Arrrrint(getFileHandle(stdOut))
17:34:13ArrrrMaybe i can get the file handle with this proc?
17:34:14dom96what does the call to SetConsoleCursorInfo return?
17:34:20Arrrr0
17:34:28Arrrrand getlasterror 6
17:34:33*fredrik92 joined #nim
17:34:33*yglukhov joined #nim
17:34:44*enthus1ast quit (Ping timeout: 268 seconds)
17:36:10cheatfateArrrr, and how you obtain your `fl`?
17:36:29cheatfateArrrr, GetStdHandle(STD_OUTPUT_HANDLE)?
17:36:33dom96cheatfate: getFileHandle(stdOut)
17:36:48dom96but yeah, try copying this code verbatim http://stackoverflow.com/a/20021332/492186
17:36:57dom96(translating to Nim of course)
17:38:05*enthus1ast1 quit (Client Quit)
17:38:35ArrrrWell ... i'll get that GetStdHandle
17:38:55*yglukhov quit (Ping timeout: 244 seconds)
17:40:08Araqcheatfate: yeah why wouldn't it?
17:40:20cheatfateAraq, it will not release lock :(
17:40:33Araqput it in a try finally
17:40:47cheatfateand raise exception?
17:42:01Arrrryay, it works!: GetStdHandle(-11)
17:42:06ArrrrTHank you dom96 and cheatfate.
17:42:08*fredrik92 quit (Ping timeout: 268 seconds)
17:42:13Araqno withLock should use try finally or 'defer'
17:42:44*enthus1ast joined #nim
17:45:47cheatfateAraq, thanks it helps
17:47:03*enthus1ast quit (Ping timeout: 246 seconds)
17:54:55cheatfateArrrr, where you found getFileHandle() ?
17:57:38*sora_kun joined #nim
17:57:38*sorakun quit (Ping timeout: 250 seconds)
17:58:55*Sembei joined #nim
18:01:21*desophos quit (Remote host closed the connection)
18:08:46*alexsystemf_ joined #nim
18:09:32*Ven joined #nim
18:14:51*desophos joined #nim
18:15:21*yglukhov joined #nim
18:16:23ArrrrIt is defined in system
18:23:11*fredrik92 joined #nim
18:24:04*Varriount quit (Ping timeout: 268 seconds)
18:26:11*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:37:11cheatfatei hate this withLock macro
18:37:21cheatfatesomebody needs to delete it from locks
18:48:03*drewsrem joined #nim
18:48:39drewsremCan someone give me a hint what I'm supposed to pass as fn here? https://github.com/nim-lang/Nim/blob/master/lib/pure/colors.nim#L70
18:49:58reactormonkdrewsrem, Color -> Color -> Color
18:50:29drewsremreactormonk, I still don't get it
18:51:08drewsremreactormonk, I sort of expected passing an anon proc, but instead I pass ...?
18:51:46*yglukhov quit (Remote host closed the connection)
18:54:08drewsremreactormonk, I really only know -> from do-notation
19:02:56*yglukhov joined #nim
19:05:21*drewsrem quit (Quit: Leaving)
19:20:21dom96drewsrem: Basically a procedure which takes two Color parameters and returns a Color.
19:20:40dom96reactormonk: not everyone is familiar with Haskell
19:24:56*drewsrem joined #nim
19:25:42drewsremdom96, thanks for the response, https://github.com/nim-lang/Nim/blob/master/lib/pure/colors.nim#L83 is this even legit syntax?
19:26:01drewsremI noticed no module makes use of mix
19:26:40dom96drewsrem: good question, never seen `bind` used that way myself.
19:26:44dom96Araq: ?
19:26:46drewsremdom96, because I tried that ofc. and it doesn't work
19:27:04dom96drewsrem: ahh, so mix doesn't work at all?
19:28:00Araqdom96: what's the question?
19:28:04drewsremdom96, http://ix.io/v2A
19:28:08drewsremI think mix is broken
19:28:22dom96Araq: what is up with that weird bind syntax? https://github.com/nim-lang/Nim/blob/master/lib/pure/colors.nim#L83
19:29:42Araqjust pass it an expression like `+`
19:30:19Araq(bind foo)(x, y) is the same as
19:30:21Araqbind foo
19:30:24Araqfoo(x, y)
19:33:45drewsremMaybe it's just on my end, or I'm still making some grave mistake: http://ix.io/v2A
19:34:25cheatfatedom96, something wrong with your locks.nim:withLock public macro
19:34:55cheatfatei have modified sharedtables.nim to use this macro (removed old one from file)
19:36:22cheatfatehttps://gist.github.com/cheatfate/51704b46b88560ced6f2
19:37:28dom96cheatfate: guess that `body` should be `stmt` not `untyped`
19:37:37dom96change it in core/locks and see if that helps
19:38:11*yglukhov quit (Remote host closed the connection)
19:39:35cheatfatedom96, same shit
19:40:16cheatfatei will try to make reproducable source
19:45:15cheatfatehttps://gist.github.com/cheatfate/a81079b5231bd7876869
19:45:28*fredrik92 quit (Ping timeout: 268 seconds)
19:46:06cheatfatethis is copy of sharedtables.nim with removed own withLock macro and added some code at the bottom
19:47:20*fredrik92 joined #nim
19:47:20*fredrik92 quit (Client Quit)
19:59:39*gokr joined #nim
20:00:03*yglukhov joined #nim
20:26:17dom96cheatfate: sorry, i'm not sure what the problem is.
20:26:17dom96Seems to be some weird interaction between templates
20:31:02*yglukhov quit (Remote host closed the connection)
20:38:28*BitPuffin quit (Read error: Connection reset by peer)
20:42:23*Arrrr quit (Read error: Connection reset by peer)
20:44:46*sora_kun quit (Remote host closed the connection)
20:51:19*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:57:28*yglukhov joined #nim
21:16:36Araqbody needs to be untyped ...
21:20:10Araqcheatfate: well the expression indeed has type 'void'
21:20:22Araqthe compiler is trying to tell you the context makes no sense
21:20:51cheatfateAraq, but it untyped or stmt produces same error
21:21:20cheatfateAraq, this is your code i just removed simple variant of withLock
21:21:29cheatfateto use advanced from locks.nim
21:21:41cheatfateand got this errors
21:27:48Araqwhat makes you think they are compatible?
21:28:04Araq acquire(t.lock)
21:28:06Araqvs
21:28:15Araq a.acquire()
21:32:15*yglukhov quit (Remote host closed the connection)
21:32:46*darkf joined #nim
21:32:50*desophos quit (Remote host closed the connection)
21:33:58cheatfateomg
21:35:39*desophos joined #nim
21:37:10*PMunch joined #nim
21:38:54cheatfateits why i hate it, i'm making this mistake 2nd time, thank you
21:41:11dom96I don't get it, what is the problem in cheatfate's code?
21:42:55cheatfatedom96, https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/sharedtables.nim (lines 43-46) i have replaced with new one you can see in gist
21:43:10cheatfateso replacement was mistaken
21:43:51cheatfateIts because of 2 types of withLock's you can find in standart library :) your variant of withLock and Araq's variant of withLock... and they are not compatible :)
21:45:32dom96oh I see.
21:45:49Araqmy 'withLock' predates dom96's :P
21:45:52dom96Yeah, the error message needs to be improved here drastically.
21:45:55Araqso mine is correct
21:46:06Araqlol be my guest.
21:46:24dom96But yours doesn't verify the locks at compile-time
21:46:31dom96:P
21:46:50Araqmine is not part of any public API anyway
21:47:26dom96cheatfate: Can you create an issue with a quick code sample asking us to improve the error message?
21:49:45Araqdom96: *cough* you haven't improved a single error message afaik.
21:50:05Araqwhat's teh point in stacking up ever more "improve error messages" issues?
21:50:21Araqnobody works on this.
21:50:26Araqnobody ever worked on this.
21:51:05Araqwhat should the error message be for (foo; bar; baz; if ...).field ?
21:51:15Araqcause that's what the compiler sees.
21:51:34Araq'(foo; bar; baz; if ...)' has no type.
21:51:57dom96And once again, Araq with the encouraging words.
21:54:00cheatfateAraq, do you remember you want to make sharedtables with 'stripping locks', just want to ask you how to implement hashkeys iterator for this case?
21:54:36cheatfateis it possible to do without locking all locks?
21:55:45Araqdom96: ha, just now I got an idea how to improve the error messages ;-)
21:56:03dom96Araq: precisely
21:56:16Araqbut that's one search&replace in the compiler, that doesn't require 5 billion issues about the same
21:56:22Araqthat I then have to close
21:57:39Araqcheatfate: you need to acquire the locks one after the one, but not all at once
21:57:49Araqeven though that's ... hrm tricky
21:58:19Araqusually the growth strategy affects the locking strategy
22:06:36dom96Araq: The issues serve as a good reminder. We have ~700 issues, that's *nothing*.
22:13:35dom96But if you really want we can create a separate repo dedicated to these types of issues.
22:23:41*pregressive quit (Remote host closed the connection)
22:26:49*darkf quit (Read error: Connection reset by peer)
22:27:00*dorei quit ()
22:27:24*darkf joined #nim
23:01:43*Matthias247 quit (Read error: Connection reset by peer)
23:22:09*BitPuffin|osx joined #nim
23:51:01*ozra_ joined #nim
23:53:51*ozra quit (Ping timeout: 246 seconds)