forked from fglock/Perlito
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME-perlito6
123 lines (70 loc) · 3.05 KB
/
README-perlito6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
"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 - [email protected]
The Pugs Team - [email protected]
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