Version 34 of parrot

Updated 2008-03-12 21:58:06 by escargo

Parrot[L1 ] is a new runtime virtual machine written in support of Perl 6 and other dynamic languages.


Try it out

To try out the Tcl interpreter (called partcl) that is currently available with parrot: (you'll need a C compiler, make, and Perl, for now.) (Some parts are compiled, but most of the current implementation is an interpreter.)

First, get a copy of parrot. (See http://www.parrotcode.org/source.html for instructions. You can use svn or grab a snapshot.)

 cd parrot
 perl Configure.pl
 make
 cd languages/tcl
 make

From here, you can cd to examples and make hello. In the tcl directory, there is also a make test target, where you can run the limited test suite. There is also a make tcl-test target that will grab the latest copy of the tcl test suite out of CVS and run them.

You can also see the PIR that your tcl compiles to with the *--pir* option. Also, you can use *-e* to specify the tcl on the command line, ala perl.

 ../../parrot tcl.pbc --pir -e='puts [expr 2 + 2]'

Current Status:

This is a tcl compiler. We use a Perl 6 grammar to parse the code into an AST, which we then translate to PIR (kind of a high level assembly). This is then compiled and executed. (We also use the grammar for the expr sublanguage.)

Only a few built-ins are available inlined: most of the work currently is *always* dispatched at runtime. The primary goal is feature completeness.

A partcl-only option --pir allows you to dump the PIR that would be executed.

Recent work on binary allows a host of expr tests to now pass, bringing up to ~23% passing rate of cvs-latest's suite; we don't *quite* run tcltest yet, but we're getting closer.

New Features

Since this is a brand-new implementation on parrot, it would be nice to take advantage of parrot features like the Parrot Grammar Engine (see PerlSixGrammars).

There's a partcl-only command called inline that lets you invoke code available in another language on parrot:

 % inline PIR {
   .sub 'hello'
      print "hello world\n"
   .end
  }
 hello world

Future Goals:

Run tcltest.tcl : With "make tcl-test", we can now run a (very slightly converted) version of the tcl suite using partcl. While at one point we did a lot of conversion to run these tests in a perl-based harness, we are now running them entirely through partcl. This is accomplished by providing a Test::More like API that has a 'test' fronted - this is shimmed into the header of each .test file, which can then be run directly by partcl.

Provide the ability to call routines defined in other languages from inside Tcl. (There is already a parrot standard library; eventually this would allow us to call anything, say, written in Perl, using native Tcl syntax.)


Hacking

Currently, the Tcl on parrot effort is being coordinated by Matt Diephouse and Will Coleda (will at coleda dot com). If you're interested in helping out, there is C, PIR, Tcl and Perl code that needs writing.

See also perl and python and Will's blog[L2 ]


[Category Language|Category Tcl Implementations (not exclusively, but inclusively)]