<<09-09-2012>>

01:01:10fowlis there any info on term rewriting macros?
06:04:53*rking joined #nimrod
06:05:15Araqhi rking
06:05:29rkingHaving a bit of trouble finding "nake". I have nimrod itself installed, and I'm looking at a nakefile.nim, but not having success with web searches.
06:05:33rkingAraq: Howdy. =)
06:05:42Araqfowl: I'm writing the docs now
06:06:27fowlrking: its in a gist, 1 sec
06:06:29rkingAha, it's in dependencies/nake. (Compiling fowl's thing)
06:06:43fowlhttps://gist.github.com/3607822
06:06:51rkingUrr, there's an empty dir there.
06:07:01fowlrking: its a submodule, git submodule init
06:08:17rkingfowl: Is it yours?
06:08:27rkingnake, that is.
06:08:45fowlyea
06:08:58rkingNice use of nakefile.nim to install nake. =D
06:11:41fowlnow i just need a nakefile to install the the nakefile :>
06:11:44rkingAlso I like the idiom of splitting $PATH then prompting.
06:14:29rkingfowl: How do I make it know where to "import nake" from?
06:15:19fowlrking: thats the one thing i havent solved yet >_> i just pushed the nakefile's nimrod.cfg to the repo
06:17:43rkingk thanks.
06:18:58rkingfowl: My output of nake all: https://gist.github.com/4dce6a00123e34e27148
06:19:22rkingI gotta jet for now, but I want to check out your stuff at some point.
06:19:33fowlrking: whats your nimrod -v
06:19:49rkingJust got it from github; Nimrod Compiler Version 0.8.15 (2012-09-08) [Linux: amd64]
06:21:20Araqfowl: do you *need* the TR macros, or do you want to play with them? :D
06:21:20fowlhm ok
06:22:30fowlthe latter
06:28:09Araqwell just read the tests/patterns/*.nim files
06:30:27Araqthese all bad examples because they change semantics to prove the tr macros are triggered ;-)
06:52:01Araqhave to go, see you later
10:03:56*q66 joined #nimrod
11:56:09*apriori_ joined #nimrod
12:38:16apriori_hey guys
12:38:22apriori_is there a static initializer for objects?
12:50:30*apriori_ quit (Ping timeout: 244 seconds)
13:24:31*bugmagnet joined #nimrod
13:33:25*bugmagnet quit (Quit: HydraIRC -> http://www.hydrairc.com <- In tests, 0x09 out of 0x0A l33t h4x0rz prefer it :))
14:46:20*XAMPP quit (Quit: Leaving)
15:27:59*XAMPP joined #nimrod
15:51:20reactormonkAraq: "static initializer"?
15:57:44fowlreactormonk: i think its a device used to create mad scientist hair
18:00:19*apriori_ joined #nimrod
18:07:57*fowl quit (Ping timeout: 245 seconds)
18:14:40Araqoh hi apriori_
18:15:00Araqyou can use a compiletime proc to get a "static initializer"
18:15:38Araqwell ... you can't use them in 'const' for now I think
18:20:57apriori_ah, ok
18:21:07apriori_but I more meant.. syntax wise..
18:21:24apriori_there is no way like: var bla: SomeType = SomeType(....)?
18:22:17apriori_I ask.. because, well, correct me if I'm wrong, but couldnt those be autogenerated?
18:23:15Araqwell we're still figuring out how to introduce constructors
18:23:39Araqmy favourite solution for now is to only support initializers
18:23:58Araqso no parameters
18:24:09Araqtype tobj = object
18:24:18Araq x: int = 12 # override default 0 value
18:24:31Araqvar o: tobj # o.x == 12 here
18:25:07apriori_ok
18:25:18Araqthis way, setLen(x, 4) can do a proper job
18:25:41apriori_I only see the problem that there will be lack of convention
18:25:53apriori_like.. one doesn't quite now how usual constructor functions are called
18:26:02apriori_create_X, construct_, make_X whatever
18:26:04Araqso what
18:26:30Araqthis problem exists for all other procs too
18:27:14apriori_yeah, sure
18:27:19Araqand for now the add/del/initT/newT convention works good enough
18:29:07apriori_okay
18:29:14Araqhttp://nimrod-code.org/apis.html
18:29:27Araqmost of the stdlib adheres to this btw
18:30:40apriori_okay
18:30:42apriori_thanks
18:33:43*fowl joined #nimrod
18:35:15Araqand yeah that document should mention the newT, initT convention
18:36:42Araqhi fowl
18:36:49fowlyo
18:36:58Araqhave you played with tr macros yet?
18:37:24fowlyea so far im just using them to be lazy
18:37:40Araqhow so?
18:42:10fowli use it to implement newExplosion(), i dont have an explosion type, they are just one-shot animations
18:42:48Araqgist please, I'm curious
18:43:53fowlbut the order of arguments i would send to newExplosion() is different than the function it calls
18:43:57fowlhttps://github.com/fowlmouth/keineSchweine/blob/master/keineschweine.nim#L168
18:44:42Araqlol you could have used an ordinary template instead
18:45:06fowlalso i call it from unrelated objects (anything that has a body field is ok)
18:45:22Araqif your pattern looks like 'newExplosion(a, b, c)' it's hardly a *pattern* :P
18:45:22fowllast i tried i couldnt have two templates with the same name
18:45:36Araqoh
18:46:10Araqwell that's easily implemented
18:46:14fowli dont need crazy syntax hax, just things like this to keep things DRY
18:48:48Araqit's an oversight because templates used to not participate in overloading resolution
18:50:45fowlit would work now?
18:51:02Araqnot yet
18:51:07Araqadded it to my todo
18:51:25fowlah
18:52:27*apriori_ quit (Quit: Konversation terminated!)
20:33:50*shevy joined #nimrod
20:40:19Araqping dom96
20:40:25dom96pong
20:40:38AraqI'm thinking about exception tracking in the compiler
20:41:35Araqand wonder what would the pragmas should look like:
20:42:14Araq{.noexceptions.} # compiler verifies no exceptions can occur at this point
20:42:36Araqlike in:
20:42:39Araqtry: ...
20:42:49Araqexcept: handleExceptions()
20:42:56Araq{.noexceptions.}
20:44:26Araqwe also need: {.noexception: EOS.} # EOS has not been forgotten to be handled
20:45:22Araqwhat do you guys think?
20:52:29fowli probably wouldnt use
20:53:12fowli just let exceptions crash the program most the time
20:53:29Araq*shrug* IMHO I'm a genius and solved Java's checked exceptions problem :P
20:53:42fowlcan you add a dialog box with a cute little bomb exploding animation?
20:54:06Araqyou can do that, hack system/excpt.nim
20:55:17fowlhttp://files.artlung.com.s3.amazonaws.com/artlung.com/blog/wp-content/uploads/2007/10/mac-os-bomb-system-error.gif
20:55:39fowl"unimplemented trap" how informative :p
20:55:52dom96I am so implementing that in Aporia.
20:55:53dom96:P
20:56:06fowlmy error dialog would just combine two or three technological-sounding words
20:56:20fowlthe rest in korean
20:56:50Araqthe error dialog should quote some aphorism
20:57:10Araq"learn to fish you idiot!" :D
21:04:27Araqping reactormonk
21:30:41zaharyAraq, the exception tracking sounds cool. add a whitelist option (please, insure that only these exceptions can exit from here) to make it complete
21:31:20Araqoh hi zahary
21:32:10Araqyeah, both whitelist and blacklist are needed I guess
21:32:24zaharysorry for not responding earlier, I was away for most of the weekend
21:34:24Araqnp, I went with the RPN solution
21:36:16zaharyRNP?
21:36:35zaharyah, reverse polish
21:37:58zaharywell, callsite() is always available so I don't see much of a problem - all kinds of flattened views are potentially just a call away (given that helper procs exist)
21:38:17zaharyvar old_style = flatten(callsite())
21:39:22Araqit's not as easy without an API to analyse types ;-)
21:47:22Araqyou have to ensure that x & (3 & 7) & y doesn't match "too deeply"
21:48:07Araqand the TR stuff is now an extra pass so that top down matching can be done
21:50:50AraqI'm unsure what to do with exceptions like EInvalidIndex that are not 'raise'd explicitely
21:51:32Araqcode uses some proc in strutils and the compiler notices it could raise EInvalidIndex but the proc is correct, so the indexes are always correct
21:52:21Araqand so EInvalidIndex screws up your {.noexception.} annotation
21:52:50zaharywell, this is equivalent to the "user overridden effects" I talked about the other day
21:53:26Araqtrue
21:53:56zaharypotentially, there may be a semi-automated solution making use of dependent typing information, but some manual overriding will probably always remain necesarry
21:56:43fowler this is weird: https://gist.github.com/3687545
21:57:20Araqon the other hand, exceptions like EInvalidIndex are surreal
21:57:32Araqas you can't catch them reliably
21:57:43Araqthey will be gone in a release build
21:57:48zaharyhow much of a second pass is TR now? if I create a pattern for statements like if and for, can I affect the semantics of the inner block?
21:58:34Araqyou can always affect semantics as the compiler can't check against that
21:58:48Araqhowever you cannot affect semchecking
22:00:28zaharywhat I mean is that if sem is ran over the body of the if statement before the rewrite is triggered I cannot replace the meaning of some ident inside it or set a dependent type value
22:01:15zahary… if you remember my if TOption[T]: body optimization
22:01:41AraqI remember and I think it's still possible
22:03:00Araqtemplate t{ if x.check: x.get() }(...) = if x.check: x.fastGet()
22:04:11Araqhowever a harder problem is that we have no proper search operator
22:04:23zaharywell, the body can be much more complicated with x.get() appearing somewhere within it
22:04:43Araq{ if x.check: A; x.get() }
22:04:53Araqwhere A does not affect 'x'
22:05:09Araqthis is the CSE problem ;-)
22:06:19zaharyinstead, it's not general, but rather the designer of the Option[T] type knows specifically that's it's ok for his particular type
22:09:47Araqfowl: that's not weird, that's how it should work
22:10:22Araq'sleep' doesn't require the CPU ...
22:20:24Araqah, zahary, I think I get what you mean now :D
22:20:36fowlo
22:20:44fowlError: undeclared field: 'spriteSheeet' lol -_-
22:24:33zaharyI'm thinking about a solution right now - maybe both the bottom-up-pre-sem and top-down-after-sem paths can be kept and they can be used depending on the pattern (it seems to me that the param types can determine that)
22:28:53Araqhow so? the param types can't do that
22:29:00zaharyif you remember, when we introduced immediate, I suggested that in the future we may add param type such as "raw stmt" that will allow you to have a "mixed" immediate/late templates and macros - e.g. template foo(a: string, b: TFoo, body: stmt{raw}) = …
22:30:03zaharysem won't be run on the body yet, just like in an immediate template - something similar can work for patterns too
22:30:32Araqmaybe
22:31:13Araqbut I think it's overly complicated
22:31:29Araqyou want a proper optimizer instead to hook into
22:33:44Araqwell you can do: macro analyse{x}(x: stmt): stmt
22:34:03Araqand implement the whole analysis there
22:34:58zaharysome way must exist to hook your dependent type modifier functions to control flow statements - the pattern matching facility sounds like a good place to do it
22:40:20*Trix[a]r_za is now known as Trixar_za
23:06:07*q66 quit (Quit: Quit)
23:14:25*zahary quit (*.net *.split)
23:14:25*fowl quit (*.net *.split)
23:14:25*shevy quit (*.net *.split)
23:14:26*Roin quit (*.net *.split)
23:14:26*comex quit (*.net *.split)
23:14:27*Reisen quit (*.net *.split)
23:14:27*mal`` quit (*.net *.split)
23:14:27*ccssnet quit (*.net *.split)
23:14:27*CodeBlock quit (*.net *.split)
23:14:28*Boscop quit (*.net *.split)
23:14:30*XAMPP quit (*.net *.split)
23:14:30*rking quit (*.net *.split)
23:14:30*JStoker quit (*.net *.split)
23:14:30*dom96 quit (*.net *.split)
23:14:30*Araq quit (*.net *.split)
23:14:30*Trixar_za quit (*.net *.split)
23:14:31*Amrykid quit (*.net *.split)
23:14:31*silven quit (*.net *.split)
23:14:32*reactormonk quit (*.net *.split)
23:15:33*shevy joined #nimrod
23:15:33*fowl joined #nimrod
23:15:33*XAMPP joined #nimrod
23:15:33*rking joined #nimrod
23:15:33*Boscop joined #nimrod
23:15:33*zahary joined #nimrod
23:15:33*Amrykid joined #nimrod
23:15:33*Araq joined #nimrod
23:15:33*Reisen joined #nimrod
23:15:33*silven joined #nimrod
23:15:33*mal`` joined #nimrod
23:15:33*JStoker joined #nimrod
23:15:33*Roin joined #nimrod
23:15:33*dom96 joined #nimrod
23:15:33*reactormonk joined #nimrod
23:15:33*Trixar_za joined #nimrod
23:15:33*comex joined #nimrod
23:15:33*ccssnet joined #nimrod
23:15:33*CodeBlock joined #nimrod
23:31:42*Trixar_za is now known as Trix[a]r_za
23:42:22*zahary quit (Quit: Leaving.)