Posts Tagged ‘Parsing’

More Parsing and Lisp

Posted in Scheme on February 22nd, 2008 by Lorenz Pretterhofer – Comments Off

The predicated parsing language (MMeta) is still very much on the way, and it’s starting to really shape up finally. So far the dialect of the parsing language is tailoring quite effectively to the PLT-Scheme target language and I hope to release a simple pair of scheme source files with the basic interface, and the pre-translated parser.

The parsing engine really is purely predicated, and still requires functional actions and predicates (since it doesn’t do any dual mode parsing like ANTLR 3 does, when it generates backtracking code), but on the whole, the tricks you can do with it are still very effective.

Once I get the architecture working properly, I’ll try to bolster its functionality to my original intentions for the parsing language, and also do a proper article on it, that describes the algorithms used to power the language and also, how to apply it effectively (a practical look at the language and its implementation).

On a less interesting note, I’ll be back at uni very soon, and that means that while I believe the parser and its documentation will still be up within a couple of weeks, it may take somewhat longer before I can get a good start on the Mention programming language itself (the Virtual Machine actually, but that’s still a start).

Because of this I’ve taken the brief general design description of the Mention language down until I have both, finished the page in question, and actually have some code worth checking out. I will still keep up the updates coming for those who are interested in the language.

– Lorenz

Evil Schemes to stop the Squeaking

Posted in Scheme on February 6th, 2008 by Lorenz Pretterhofer – 2 Comments

After working on the Squeak based Mention prototype for some time now, I’ve come to the conclusion that its finally time to put the prototype to rest. Yes, I realize that it have never actually worked yet, but the truth is, Squeak still lacks significant services for language research and development.

The final nail in this case, goes out to the Transcript window, now defunct for god knows why. I actually considered attempting to find a fix for it, or even fixing it myself, and then I realized the obvious. I don’t like Squeak. Its always flakey, or broken, or difficult, or anything but genuinely useful!

I’m sure there are plenty of things it does well if you’re interested in Seaside, but I’m not.

Then I considered the last language I was working on (a concept Lisp that was intended to integrate newer Object-Oriented ideas like Traits). The interesting thing about Lisp is that it handles the Virtual Machine work like there’s no tomorrow. Its also simpler and console based, and you can generate lambdas without even really thinking twice. Hugely important if you want to quickly prototype some high level stuff, that also needs to run reasonably efficiently (not stuff that’s directly part of the language, but rather the VM’s implementation itself).

So, I’ve decided to finally get around to learning the thinking mans Lisp, Scheme. Scheme may not be massively different from other Lisps (i.e. Common Lisp), but it does tend to do things in a somewhat more straightforward fashion. The biggest example I can think of is that it is a Lisp-1 language, which means that there is only one namespace. This is a big plus in my book, for languages that do not provide separate syntaxes for selectors and variables. Mention of course has two namespaces, due to the selector syntax involved in sending messages. On the other hand, selectors in Mention and Smalltalks in general do not always correspond to the same function object.

If all goes well, I should get started writing actual code within a couple of weeks, with a reasonable understanding of Scheme. Since I already know a reasonable amount of Common Lisp I don’t believe it will take too long to learn, but you never really know with close cousins in the languages world.

I would also like to take the time to note that I’ll be developing a reworking of the OMeta parsing architecture for PLT-Scheme (or some other dialect if I swap away from PLT, but that seems unlikely). This parser framework is called MMeta, as I’ve probably mentioned (no pun intended) before, and will serve as the basis for the compiler and parser used throughout the Mention implementation and within the implementation. The PLT-Scheme variation of the actual parsing code (and the S-Expression support), will be referred to as MMeta-L (for Lisp).

– Lorenz