Parrot: Writing PIRLast modification: 2008/07/20 23:55 |
||||
|---|---|---|---|---|
| Parrot: HomePIRPGE | ||||
Writing PIR
PIR stands for Parrot Intermediate Representation. It is half-way between PASM (the Parrot Assembly Language) and a full-blown language such as Perl. Whenever writing programs targeting the Parrot runtime directly, you will almost always use PIR. It abstracts away a number of the nastier problems with assembly language, such as running out of registers for storage and the need to hard code GOTO jumps. Here's the classic 'Hello World' program: .sub hello
# Trivial example
print "Hello world!\n"
.end
To run this, save this text as hello.pir, fire up a command line shell with the parrot executable on the path and type: parrot hello.pir
"Hello world!" should be printed on the screen. TutorialsMore detailed tutorials can be accessed from the following links: Tutorial 1: Local variables |
||||
|
QuokkaWiki 0.8.16
2012/05/19 16:32 -- 38.107.179.211 |
||||