Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tag: v9.0
Fetching contributors…

Cannot retrieve contributors at this time

executable file 167 lines (97 sloc) 4.052 kB
TODO list for Perlito5
* perlito5 command-line
* basic functionality
-- add "print" special parsing
* libraries
-- these should probably go into namespace Perlito5X::*
-- Test (implemented as Perlito5::Test)
-- Data::Dumper (implemented as Perlito5::Dumper)
* Parser
-- bug: fix 'exists' prototype (perl doesn't have a prototype for 'exists')
-- compile-time eval() is not bound to the "program" environment, but to the "compiler" environment instead
my $v;
BEGIN { $v = "123" }
use Module $v; # $v is not accessible at compile-time
-- parse the regexes
-- prototypes (signatures)
--- done: "empty" _ $ ;$
--- check that undeclared barewords give the right error
--- *foo = sub () { ... } # does prototype work here?
--- check signature in sort()
-- check that \(@a) and \@a have different meanings
-- parse "local $x[1]"
-- parse local $@
-- $v{x} doesn't autoquote the index
-- $v{x} doesn't interpolate inside double quotes
-- deref inside double quotes:
$ node perlito5.js -Bjs -e ' my $x = "123"; my $y = \$x; print "[$$y]\n" '
[$[object Object]]
-- this should give a syntax error: $x->meth 123
-- indirect object notation
method Module $param;
-- lookup for existing subroutines:
sub m { my @x = 8, 9; @x } $x = m(); # m() is not a "match"
* Perl5 backend
-- ${^NAME} needs curly-escaping
- fix regex delimiters, or escape the regexes
* Javascript backend
-- bug: don't emit throw() in term position; javascript requires a function() wrapper because throw() is a statement
-- initialize @INC from $ENV{PERL5LIB}
-- javascript errors don't show in the global error handler when running in node.js
-- "autoload" the compiler if eval-string is used (eval-string needs the compiler at run-time)
-- symbol variables like $] ${"main::\$"} $#_
-- check that @_, $_, $a, $b and other special variables are in the right context (lexical, global, package global)
-- emit array/hash slices: @a[@x], @a{@x}
-- add alternate mro's
-- cache the mro
-- add regex compiler
-- /e modifier
-- support all perl5 regex syntax
-- @v = /x/g
-- bug: variable redeclaration does not work
-- javascript "var" erases the outer value within the whole current lexical scope
-- bug: "my" variables - this doesn't work as expected: my $v = $v
possible fix: rename variables
-- lvalue substr(); 4-arguments substr()
-- pos($str)
-- missing some types of subroutine signatures
-- bug: negative index in array doesn't work
-- bug: variable aliases create copies instead
-- generate more compact code; maybe use more subroutines instead of inlining;
autovivification is probably the most verbose part of the code.
-- in the browser: implement "use" with XMLHttpRequest (what are the security implications?)
-- add symbol tables for scalar, array and hash
-- string increment and string ranges
-- finish "overload" implementation
-- pack(), unpack()
-- sprintf()
-- y()()
* More backends
-- Python backend
reuse the Perlito6 implementation
-- Ruby backend
reuse the Perlito6 implementation
-- Java backend
not sure if this is a good idea; other dynamic languages are reported slow in JVM
* Nice to Have
-- labels, "next", "last", "continue"
-- run more of the "perl" test suite
-- proper "use strict" and "use warnings"
-- use the same error messages and warnings as 'perl'
-- no warnings 'redefine';
-- __END__, __LINE__, __DATA__, __FILE__
-- BEGIN{}, INIT{}, END{}
-- source code - remove Perl 6 code such as "token"
(fixed: This is only loaded if the grammar compiler is needed)
-- *{ $name }{CODE}->();
-- local(*{$caller."::a"}) = \my $a;
-- *{$pkg . "::foo"} = \&bar;
* Deprecate
-- remove unused features from src5/lib/Perlito5/Grammar/
-- Interpreter backend
this is not being maintained; the code is still in src5/lib/Perlito5/ just in case
-- Perl6 backend (started)
this is not being maintained; not sure if compiling to Perl6 is the best way
maybe compiling directly to Parrot/dotnet/Haskell gives better results
Jump to Line
Something went wrong with that request. Please try again.