Browse files

start to tell fewer outdated things in docs/compiler_overview.pod

  • Loading branch information...
1 parent 84ca50d commit a5aaddbe6ccf5e8632c684cd24e16a98edf20625 @moritz moritz committed Jul 29, 2011
Showing with 22 additions and 42 deletions.
  1. +22 −42 docs/compiler_overview.pod
64 docs/compiler_overview.pod
@@ -21,7 +21,7 @@ Not Quite Perl builds Perl 6 source code parts into Rakudo
=item 2.
A main program drives parsing, code generation and runtime execution
=item 3.
@@ -43,7 +43,7 @@ F<core/*.pm>, F<glue/*.pir>, F<metamodel/*>)
-The F<Makefile> (generated from F<build/> by
+The F<Makefile> (generated from F<../tools/build/> by
F<../>) compiles all the parts to form the F<perl6.pbc>
executable and the F<perl6> or F<perl6.exe> "fake executable". We call
it fake because it has only a small stub of code to start the Parrot
@@ -53,61 +53,41 @@ F<perl6.c> with the stub at the very end. The entire contents of
F<perl6.pbc> are represented as escaped octal characters in one huge
string called C<program_code>. What a hack!
-=head2 1. NQP[-RX]
+=head2 1. NQP
The source files of Rakudo are preferably and increasingly written in
Perl 6, the remainder in Parrot Intermediate Representation (PIR) or C.
Not Quite Perl (nqp) provides the bootstrap step of compiling compiler
code (yes!) written in a subset of Perl 6, into PIR.
-The latest version of NQP is called B<nqp-rx> because it now also
-includes a powerful Perl 6 regex engine. This gives a streamlined
-compiler framework on which to build a very functional Perl 6
+The latest version of NQP includes the I<6model> library, which is the
+building block for all Perl 6 object. It also comes with a regex engine
+that Rakudo uses.
-NQP-rx is a bootstrapped compiler, it is mostly written in NQP-rx.
-The source code of NQP-rx is in a separate repository at
-L<>. A compiled version of NQP-rx is shipped
-with parrot in the F<../parrot/ext/nqp-rx/> directory, and the resulting
-compiler is F<../parrot_install/bin/parrot-nqp>. Note, NQP-rx only
+NQP is a bootstrapped compiler, it is mostly written in NQP.
+The source code of NQP is in a separate repository at
+L<>. Note, NQPx only
I<builds> the Rakudo compiler, and does not compile or run user programs.
=head3 Stages
-NQP[-RX] compiles us a very good compiler in F<gen/perl6.pbc>, referred
-to as "stage-1", or C<S1_PERL6_PBC> in the F<Makefile>. This version
-would be limited in production though, because libraries of classes and
-methods available at run time (for example Complex) have not yet been
-The "stage-1" compiler (note: not NQP) compiles all Rakudo's Perl 6 code
-again, this time including all the library modules (F<gen/>), to
-make F<perl6.pbc> which could be called "stage-2" (note: not in
-F<gen/>). That F<gen/> file is generated by
-F<build/> from a list called C<CORE_SOURCES> in
-F<Makefile>. Thanks to the staging process, a large and growing
-proportion of Rakudo's source code is written in Perl 6.
-We can conceivably use the Rakudo compiler to compile itself to PIR and
-eliminate the need for NQP entirely. At some point as Rakudo matures we
-will probably do this. However, for the time being it's slightly easier
-to manage the process if we keep a distinction between the two tools,
-and using NQP for this stage also helps us to limit ourselves to using a
-regular, well-defined, and relatively easy-to-implement subset of Perl 6
-for the core compiler. So, while it's possible for us to eliminate NQP
-from the process, there are some good reasons not to do so just yet.
-(If at some point we discover that we need something for the compiler
-that NQP can't or won't support, then that will probably be a good point
-to switch.)
+NQP compiles us a compiler in F<../perl6.pbc> and then F<../perl6>
+or F<../perl6>. NQP also compiles the I<Meta model> found in
+F<Perl6/Metamodel/>. This is a library that controls how classes, methods,
+roles and so on work.
+The bare-bones compiler then loads the compiled metamodel, and compiles
+the I<core files> found in F<core/*.pm>. Those core files provide the runtime
+library (like the C<Array> and C<Complex> classes). But note that many
+of these classes are also used when the final compiler processes your
+Perl 6 scripts.
=head2 2. Compiler main program
-A subroutine called C<'main'>, in F<Perl6/Compiler.pir>, starts the
+A subroutine called C<'MAIN'>, in F<main.nqp>, starts the
source parsing and bytecode generation work. It creates a
-C<Perl6::Compiler> object for the C<'perl6'> source type. The
-C<Perl6::Compiler> class inherits from the Parrot Compiler Toolkit's
-C<HLLCompiler> class, see
+C<Perl6::Compiler> object for the C<'perl6'> source type.
Before tracing Rakudo's execution further, a few words about Parrot
process and library initialization.

0 comments on commit a5aaddb

Please sign in to comment.