<< 27-05-2016 >>

00:00:08*shodan45 quit (Quit: Konversation terminated!)
00:52:19tautologicois there a way to dump the AST for a module during compilation? I can't seem to find one
00:53:45*PMunch quit (Quit: leaving)
01:20:22*Jesin quit (Quit: Leaving)
01:34:22*space-wizard quit (Read error: Connection reset by peer)
01:59:40*space-wizard joined #nim
02:01:33*user___ joined #nim
02:03:41*user2 quit (Ping timeout: 244 seconds)
02:10:16notfowltautologico, if you can wrap the module in a template like this https://github.com/nim-lang/Nim/blob/master/lib/core/macros.nim#L494
02:15:32*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
02:52:53tautologicofound a way to do that inside the compiler by using debug
02:55:00*gugugaga joined #nim
03:11:22*|meta quit (Quit: Connection closed for inactivity)
03:18:11*kseg joined #nim
03:22:48*kseg quit (Ping timeout: 276 seconds)
04:44:38*Demon_Fox quit (Quit: Leaving)
05:02:37*GangstaCat quit (Quit: Leaving)
05:38:29*endragor joined #nim
05:39:26*gugugaga quit (Quit: Leaving)
06:05:41*gugugaga joined #nim
06:17:55*yglukhov joined #nim
06:26:12*endragor_ joined #nim
06:30:28*endragor quit (Ping timeout: 264 seconds)
06:42:14*GangstaCat joined #nim
06:44:25*endragor_ quit (Remote host closed the connection)
06:44:55*endragor joined #nim
07:06:39*gokr joined #nim
07:14:52*GangstaCat quit (Quit: Leaving)
07:15:15*Trustable joined #nim
07:18:47*irrequietus joined #nim
07:19:03*GangstaCat joined #nim
07:23:25gokrjeffc: Using c2nim or?
07:24:53gokrjeffc: What platform are you using on the embed side? We are working with lots of embedded stuff and I even did a shot at "Ardunimo": http://goran.krampe.se/2016/02/25/nim-meets-arduino/
07:25:12gokrI am itching to do something similar but for mbedOS instead.
07:48:27*Sembei quit (Ping timeout: 244 seconds)
07:50:15*yglukhov quit (Remote host closed the connection)
07:50:24*Sembei joined #nim
08:03:14*der-landgraf quit (Quit: WeeChat 1.5)
08:16:11*filcuc joined #nim
08:24:13veganskAraq_, hi! Is it legal to use templates in type definitions as I did here: https://github.com/vegansk/jbridge/blob/eb23dcb1991d1a0e36d240046f19be3bb40b656f/src/private/jni_api.nim#L92 and here: https://github.com/vegansk/jbridge/blob/eb23dcb1991d1a0e36d240046f19be3bb40b656f/src/private/jni_api.nim#L383?
08:27:17veganskIs it by design, or it can be broken in the future?
08:28:37*Pisuke joined #nim
08:37:38Araq_it's legal but it causes problems (but what doesn't?)
08:38:01Araq_but we try our best and not break it ;-)
08:45:37veganskOops. It's not working. The test is green because it checks only the first typedesc from template. :-(
08:51:16*Matthias247 joined #nim
08:53:34*gokr quit (Ping timeout: 244 seconds)
08:59:45veganskAraq_, it's already broken. https://github.com/nim-lang/Nim/issues/4228. Is it hard to fix?
09:02:50Araq_did it ever work?
09:03:08*derka joined #nim
09:03:37Araq_seems to be an 'is' operator bug
09:08:43veganskAraq_, I tried it today, so don't know if it ever worked.
09:10:23*gokr joined #nim
09:26:25*irrequietus quit ()
09:29:31*dmitry_p joined #nim
09:45:04*gugugaga quit (Quit: Leaving)
09:48:03*gokr quit (Ping timeout: 240 seconds)
09:56:46*arnetheduck joined #nim
09:57:44*jjido joined #nim
10:02:13*TheLemonMan joined #nim
10:05:13*gokr joined #nim
10:10:00*der-landgraf joined #nim
10:11:39*dmitry_p quit (Quit: Leaving)
10:40:23veganskAraq_, I tried to debug this issue. The problem is that when VM executes ``opcIf`` instruction, typedesc variable doesn't contain the real type. Here is debug output: ``tyTypeDesc(tyGenericParam T)``
10:52:09Araq_told ya.
10:53:43*derka quit (Quit: derka)
10:56:07*Matthias247 quit (Read error: Connection reset by peer)
10:57:27veganskAraq_, but why? I can have ``proc f[T](v: T): T = ???``and the type of result is known.
10:58:18*fastrom joined #nim
11:00:05veganskIs there a chance to fix the compiler so it will execute templates when type parameters is known and not before?
11:02:12*derka joined #nim
11:02:44*fastrom quit (Ping timeout: 244 seconds)
11:03:59Araq_sure
11:06:31veganskTell me please, where is the code for generics instantiations?
11:08:42Araq_semtypinst and seminst iirc
11:09:11veganskThanks!
11:09:16Araq_but I doubt the problem is there
11:09:41Araq_I would look into vm.nim and what it does with tyTypeDesc. it might prune it back to a generic tyTypeDesc
11:11:21veganskGot it
11:16:36*derka quit (Quit: derka)
11:47:59cheatfatedom96, i know i have already asked you about https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L932-L933, but please could you think about it again, is this really needed?
11:48:51cheatfatedom96, i can't find any reason why socket can contain multiple callbacks
11:49:12cheatfatedom96, even in multithreaded environment
11:49:58dom96cheatfate: I guess you're right. Can't really look into it right now, but I have a feeling that you are right :)
11:50:56cheatfatedom96, i thought you have passed book deadline and you have completed your exams, when you get some spare time? :)
11:51:30dom96cheatfate: There is always more things to be done on the book :P
11:51:58dom96But anyway, you can easily see if you're right.
11:52:17dom96Just assert false if readCBs.len > 0 or writeCBs.len > 0
11:52:39cheatfatedom96, `> 0` or `> 1`
11:52:52TheLemonManhmm, is there a way to get the upper/lower bound for a given type (if it's an integral one obviously)
11:53:15dom96TheLemonMan: low()/high() IIRC
11:53:37dom96cheatfate: hrm... assert readCBs.len == 0 and writeCBs.len == 0
11:54:05dom96put that before readCBs/writeCBs is added to
11:54:13dom96that way it will crash if there is already something in it
11:55:09cheatfatedom96, hah this assert ofc will be raised
11:56:31cheatfateAraq_, this `withXXXX` templates boost speed of asynchttpserver for 10% more :)
11:57:48dom96cheatfate: huh?
11:58:11cheatfatedom96, its hard to explain, but this because of `yields`
11:58:41cheatfatedom96, now i'm trying to check libuv and python's asyncio if they using sequences for callback storage
11:58:50dom96I'm confused
11:58:55dom96what is your problem with the code you linked?
11:59:15dom96I was under the impression that you think there is no need for the seq?
11:59:27dom96because there is ever only one callback?
12:00:07*fastrom joined #nim
12:02:04cheatfatedom96, `because there is ever only one callback` - yes i think so
12:02:27dom96cheatfate: yeah, so won't the 'assert' prove your hypothesis?
12:02:30cheatfatedom96, can be only one moment - transition from READ->WRITE and from WRITE->READ
12:02:52dom96That is what the 'assert' is er, asserting :)
12:03:26dom96"Crash if `readCBs`/`writeCBs` doesn't have 0 elements in it"
12:03:30cheatfateyeah there can be a moment of time when READ callback is still not called but WRITE callback must be inserted...
12:04:06cheatfatebut i dont sure about multithreading environment
12:04:08dom96or maybe my logic is wrong
12:05:17dom96yeah, it should be: 'assert readCBs.len != 1 and writeCBs.len != 1'
12:07:13cheatfatedom96, i found a moment when this problem can appeared, when we are in poll() calling `read` callback and this callback call to addRead() again with READ to continue reading
12:08:24dom96so the 'seq' is required?
12:08:33*BitPuffin joined #nim
12:11:17cheatfatedom96, still not sure
12:11:43dom96is your concern performance?
12:23:54*PMunch joined #nim
12:40:53cheatfatedom96, https://gist.github.com/cheatfate/85024430f292fec8e728fd5ac7db1057 and this works...
12:41:45cheatfateso there no need of sequence
12:42:26cheatfateand this works under `wrk` load test
12:44:40dom96I'm not sure what this proves.
12:45:12dom96oh, did you just get rid of the sequence?
12:45:55cheatfateyep there no sequence anymore
12:54:41dom96and how much faster is it?
12:55:33*gokr quit (Ping timeout: 240 seconds)
13:06:08cheatfatedom96, i dont know... i think i have reached my maximum performance
13:06:19cheatfatedom96, because i'm testing in VMs
13:11:32*r4vi quit (Remote host closed the connection)
13:21:53*kseg joined #nim
13:25:19*heinrich5991 quit (Ping timeout: 260 seconds)
13:26:22*kseg quit (Ping timeout: 244 seconds)
13:27:47*heinrich5991 joined #nim
13:30:53*gokr joined #nim
13:43:49*MyMind joined #nim
13:45:59*Sembei quit (Ping timeout: 244 seconds)
13:52:15*gokr quit (Ping timeout: 260 seconds)
14:09:52*jjido quit (Ping timeout: 260 seconds)
14:29:01*nsf quit (Quit: WeeChat 1.4)
14:29:11*Matthias247 joined #nim
14:34:17*jjido joined #nim
14:38:49*jjido quit (Ping timeout: 260 seconds)
14:39:28*Demon_Fox joined #nim
14:55:03*kulelu88 joined #nim
14:55:03*kulelu88 quit (Changing host)
14:55:03*kulelu88 joined #nim
15:01:07*Jesin joined #nim
15:12:30*jjido joined #nim
15:18:40*Jesin quit (Quit: Leaving)
15:25:37*Jesin joined #nim
15:38:01*pregressive joined #nim
15:44:48*|meta joined #nim
15:52:10tautologicoAraq_: I've been looking at this: https://github.com/nim-lang/Nim/issues/4001 is this a parsing bug? the problem happens in pragmas.nim, processNotes, the code assumes a nkBracketExpr has 2 sons but in this case it has only one. should this be a syntax error?
15:53:45*Sembei joined #nim
15:55:15*Jesin quit (Quit: Leaving)
15:55:55*kingofoz quit (Ping timeout: 252 seconds)
15:56:48*Pisuke quit (Ping timeout: 276 seconds)
15:59:25*arnetheduck quit (Ping timeout: 260 seconds)
16:01:21*Sembei quit (Ping timeout: 244 seconds)
16:01:59*Jesin joined #nim
16:03:54*endragor quit (Remote host closed the connection)
16:05:18*jjido quit (Ping timeout: 258 seconds)
16:06:47*Sembei joined #nim
16:07:59Araq_if it happens in pragmas.nim it is no a parser bug
16:24:34*fastrom quit (Quit: Leaving.)
16:25:35*fastrom joined #nim
16:29:02*fastrom quit (Client Quit)
16:30:40*Arrrr joined #nim
16:30:40*Arrrr quit (Changing host)
16:30:41*Arrrr joined #nim
16:32:26*filcuc quit (Read error: Connection reset by peer)
16:36:17*kulelu88 quit (Quit: Leaving)
16:36:20Araq_tautologico: just check for n.len == 2
16:36:34Araq_I marked it "easy", don't think too hard.
17:01:35*Matthias247 quit (Read error: Connection reset by peer)
17:04:19*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
17:16:45tautologicoWhat is the intended behavior in this case? Is it an invalid pragma?
17:17:14Araq_yup
17:18:37dom96Maybe you could look into fixing this as well? https://github.com/nim-lang/Nim/issues/4225 :)
17:20:26Araq_dom96: I think that's not a bug.
17:20:40dom96okay, why not?
17:20:57Araq_certain pragmas cause Nim to ignore the proc body
17:21:09Araq_otherwise the nimRtl pragma would be a pita to use
17:22:11dom96hrm. It seems like an easy mistake to make though.
17:23:07dom96Couldn't the body still be checked to ensure it's valid?
17:23:30*kseg joined #nim
17:26:52Araq_currently 'importc' triggers this "don't check body" behaviour
17:27:03Araq_we could also require 'dynlib' but meh.
17:27:29Araq_hmm, well perhaps it's a good solution.
17:27:38dom96huh
17:27:43Araq_I only want to ignore the body for DLL imports
17:27:46*kseg quit (Ping timeout: 252 seconds)
17:28:00dom96surely the 'importc' doesn't get applied in my example?
17:28:11dom96only 'cdecl' and 'header' do
17:29:04Araq_header implies importc
17:29:51Araq_which could be revised now that importcpp exists
17:30:33Araq_not sure what code it would break though ...
17:32:29Araq_ah and it's also internally messy. importcpp sets the same flag as importc and then some
17:33:51Araq_so yeah, my fix is better.
17:33:57Araq_tie it to DLL importing
17:37:37Araq_btw https://github.com/web2py/pydal/ seems an excellent match for Nim. somebody should write something like this.
17:39:03*nsf joined #nim
17:48:58*Pisuke joined #nim
17:51:42*MyMind quit (Ping timeout: 272 seconds)
18:04:56*Matthias247 joined #nim
18:09:01*gugugaga joined #nim
18:10:01*fastrom joined #nim
18:12:41def-Araq_: pydal looks fun, I might play around with how it can look in Nim
18:24:02*lubos_cz joined #nim
18:59:02*BitPuffin quit (Read error: Connection reset by peer)
19:07:54*Sembei quit (Ping timeout: 244 seconds)
19:09:02*gugugaga quit (Quit: Leaving)
19:13:47*pregressive quit (Read error: Connection reset by peer)
19:13:48*pregress_ joined #nim
19:14:26*lubos_cz quit (Ping timeout: 244 seconds)
19:16:55*gugugaga joined #nim
19:26:49*TheLemonMan joined #nim
19:31:02*gugugaga is now known as gagagugu
19:35:57*irrequietus joined #nim
19:41:47*Arrrr quit (Quit: WeeChat 1.4)
19:50:45*gokr joined #nim
19:53:00*lubos_cz joined #nim
20:26:55*yglukhov joined #nim
20:31:06TheLemonManhmm, nim-mode slows down to a crawl for pretty much every file
20:33:29*yglukhov quit (Ping timeout: 260 seconds)
20:34:35TheLemonManalso why countup allows distinct types for the range ends and countdown doesn't ?
20:34:44*dhk joined #nim
20:39:42Araq_TheLemonMan: probably because it's not a clear advantage to be able to count from uint.high to -1
20:39:54Araq_*to count down
20:55:18TheLemonManfair, I would've used some asserts but whatever floats your boat
21:24:31*kseg joined #nim
21:29:13*kseg quit (Ping timeout: 252 seconds)
21:30:35*notfowl is now known as fowl
21:34:02*libman joined #nim
21:41:54*gagagugu quit (Quit: Leaving)
21:47:25*Sembei joined #nim
21:52:18*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
22:11:06tautologicodone: https://github.com/nim-lang/Nim/pull/4231
22:13:09*vendethiel joined #nim
22:16:07*yglukhov joined #nim
22:17:43*Mat4 joined #nim
22:19:05Araq_tautologico: very nice. I prefer to not add tests for trivial stuff like this where regressions are super improbable, but it's fine.
22:20:33*yglukhov quit (Ping timeout: 240 seconds)
22:24:03*lubos_cz quit (Ping timeout: 244 seconds)
22:26:40tautologicoAraq_: true, I thought a test could be overkill in this case, but it can be deleted
22:27:36Araq_ok, so remove it then. our test suite could always run a little faster.
22:33:57*libman quit (Ping timeout: 276 seconds)
22:35:12*Mat4 left #nim (#nim)
22:35:54*irrequietus quit ()
22:37:14*Trustable quit (Remote host closed the connection)
22:37:25*pregress_ quit ()
22:39:08tautologicook done
22:39:27tautologicoCI tests pass
22:41:23*|meta quit (Quit: Connection closed for inactivity)
22:44:41*der-landgraf quit (Ping timeout: 240 seconds)
22:49:34*Ven joined #nim
22:54:21*Ven quit (Client Quit)
22:55:32*Ven joined #nim
23:19:55cheatfateAraq_, sorry but something wrong with my `withValue` templates: https://gist.github.com/cheatfate/203cebc7f76c20e436c0ad958d41dadb
23:22:54Araq_that seems a parser bug?
23:23:02Araq_nothing wrong with the template, is it
23:25:38*kseg joined #nim
23:28:05cheatfatei think this is compiler bug but i want to make for you reproducible source
23:29:49*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:30:20*kseg quit (Ping timeout: 260 seconds)
23:30:53Araq_don't worry, I have a trivial test case
23:33:16cheatfateAraq_, i have made some modifications to gist and got one more error
23:33:53cheatfatejust tried to avoid "invalid indentation" and merged 2 lines...
23:38:37*heinrich5991 quit (Ping timeout: 260 seconds)
23:39:27*mnemonikk quit (Ping timeout: 264 seconds)
23:40:50*mnemonikk joined #nim
23:40:50*mnemonikk quit (Changing host)
23:40:50*mnemonikk joined #nim
23:47:24*Sembei quit (Ping timeout: 244 seconds)
23:49:45*heinrich5991 joined #nim
23:51:13*fastrom quit (Quit: Leaving.)
23:54:18*Matthias247 quit (Read error: Connection reset by peer)
23:56:35*vendethiel quit (Ping timeout: 260 seconds)