<< 11-05-2016 >>

00:07:28*brson joined #nim
00:09:52Araq_tautologico: use a concept
00:18:51tautologicoI was looking into concepts a few minutes ago. the manual says they're still in development, how usable are they in practice?
00:22:13libmanI asked on LLVM official IRC channel (irc.oftc.net/#llvm): "Is there still a possibility of LLVM switching licenses, as someone suggested in October, or did that madness finally pass?"
00:42:37libmanLog: http://libman.org/tmp/20160510-llvm-irc.log - they don't understand the difference between BSD and Apache license :(
00:45:49libmanSuggestion: nim-lang.org could use a more noticeable favicon. I recommend putting http://libman.org/tmp/nim.png through http://www.favicon-generator.org/ and using the code it gives you.
00:48:40*yglukhov joined #nim
00:53:24*yglukhov quit (Ping timeout: 276 seconds)
00:54:20*lubos_cz joined #nim
00:55:39*libman quit (Remote host closed the connection)
01:01:41Araq_tautologico: most pressing bug is that "generic concepts" with [T] don't work, but usually that's not required
01:02:04Araq_that said, I still want to rewrite the implementation, it's goofy
01:07:40tautologicogood to know
01:08:58tautologicoI imagine there are future plans to use concepts in the stdlib?
01:33:53*brson quit (Ping timeout: 276 seconds)
01:57:56*chemist69 quit (Ping timeout: 276 seconds)
02:09:44*kseg joined #nim
02:11:12*chemist69 joined #nim
02:20:08ksegNew user, so maybe this is silly, and I know it’s trivial to write, but I feel that there should be a SeqRef type.
02:31:33*lubos_cz quit (Ping timeout: 240 seconds)
02:59:24*fastrom joined #nim
03:51:31*yglukhov joined #nim
03:55:42*yglukhov quit (Ping timeout: 246 seconds)
04:59:59*bozaloshtsh quit (Changing host)
04:59:59*bozaloshtsh joined #nim
05:16:58*kseg quit (Ping timeout: 250 seconds)
05:36:02*endragor joined #nim
05:40:17*gokr joined #nim
05:53:34*yglukhov joined #nim
05:58:26*yglukhov quit (Ping timeout: 276 seconds)
06:12:13*irrequietus joined #nim
06:35:31*endragor_ joined #nim
06:38:27*endragor quit (Ping timeout: 260 seconds)
07:01:41*yglukhov joined #nim
07:03:06*endragor_ quit (Remote host closed the connection)
07:03:34*endragor joined #nim
07:19:52*Trustable joined #nim
07:27:45*arnetheduck joined #nim
08:14:03*irrequietus quit ()
08:51:37*Arrrr joined #nim
08:51:37*Arrrr quit (Changing host)
08:51:37*Arrrr joined #nim
08:53:55*Demon_Fox quit (Quit: Leaving)
08:56:37*PMunch joined #nim
09:02:05*r4vi joined #nim
09:09:09*gokr quit (Remote host closed the connection)
09:12:36ArrrrThis now works http://pastebin.com/znvjgSCg, i think this will benefit object variants.
09:12:50ArrrrWill import follow the same road?
09:28:49*kulelu88 joined #nim
09:28:49*kulelu88 quit (Changing host)
09:28:49*kulelu88 joined #nim
09:36:45*fastrom quit (Quit: Leaving.)
09:47:36*ozra_ joined #nim
09:47:44*ozra_ left #nim (#nim)
09:54:01Araq_Arrrr: no.
09:54:21Araq_import is fundamentally different and local imports caused very big problems in D
09:55:20Araq_with local imports you can either have (a) inconsistent scoping rules or (b) error prone scoping rules
09:55:50Araq_neither of which is desirable.
10:00:35ArrrrI see
10:03:18*Senketsu quit (Ping timeout: 276 seconds)
10:27:42*zipR4ND joined #nim
10:34:23cheatfateAraq_, is while() is faster than for...yield mechanism?
10:35:47Araq_no
10:36:10*Senketsu joined #nim
10:36:18cheatfatethanks
10:55:10*lubos_cz joined #nim
11:17:03*kulelu88 quit (Quit: Leaving)
11:35:42*enthus1ast joined #nim
11:35:46enthus1asthoi
11:36:53*lubos_cz quit (Ping timeout: 265 seconds)
11:42:13*fastrom joined #nim
11:45:58*AnonCat joined #nim
11:46:14*GangstaCat quit (Ping timeout: 260 seconds)
11:51:16*elrood joined #nim
12:01:08*zipR4ND quit (Ping timeout: 276 seconds)
12:13:07*yglukhov quit (Ping timeout: 252 seconds)
12:26:53*BitPuffin joined #nim
12:36:18*yglukhov joined #nim
12:55:05kieris there any way to get the filename of the source file currently being compiled at compile time?
12:55:16kierI've looked at instantiationInfo, but that seems to only work at runtime
12:55:56kiernvm, i've just seen currentSourcePath
12:56:31*gokr joined #nim
13:01:27*yglukhov_ joined #nim
13:04:30*yglukhov quit (Ping timeout: 246 seconds)
13:50:26cheatfateAraq_, looks like nim got a problem with your latest debuginfo patches https://github.com/nim-lang/Nim/issues/4144
13:50:46cheatfatebut i have made same thing on archlinux and got no error
13:50:55cheatfatemaybe because my compiler was fresh enough
13:52:18Araq_0.13 cannot build devel.
14:01:42*saml_ joined #nim
14:01:56*AnonCat is now known as GangstaCat
14:03:50Araq_cheatfate: fixed.
14:05:33cheatfateAraq_, very fast :) nice
14:06:24cheatfateAraq_, i'm looking for advice/suggestion
14:06:55cheatfatedo you have some time to spare?
14:08:42Araq_kind of, go ahead
14:12:21cheatfatelet assign situation for asynchttpserver.nim where it already accepted socket and start waiting for request headers from client
14:12:48cheatfatefirst of all it registers with selectors.nim socket for reading data
14:13:41cheatfateand after that it registers same socket with selectors for writing data
14:14:28cheatfatefor linux epoll it results to calls to epoll_ctl() one with registering socket for reading and another for modification socket for read and write
14:15:04cheatfateso there 2 calls to kernel but it can be done with only one
14:15:52cheatfatein such case we need to maintain data structure in selectors.nim to cache modifications to sockets and pass it to kernel in select() method
14:16:18cheatfatethis will reduce kernel/user mode switches by 2x times
14:17:00cheatfateand now problem i'm looking data structure for caching this information which can work as hashtable and can iterate like array :)
14:17:46cheatfatecurrently i have only one method is to maintain hashtable and also queue or linked list
14:18:12*zipR4ND joined #nim
14:18:13cheatfatehashtable and queue will hold same data
14:18:59cheatfatebut in select() i will use only queue to update kernel structures
14:19:37Araq_I know it's unlikely to be a productive remark
14:19:47Araq_but when I need a table/seq hybrid
14:20:10Araq_I use a seq and slowish O(N) access
14:20:35Araq_my N is usually tiny anyway.
14:22:19cheatfatei can't use seq just because currently asyncdispatch can process 100,000 connections per second
14:22:45cheatfateO(100,000) will destroy all my improvements
14:23:37cheatfateand also i want to make selectors.nim threadsafe...
14:23:52cheatfate^^^^ the biggest and complex task
14:24:45*pregressive joined #nim
14:27:35Araq_there is also OrderedTable which keeps insertion order
14:30:02gokrOr perhaps a critbit tree
14:30:18gokrJust read a bit about that thing earlier today.
14:33:25cheatfateAraq_, i think you must make a rule, if somebody proposes data structure to stdlib he must introduce not only singlethreaded variant but sharedmemory variant too
14:34:27Araq_that rule would be counterproductive and totally weird
14:36:31*libman joined #nim
14:36:31Araq_most of the time the shared variant can only support a subset of the available operations.
14:37:23cheatfateAraq_, there not so many structures in stdlib which are threadsafe... or can be used in multithreaded environment
14:37:40Araq_if not contains(x, key): x.incl key # single threaded variant: 2 operations are fine.
14:38:02Araq_if not containsOrIncl(x, key) # Multi threaded variant: ops need to be fused for sane semantics
14:38:31Araq_they require vastly different API designs
14:39:03Araq_and 'len' for example is often just a race condition waiting to happen in an MT design
14:39:58Araq_also: Every stdlib collection can be used in a MT environment already. It just cannot be used as a global variable sharing data between threads.
14:40:25cheatfatebut singlethreaded API design can be subset of multithreaded API
14:40:41cheatfateyou can easily use containsOrIncl(x, key) in singlethreaded design
14:42:01cheatfatewe are trying to make stdlib to be OS independent/arch independent and to make it thread independent i need to make very complex sources...
14:42:59*PMunch quit (Ping timeout: 276 seconds)
14:47:10Araq_cheatfate: as I said before, a version that requires --threads:on is fine with me, we need to enable locks and shared allocs and the like for --threads:off anyway
14:47:38Araq_the current design where --threads:off means lots of stuff is missing from system.nim is not acceptable
14:48:29cheatfatehttps://gist.github.com/cheatfate/dd0b0ece334634be164fd6750ac63a52
14:49:42cheatfateits how selectors.nim can be look
14:49:59cheatfateor must look
14:50:05cheatfateto be threadsafe
14:50:27cheatfateand this will be complex source
14:51:13cheatfateand in every block i need to use different data structures...
14:51:27cheatfatejust because most of them not threadsafe
14:52:27cheatfatebut this is not dispute... i'm just looking for data structure which will be most suitable for enumeration and fast searches
14:56:27cheatfateAraq_, or you want me to make just singlethreaded variant of selectors.nim which support timers/signals/processes and all other staff?
14:56:44Araq_no, just multithreaded variant.
14:57:42Araq_and if it helps you further, just the 64 bit variant.
14:58:08Araq_heavily efficient servers can run in 64 bits
15:01:54*endragor quit (Read error: Connection reset by peer)
15:02:06*Salewski joined #nim
15:02:36*endragor joined #nim
15:03:06cheatfateAraq_, just to remember do you know about problem with 'union'?
15:03:36Araq_there is no problem.
15:03:46Araq_it's an unaligned pointer access.
15:04:11Araq_you need to use 'ptr' to begin with and cast the ref under GC_ref or something.
15:04:47Salewskimain.nim(123, 12) Error: ambiguous identifier: 'File' -- use a qualifier # var f: File # Would be great to get a hint which modules provide type File. compiling with -- verbosity:3 seems not to give more info.
15:14:31Araq_Salewski: indeed and is reported
15:14:56SalewskiGreat!
15:15:49Salewskiusage: sug|con|def|use|dus|chk|highlight|outline # is there some info about new commands like dus, chk...
15:17:24Salewskiwhen activating terse mode nimsuggest seems to crash always, but that is not a big problem for me currently. Socked use seems to work.
15:18:54Araq_hu?
15:19:16Araq_dus is 'def or use'
15:19:35Araq_chk is the same that 'nim check' does
15:20:06Araq_highlight outputs semantic highlighting information, like 'this identifier over there is a type/proc/const'
15:20:22Araq_outline # no idea, cannot remember lol.
15:21:52SalewskiAh. And what is these new --v2 mode? Yesterday I tried nimsuggest in terminal, and there terse mode always crashed. No idea why. Something like illegal storage access.
15:23:22Araq_the v2 mode adds more information and should always be used for new developments
15:28:04SalewskiOK, thanks. Will use v2.
15:30:41Salewskiterse crashes only with sug command, no problem
15:30:48Salewskinimsuggest --v2 --stdin main.nim
15:31:05Salewskisug main.nim:14:5 SIGSEGV: Illegal storage access. (Attempt to read from nil?)
15:31:37Araq_Salewski: oh btw checkout the new strscans module as yet another alternative to pegs and regexes
15:32:11SalewskiOK, will do.
15:33:01Araq_if scanp(input, +({'a'..'z'} -> ident.add($_))):
15:33:06Araq_ echo "identifier ", ident
15:33:18Araq_somebody needs to document 'scanp'. :-)
15:33:28Araq_it's really sweet.
15:33:48Araq_and you can write real parsers with it
15:40:56Salewski>new strscans module # not easy to find its location. Is it a nimble package?
15:41:48yglukhov_dom96: I can remember some PR that fixed something with windows sockets, and you argued a lot against it. could you please point me to it? was it merged?
15:43:28Araq_Salewski: it's in the devel branch under lib/pure
15:44:38SalewskiYes, I just found it, thanks.
15:44:42SalewskiBye.
15:44:45*Salewski quit ()
15:46:06dom96yglukhov_: this one maybe? https://github.com/nim-lang/Nim/pull/4098
15:46:44yglukhov_exactly! thanks.
15:49:28*yglukhov_ quit (Remote host closed the connection)
15:52:06*fastrom quit (Quit: Leaving.)
15:54:48*brson joined #nim
15:56:27*fastrom joined #nim
16:05:19*pregressive quit (Read error: Connection reset by peer)
16:05:26*saml_ quit (Quit: Leaving)
16:05:35*pregressive joined #nim
16:08:10*yglukhov joined #nim
16:09:18*enthus1ast quit (Ping timeout: 246 seconds)
16:13:22*Jesin quit (Quit: Leaving)
16:14:39*yglukhov quit (Remote host closed the connection)
16:16:15*yglukhov joined #nim
16:18:48*Jesin joined #nim
16:21:33*chrisheller joined #nim
16:32:35cheatfateyglukhov, it was not a good idea to remove this because after some tests i have found that some immediate completion routines are useful and cannot be removed
16:33:20cheatfateyglukhov, we found another way to avoid this deep recursion problems
16:33:30yglukhovcheatfate, no problem, just got some strange bug on windows and thought it might be related to this pr, but as i see, it was never merged, so the bug is elsewhere...
16:33:53cheatfateyglukhov, not this one? https://github.com/nim-lang/Nim/issues/3919
16:34:22yglukhovnope
16:35:01cheatfateyglukhov, interesting, what you found
16:36:52*Arrrr quit (Ping timeout: 250 seconds)
16:37:49yglukhovwell, theres an issue with nimongo. under heavy load in async mode it hangs because it thinks that mongo msg len is huge, and tries to read it out. reproduces only on windows. macos and linux are ok.
16:38:25yglukhovlooks like it's reading some garbage from the socket.
16:40:52dom96yglukhov: have you tried using `--gc:markandsweep`?
16:41:18dom96might be a memory corruption which will disappear with a different GC
16:42:42yglukhovok, i'll try, thanks
16:43:45*saml_ joined #nim
16:43:59*pregressive quit (Read error: Connection reset by peer)
16:44:12cheatfateyglukhov, do you know why nimongo using locks?
16:44:32*pregressive joined #nim
16:45:15yglukhovcheatfate, yes. just by accident. they should not really be there =)
16:45:45*saml_ quit (Client Quit)
16:49:06cheatfateyglukhov, nimongo looks very strange... https://github.com/SSPkrolik/nimongo/blob/master/nimongo/mongo.nim#L294
16:49:18cheatfateyglukhov, this procedure uses try: except: and await...
16:50:43cheatfatebut asyncdispatch do not support such construction
16:53:46*Arrrr joined #nim
16:53:58*Arrrr quit (Changing host)
16:53:58*Arrrr joined #nim
16:55:02cheatfateyglukhov, does it receive totally wrong data or maybe it was a part of data?
16:55:52yglukhovcheatfate: can't tell yet. bot dom96, gc suggestion `--gc:markandsweep` seems to work
16:56:00yglukhov* but
16:56:39dom96yglukhov: cool
16:56:50dom96cheatfate: asyncdispatch does support it, just not very well.
16:57:52yglukhovdom96, argh, sorry, your suggestion doesn't help :(
16:58:14dom96D:
16:58:38dom96yglukhov: best thing to do is to start removing as much out of nimongo as you can while preserving the bug
16:58:52dom96but yeah, that is very time consuming :\
16:59:44yglukhovno worries, working on it.
17:09:32cheatfatedom96, its maybe a problem i have tried to message you some days ago
17:14:06cheatfatebut i think it looks like nimongo problem because of pool usage maybe there is a little bug happens when data receiving from wrong socket...
17:16:02*fastrom quit (Quit: Leaving.)
17:18:26cheatfatedom96, does 'await' macro support this construction? https://github.com/SSPkrolik/nimongo/blob/master/nimongo/mongo.nim#L450
17:19:03dom96what construction?
17:19:55cheatfatei know await expands to yield future. future.read()
17:21:14*zahary joined #nim
17:21:18cheatfateok i will check expanded variant
17:23:53*PMunch joined #nim
17:28:48cheatfatedom96, nm 'await' expands properly
17:29:27dom96Remember that 'await' isn't a macro
17:29:29dom96'async' is
17:29:45dom96It analyses the context in which 'await' is invoked and transforms it appropriately
17:30:58cheatfatedom96, yeah i know just missed names
17:31:56cheatfatedom96, no, i'm not wrong, not me called 'await' macro but somebody https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1245
17:32:41cheatfatedom96, but this is just joke...
17:33:54dom96Guess it's my bad.
17:34:53*zahary quit (Quit: Leaving.)
17:39:58*ephja joined #nim
17:42:06*pregressive quit (Remote host closed the connection)
17:55:29cheatfatedom96, i always time thinking about https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L955 why you are used seqs
17:56:46cheatfatedom96, maybe i'm wrong but i think at one moment of time there can be only one future waiting for reading on particular socket
17:57:25*chemist69 quit (Quit: WeeChat 1.5)
18:01:41*pregressive joined #nim
18:06:33*yglukhov quit (Remote host closed the connection)
18:11:21dom96cheatfate: Even if that is the case it isn't a problem as long as we're single threaded.
18:11:52cheatfatedom96, i'm just looking a reason why you made this...
18:12:01cheatfatewhy you used sequence
18:12:18cheatfatenot just one callback holder for ready and one callback holder for write
18:13:07dom96cheatfate: because it was the easiest at the time, I don't have a specific reason.
18:13:53cheatfatedom96, i dont think you will use sequence if you need only one callback to hold... there must be a reason for this situation
18:15:16*enthus1ast joined #nim
18:15:19dom96cheatfate: There likely is, but I can't remember it right now.
18:39:13*fastrom joined #nim
18:44:10*zipR4ND quit (Ping timeout: 252 seconds)
18:46:26*bozaloshtsh quit (Ping timeout: 250 seconds)
18:57:41*silven quit (Ping timeout: 265 seconds)
18:58:09*silven joined #nim
19:09:04*chrisheller quit ()
19:10:57*tautologico quit (Quit: Connection closed for inactivity)
19:33:35*vendethiel joined #nim
19:36:09*fastrom1 joined #nim
19:37:12*fastrom quit (Ping timeout: 246 seconds)
19:41:02*enthus1ast quit (Ping timeout: 250 seconds)
19:43:23*Arrrr quit (Quit: WeeChat 1.4)
19:43:34*enthus1ast joined #nim
19:44:36*BitPuffin quit (Read error: Connection reset by peer)
20:17:54*yglukhov joined #nim
20:19:10ldleworker#machine-learning has recently started up, come join if that's a thing to you.
20:22:00*yglukhov quit (Ping timeout: 246 seconds)
20:24:16Araq_ldleworker: ha, you are not there either
20:24:48*bozaloshtsh joined #nim
20:25:41*fastrom1 quit (Quit: Leaving.)
20:26:20ldleworkerAraq_: we realized that #ai exists and we abandoned ship
20:26:24ldleworkersorry
20:26:33Araq_lol, that was quick
20:31:24*tautologico joined #nim
20:37:24*kier quit (Quit: leaving)
21:12:22*kier joined #nim
21:13:03*devn_ is now known as devn
21:21:42*yglukhov joined #nim
21:26:17*yglukhov quit (Ping timeout: 260 seconds)
21:46:12*yglukhov joined #nim
21:48:10*Demon_Fox joined #nim
22:04:26*endragor quit (Remote host closed the connection)
22:04:34*yglukhov quit (Ping timeout: 260 seconds)
22:07:40*enthus1ast quit (Ping timeout: 252 seconds)
22:12:06*arnetheduck quit (Ping timeout: 244 seconds)
22:12:24*elrood quit (Quit: Leaving)
22:13:26*yglukhov joined #nim
22:16:51*Matthias247 joined #nim
22:17:54*yglukhov quit (Ping timeout: 250 seconds)
22:18:41*enthus1ast joined #nim
22:22:51*Demon_Fox quit (Quit: Leaving)
22:25:58*PMunch quit (Quit: leaving)
22:26:26*gokr quit (Ping timeout: 276 seconds)
22:27:46*Demon_Fox joined #nim
22:41:40*yglukhov joined #nim
22:46:35*yglukhov quit (Ping timeout: 276 seconds)
22:46:38*pregressive quit (Remote host closed the connection)
23:03:18*Trustable quit (Remote host closed the connection)
23:14:14*fold4 quit (Ping timeout: 260 seconds)
23:14:16*cyraxjoe quit (Read error: Connection reset by peer)
23:14:50*Matthias247 quit (Read error: Connection reset by peer)
23:15:25*cyraxjoe joined #nim
23:17:22*fold4 joined #nim
23:18:00*yglukhov joined #nim
23:22:22*yglukhov quit (Ping timeout: 244 seconds)
23:26:03*ephja quit (Ping timeout: 276 seconds)
23:42:22*yglukhov joined #nim
23:46:40*yglukhov quit (Ping timeout: 252 seconds)
23:47:30*kingofoz quit (Ping timeout: 276 seconds)
23:48:44*kingofoz joined #nim