<yorickpeterse>
darix: can you add that to the issue? I'm terrible at keeping tabs on this in IRC
<darix>
ok
<yorickpeterse>
I have some FOSDEM stuff to prepare this weekend but I'll make a note to take a look at it as well
<|jemc|>
yorickpeterse: I see you're doing some new years issue ticket cleaning :)
<yorickpeterse>
|jemc|: Yeah, it's my way of zen gardening
<darix>
there
<yorickpeterse>
darix: thanks
atambo has quit [Quit: yarr]
atambo has joined #rubinius
JohnBat26 has joined #rubinius
JohnBat26 has quit [Client Quit]
benlovell has quit [Ping timeout: 240 seconds]
goyox86_ has joined #rubinius
yorickpeterse1 has joined #rubinius
jeremyevans has quit [Ping timeout: 256 seconds]
yorickpeterse has quit [Ping timeout: 256 seconds]
TheMoonMaster has quit [Ping timeout: 256 seconds]
goyox86 has quit [Ping timeout: 264 seconds]
dreinull75 has quit [Ping timeout: 264 seconds]
TheMoonMaster_ has joined #rubinius
yorickpeterse1 has quit [Changing host]
yorickpeterse1 has joined #rubinius
yorickpeterse1 is now known as yorickpeterse
Bwild has joined #rubinius
goyox86_ has quit [Read error: Connection reset by peer]
goyox86 has joined #rubinius
<yorickpeterse>
Right, compiler question:
<yorickpeterse>
In this particular case I'm working on a compiler for my parser, which is supposed to turn a grammar AST into a set of parsing states and what not
<yorickpeterse>
I'm currently torn between 1) having the compiler process the AST directly or 2) having the compiler process an intermediate format
<yorickpeterse>
Option 1 would be easier time wise, but option 2 would seem to make more sense as you're not directly tied into an AST
<yorickpeterse>
Though I'm still not sure if option 2) would give any benefits over 1 in this case, since I'm not writing something as complex as, say, clang
<yorickpeterse>
Any thoughts on this?
johnmuhl has joined #rubinius
robin850 has quit [Remote host closed the connection]
<[spoiler]>
I'd go with o2, because you're more versatile, ihmo
<[spoiler]>
yorickpeterse: ^
<yorickpeterse>
But in what way though? Seeing how this compiler wouldn't be that complex I'm not sure if it's going to offer more compared to just using the AST
<yorickpeterse>
Somewhere in the back of my head it makes sense not to couple this directly to the AST, but I'm a bit confused
<yorickpeterse>
e.g. with ruby-lint (https://github.com/yorickpeterse/ruby-lint) I chose to use the AST directly, although there it makes sense since it's well, code analysis
<yorickpeterse>
But there I did also have the problem that it leads to quite confusing code
<[spoiler]>
hmm
<[spoiler]>
This is a bit beyond me, to be fair :P I can't offer any more advice apart from my "abstract" advice from earlier
<yorickpeterse>
Don't worry, Any form of advice is much appreciated
<|jemc|>
yorickpeterse: what would the intermediate form "look like"?
<|jemc|>
as in, in what way would it be different from an AST?
<|jemc|>
for what it's worth, in pegleromyces it works something like (parsable grammar text) -> (AST) -> (AST optimizations) -> (parsing machine opcodes) -> (Rubinius VM bytecode)
<yorickpeterse>
|jemc|: That's what I'm not sure of just yet
<|jemc|>
so if you need another layer of indirection it may make sense to add it after the AST?
<yorickpeterse>
what the AST would have to result in (eventually) is: a list of terminal names, a list of non-terminal names, a state transition table, a rule table and that's about it
<yorickpeterse>
so a bunch of arrays :P
<yorickpeterse>
I was thinking of converting an AST to basically opcodes, but that wouldn't be very different from just using the AST directly (the opcodes would basically just be method calls)
<|jemc|>
to me it sounds like you could have a visitor walk the AST to make the final tables
<|jemc|>
that should be enough separation of concern to suit
<yorickpeterse>
That's what I'd normally do: build an AST runner
<yorickpeterse>
(e.g. it's what I did with ruby-lint)
<yorickpeterse>
and Oga's XPath evaluator is an AST runner as well
<yorickpeterse>
right I'm off to bed, I'll probably dream about this and see :P