Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 1a8d3e4e8f
Fetching contributors…

Cannot retrieve contributors at this time

124 lines (70 sloc) 3.125 kB
"Perlito6" Perl 6 compiler
This is Perlito6, a compiler that implements a subset of Perl 6.
Backends
Perlito6 can compile Perl 6 programs into one of the 'backend'
languages:
Perl 5, Javascript, Python 2.6
Previous versions of Perlito6 also compile to: Go, Common Lisp, and Ruby 1.9
Web
Main Perlito repository: http://github.com/fglock/Perlito
Main Project web page: http://www.perlito.org
Run Perlito6 online, in the browser: http://perlcabal.org/~fglock/perlito6.html
Source code
The source code for Perlito can be found in the 'src' directory.
Perlito6 is written in Perl 6.
USING PERLITO
Using the Javascript backend in the browser
Open the file 'html/perlito6.html' in a browser (Firefox, Chrome, Safari).
Alternately, browse to:
http://perlcabal.org/~fglock/perlito6.html
Using the Javascript backend in the command line
export PERL5LIB=lib5
perl perlito6.pl -Cjs -e 'class Main { say "hello, World!" }' > tmp.js
d8 tmp.js
Creating a bootstrapped compiler:
# compile src6/util/perlito6.pl to Javascript, using perlito6.pl:
export PERL5LIB=lib5
perl perlito6.pl -Cjs src6/util/perlito6.pl > perlito6.js
# testing the bootstrap with the v8 developer shell
d8 perlito6.js -- -Cjs src6/util/perlito6.pl > perlito-new.js
Using the Perl 5 backend
From CPAN:
Perlito is available at http://search.cpan.org/dist/v6/lib/v6.pm
Installation:
cpan v6
From the Perlito git project directory:
export PERL5LIB=lib5
perl perlito6.pl -Cperl5 -e 'class Main { say "hello, World!" }' | perl
Creating the bootstrapped compiler:
# compile src6/util/perlito6.pl using perlito6.pl:
export PERL5LIB=lib5
perl perlito6.pl -Cperl5 src6/util/perlito6.pl > perlito-perl5.pl
Using the Python backend
# initialize "./libpy" and compile "perlito6.py"
. util-python/build-perlito6-python.sh
# using the perlito6.py compiler
export PYTHONPATH=libpy
python perlito6.py -Cpython -e 'class Main { say "hello, World!" }' | python
Using the Ruby backend
export RUBYLIB=src6/lib
PRODUCING AST OUTPUT
perl perlito6.pl -Cast-perl6 -e 'class Main { say "hello, World!" }'
RUNNING TESTS
Perl 5:
find t6/*.t | perl -ne ' print "*** $_"; chomp; print ` perl perlito6.pl -Cperl5 $_ | perl ` '
Javascript:
find t6/*.t | perl -ne ' print "*** $_"; chomp; print ` d8 perlito6.js -- -Cjs $_ > tmp.js && d8 tmp.js ` '
Python 2.6:
find t6/*.t | perl -ne ' print "*** $_"; chomp; print ` python perlito6.py -Cpython $_ | python ` '
AUTHORS
Flavio Soibelmann Glock - fglock@gmail.com
The Pugs Team - perl6-compiler@perl.org
SEE ALSO
The Perl 6 homepage at http://dev.perl.org/perl6
The Pugs homepage at http://pugscode.org
The Perlito homepage at http://perlito.org
COPYRIGHT
Copyright 2006, 2009, 2010, 2011, 2012 by Flavio Soibelmann Glock, Audrey Tang and others.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
Jump to Line
Something went wrong with that request. Please try again.