pct user docs

Bernhard Schmalhofer Bernhard.Schmalhofer at gmx.de
Tue Nov 25 10:33:30 UTC 2008


Jonathan Worthington schrieb:
>> It shows that you have to use a mix of PIR and NQP. With most tricky
>> parts (like symbol table) done in low-level assembly-like language.
>> Alternative approach is to write a {my HLL} to PIR compiler in perl
>> and forget about PCT at all.
>> Keeping that old way in mind:
>> * NQP looks like reinventing the wheel
>> * using PIR to write a compiler looks as a jump back to a stone age
>> without languages like Perl or C++.
>>
>> This is how it looks from the point of view of a newbie
>>   
>>     
> One big thing is that if you write your compiler in something that isn't 
> running on top of Parrot, you're going to have a lot harder time doing 
> eval-style things, where you need to call back into the compiler at 
> runtime. That's trivial if you're using the PCT toolchain.
>   
However, writing a parser in something else than PGE is currently harder 
than it has
to be. For Pipp I worked on alternative frontends using ANTLR3 and a mix 
of PHC and XSLT.
Both of these alternative frontends are targeting PAST.
For handing the generated PAST to the following parts of the toolchain I 
had to use odd workarounds.
I ended up with generating PIR that emits a PAST-Tree when executed.

For these alternative parsers it would be nice if PCT would accept 
stringified PAST
or an in-memory PAST tree.

On the other hand, I suppose that soon there will be HLL implementations 
using pure Perl 6.

Regards,
    Bernhard



More information about the parrot-dev mailing list