<<08-01-2013>>

00:19:25NimBotAraq/Nimrod 587806e Araq [+0 ±5 -0]: FFI at compiletime improvements
08:30:21*zahary joined #nimrod
13:00:19*q66 joined #nimrod
14:50:46*zahary joined #nimrod
15:00:18*Araq_ joined #nimrod
15:18:46*reactormonk joined #nimrod
19:05:10Araqyay new nimbuild fails ... or github
19:05:50Araqdom96: have a look please
19:05:58AlexLibmanWeight lifters consider muscle "failure" a good thing.
19:07:49dom96ugh
19:08:13dom96Araq: click test hook
19:09:38NimBotAraq/Nimrod 163113c Grzegorz Adam Hankiewicz [+0 ±1 -0]: Fixes tutorial pdf generation due to hierarchy depth.... 3 more lines
19:09:38NimBotAraq/Nimrod 9c91e9b Araq [+0 ±1 -0]: Merge pull request #294 from gradha/pr_fixes_pdf_generation... 3 more lines
19:09:55AraqI applied a pull request instead :P
19:10:23Araqoh btw
19:10:26dom96Github decided to connect from a non-github hostname for some stupid reason
19:10:35dom9650-57-231-61.static.cloud-ips.com
19:10:44AraqI've implemented #295
19:10:57Araqplease add it to aporia so that I can see the results :P
19:11:04*Araq didn't test it ;-)
19:11:16dom96lol
19:28:19dom96These compiler diffs inspire me.
19:31:44Araqhow so?
19:32:16dom96they make me want to fix compiler bugs :P
19:33:42Araqthe small diffs doesn't mean it way easy to *find* the bug :P
19:33:46Araq*it was
19:34:38dom96well I was referring to your implementation of #295 to be honest.
19:35:12Araqalright, well I'll happily give the 'suggest' stuff to you ;-)
19:35:42dom96sure. I can attempt it :P
19:35:47dom96I already have a feature in mind.
19:35:58dom96I'm still waiting on those patches from zahary though...
19:36:14Araqwe all do ...
21:31:29*_ponce joined #nimrod
21:31:35_poncehi
21:31:39Araqwb
21:31:46_ponceI'm trying to compile Aporia dom96
21:31:55dom96hello _ponce.
21:32:00_poncehello
21:32:01dom96_ponce: Having trouble?
21:32:03_ponceI get "utils.nim(59, 22) Error: undeclared identifier: 'PInfoBar'"
21:32:14dom96You need to get the latest compiler from git.
21:32:18_poncewith Nimrod & Aporia git-head
21:32:28dom96You need Nimrod git-head also.
21:32:42_ponceok, I probably got this wrong :|
21:32:58Araqor maybe I broke it today ;-)
21:33:39Araqpushing triggers the auto tester so I push to run the tests ;-)
21:33:41_ponceI like being in trunk anyway
21:34:05Araqbut I can change that workflow now that nimbuild supports branches :-)
21:34:12_poncecan we talk about the Javascript backend?
21:34:48Araqsure
21:34:50_ponceIf I ever does a roguelike using libtcod-nim, would it be possible to port to Javascript?
21:35:07_poncedoes it support DOM operation like createElement
21:35:53Araqpossible to port ... I think so. easy? no ...
21:36:31_poncewell I would not do any call to libtcod in this js case
21:36:55Araqwell tbh I'm not up to date with JS's capabilities
21:37:13dom96certainly possible with HTML5's new fancy features
21:37:37dom96Perhaps a port of the graphics module to the JS backend would be a good start.
21:38:13AraqI consider the JS platform different enough to not even try to share most libraries
21:39:13_ponceif we can output js with a pragma that should be good enough?
21:39:25Araqyou can do that with today's compiler
21:39:26_ponceto create builtin objects like Audio
21:39:31_poncefine!
21:39:35Araqthe 'asm' statement is mapped to it :D
21:40:54AraqI know there is work going on to give JS unboxed datatypes and more low level features for porting C(++) code over
21:41:36Araqthe current JS codegen doesn't use these fancy things ;-)
21:41:47Araqmy target was IE6 or something :D
21:42:18_ponceI don't need that much performance, just a small game for tasting the language
21:43:42*gradha joined #nimrod
21:44:11Araqalright, well you can try if you can live with broken exception support for JS for now
21:45:28_ponceI simply can't live with JS :)
21:45:41Araqand expect to run into codegen bugs, though it was suprisingly stable for the examples that I tested
21:49:15Araqreactormonk: I implemented #295, please test it
21:55:23NimBotAraq/Nimrod 05d8aac Araq [+0 ±1 -0]: make some tests green
21:55:23NimBotAraq/Nimrod fa809d0 Araq [+0 ±3 -0]: Merge branch 'master' of github.com:Araq/Nimrod
22:01:08Araqbtw dom96, nimbot again missed a push
22:02:08dom96ugh, ok. I'll fix it.
22:02:41Araqit's nice that github keeps her API stable
22:08:48dom96Fixed.
22:08:57dom96Lets hope github doesn't use other hostnames...
22:10:34NimBotnimrod-code/nimbuild 2c56992 Dominik Picheta [+0 ±1 -0]: Whitelisted another hostname for the github module.
22:11:37dom96whoa that was a bit slow
22:11:57Araq7 minutes to fix it ain't slow
22:12:20dom96I mean the lag between my push and the announce here.
22:26:15gradhacool, so now "files = json_params["files"].elems.each do (x: PJSonNode) -> string: x.str" compiles and wors, reducing about five lines to one
22:27:01gradhaquestion: is it possible to get rid of the param type in the do notation? It's going to come from the each first param type anyway
22:27:43Araqgradha: not yet, it's planned though
22:28:06gradhaamazing
22:28:30AraqI think you can leave it out already and it may work
22:28:41Araqbut the semantics are different ;-)
22:28:50dom96gradha: whoa. That looks pretty cool :D
22:29:25*Araq still thinks 'each' should be a template
22:30:01Araqand it should be called 'map' ;-)
22:38:53Araqdom96: 'findDefinition' calls 'quit'
22:39:06Araqcan't see how that can loop endlessly ...
22:39:54dom96it goes into a infinite recursion
22:40:21Araqmaybe you use 'usages' instead?
22:40:52dom96nope
22:41:03dom96please test it in aporia
22:41:25Araqcrashes my aporia :P
22:41:45dom96do you have the latest?
22:41:53Araqon it
22:42:03_ponceAraq: I'm stuck in my Javascript experiments, I create a <canvas> node and append it to body, but I would need to call the getContext() function on it
22:42:32Araq_ponce: found the example? it's either in examples/ or tests/ ...
22:42:35_ponceand then this context would have a lot of 2D draw functions
22:47:08Araqsounds like you need to write some wrapper then, take a look at lib/ecmas/dom.nim
22:48:20_poncedoes the DOM wrapper need compiler support or is fully in dom.nim?
22:48:32Araqfully in dom.nim
22:48:35Araqiirc
22:48:48_ponceyay
22:49:31Araqhave a look at tests/js/test1.nim too
22:50:15Araqyou need the 'exportc' pragma to export the stuff you call from within your html
22:50:38Araqotherwise the compiler optimizes it away :P
23:10:17Araqdom96: same with latest version, aporia crashes when I do 'find' ... argh
23:10:28AraqError: unhandled exception: len(s) == 7 [EAssertionFailed]
23:13:19Araqdom96: fix that please so I can investigate the endless recursion
23:16:42dom96yeah yeah. I'm fixing it now.
23:18:52gradhahow do you use the do notation in a for loop?
23:18:56gradhaI have the line "for even_number in filter(numbers, proc (x: int): bool = x mod 2 == 0):"
23:18:59gradhathis works
23:19:08gradhabut "for even_number in numbers.filter do (x: int) -> bool : x mod 2 == 0:" doesn't
23:19:14gradhaError: ':' expected
23:19:22Araqwell yes
23:19:44Araqthe 'do' notation is handicapped ... haven't looked at the underlying problem
23:20:38gradhawill the do notation improve over time or will it be discarded?
23:20:56Araqthe grammar is almost at its breaking point :-)
23:21:02Araqso it's hard to say
23:21:30AraqI want to rethink it from ground up
23:22:05Araqand change the spec accordingly while preserving as much compatibility with the old parser as possible
23:22:22Araqquite a challenge ;-)
23:23:23Araqbut the 'do' notation provides a unique feature, so it'll stay
23:23:44Araqhowever the current restrictions may stay too
23:32:56_ponceok got <canvas> drawing working https://dl.dropbox.com/u/541786/test.htm
23:33:36_poncebut lack of cast in the JS target made me merge TNode and the node specific to Canvas element
23:34:13Araqwell what should 'cast' produce in JS?
23:34:28Araqno-op since it's dynamically typed?
23:34:33_ponceI guess a regular assignment
23:34:38_ponceyea no-op
23:34:47_poncevar a = b; // always work in js
23:34:55Araqok, wait a sec
23:38:32_poncemaybe it's more complicated
23:38:48Araqwhy?
23:39:07_poncesince in js non-primitive types have reference semantics
23:39:31_ponceI don't know enough Nimrod semantics to say
23:40:00Araqwell 'cast' is all about providing a loophole in the type system
23:40:15Araqso mapping it to a no-op for JS sounds very reasonable
23:40:29_ponce'cast' should also work identical regardless of the target though
23:40:49Araqbut that's unrealistic
23:41:01_ponceworks for me then :)
23:41:06Araqit doesn't even work regardless of pointer bitwidths
23:41:19Araqfor obvious reasons
23:43:54_ponceif I understand correctly, Nimrod's cast is C++'s reinterpret_cast?
23:44:20_poncein this case, no problem
23:44:39AraqI think so, tbh I can't recall the details about C++'s cast operators
23:45:06Araqbut usually you don't use 'cast' but a proper type conversion in Nimrod
23:45:37Araq'cast' is inherently unchecked and unsafe (and easy to grep ;-) )
23:45:45_ponceI always hated the conflation of bitwise-cast and type conversions in C and C++
23:45:53_poncegotta love the Pascal inspiration
23:46:23Araqactually it's my own invention, pascal copied C here
23:46:42Araqor maybe I copied it from Ada ...
23:46:49_ponceuh ok, I had different memories from Turbo Pascal
23:47:23AraqTurbo Pascal only has T(x)
23:50:19Araq_ponce: 'cast' should work for the JS target now
23:51:13_poncethat was pretty fast :)
23:53:06AraqI'm bored ;-)
23:53:18Araqwaiting for dom96's bugfix so I can improve idetools
23:53:36dom96You cannot rush a master.
23:54:41AraqI could answer on the D forum again but then ... ugh
23:55:38Araqnobody will understand me anyway
23:57:47gradhayou are asking for trouble in D forums?
23:58:42AraqI don't ask for trouble, I sometimes post something
23:59:15gradhado they have a web interface or it's nntp?
23:59:34AraqI use the web interface