Re: To get things started...
[email protected] (Dan Sugalski) Wed, 22 Nov 2000 14:15:57 -0500
| Newsgroups | perl.perl6.internals.api.parser |
|---|---|
| Message-ID | <[email protected]> |
At 01:50 PM 11/22/00 -0500, Chaim Frenkel wrote: > >>>>> "DS" == Dan Sugalski <[email protected]> writes: > >DS> At 07:36 AM 11/21/00 -0500, David Grove wrote: > >> However, one thing is seriously lacking in this theory... if the parser is > >> perl, how does the perl parse? (Sort of a woodchuck chucking wood type of > >> thing.) Somehow, the external parser API thingy has to know enough perl > >> (through the chosen language) to be able to handle the parsing. > >DS> Nope. We do it in two phases. The end result will not actually parse perl >DS> code to build the parser (we'll provide bytecode for that) but to >start we >DS> can run the parser through perl 5 to get a syntax tree until the perl 6 >DS> engine's capable of doing it itself. > >Sounds fragile. > >We bootstrap on perl5 to get a bytecode stream, and then that bytecode >stream had better stay supported. Yup. It's one way to ensure backwards compatibility... :) >I remember this game. The Symbolics Lisp Machine (and probably other's of >this ilk) did the same. You were able to modify the World to do anything >and hopefully you saved the original so that when your world fell down >around your ears, you had somewhere to get back to. > >Please tell me that I'm wrong. (And that this will be able to parse code >at acceptable speed.) You're not wrong, but I don't think this is a huge problem. Lots of systems do it like this at the moment--GCC comes to mind as a first one, but there are lots of others. Granted it does mean that we'll need to ship a bytecode-compiled version of the parser as part of the perl distribution, but that's not a big deal. (Besides, that's what Larry wants, and he's got a point) It's also possible we'll do the parser mainly in C with perl hooks, but that's not the direction I've been pointed in. >Anyway, what does this have to do with the API? Well, the choice of language for the parser's relevant, but other than that it's really more of a generic -internals thing. Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai [email protected] have teddy bears and even teddy bears get drunk