Permalink
Browse files

Perlito version 8.0

  • Loading branch information...
1 parent 047d0a3 commit 8f67bea40e91a766f85da0f2165d82283a039171 @fglock committed Dec 24, 2011
Showing with 857 additions and 830 deletions.
  1. +15 −4 ChangeLog
  2. +20 −98 README
  3. +123 −0 README-perlito6
  4. +32 −0 TODO-perlito5
  5. +10 −12 TODO → TODO-perlito6
  6. +1 −1 hello.sh
  7. +2 −2 html/perlito5.js
  8. +2 −2 html/{perlito-pt-BR.html → perlito6-pt-BR.html}
  9. +1 −1 html/{perlito.html → perlito6.html}
  10. +398 −458 html/{perlito.js → perlito6.js}
  11. +1 −1 lib5/Perlito/AST.pm
  12. +1 −1 lib5/Perlito/Clojure/Emitter.pm
  13. +1 −1 lib5/Perlito/Emitter/Token.pm
  14. +1 −1 lib5/Perlito/Eval.pm
  15. +1 −1 lib5/Perlito/Expression.pm
  16. +1 −1 lib5/Perlito/Go/Emitter.pm
  17. +1 −1 lib5/Perlito/Go/Prelude.pm
  18. +1 −1 lib5/Perlito/Grammar.pm
  19. +1 −1 lib5/Perlito/Grammar/Control.pm
  20. +1 −1 lib5/Perlito/Grammar/Regex.pm
  21. +1 −1 lib5/Perlito/Java/Emitter.pm
  22. +1 −1 lib5/Perlito/Javascript/Emitter.pm
  23. +1 −1 lib5/Perlito/Javascript/Prelude.pm
  24. +1 −1 lib5/Perlito/Javascript/Runtime.js
  25. +1 −1 lib5/Perlito/Lisp/Emitter.pm
  26. +1 −1 lib5/Perlito/Lisp/Prelude.pm
  27. +1 −1 lib5/Perlito/Macro.pm
  28. +1 −1 lib5/Perlito/Parrot/Emitter.pm
  29. +1 −1 lib5/Perlito/Parrot/Match.pm
  30. +1 −1 lib5/Perlito/Perl5/Emitter.pm
  31. +1 −1 lib5/Perlito/Perl5/Prelude.pm
  32. +1 −1 lib5/Perlito/Precedence.pm
  33. +1 −1 lib5/Perlito/Python/Emitter.pm
  34. +1 −1 lib5/Perlito/Rakudo/Emitter.pm
  35. +1 −1 lib5/Perlito/Ruby/Emitter.pm
  36. +1 −1 lib5/Perlito/Runtime.pm
  37. +1 −1 lib5/Perlito/Test.pm
  38. +1 −1 lib5/Perlito5/AST.pm
  39. +1 −1 lib5/Perlito5/Emitter/Token.pm
  40. +1 −1 lib5/Perlito5/Eval.pm
  41. +1 −1 lib5/Perlito5/Expression.pm
  42. +1 −1 lib5/Perlito5/Grammar.pm
  43. +1 −1 lib5/Perlito5/Grammar/Control.pm
  44. +1 −1 lib5/Perlito5/Grammar/Regex.pm
  45. +1 −1 lib5/Perlito5/Javascript/Emitter.pm
  46. +1 −1 lib5/Perlito5/Javascript/Prelude.pm
  47. +1 −1 lib5/Perlito5/Javascript/Runtime.js
  48. +1 −1 lib5/Perlito5/Macro.pm
  49. +1 −1 lib5/Perlito5/Perl5/Emitter.pm
  50. +1 −1 lib5/Perlito5/Perl5/Prelude.pm
  51. +1 −1 lib5/Perlito5/Precedence.pm
  52. +1 −1 lib5/Perlito5/Runtime.pm
  53. +1 −1 lib5/Perlito5/Test.pm
  54. +2 −2 perlito5.pl
  55. +3 −3 perlito.pl → perlito6.pl
  56. +1 −1 src5/lib/Perlito5/Javascript/Runtime.js
  57. +1 −1 src5/util/perlito5.pl
  58. 0 {src → src6}/lib/Perlito/AST.pm
  59. 0 {src → src6}/lib/Perlito/Clojure/Emitter.pm
  60. 0 {src → src6}/lib/Perlito/Emitter/Token.pm
  61. 0 {src → src6}/lib/Perlito/Eval.pm
  62. 0 {src → src6}/lib/Perlito/Expression.pm
  63. 0 {src → src6}/lib/Perlito/Go/Emitter.pm
  64. 0 {src → src6}/lib/Perlito/Go/Prelude.pm
  65. 0 {src → src6}/lib/Perlito/Go/Runtime.go
  66. 0 {src → src6}/lib/Perlito/Grammar.pm
  67. 0 {src → src6}/lib/Perlito/Grammar/Control.pm
  68. 0 {src → src6}/lib/Perlito/Grammar/Regex.pm
  69. 0 {src → src6}/lib/Perlito/Java/Emitter.pm
  70. 0 {src → src6}/lib/Perlito/Java/Runtime.java
  71. 0 {src → src6}/lib/Perlito/Javascript/Emitter.pm
  72. 0 {src → src6}/lib/Perlito/Javascript/Prelude.pm
  73. +1 −1 {src → src6}/lib/Perlito/Javascript/Runtime.js
  74. 0 {src → src6}/lib/Perlito/Lisp/Emitter.pm
  75. 0 {src → src6}/lib/Perlito/Lisp/Prelude.pm
  76. 0 {src → src6}/lib/Perlito/Lisp/Runtime.lisp
  77. 0 {src → src6}/lib/Perlito/Macro.pm
  78. 0 {src → src6}/lib/Perlito/Parrot/Emitter.pm
  79. 0 {src → src6}/lib/Perlito/Parrot/Match.pm
  80. 0 {src → src6}/lib/Perlito/Perl5/Emitter.pm
  81. 0 {src → src6}/lib/Perlito/Perl5/Prelude.pm
  82. 0 {src → src6}/lib/Perlito/Perl5/Runtime.pm
  83. 0 {src → src6}/lib/Perlito/Precedence.pm
  84. 0 {src → src6}/lib/Perlito/Python/Emitter.pm
  85. 0 {src → src6}/lib/Perlito/Python/Prelude.pm
  86. 0 {src → src6}/lib/Perlito/Python/Runtime.py
  87. 0 {src → src6}/lib/Perlito/Rakudo/Emitter.pm
  88. 0 {src → src6}/lib/Perlito/Ruby/Emitter.pm
  89. 0 {src → src6}/lib/Perlito/Ruby/Prelude.pm
  90. 0 {src → src6}/lib/Perlito/Ruby/Runtime.rb
  91. 0 {src → src6}/lib/Perlito/Runtime.pm
  92. 0 {src → src6}/lib/Perlito/Test.pm
  93. 0 src/util/perlito-browser.pl → src6/util/perlito6-browser.pl
  94. +4 −4 src/util/perlito.pl → src6/util/perlito6.pl
  95. +0 −7 util-js/make-perlito-js.sh
  96. +7 −0 util-js/make-perlito6-js.sh
  97. +1 −1 util-parrot/hello-parrot.sh
  98. +0 −77 util-perl5/bootstrap-perl5.sh
  99. +77 −0 util-perl5/bootstrap-perlito6-perl5.sh
  100. +34 −0 util-python/build-perlito6-python.sh
  101. +0 −34 util-python/build-python.sh
  102. +40 −0 util-ruby/bootstrap-perlito6-ruby.sh
  103. +0 −40 util-ruby/bootstrap-ruby.sh
  104. +31 −0 util-ruby/build-perlito6-ruby.sh
  105. +0 −31 util-ruby/build-ruby.sh
  106. +1 −1 v6.pm/ChangeLog
  107. +2 −1 v6.pm/MANIFEST
  108. +1 −1 v6.pm/Makefile.PL
  109. +3 −3 v6.pm/make-v6.sh
  110. +1 −1 v6.pm/perlito.pm
View
@@ -1,17 +1,28 @@
-dev 2011-11-10
+8.0 2011-12-24
+- added new compiler for Perl version 5.
+
+Perlito Perl 5:
+- command line "perlito5.pl"
+- supported backends: Perl 5, Javascript
+- source code in src5/ directory
+
+Perlito Perl 6:
+- command line renamed to "perlito6.pl"
+- supported backends: Perl 5, Python 2.6, Javascript
- new experimental backend: Java
- fixed META.yml for "v6.pm" CPAN distribution (thanks Aevar)
- fixed unicode IO, added unicode tests
- add some formatting to Perl5 and Javascript output
- methods: map, grep
- operators: x
-- source code moved to src/ directory
+- source code moved to src6/ directory
Regressions:
- removed '-B' command line flag (since 7.0)
-- backends pending upgrade to the new AST: Go, Common Lisp, Ruby 1.9, Eval (since 7.0)
-- backends not supported in this version: Parrot, Rakudo, Clojure (since 7.0)
+- backends pending upgrade to the new AST: Common Lisp, Ruby 1.9, Eval
+- backends no longer supported in this version: Go, Parrot, Rakudo, Clojure
+
7.0 2011-04-20
- supported backends: Perl 5, Python 2.6, Javascript
View
118 README
@@ -1,123 +1,45 @@
-"Perlito" Perl 6 compiler
+"Perlito" Perl compiler
- This is Perlito, a compiler that implements a subset of Perl 6.
+ This is Perlito, a compiler collection that implements a subset of Perl 5 and Perl 6.
Backends
- Perlito can compile Perl 6 programs into one of the 'backend'
+ Perlito5 can compile Perl 5 programs into one of the 'backend'
+ languages:
+
+ Perl 5, Javascript
+
+ Perlito6 can compile Perl 6 programs into one of the 'backend'
languages:
Perl 5, Javascript, Python 2.6
- Previous versions of Perlito also compile to: Go, Common Lisp, and Ruby 1.9
+ 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 Perlito online, in the browser: http://perlcabal.org/~fglock/perlito.html
-
-Source code
-
- The source code for Perlito can be found in the 'src' directory.
- Perlito is written in Perl 6.
-
-USING PERLITO
-
-Using the Javascript backend in the browser
-
- Open the file 'html/perlito.html' in a browser (Firefox, Chrome, Safari).
-
- Alternately, browse to:
-
- http://perlcabal.org/~fglock/perlito.html
-
-Using the Javascript backend in the command line
-
- export PERL5LIB=lib5
- perl perlito.pl -Cjs -e 'class Main { say "hello, World!" }' > tmp.js
- d8 tmp.js
-
- Creating a bootstrapped compiler:
-
- # compile src/util/perlito.pl to Javascript, using perlito.pl:
- export PERL5LIB=lib5
- perl perlito.pl -Cjs src/util/perlito.pl > perlito.js
-
- # testing the bootstrap with the v8 developer shell
- d8 perlito.js -- -Cjs src/util/perlito.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:
+ Run Perlito online, in the browser:
- cpan v6
+ http://perlcabal.org/~fglock/perlito5.html
- From the Perlito git project directory:
+ http://perlcabal.org/~fglock/perlito6.html
- export PERL5LIB=lib5
- perl perlito.pl -Cperl5 -e 'class Main { say "hello, World!" }' | perl
-
- Creating the bootstrapped compiler:
-
- # compile src/util/perlito.pl using perlito.pl:
- export PERL5LIB=lib5
- perl perlito.pl -Cperl5 src/util/perlito.pl > perlito-perl5.pl
-
-Using the Python backend
-
- # initialize "./libpy" and compile "perlito.py"
- . util-python/build-python.sh
-
- # using the perlito.py compiler
- export PYTHONPATH=libpy
- python perlito.py -Cpython -e 'class Main { say "hello, World!" }' | python
-
-Using the Ruby backend
-
- export RUBYLIB=src/lib
-
-PRODUCING AST OUTPUT
-
- perl perlito.pl -Cast-perl6 -e 'class Main { say "hello, World!" }'
-
-RUNNING TESTS
-
- Perl 5:
-
- find t/*.t | perl -ne ' print "*** $_"; chomp; print ` perl perlito.pl -Cperl5 $_ | perl ` '
-
- Javascript:
-
- find t/*.t | perl -ne ' print "*** $_"; chomp; print ` d8 perlito.js -- -Cjs $_ > tmp.js && d8 tmp.js ` '
-
- Python 2.6:
-
- find t/*.t | perl -ne ' print "*** $_"; chomp; print ` python perlito.py -Cpython $_ | python ` '
+Source code
-AUTHORS
+ The source code for Perlito5 can be found in the 'src5' directory.
+ Perlito5 is written mostly in Perl 5. It currently contains some Perl6 extensions,
+ but these are being cleaned up.
-Flavio Soibelmann Glock - fglock@gmail.com
-The Pugs Team - perl6-compiler@perl.org
+ The source code for Perlito6 can be found in the 'src6' directory.
+ Perlito6 is written in Perl 6.
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 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.
+ README-perlito6
-See http://www.perl.com/perl/misc/Artistic.html
+ README-perlito5
View
@@ -0,0 +1,123 @@
+"Perlito" Perl 6 compiler
+
+ This is Perlito, a compiler that implements a subset of Perl 6.
+
+Backends
+
+ Perlito can compile Perl 6 programs into one of the 'backend'
+ languages:
+
+ Perl 5, Javascript, Python 2.6
+
+ Previous versions of Perlito 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 Perlito online, in the browser: http://perlcabal.org/~fglock/perlito6.html
+
+Source code
+
+ The source code for Perlito can be found in the 'src' directory.
+ Perlito 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 t/*.t | perl -ne ' print "*** $_"; chomp; print ` perl perlito6.pl -Cperl5 $_ | perl ` '
+
+ Javascript:
+
+ find t/*.t | perl -ne ' print "*** $_"; chomp; print ` d8 perlito6.js -- -Cjs $_ > tmp.js && d8 tmp.js ` '
+
+ Python 2.6:
+
+ find t/*.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 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
+
View
@@ -0,0 +1,32 @@
+TODO list for Perlito5
+
+* source code
+
+-- remove Perl6 code: "class", "has", "token", hyper operator, .push, .shift, .print
+
+-- add "map", "grep", "sort"
+
+-- add regexes
+
+
+* libraries
+
+-- Data::Dumper
+
+
+* Perl5 backend
+
+* Javascript backend
+
+-- bug: packages currently create lexical blocks
+
+-- bug: "my" variables are block-wide; this doesn't work as expected: my $v = $v
+
+-- bug: variable aliases create copies instead
+
+* Python backend
+
+* Ruby backend
+
+* Java backend
+
View
@@ -1,4 +1,4 @@
-TODO list for Perlito
+TODO list for Perlito6
CPAN distribution
@@ -10,9 +10,7 @@ Eval.pm module
- complete ast nodes implementation
-Command line compiler (util/perlito.pl)
-
-- migrate all bootstrap scripts to use util/perlito.pl - FIXED
+Command line compiler (src6/util/perlito6.pl)
- build Ast cache using JSON (we currently use Perl5 Data::Dumper) or XML (Go has XML and JSON input)
@@ -24,33 +22,33 @@ Command line compiler (util/perlito.pl)
- add '-B' option (execute)
-Perlito in Rakudo
+Perlito6 in Rakudo
-- Rakudo should be able to execute Perlito directly. What do we need to fix in both sides?
+- Rakudo should be able to execute Perlito6 directly. What do we need to fix in both sides?
-Perlito in Lisp
+Perlito6 in Lisp
- test other Lisp implementations
-Perlito in Go
+Perlito6 in Go
- document which release of Go to use
-Perlito in Perl5
+Perlito6 in Perl5
(no issues at the moment)
-Perlito in Parrot
+Perlito6 in Parrot
- finish OO, class variables
- fix die() parameter handling
-Perlito in Python
+Perlito6 in Python
- module loading uses mangled filenames (with underlines); it should use dot-separated names instead.
-Perlito in Ruby
+Perlito6 in Ruby
- module loading uses mangled filenames (with underlines); it should use dot-separated names instead.
View
@@ -1 +1 @@
-perl -Ilib5 perlito.pl -Bperl5 -e 'class Main { say "hello, World" }' | perl -Ilib5
+perl -Ilib5 perlito6.pl -Bperl5 -e 'class Main { say "hello, World" }' | perl -Ilib5
Oops, something went wrong.

0 comments on commit 8f67bea

Please sign in to comment.