| 1 |
The Pugs team is porting all content in this directory to the Pugs Trac |
|---|
| 2 |
at http://dev.pugscode.org. Please put new content there ;-) |
|---|
| 3 |
|
|---|
| 4 |
---- |
|---|
| 5 |
|
|---|
| 6 |
Feel free to use wikipedia Talk style if you know it. |
|---|
| 7 |
|
|---|
| 8 |
== Purpose == |
|---|
| 9 |
|
|---|
| 10 |
This directory was created to address these problems: |
|---|
| 11 |
- No one knows what the current state of the project is. |
|---|
| 12 |
- It is difficult to determine what people are working on. |
|---|
| 13 |
- No one knows what needs to be done. |
|---|
| 14 |
- No one knows how they can help. |
|---|
| 15 |
- No one knows where we are going, or how we are to get there. |
|---|
| 16 |
Perhaps this is a slight overstatement. But only a slight one. |
|---|
| 17 |
|
|---|
| 18 |
The project management approach of pugs has been anarchistic |
|---|
| 19 |
development. A flooding algorithm for planning (everyone working on |
|---|
| 20 |
whatever development path/aspects appeals to them); active and rapid |
|---|
| 21 |
development; continuous communication; and a low commit threshold |
|---|
| 22 |
("don't worry about breaking the build, just commit, and we'll fix |
|---|
| 23 |
it"). This approach worked well when development was rapid, there |
|---|
| 24 |
was a clear primary development thrust, and an active community with |
|---|
| 25 |
an up to date and detailed organizational memory. |
|---|
| 26 |
|
|---|
| 27 |
For several reasons (we haven't been able to pay audreyt to work full |
|---|
| 28 |
time being a key one), the main thrust has slowed, the overall pace of |
|---|
| 29 |
development has slowed, and the community has become smaller, less |
|---|
| 30 |
active, and less tightly informed. This created negative feedback. |
|---|
| 31 |
It became harder to tell what to work on, easier to get stuck, and |
|---|
| 32 |
harder to be motivated. Thus further slowing development and |
|---|
| 33 |
shrinking the active community. |
|---|
| 34 |
|
|---|
| 35 |
I created this directory to increase project transparency. To make it |
|---|
| 36 |
easier for people to see what needs doing, and why. This is not a |
|---|
| 37 |
full solution, but will hopefully mitigate the negative feedback loop, |
|---|
| 38 |
helping us make less slow progress until things pick up again. |
|---|
| 39 |
|
|---|
| 40 |
-- putter 2007-01-20 |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
== Fix PIL2JS == |
|---|
| 44 |
|
|---|
| 45 |
PIL2JS is currently broken. |
|---|
| 46 |
It is our second most complete implementation of p6, after pugs. |
|---|
| 47 |
|
|---|
| 48 |
$ ./pugs -Bjs -e 'say 3;' |
|---|
| 49 |
$ |
|---|
| 50 |
No output. |
|---|
| 51 |
"make test-js" fails similarly. |
|---|
| 52 |
|
|---|
| 53 |
<audreyt> the problem is that JS.pm needs to accomodate statement:cond form |
|---|
| 54 |
which unlike the :if form, takes two arguments as full closures instead of blocks |
|---|
| 55 |
and so will need to do the pil2js equiv of closure apply .() |
|---|
| 56 |
I'm checking in something that doesn't do the .() -- it's 7am here [...] |
|---|
| 57 |
|
|---|
| 58 |
See r15128. |
|---|
| 59 |
perl5/PIL2JS/lib/Prelude/JS.pm |
|---|
| 60 |
register "&statement_control:cond" => sub {... |
|---|
| 61 |
|
|---|
| 62 |
-- putter 2007-01-22 |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
== KP6 on PIL2JS? == |
|---|
| 66 |
|
|---|
| 67 |
Could kp6 run on PIL2JS? If so, then kp6-pil2js would become our |
|---|
| 68 |
second self-hosting p6 implementation. pil2js has good smoke results, |
|---|
| 69 |
and so might be a faster way to get kp6 "real" than writing a new |
|---|
| 70 |
backend from scratch. |
|---|
| 71 |
|
|---|
| 72 |
pil2js currently delegates its parsing to pugs, and so can't parse oo, |
|---|
| 73 |
but does use oo internally. so porting kp6 might require hand |
|---|
| 74 |
transfering the oo parts to get bootstrapped. |
|---|
| 75 |
|
|---|
| 76 |
Some things which might be explored: |
|---|
| 77 |
- how much of kp6 can pil2js run now? |
|---|
| 78 |
- can kp6 handle pil2js's p6 code? (perl5/PIL2JS/lib6/Prelude) |
|---|
| 79 |
- how close is the kp6 ast to the PIL1 ast pil2js uses? |
|---|
| 80 |
|
|---|
| 81 |
-- putter 2007-01-22 |
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 |
== redsix on PIL2JS == |
|---|
| 85 |
-- putter 2007-01-24 |
|---|
| 86 |
|
|---|
| 87 |
Background |
|---|
| 88 |
|
|---|
| 89 |
PIL2JS uses pugs to generate PIL1 ast, processes it using p5, and has |
|---|
| 90 |
a p6+js runtime. It has been blocked for two years by PIL1 not having |
|---|
| 91 |
oo information. |
|---|
| 92 |
|
|---|
| 93 |
PIL2JS is attractive. It was our second best (after pugs) backend in |
|---|
| 94 |
terms of test coverage. It's use of p6 and p5 means it is closer than |
|---|
| 95 |
pugs to being a p6 bootstrap. Even some of its js could be rewritten |
|---|
| 96 |
in p6, if oo parsing was available. Its performance, while slower |
|---|
| 97 |
than pugs, seemed tolerable. jsperl5 is a variant of pil2js which |
|---|
| 98 |
allows it to use p5. |
|---|
| 99 |
|
|---|
| 100 |
Redsix, written in ruby, has a p6 parser. The grammar was derived |
|---|
| 101 |
from pugs's. While buggy, it aspires to completeness. It uses |
|---|
| 102 |
p5-syntax regexps plus rules. It has a working operator precedence |
|---|
| 103 |
parser, though it's non-spec. Performance is good - it was running |
|---|
| 104 |
faster than pugs at one point. |
|---|
| 105 |
|
|---|
| 106 |
An implementation of p5-syntax regexps plus rules exists for p5. |
|---|
| 107 |
Performance is good - it may be faster than the ruby one. |
|---|
| 108 |
|
|---|
| 109 |
Proposal |
|---|
| 110 |
|
|---|
| 111 |
Create an alternate p6 parser for pil2js. Translate the redsix |
|---|
| 112 |
grammar and opp to p5. Write a new emitter for it, based on pil2js's |
|---|
| 113 |
PIL1 emitter. Get pil2js and the new parser working together. |
|---|
| 114 |
|
|---|
| 115 |
Tweak the new parser until it can handle the pil2js p6 code. |
|---|
| 116 |
At that point, pil2js is free to evolve independently of pugs. |
|---|
| 117 |
|
|---|
| 118 |
Development can then proceed in several directions. |
|---|
| 119 |
Improve the new parser to recover test regressions from the switch. |
|---|
| 120 |
Add emitting for oo declarations. |
|---|
| 121 |
Then: |
|---|
| 122 |
Migrate the p5 bits to p6. |
|---|
| 123 |
At that point, we have a bootstrapped p6-on-p6, for a large subset of p6. |
|---|
| 124 |
|
|---|
| 125 |
Disadds/Risks |
|---|
| 126 |
|
|---|
| 127 |
The emitter backend is new. Redsix was passing less than 20% of |
|---|
| 128 |
tests, so the ability of the grammar to correctly handle the other 80% |
|---|
| 129 |
is uncertain/unlikely without more work. |
|---|
| 130 |
|
|---|
| 131 |
Compared with running kp6 on pil2js, this is a harder and more complex |
|---|
| 132 |
approach. Though one with the potential to more quickly result in a |
|---|
| 133 |
relatively complete p6 implementation. |
|---|
| 134 |
|
|---|
| 135 |
pugs can *already* do parsing and oo. Faster and better than the |
|---|
| 136 |
result of this exercise will be able to until after quite a bit of |
|---|
| 137 |
work. Even then, if you have to move to another, faster backend, you |
|---|
| 138 |
might as well have developed on pugs instead, and emitted to the new |
|---|
| 139 |
backend from there. |
|---|
| 140 |
|
|---|
| 141 |
An alternative is to migrate pil2js into a new pil2p6. Run it on |
|---|
| 142 |
pugs. Then it can be developed in a full p6 dialect, rather than |
|---|
| 143 |
playing bootstrap games. The redsix parser can be migrated to p6, |
|---|
| 144 |
full p6, if that still seems the right way to develop a parser. |
|---|
| 145 |
Bootstrap happens when it is ready to happen. The main risk of this |
|---|
| 146 |
approach is the possibility of pugsbugs interfering with development. |
|---|
| 147 |
|
|---|
| 148 |
So the key assumptions of this proposal are that (1) pugs won't be |
|---|
| 149 |
able to output an oo ast for pil2js anytime soon; and (2) pugs is |
|---|
| 150 |
currently too buggy to develop a pil2p6 on it. It's not entirely |
|---|
| 151 |
clear either of these is true. If (2) is untrue, a better path to |
|---|
| 152 |
p6-on-p6 is pil2p6. If (1) is untrue, a better path is to wait, |
|---|
| 153 |
perhaps filling time by migrating the redsix parser to p6, or fleshing |
|---|
| 154 |
out kp6. |
|---|
| 155 |
Counter: (1) may turn out to be untrue, but it is certainly a |
|---|
| 156 |
plausible hypothesis. And even if untrue, the only impact is it would |
|---|
| 157 |
be better to migraite the redsix parser to p6 instead of p5. Which |
|---|
| 158 |
doesn't seem a deadly issue. Regards (2), unlike creating an |
|---|
| 159 |
alternative parser for pil2js, pil2p6 is setting aside working code, |
|---|
| 160 |
and hoping a non-trivial translation to p6 will sort of work too -- |
|---|
| 161 |
the proposal has more of a "keep working code working" flavor than pil2p6. |
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
== Integrating KP6 with the test suite == |
|---|
| 165 |
|
|---|
| 166 |
It would be nice to run the test suite against kp6. |
|---|
| 167 |
It is easy, and will help make it obvious what is and is not working. |
|---|
| 168 |
:Counter argument: it will only show nothing is working, and is thus |
|---|
| 169 |
uninteresting. I expect only 01-sanity/01-tap.t will pass, as |
|---|
| 170 |
variable assignment doesn't work yet. -- putter 2007-01-22 |
|---|
| 171 |
::But keeping an eye on that, and motivating improvement, is exactly |
|---|
| 172 |
what the testing is for. *Everything* which is a p6 implementation |
|---|
| 173 |
should be able to run the test suite, no? -- putter 2007-01-22 |
|---|
| 174 |
|
|---|
| 175 |
* Create a friendlier "program api" to kp6. |
|---|
| 176 |
It currently spits p5 on stdout. |
|---|
| 177 |
* Create a run-kp6.pl analogous to mp6's run-mp6.pl. |
|---|
| 178 |
* Make ./pugs -Bkp6 call run-kp6.pl. |
|---|
| 179 |
src/Pugs.hs. Perhaps follow the js code there. |
|---|
| 180 |
Hopefully only one or two lines will be needed. |
|---|
| 181 |
* Add a test-kp6 target in Makefile.PL. |
|---|
| 182 |
* Make smoke work. |
|---|
| 183 |
* Add a smoke-kp6 target in Makefile.PL. |
|---|
| 184 |
* Tell util/run-smoke.pl about kp6. |
|---|
| 185 |
Just a $ENV{HARNESS_PERL} modification like the other ones there. |
|---|
| 186 |
|
|---|
| 187 |
-- putter 2007-01-21 |
|---|
| 188 |
|
|---|