# $Id: ROADMAP.pod 17502 2007-03-15 18:52:41Z paultcochrane $

=head1 Title 

Roadmap for languages/PIR

=head1 Intro

This document describes a roadmap for languages/PIR, the PIR
implementation using the Parrot Compiler Tools: PGE and TGE.

This document does NOT describe IMCC, the current implementation
of Parrot Intermediate Representation (PIR) used by Parrot.

Neither does this document describe a TODO list; you can find
that list in the, you guess it, TODO file.

=head1 What's the goal of languages/PIR?

The goal is to have a PIR implementation in PIR itself :-)

Just like most C compilers are implemented in C, it'd be nice to
define PIR in PIR itself. Moreover, this is a good test-case of the
Parrot Compiler Tools Suite (PCTS), consisting of PGE (for parsers) and TGE
(for tree transformations).

Besides PIR, Perl6 and a number of other languages is being implemented
using the PCTS.

Another, secondary, goal is to *define* PIR; there is not yet a 
final description that precisely states the grammar of PIR. (The
Yacc input file is big and hard to read). This also gives the opportunity
to clean up the grammar, and present a nice and clean grammar for
Parrot 1.0.


=head1 Where is languages/PIR now?

Currently, work is being done on the PIR parser. The parser is being
implemented using the Parrot Grammar Engine (PGE), that implements
the subsystem of Parrot that will process Perl6 regex-es and rules.


=head1 Where is languages/PIR going?

As soon as the parser is done, there should be a simple processing
pass that reads the parse-tree and emits PIR instructions. That's right,
it will be a PIR->PIR compiler. This works, because currently PIR
is already implemented by IMCC, using Lex and Yacc.

Then after that, *and* if there is an API to emit bytecode, (or at least
a way to call into Parrot to do the stuff it's supposed to do), the 
Real Parrot Bytecode can be emitted, so that IMCC can be skipped altogether.



=head1 What main tasks need to be done?

This is only a top-level view (a.k.a. ROADMAP), for a detailed list, see TODO.

=over 4

=item Finish and TEST the parser

=item Implement a first back-end: emit PIR

=item Implement a second back-end: call the bytecode API

=back


=head1 Author

Klaas-Jan Stol <parrotcode@gmail.com>

January 2007

=cut


syntax highlighted by Code2HTML, v. 0.9.1