up
Perl Lecture Notes - July 13 - Perl 6
- end of term business
- Perl 6 Background
- Summer of 2000 : Larry Wall et al decided
it was time for
a major re-write of Perl, from the bottom up.
(Here's the
talk
where it was announced.)
- 361 RFCs
(Request for Change) by Aug 2000.
- Apocalypses
are what Larry calls the language design documents he's
been turning out. Themes are similar to chapters
in the Camel book.
- Exegeses
are what Damien Conway's been calling his explanations of
Larry's Apocalypses.
- PDDs
(Perl Design Documents) are the more concrete versions
of what the language will be.
- Parrot is the
the bottom
is a software assembler virutal machine, the platform
that Perl6 will run on. More on this later.
- Design Goals (filtered through Jim)
- Clean up perl 5. Things like
- support for objects from the ground up, not tacked on
- optional type declarations for more speed.
- better multiple array indeces and loop operators.
- Easily extensible (replace XS) in C
- Customizable at the parser level - even
perl without funny symbols, for example.
- Able to run on small platforms i.e. handhelds
- at least a subset without eval(string).
- Bytecode compilation - cleaner split between high level parser
and low level execution.
- Better able to translate to Java bytecode, .NET, ...
- But..
- what about perl 5.xxx ?
It isn't going away anytime soon.
The claim is that Perl6 will be able to run either, but the details aren't clear yet.
- And when is this all-new version going to be released ?
What do I look like, a fortune teller?
- Parrot
- A "software assembler"
- the virtual machine that Perl 6 will run on.
- Named after a Simon Cozen's
April Fool's Joke in which Larry Wall and Guido van Rossum were going to
merge Perl and Python. (Particularly amusing if you've
seen the language bashing between the two communities at
the various conferences.)
- Unlike Java and C# which are both statically typed,
Parrot is designed for a dynamic typing. Thus both
.NET and JavaVM would run Perl more slowly than Parrot.
- Most of the current active development I can see is here.
- Several small test languages now compile to Parrot:
Jako (C-is), Cola (Java-ish), and Basic. There's even
someone playing with converting
JavaVM to ParrotVM
- Parrot is register based, not stack based.
(The authors claim that this is faster.)
- Written in C. ('cause it runs fast on the most platforms.)
- 4 data types: int (pointer), float, string, PMC (PerlMagicCookie - scalar)
- 32 registers for each type: I0..I31, N0..N31, ..S0..S31, P0..P31
- assember.pl* converts source *.pasm to bytecode *.pbc
- parrot* runs the bytecode
- operations (inc, set, lt) on PMC's will be defined
per PMC - giving an object oriented assembler. (!)
- Here's some parrot fibonacci source code.
- A true open source effort, managed through a mailing list and CVS
repository, with specific folks designated as responsible
for various pieces. A few are even getting paid.
- All examples shown here are a snapshot as of this week.
- some Perl 6 syntax
- Too many pieces to put here, so I've
simply left a number of examples in
this file.
- Resources
- Assignmnent
- Finish on your capstones.
- Entirely Optional
- Browse Larry and Damien's musings on what's coming down the pike.
- Download and try some Parrot.
My last lecture of the term...
- What is Jim doing next semester?