<<23-08-2012>>

00:30:02*Boscop quit (Disconnected by services)
00:30:03*Boscop joined #nimrod
01:13:52*reactormonk quit (Ping timeout: 246 seconds)
01:27:17*reactormonk joined #nimrod
01:40:48*q66 quit (Quit: Quit)
02:24:13*zahary quit (Quit: Leaving.)
03:14:37*reactormonk quit (Ping timeout: 246 seconds)
03:27:46*reactormonk joined #nimrod
05:12:34*XAMPP quit (Ping timeout: 260 seconds)
07:07:31*Trix[a]r_za is now known as Trixar_za
07:27:51*XAMPP joined #nimrod
07:27:52*XAMPP quit (Changing host)
07:27:52*XAMPP joined #nimrod
07:32:14Trixar_zaHmmm
07:32:20Trixar_zaI might as well
09:28:41*q66 joined #nimrod
10:57:53*Trixar_za is now known as Trix[a]r_za
11:01:56*Araq_ joined #nimrod
11:19:43*Araq_ quit (Read error: Connection timed out)
12:05:24fowlwow i just discovered that repr(result) shows the nimrod code result instead of treerepr() showing the tree
12:05:26fowlbeautiful
13:20:40*zahary joined #nimrod
13:47:26fowlsomeone should copy the styles dir for http://build.nimrod-code.org/docs/
14:31:32dom96hello
14:32:27fowlyp
14:32:30fowlyo*
14:38:59*dom96 just got back from a school interview heh
14:49:58dom96fowl: Why should someone copy the styles dir for http://build.nimrod-code.org/docs/?
15:00:42fowlbecause its missing and would make it a lot more readable
15:05:32dom96oh I see what you mean.
15:05:38dom96Well, you should access that to be honest.
15:05:44dom96Just go straight to http://build.nimrod-code.org/docs/lib.html
15:05:53dom96And that is what http://build.nimrod-code.org/ links to as well
15:06:07dom96I might make a page with all the links at some point though.
15:07:19*Trix[a]r_za is now known as Trixar_za
15:11:04Trixar_zaYou so should list the events in the irc module documentation
15:11:33Trixar_zaOh wait, there it is
15:11:35Trixar_zanevermind
15:11:54dom96heh
15:12:34Trixar_zaTIRCMType* = enum
15:12:35Trixar_za MUnknown, MNumeric, MPrivMsg, MJoin, MPart, MMode, MTopic, MInvite, MKick,
15:12:35Trixar_za MQuit, MNick, MNotice, MPing, MPong, MErro
15:12:44Trixar_zaTIRCEventType* = enum
15:12:45Trixar_za EvMsg, EvDisconnected
15:12:48Trixar_zaI assume it's those
15:12:48Trixar_za:P
15:13:03Trixar_zaBut yeah - rewriting the damn java logbot in Nimrod
15:13:04fowldom96: i like to get to the index that way
15:18:49Trixar_zaThe module can retrieve lag? Oo
15:19:55dom96fowl: I just type "theindex" into firefox and it suggests the page for me ;)
15:20:39dom96Trixar_za: Yay, awesome. And yes, it can ;)
15:20:45fowllol
15:20:53dom96It pings the server periodically, and stores the lag.
15:21:13fowlnow that i have networking working i have to start on the rest of my game :/ all this work i've been putting off lol
15:21:51dom96hehe
15:25:02Trixar_zaYeah, I'm reading through c4hbot's code to learn a proper way to write IRC bots
15:25:03Trixar_za:P
15:25:50Trixar_zaWell, 'better way' would probably be more accurate
15:29:22dom96Note: That code is competition quality on a strict timeline ;)
15:30:11Trixar_zaYeah, but you created procs to handle the events. That's really a better way to do it
15:30:43Trixar_zaYou also turned the Bot into an object (if I'm reading this right)
15:47:52dom96Trixar_za: Yes, it's an object with the Bot as a field.
15:48:17*Trixar_za should learn to program properly
16:11:45*shevy quit (Ping timeout: 252 seconds)
16:24:00*shevy joined #nimrod
17:44:48Araqping zahary
17:45:03AraqI'm implementing 'bind' for macros; I'm almost done
17:46:43Araqbut I wonder if newIdentNode() should return a bound symbol or if we should introduce a new magic
17:50:54zaharywell, if there is a new magic, then there is no need for bind
17:51:03Araqyes there is
17:51:34zaharywhy?
17:51:44Trixar_zaThe sex won't be the same without it
17:51:53Trixar_zaAnd hi Araq
17:52:14Araqlet abc = "x", n = getBoundSym(abc)
17:52:30Araq--> by the time we know what to bind, it's too late
17:52:40Araqbecause it can be runtime value
17:53:20Araq'bind' is declarative and can be processed earlier accurately
17:53:25zaharyI don't follow. it will still be evaluated during the execution of the macro?
17:53:42zaharyah, you mean you need to do the analysis in sem
17:53:44zaharynot in evals
17:53:50Araqyes
17:58:20zaharywell, depending on how inner scopes are handled (whether it's possible to return a call to symbol local to the proc), it may be much more appropriate to do in sem indeed
17:59:06AraqI'm doing it in sem, yes
17:59:09zaharythat said, why do you think a new magic is required
17:59:27Araqbecause newNimNode() is too low level
17:59:37Araqand newIdentNode() is not a builtin anway
17:59:56zaharyI suggested StrToIdent as the hooked magic
18:00:16Araqyeah I don't understand why :-)
18:00:25Araqa symbol is not an ident
18:00:27zaharynotice how newIdentNode expects PNimrodIndent - you cannot create these without StrToIdent
18:00:48Araqah I see, true
18:03:16Araqhi Trixar_za
18:03:37zaharyI still imagine something more along the lines of a special indent node until it's time to return the macro AST and then some additional logic in lookups.nim to turn these into the appropriate symbols
18:04:17Araqwell my latest gensym changes ensure that a nkSym won't be looked up again
18:04:18zaharywhen I say bind x, there may be multiple symbols with that identifier so it depends on the particulars of the nkCall node
18:04:42Trixar_zaI'm so many levels behind it's not even funny
18:04:58dom96Trixar_za: Join the club.
18:04:59Araqwell, nkSymChoice deals with that, zahary
18:05:21Araq'bind x' is more advanced than you may think it is
18:06:23zaharysure, I imagined that may be the case - still you can defer the resolution to the end of evalMacro
18:06:56Araqno because that would require capturing the macro definition's scope
18:07:01Araqand I don't want that :-)
18:07:41Araqit's annoying enough I can't throw away a proc's AST because it could be necessary for CTFE
18:08:07Araqand thus memory usage can only ever increase for large programs
18:10:02zaharya noble goal is to make the memory linear with regard to the source code size (regardless of the constant factor) - then you can postulate that computer's ram amounts will increase faster then the ability of humans to produce code :)
18:10:05zaharybut back to topic
18:10:55zaharyso, you want this new magic to be at least partially handled in sem as well
18:12:54Araqno
18:13:03Araqit works like this:
18:13:24AraqnkBindStmt in macro body: processed in sem.nim, nkBindStmt becomes a list of symbols
18:13:28zaharyand it's not about identifiers, but about symbols… if there is a new magic and it's handled in sem then bind is not needed again, no?
18:13:59AraqnkBindStmt in evals.nim is processed again and fills a symbol table in PEvalContext
18:14:16Araqthe new magic looks at this symbol table
18:14:30Araq--> new magic only in evals.nim
18:14:53Araqan AST can already be "mixed"
18:15:14Araqwith some stuff looked up and other nkIdent's that are still to be processed
18:15:17zaharybindMagic could be handled in sem directly and it can produces a meta node to be used directly in evals.nim without any further analysis
18:15:46AraqbindMagic(myVariableString) # ugh
18:16:05Araqof course you can prevent that by special semantic checking code
18:16:12Araqbut 'bind' seems more attractive
18:16:22zaharyah, yes - 2 minutes ago I though of that, but forgot it
18:16:59Araqwhy do you dislike my solution? ;-)
18:17:14zaharybind requires static symbol names - such new magic could require it too...
18:17:35Araqyeah, I said that :P
18:17:36zaharyI want to avoid the "repeating my intentions" element in the solution
18:18:12zaharybind X
18:18:12zaharygetBoundSym("X")
18:21:43Araqwell yes, as I said, I like the improved readability
18:22:02AraqI guess it often suffices to look at the 'bind' statement and get what the macro is about to do
18:22:43Araq'bind write, writeln, `$`, `&`' # ok, I have an idea ;-)
18:26:44zaharyit's certainly not extremely painful, but it's one thing to say "write a bind statement, then do everything as usual in the rest of the macro" and it's another to say "write a bind statement, then use the % operator to get a bound symbol everywhere where you need one" (my first reaction will be "why do I need to steps here?")
18:27:14zahary* two steps *
18:28:33zaharybut if you like the extra readability then I can't argue further
18:28:53Araqwell I'm almost done with the feature and then we can play around ;-)
18:29:25Araqanother solution is to re-activate the bind *expression* inside of a macro
18:29:41Araqwhich is exactly your solution, but with a keyword instead of a magic
18:30:10Araqmight be a good compromise readability-wise though
18:32:51Araqyour unittest module is interesting btw
18:33:10Araqit shows 'dirty' is really necessary and the same can't be done with 'inject'
18:33:46zaharydirty is the old injectAll, right?
18:34:01Araqas then the client code needs to be aware of the implementation and 'inject' its own locals
18:34:11Araq(yes, dirty = old injectAll)
18:34:48Araqin fact, there is a paper that argues for special hygiene rules to support your testsuite macro
18:36:52Araqso maybe I should have implemented those ;-)
18:38:29zaharythe explicit control one has now with nimrod is the way to go for me - any more complicated rules require you to understand very well the intended usage model set by the language designer and contributes to a much steeper learning curve - learning ATS is example for me in that direction
18:39:24zaharyof course there may be robustness benefits with some more advanced set of rules, but it's hard to tell without any real-world experience using them
18:39:38Araqyeah true
18:41:14*Trixar_za is now known as Trix[a]r_za
18:41:43Araqbut the real "proper" solution are fexprs anyway
18:42:13Araqwhich are first class; hygiene is a workaround to get some kind of lexical scoping back
18:43:15zaharyahm
18:43:42zaharygotta go btw, see you later
18:43:57Araqalright
18:44:09Araqand no, I don't get fexprs either :-)
18:46:59*reactormonk quit (Ping timeout: 240 seconds)
18:48:12*reactormonk joined #nimrod
18:48:39dom96I am so going to compete in Ludum Dare 24 with Nimrod
18:50:20Araqcool :-)
18:51:35dom96http://www.youtube.com/watch?feature=player_embedded&v=v1ByVqh0jrU
18:51:42dom96That's a pretty cool keynote :P
18:55:28Araqbrb
19:18:59Araqback
20:19:04fowlmacro `?`*(a: expr): expr = result = if a[1].kind == nnkIdent: hash($a[1].ident).lit else: a[1]
20:19:31fowl?ez ?fake ?symbols :>
20:22:36dom96That's like obfuscation to the max, if I understand what it does :P
20:27:35Araqfowl: what do you need symbols for?
20:27:44AraqI prefer enums :P
20:34:56fowlI was thinking about using them for IDs
20:35:38Araquse a compiletime variable
20:35:48Araqvar counter {.compileTime.}: int
20:42:50Araqfowl: what about some bug reports? or does your macro fu simply work?
20:43:04fowlit works
20:45:26*zahary quit (Ping timeout: 245 seconds)
20:58:34reactormonkfowl: hmm, liberal symbols vs. conservative enums? ;-)
21:04:16Araqtype TSymbol = distinct int
21:04:22Araqconst
21:04:30Araq symA = TSymbol(0)
21:05:19fowlhmm i should start it again with a compiletime table then i could just use increasing values 0, 1, 2, etc
21:06:01Araqvar counter {.compileTime.}: int
21:06:16Araqproc gensym(): int {.compileTime.} =
21:06:22Araq result = counter
21:06:27Araq inc counter
21:06:45Araqconst symB = TSymbol(gensym())
21:06:54Araqconst symC = TSymbol(gensym())
21:07:16Araqproc `==`(a, b: TSymbol): bool {.borrow.}
21:07:45fowli mean ?foo map foo => compiletimetable["foo"] or compiletimetable["foo"] = counter; inc counter
21:09:11Araqwhy?
21:09:27Araqwhy do you want a compiletimetable?
21:09:38Araquse the compiler's symbol table instead ;-)
21:10:13fowlso when it hits ?foo again its looked up instead of a new id generated
21:10:32Araqmeh
21:10:42Araqso you don't want to declare symbols at all
21:10:48AraqI see
21:10:58fowlno i want to replace them with int literals :p
21:11:33Araqhow do you notice typos then? oh alright, you don't :P
21:11:43Araqseems the way to go :P
21:11:59fowlbrb pizza
21:20:28Araqdom96: please make the "output" subwindow optional
21:21:52*dom96 looks at his todo list and cries
21:21:53dom96:P
21:57:39*reactormonk quit (Ping timeout: 260 seconds)
22:00:21*reactormonk joined #nimrod