pct user docs

Jonathan Worthington jonathan at jnthn.net
Mon Nov 24 14:23:10 UTC 2008


Pavlo Korzhyk wrote:
> Series of articles from parrotblog was the only tutorial documentation
> I was able to find.
>   
Aye, we need I think some good reference material as well as maybe get 
that tutorial put into the Parrot wiki and any updates done as needed.

> 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.

Note that while you'll no doubt write a little PIR here and there, to do 
some of the low-level stuff, it's not so much. Even in Rakudo, which has 
plenty of evil stuff to do, if you discount the builtin functions and 
classes that are currently written in PIR (which we plan to re-write 
many of in Perl 6 anyway, and in a sense aren't really part of the 
compiler but rather the language's standard library), the PIR code is in 
the minority, and the Perl 6 Grammar and the NQP actions make up the 
majority of the codebase. So it's certainly possible to write a compiler 
with just a little PIR here and there, rather than it making up a big 
part of the code-base...I guess we should see if we can convey that 
better in the tutorial.

Thanks for the feedback,

Jonathan


More information about the parrot-dev mailing list