From: Charles Oliver Nutter Date: 2009-02-27T12:26:44+09:00 Subject: Re: Nexus Programming Language J旦rg W Mittag wrote: > Actually, I believe it is the other way round: embracing ParseTree > would preclude alternative implementations like JRuby from being > implemented in the first place. > > Well, I admit, I was exaggerating. However, until recently, JRuby > *had* a (somewhat) ParseTree-compatible AST. The reason why they > decided to drop ParseTree-compatibility was simply that it would be > impossible to evolve the compiler while keeping the AST compatible. Not impossible...there's just been practically *zero* demand, limited resources, and other things that needed more attention. I'm not opposed to supporting PT in JRuby, but it's never been a very high priority. And now that ruby_parser can be used for almost all the offline PT-based tools, there's even less motivation. > ParseTree is intimately tied to the actual layout of the AST inside > MRI and to the actual inner workings of MRI. That would mean that the > alternative implementations would be intimately tied to the inner > workings of MRI -- in other words, they wouldn't actually be > "alternative" implementations any more, just clones. I've also had an issue with PT basically just *being* MRI's AST. We've made numerous changes to the structure of the AST, some of them for very good reasons. We've also unified a number of constructs that MRI still keeps separate. In short, we've evolved, and while PT did a good job exposing the general structure of MRI's AST, it also exposes MRI's implementation warts. We don't feel a strong need to emulate those warts. But it's doable :) The fact that it hasn't been done says more about the demand for it than the challenge of making it happen. > I wouldn't say that. There are better ways than ParseTree. A > standardized generic, abstract, high-level parser API for example. ruby_parser handles some of this, but it's another all-at-once parser; you can't stop and start it or handle subsections of code easily. Really, it's just a port of MRI's Yacc/Bison parser to Racc. - Charlie