|
Perl 6
Sprixel: Revision 6
The name is a cute anagram of "Perl six". There is an existing but dormant version, and a radically different yet-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 was executed by the V8 Just-In-Time compiler and runtime that also gives the Google Chrome browser its extremely fast JavaScript performance. Any other JavaScript engine, or any other browser, can also be used, but they would be slower. Sprixel also runs in a text only mode without a web browser. The main Sprixel program is written in Perl 5. It embeds viv and calls that to convert Perl 6 source to an Abstract Syntax Tree that is stored in set of nested Perl 5 hashes and arrays. A Sprixel module strips that AST to the bare essentials and makes a JSON structure from it. Sprixel then starts the V8 JavaScript processor, passing it startup code, libraries and this AST-in-JSON structure. The startup code loads the JSON AST, and the runtime libraries (all written in JavaScript) interpret the code in the tree. 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. From Common Language Runtime bytecode, Sprixel will use a module called RunSharp to dynamically generate and execute native machine code. The new version of Sprixel will 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. |