Camelia, the Perl 6 bug

IRC log for #ironperl, 2009-02-12

| Channels | #ironperl index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
03:53 diakopter cj: you rang?
15:58 cj http://langnetsymposium.com/
16:01 cj so, if the parser spews to a file handle that is listened to by another process which acts on the spewage, is that "good enough" to bootstrap, do you think?
16:46 diakopter oh, there you are
16:47 diakopter yeah I think that's definitely good enough
16:47 diakopter that's what I was planning..
16:47 diakopter /implementing
16:50 diakopter what're you up to
16:51 diakopter oooooooooooooo   how do I get to go to Lan.NET
16:51 diakopter Lang.NET
16:54 cj just ask.  I'll get you in if you want to come.
16:54 cj they've got a register link on that page
16:54 diakopter it goes to email
16:54 diakopter are you definitely going?
16:54 diakopter If I'm going I'll get Larry to go
16:54 cj I have to check with my manager to see if he can spare me, but I'm pretty sure I will.  It's just as easy for me to get to than my normal building.
16:55 cj yeah, I'd love to see Larry there.  I IRC'd him questions while sitting in on it last year.
16:55 diakopter I mean, I'll ask Larry to go
16:55 cj I've got a video of the State of the Onion from '06 I still owe him :)
16:55 diakopter heh
16:56 cj cc me on that email, either a-cjcol@microsoft.com or cjac@colliertech.org
16:57 diakopter k
16:57 diakopter is there a cost for it?
16:57 diakopter doesn't mention one
16:57 cj no.  it's gratis
16:57 diakopter ok, so it's primarily a recruiting event :P
16:57 cj it was a pretty small gathering last year.  maybe 40 people.
16:58 cj no, just a mind share for the language designers/implementors
16:58 diakopter heh, I was joking
17:00 diakopter (half)
17:04 diakopter I've been thinking a lot about how to most efficiently express the rules to convert the viv-AST to DLR-AST
17:04 diakopter so, lots of thinking and reading, not much typing :)
17:06 cj ASTs still baffle me :)
17:06 diakopter sorry to be so direct (I get this way (demanding) at times), but be more specific.  what about them baffles you
17:06 cj :)
17:07 cj I've never used one, so it's all very abstract to me.
17:07 diakopter lol
17:07 cj if I saw one in use, perhaps I would grasp what I don't understand.
17:07 cj grasp what it is that I don't understand, that is
17:08 cj if I saw a hello world reduced to an AST and then saw how the interpreter/compiler used that to actually *do* something, then I would probably start getting it.
17:08 diakopter well, it's a tree structure.  with each node of the tree representing some *thing* that the parser found.  it's arranged in a tree because traditionally parsers are what detect the implicit and explicit "order of operations" for the program's instructions.
17:09 diakopter so, the root (top) of the tree represents the final result of the program
17:09 diakopter and its children represent its dependencies
17:09 diakopter (chronological dependencies)
17:09 diakopter the children of each node represent that node's chronological dependencies
17:13 cj alright... can you show me the result of parsing a perl6 hello world in a main() function?
17:14 diakopter so, each node has a bunch of metadata attached to it by the parser, and that metadata represents the parser's semantic interpretation and classification of that node
17:15 diakopter ultimately, all that metadata will be used by the following compilation phases to more explicitly convert the AST to a more "granular" AST
17:15 diakopter that is, where the operations are represented in terms of the instructions of the target language (in this case, IronRuby/DLR/C#)
17:16 diakopter ok, so perl6 hello world
17:16 diakopter well, I can do it in pseudocode
17:16 cj okay.  pastebin?
17:16 diakopter I don't understand viv's format yet
17:16 diakopter here is fine:
17:17 diakopter ok fine, pastebin :D
17:17 cj but what if we annoy the other channel members?
17:17 diakopter lol
17:18 diakopter http://ironperl.pastebin.com/d528f2e6e
17:19 cj haha.  you're really setting up the infrastructure :)
17:20 diakopter well, *.pastebin autovivifies that realm
17:20 cj ah.  fancy :)
17:28 diakopter http://ironperl.pastebin.com/d32d696f1
17:30 diakopter so then, a compiler "merely" needs to know how to convert the parser's tree output into the appropriate structure for its target language
17:31 diakopter the work lays in the working out of the details of representing and applying the rules for all those tree transformations
17:31 diakopter and to do that, just knowing the syntax of the source and target languages is not enough
17:31 diakopter the tree transformers must know how the different languages differently apply certain things
17:31 cj this makes me wish I went to school.  :)
17:32 cj I hear most CS folks had a compiler course or two...
17:33 diakopter I didn't; my undergrad degree was "bachelor's of business administration, with specialization in Finance, with subspecialization in Investments", and I'm currently in a top-50 MBA program, focus/concentration undetermined.
17:34 diakopter just, all my jobs have been IT, mostly.
17:34 cj the closest thing I've ever done to this is to write a tool that took objective-c headers and spat out c functions that instantiated the various classes and called each of the methods on those objects
17:34 diakopter sysadmin then coding then project mgmt
17:34 diakopter yeah, well, that's a compiler
17:34 diakopter of sorts.
17:34 diakopter heh
17:34 cj it was a terrible hack :)
17:35 cj it was re-written and is now mono's cocoa#
17:36 cj I had a baby and kangaroo had enough time to do it the right way.  it was fun, even if it was thrown away :)
17:36 diakopter there, emailed
17:36 cj got the email
17:37 cj shri will probably get it and rubber stamp you :)
17:37 diakopter did you see my 2nd pastebin
17:37 cj yeah.  it confused and baffled me.  what does a compiler do with that?
17:38 cj how does that get translated to IL & C#?
17:38 diakopter well, I should have single-quoted all the strings
17:38 diakopter so you could see that it's just "data"
17:38 diakopter not "code"
17:38 diakopter an AST is the "data" form of "code"
17:38 diakopter the compiler (after the parser) has to turn that data structure back into code
17:38 diakopter so it applies various transformations based on the rules it's given
17:39 diakopter the trick to implmenting Perl 6 quickly will be to figure out how to optimally represent "Perl 6 to IronRuby/DLR conversion rules" so that they can be written out very quickly and maintained very easily.
17:40 diakopter that is, representing them as data instead of C#
17:40 cj 'main' => ( 'builtin_function.say' => ( ... ) ), eh?
17:40 diakopter exactly
17:41 cj I played a bit with PPI, which spits out a Code DOM... similar?
17:42 diakopter yeah, the Code DOM is an AST of sorts
17:42 diakopter just maybe a little more (or less) "abstract" than a true Abstract Syntax Tree
17:43 diakopter where the job of the compiler is to make it less and less abstract
17:45 diakopter have you read dlr-spec-hosting.doc ? it's on the codeplex dlr site
17:45 diakopter I'm reading it now
17:45 cj no, I'll take a look
17:47 diakopter since Perl 6 really is *that much more dynamic* than (even) Ruby or Python, it'll be easier/quicker (to implement, but obviously probably slower to execute) to use a hosted IronRuby (combo IronPython) to generate the DLR code... and then another few layers of eval(eval()) later.... it's done. :D  (vastly oversimplified)
17:48 diakopter instead of starting with ToyScript and trying to go directly to DLR
17:48 diakopter which in that case would mean having to replicate a lot of what's already in IronRuby and IronPython
17:48 diakopter it'll be easier to just run on top of one [or both!] of them. :)
17:49 diakopter hell, why not have both runtimes up concurrently, and call into and out of each of them as needed.....!
17:49 cj heh.  eventually it will run on itself, I assume...
17:49 diakopter well sure
17:49 diakopter but I guess what I'm saying is that wouldn't necessarily ever be an "IronPerl.dll"
17:50 diakopter well, there would
17:50 diakopter but more properly it'd be called IronPerlInterpreterGenerator.dll
17:51 diakopter okay, now I'm experimenting with calling in and out of both ir and ipy, hosted.
21:33 diakopter you around?
23:18 diakopter cj: ping
23:46 cj heya
23:46 cj sup?

| Channels | #ironperl index | Today | | Search | Google Search | Plain-Text | summary