root/v6/v6-KindaPerl6/docs/kp6-parrot-boundry.txt

Revision 18812, 3.7 kB (checked in by moritz, 13 months ago)

[kp6]

  • make forcerecompile
  • delete broken script/run_tests_kp6_mp6_perl5rx.pl, the same can be achieved with script/run_tests.pl --backend=perl5rx
  • updated link in docs/pk6-parrot-boundry.txt
Line 
1
2During my quest to figure out where the difficult programming of perl6
3implementation is done, I asked a few questions and received a few responses.
4I have cleaned up the questions and responses and documented them here.  The
5question is "Where is the programming that makes programmer's work a lot
6easier"; Method overloading, objects and so on.
7
8namespace resolution (lexical (my) / file (our) / global (local)) is partly done
9in Runtime/Perl5/Pad.pm (footnote #11)
10
11I had to figure out what code does what?  The AST (footnote #2) / Emit(ers)
12(footnote #1) are too small to be doing the work, thus some other code had to be
13doing the majority of the work.
14
15When thinking about the kindaperl6 compilation process; think of kindaperl6 as
16being a translator rather than a compiler.  kindaperl6's AST uses a visitor
17pattern to convert [emit] perl6 code into perl5, parrot, or lisp. (footnote #1,
18#7)
19
20One method to write the compiler would be to write a compiler in perl5 that
21reads in the perl6 code and produces parrot PIR.  While this is straight forward
22process, writing a perl6 compiler in perl5 to compile perl6 provides a very
23good self test.  If the perl6 can compile itself, then the perl6 compiler
24probably is correct.
25
26However, while looking at the perl6 compiler I realized that there is not enough
27code in there to be a true compiler.  There are whole blocks of code missing
28that should be handling a lot of the difficult programming.  Method overloading,
29object handling and so on.
30
31The majority of the missing code is in the Parrot op code. (footnote #5) When
32thinking about perl6/parrot, think of parrot as being a virtual machine that
33that executes a subset of perl6 in an macro language.  Kindaperl6 converts
34perl6 code into Parrot PIR (future: convert perl6 code into a Parrot AST)
35(footnote #4, #8). Parrot provides it's own object method handling code
36(footnote #9) however that is not completed.  However, Parrot Object code is
37not done yet (footnote #10), and Object inheritance / virtual methods is
38currently (Oct. 14 2007) done in the kp6 compiler/runtime (footnote #12).
39
40However, some perl6 code will be have to expanded into Parrot PIR such as the
41regular expressions and grammars.  Junctions where also noted as part of the
42work that kindaperl6 would have to write out its own Parrot code to do
43(footnote #6).
44
45Notable links:
46
47Parrot op code:
48    http://www.parrotcode.org/docs/ops/
49Description of parrot processing:
50    http://www.oreillynet.com/onlamp/blog/2006/03/inside_parrots_compiler_tools.html
51
52Footnotes:
53
54 0. Bulk of the conversation:
55    http://irclog.perlgeek.de/perl6/2007-10-24
56
57 1. AST/Emit(ers):
58    http://svn.pugscode.org/pugs/v6/v6-KindaPerl6/src/KindaPerl6/Visitor/Emit
59
60 2. kindaperl6 AST
61        http://svn.pugscode.org/pugs/v6/v6-KindaPerl6/src/KindaPerl6/Ast.pm
62    Abstract Syntax Tree
63        http://en.wikipedia.org/wiki/Abstract_syntax_tree
64 3. visitor pattern:
65    http://en.wikipedia.org/wiki/Visitor_pattern
66
67 4. http://irclog.perlgeek.de/perl6/2007-10-24#i_131304
68
69 5. http://irclog.perlgeek.de/perl6/2007-10-24#i_131284
70
71 6. http://irclog.perlgeek.de/perl6/2007-10-24#i_131293
72    http://search.cpan.org/dist/Perl6-Junction/lib/Perl6/Junction.pm
73
74 7. http://irclog.perlgeek.de/perl6/2007-10-24#i_131293
75
76 8. http://irclog.perlgeek.de/perl6/2007-10-24#i_131350
77
78 9. http://www.parrotcode.org/docs/ops/object.html
79
8010. http://irclog.perlgeek.de/perl6/2007-10-24#i_131401
81
8211. http://svn.pugscode.org/pugs/v6/v6-KindaPerl6/src/KindaPerl6/Runtime/Perl5/Pad.pm
83    http://svn.pugscode.org/pugs/v6/v6-KindaPerl6/src/KindaPerl6/Runtime/Perl6/Pad.pm
84    http://irclog.perlgeek.de/perl6/2007-10-24#i_131403
85
8612. http://irclog.perlgeek.de/perl6/2007-10-24#i_131400
Note: See TracBrowser for help on using the browser.