TODO list for KindaPerl6 The kp6 Milestones are: - lexical subs - metamodel interface - bootstrap == kp6-2 - lexical classes - begin blocks - containers Starting Code freeze - translate perl5 runtime to mp6? - translate the compiler front-end to mp6 - test suite - debugging - minimal runtime - bootstrap? - plan Perl6-in-Perl6 The optional features in kp6 are: - coro - macro - multi - private method/sub/accessor - junctions - signatures with optional, named, slurpy arguments - a better parser - $?FILE, $?LINE - finer-grained error messages - precompilation - compiler cache - version checking - user-clonable closures - $closure.clone - creates new pads with copies of lexicals - lexically modifieable Grammar Incomplete features: + try(), eval() + 'Code' closure objects + 'Capture' objects + classes, methods, at compile-time + short-circuiting <&&>, <||>, (require macros, or laziness) - 'let' variables - 'our' variables - CATCH blocks - method hyperization is untested - binding does no type check - (FIXED) all variables initialized during compilation should have initializers for run-time - traits - is context, rw, readonly - containers, but no laziness, no slices - hash and array are under refactoring - type system - optimization phase - for-loop, map, with several arguments - (FIXED) begin-blocks with side-effects - subroutine calls, data, are incompatible with perl 5 - no 'use v5' - declare our/state/temp/constant things - missing GLOBAL::import() at compile-time - 'our $x' should compile to 'my $x ::= $Pkgname::x' - 'use GLOBAL $x' should compile to 'my $x ::= $GLOBAL::x' - perl6-land 'use' - COMPILING::<$?PARSER> - translate the COMPILER package to mp6 - translate Pad.pm and Type.pm to mp6 - create an AST node for INIT/END BEGIN blocks: - (FIXED) an anonymous subroutine is generated, but it is not called at runtime - logging of array/hash element modifications is not implemented - binding to Value is not emitted - Method and Class doesn't have '.perl' Bugs: - missing compile-time methods - compile-time does not import GLOBAL - 'say' doesn't work inside BEGIN blocks - grammar: 'undefine($v)' is not parsed - structure binding/assign is untested Bootstrap: - add a switch for 'mp6 emulation', so that kp6 can be compiled efficiently using itself Roles: - (FIXED) possible implementation: $Obj->{Role_bool} = sub { 1 }; at runtime: $Obj->{Role_bool} && $Obj->{Role_bool}() || $Obj->bool() - problem: objects based on p5-array (Array), p5-code (Code) - p5-land objects will only have Moose-based roles Optimization: - TODO Perl5 compatibility: - mark closure blocks as p5 or p6 (kp6/mp6) Problems running the Perl6 test suite: - kp6 requires a 'compilation unit' declaration - '&&', '||' operators don't short circuit - (FIXED) 'if', 'sub' require ';' - prefix and postfix:<++> not implemented - 'use' doesn't accept parameters: use lib "."; - parameter list error in: if defined $var { ... requires: if defined($var) { ... - no END blocks Visitor modules: - deprecated modules: KindaPerl6::Visitor::LexicalSub KindaPerl6::Visitor::CreateEnv - (FIXED) add variable declarations collector -- XXX now obsolete! - move variable declarations to the start of each block - LexicalSub.pm -- XXX now obsolete! - add 'our' subs to the namespace, if there is one - verify the interface with native p5 subs, such as 'Main::say' - only create a "lexical sub" call if the sub is in scope - MetaClass.pm - add class variables - test bootstrap - roles - alias Class::MOP's 'meta' to 'HOW' --- package Class::MOP::Class; sub meta { Class::MOP::Class->initialize(blessed($_[0]) || $_[0]) } --- - create BUILD, BUILDALL Other: - star/GLOBAL namespace -- done! zzz() --> ($_SUB_zzz || $GLOBAL::_SUB_zzz)->(@args) $*foo --> $GLOBAL::foo but: TimToady> under strict there is no fallback to global unless you explicitly import (you also get a snapshot of GLOBAL imported automatically at the start of compilation) - what are the differences between compiling modules and compile plain-programs - OUTER namespace - ROUTINE - tail-calls For later: - desugar blocks into real subroutines, in support for the parrot backend - fixed by now, using p6parrot as an intermediate language - desugar closures into simple subroutines, in support for the C backend - temp/state desugaring, for perl5 - 6-on-6 design - full-ast - Directory structure + lib + script + t * lib * Kp6 + Compiler + Runtime (or "Prelude") - second level * lib * Kp6 * Compiler + FrontEnd + Grammar (or "Language") + AST + Emitter (or "Target") * Runtime + Kp6 + Parrot + Perl5 - expanded * lib * Kp6 * Compiler * FrontEnd * Cache * Grammar * Perl6 * Regex * Quote * Macro * Variable * AST * Perl6 * Hyper * MetaClass * Regex * Quote * Macro * Variable * Emitter * Kp6 * Parrot * Perl5 * Runtime * Kp6 * Match * Pad * Type * Parrot * Perl5