a perl5 to perl6 translator - update

I've moved the "perlito" perl5 to perl6 compiler to a new home:

There are minor improvements in the compiler since last post, such as:

  • scalar(@a) is @a.elems

  • $a[-1] is @a[*-1]

  • fix "map" syntax

  • eval-string is EVAL

a perl5 to perl6 translator

The "perlito" perl5 to perl6 compiler is online at: http://perlcabal.org/~fglock/perlito5to6.html.

It is also available as an irc bot for snippets and as a command line script.

formats added to perlito5

perlito5 is a Perl compiler written in Perl.

The format statement was required in the grammar for completeness. The 'format' command is not supported at the emitter side - it compiles, but it doesn't run yet.

Some other features are still marked as TODO and are simple to implement:

- dot-decimal strings (without the 'v'),
- "'" meaning "::",
- using 'CORE::' in odd places - 'CORE::if' in place of 'if' and 'CORE::and' in place of 'and'.

With these in place, the grammar will be "100% complete" - the tests will eventually tell if we got there or not.…

indirect-object added to perlito5

perlito5 is a Perl compiler written in Perl.

The tests* for indirect-object and bareword disambiguation can be run online at http://perlcabal.org/~fglock/perlito5.html (you need to copy-paste the tests, it is not automated).

* t5/01-perlito/27-syntax-indirect-object.t

tie() in perlito5

I've just added a small tie() example to the perlito5-in-the-browser page.

This was implemented today, and it only supports a few methods for now.

tie() does not make perlito5 any slower - the tied containers use a separate class, while the non-tied perl5 containers are javascript native array and hash objects.