forked from fglock/Perlito
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME-perlito5
83 lines (44 loc) · 2.11 KB
/
README-perlito5
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
Using make:
make
- builds perlito5.js (which runs in node.js)
make test
- tests perlito5.js using node.js
make build-5browser
- builds html/perlito5.js (which runs in the browser)
-- See "Makefile" for more options
Running the tests using "node.js":
# this command will compile "perlito5.js"
perl perlito5.pl -I./src5/lib -Cjs src5/util/perlito5.pl > perlito5.js
# this will run a single test script
node perlito5.js -Isrc5/lib t5/01-perlito/01-sanity.t
# this will run all tests
prove -r -e 'node perlito5.js -I./src5/lib' t5
Compile the compiler to Javascript into perlito5.js:
-- using perl and perlito5.pl:
perl perlito5.pl -I./src5/lib -Cjs src5/util/perlito5.pl > perlito5.js
-- using node.js and perlito5.js:
node perlito5.js -I./src5/lib -Cjs src5/util/perlito5.pl > perlito5-new.js
Compile the compiler to Perl5 using perl:
perl perlito5.pl -I./src5/lib -Cperl5 src5/util/perlito5.pl > perlito5-new.pl
Compile perlito5-in-browser using perl:
perl util-js/make-perlito5-js.sh
Running the tests using "perl":
# this will run all tests
prove -r -e 'perl perlito5.pl -I./src5/lib ' t5
Bootstrap with perl:
time perl perlito5.pl -Isrc5/lib -Cperl5 src5/util/perlito5.pl > perlito5-new.pl && diff perlito5-new.pl perlito5.pl ; cp perlito5-new.pl perlito5.pl
Bootstrap with node.js:
time node perlito5.js -Isrc5/lib -Cjs src5/util/perlito5.pl > perlito5-new.js && diff perlito5-new.js perlito5.js ; cp perlito5-new.js perlito5.js
Minifying the javascript output:
The "jsmin" compressor seems to work, it gives 20% compression:
http://crockford.com/javascript/jsmin
$ sudo port install jsmin # osx
$ jsmin < perlito5.js > mini-perlito5.js
$ nice prove -r -e 'node mini-perlito5.js -I./src5/lib' t5
...
All tests successful.
TODO:
Running the tests using perl6:
# TODO - this is not implemented yet
. util-perl6/setup-perlito5-perl6.sh
find t5/01-perlito/*.t | perl -ne ' print "*** $_"; chomp; print ` perl perlito5.pl -I./src5/lib -Cperl6 $_ > tmp.p6 && perl6 tmp.p6 ` '