Sprixel


The name is a cute anagram of "Perl six". There is an existing but dormant version, and a radically different to-be-released version.

Matthew Wilson (diakopter) has prototyped several Perl 6 implementations. His fourth one started out being called "vijs", because it connected the viv language parser to a runtime interpreter written in JavaScript. Along the way it got renamed to "Sprixel". The JavaScript is executed by the V8 Just-In-Time (JIT) compiler and runtime, the one that makes the Google Chrome browser so fast. Sprixel runs in text only mode, or with any web browser.

The main Sprixel program is written in Perl 5. It embeds viv and calls that to convert a Perl 6 program to an Abstract Syntax Tree. Viv stores the AST in a data structure of nested Perl 5 hashes and arrays. A Sprixel module strips that AST to the bare essentials and serializes it to JSON format. Sprixel then starts the V8 JavaScript processor, passing it runtime code and the AST-in-JSON text. The runtime code loads the AST, and then interprets the code it contains.

So the Sprixel currently available at http://svn.pugscode.org/pugs/src/perl6/sprixel is an AST interpreter, but a fairly quick one when run on V8.

Development of this version of Sprixel stalled because implementing the complex features of Perl 6 in JavaScript became increasingly difficult. Also, diakopter wanted more speed than viv was ever going to give.

After several months of experimentation diakopter settled on C# as the new implementation language, to run on both the Mono and the .NET virtual machines. The new Sprixel will embed a utility called RunSharp to dynamically generate bytecode that gets JIT compiled to native machine code before being executed. It will also contain its own regex and grammar engine, and will probably have its own derived variant of STD.pm for the Perl 6 language definition. The microbenchmarks published in #perl6 so far promise extremely fast parsing and execution performance.