More interesting in terms of extensibility: TimToady succeeded in his effort to write a mutable grammar for Perl 6.
STD.pm plus its automatic translation to perl 5 now parses 267 out of 269 test files in the official test suite. Not only that, it also exploits its own mutability to parse DSLs such as regexes and quotes.
I think this is quite an important step on our way to more complete implementations. | [reply] |
More interesting in terms of extensibility: TimToady succeeded in his effort to write a mutable grammar for Perl 6.
That's something I'd really like to hear more about. Is there anything around explaining or documenting what that is, how it works, and what it gives you?
Also, is there any substance about it in the video? These things take me sufficiently long to download that I'd rather not bother if there is a document (transcription, slides) kicking around somewhere?
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
Is there anything around explaining or documenting what that is, how it works, and what it gives you?
There are bits and pieces here and there, and I'll try to put them together.
STD.pm lives in the pugs repo in src/perl6/. It's a Perl 6 file, and mostly contains regexes as spec'ced in S05. I wrote an article about the techniques it uses to be modifiable (feedback welcome) that tries to motivate some of the choices in the implementation.
In the same directory as STD.pm there's a perl 5 script called gimme5 that "compiles" STD.pm to a perl 5 module named STD.pmc. That file, together with some runtime files (like Cursor.pmc) is able to parse Perl 6 files.
If you want to test it, you need perl 5.10.0 installed under /usr/local/bin, and some modules like YAML::XS and re::engine::TRE.
Once you've got the requirements installed, you can go ahead and test it:
$ svn co http://svn.pugscode.org/pugs
$ cd pugs/src/perl6
$ make
$ echo 'say "Hello, world";' > test.t
$ ./tryfile test.t
$ # let it parse itself and then the test suite:
$ make test
Last time I tried tonight it hang on one test (or maybe I wasn't patient enough), and failed one other, the rest of the > 250 test files where parsed.
There's much more to say about STD.pm, its relation to rakudo and other compilers (such as elf and pixie), its implementation details (about which I'm mostly ignorant) and history - too much to write it all down at once. If there's anything that you find particularly interesting, just ask.
(Continued update here:)
What it gives you? The best parser for Perl 6 out there, and one with the option to modify the grammar from perl 6 source code. For stuff like introducing new operators you don't have to know anything about the grammar (well, nearly nothing at least), for macros you might have to know a tiny bit more, for substantial changes you'd still be able to do it without recompiling your perl compiler.
Also, is there any substance about it in the video?
No. That video talks much about philosophy, but says little in terms of substantial progress. | [reply] [d/l] [select] |
| [reply] [d/l] |
Interesting, but flawed re regexen and what the writer choses to call "additional shortcuts ...to simplify the creation of regex statements."
For instance, if you are looking for a long string of identical letters, you can just indicate the number of letters in the string, instead typing out each letter. In other words, with the current version of Perl, you'd type "aaaaa" to indicate you are looking for 5 letter a's. In Perl 6, you need type only "a**5." There, the 5 indicates the number of letter a's you seek.
You can also specify ranges with this technique: "y ** 3..5" means you are looking for a string of y's from 3 to 5 characters long.
The base example, "aaaaa" ignores character classes and quantifiers, which is understandable in a brief article aimed as much at a general IT audience as at Perl devs, But for the dev, it raises the question "is the first a**5 somehow different from [a]{5}and y ** 3..5 different from [y]{3,5} in ways other than the number of keystrokes?" (I suspect the answer is "no.")
FWIW, this is not a bash on Perl 6, but that section of the article suggests (for /me; YMMV) that the reporter's understanding of his subject and diligence in crafting the report may be suspect.
| [reply] [d/l] [select] |
| [reply] |
I sure hope Perl6 regexes still have (.*) :-)
| [reply] |
It has, and it means nearly the same thing as perl 5 (it means the same as with the /s modifier in perl 5, i.e. . matches anything, not [^\n]).
| [reply] [d/l] [select] |
Sorry to nitpick, but it really stood out for me;
Govenrment Computer News ? (Deliberate or misspelled?)
Confucius says kill mosquito unless cannon
| [reply] |