April 15, 2004

Mmmm, article goodness

Looks like the article on writing a compiler that targets Parrot has hit OnLamp. Probably worth taking a look.

Posted by Dan at April 15, 2004 10:57 PM | TrackBack (1)

Sorry I didn't catch this earlier, but I've found at least one bug (or limitation) in the example compiler. :)

If you try something like

print 1 + 1

Then the generated code won't work.

For a quick workaround, do something like:
push @tokens, "\$P$dest = $val\n";
push @tokens, "\$P$dest = \$P$dest $oper $other_val\n";

Instead of just:
push @tokens, "\$P$dest = $val $oper $other_val\n";

Posted by: Pb at April 16, 2004 08:05 PM