Gentlemen, we can rebuild him. We have the technology. [ . . . ]
Better than he was before. Better . . . stronger . . . faster.
The Intermediate Code Compiler (IMCC) is an alternate tool for creating and running Parrot bytecode. It has several advantages over the method introduced in the previous chapter. It’s a Parrot assembler and embeds the Parrot runtime engine, so it can compile a PASM file to bytecode and immediately run the bytecode with a single command. IMCC can also perform code optimizations, though it doesn’t by default.
IMCC includes its own language, which is commonly called
Language (PIR). PIR is an overlay on top of Parrot assembly language
and has many higher-level features, though it still
isn’t a high-level language. Assembly files
containing PIR code end with an
The first step to working with IMCC
is to compile it. First, build Parrot following the steps in the
previous chapter. Then, from within the
languages/imcc directory in the
parrot repository, type:
$ make $ make test
It’s likely that by the time you read this, you
won’t have to compile IMCC at all. One of the
planned tasks is to include these steps in Parrot’s
Makefile, so it will be done when you compile
After compiling IMCC, create a file
languages/imcc directory with these two
lines (or reuse the file from Chapter 6):
print "He's pining for the ...