Perl 6
viv: Revision 6
The 'viv' parser is a generated program for experimenting with the evolving Perl 6 language specifications, using only Perl 5 based software. The main source code of 'viv' is [], the "official" Perl 6 grammar, self referentially written in a subset of Perl 6. [] parses Perl 6 source code, checking it for correct syntax and semantics, and converts it to a 'viv' abstract syntax tree (VAST).

The chicken-or-egg bootstrap problem is how to use [] on a computer that does not have a Perl 6 to run it. None of the current (March 2010) Perl 6 implementations (Rakudo, Pugs etc) can handle [], because amongst other things it uses Longest Token Matching (LTM), a feature of Perl 6 grammars that is particularly difficult to implement in a general purpose parser.

A utility called 'gimme5' comes to the rescue. Larry wrote 'gimme5' in Perl 5 to translate a subset of Perl 6 grammars into Perl 5 language. The [] 'make' command uses 'gimme5' to translate [] into 'viv'. Larry ensures that [] is written in just a translatable subset of Perl 6, so that 'gimme5' can handle it. He also causes 'viv' to emulate Longest Token Matching, by carefully arranging the sequence of tokens where they occur as alternatives in []. The result is that longer tokens occur and match before shorter ones.

Anyone can try 'viv' online. Join the #perl6 channel on, then address your command to the std: nick. For example:

> std: say "hello";

The output is either an awesome error message, or the status 'ok' followed by the amount of time and megabytes of memory that 'viv' took to parse the source. Unfortunately, 'viv' is not equipped to execute the code. Other language tools such as [Mildew] extend 'viv' further and may be able to do that.

* "read viv source code"<>

Upload Files

Click "Browse" to find the file you want to upload. When you click "Upload file" your file will be uploaded and added to the list of attachments for this page.

Maximum file size: 50MB

File Name Author Date Uploaded Size

Save Page As

Enter a meaningful and distinctive title for your page.

Page Title:

Tip: You'll be able to find this page later by using the title you choose.

Page Already Exists

There is already a page named XXX. Would you like to:

Save with a different name:

Save the page with the name "XXX"

Append your text to the bottom of the existing page named: "XXX"

Upload Files

Click "Browse" to find the file you want to upload. When you click "Add file" this file will be added to the list of attachments for this page, and uploaded when you save the page.

Add Tags

Enter a tag and click "Add tag". The tag will be saved when you save the page.