Posts Tagged ‘Lisp’

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

Growing Pains – Bootstrapping a new Language

Posted in Languages on January 25th, 2008 by Lorenz Pretterhofer – Comments Off

Creating a programming language is hard. I’m not talking about the kind of hard that’s involved in math problems or even getting pwned with that rather expensive new internet connection (no, its not the mouse either… you’re really just not that good;). No, I’m talking about the sheer amount of effort required to first come up with your amazing, world changing programming language, and then realizing that you actually need to implement the whole thing a few times over, using variations of that language that are in-fact worse than what you started with (unless your using Java, in which case, jump right ahead).

As you might have guessed I’m mainly writing this out of mere frustration, that even the dumbed down, simplified variation of Mention that I’m attempting to bootstrap is going, well, slowly. Very slowly.

So far I’ve come to the conclusion that there may even be some general rules of thumb, which to the enlightened few, might not actually seem all that obvious. Firstly, the current attempt to bootstrap Mention is utilizing the Squeak programming language/tool-chain, in the hopes that it would help to speed up the development process. It didn’t. Actually, I’m even wondering if its actually slowing me down… Which brings me to the obvious question. Why?

The most useful languages that spring to mind after asking this question, probably actually come from the Lisp family, along the lines of some dialect of Scheme + a parsing language to complete the picture. But what would make a language like Lisp, outgun its successors like Smalltalk or perhaps even python. Well, actually, I think python might even work, but Smalltalk has issues… Namespace issues.

The issues with Smalltalk I’m referring to are the conventions surrounding the naming of global variables, or at least the lack-there-of. Many scripting languages and most Lisps, allow the programmer to assign to any old variable name, and its simply there, for the entire world to see. But of course, when you have to think in objects, you can’t expect to have globals. After all, good Object-Oriented software should be based on the interaction of object, and not glorified globals, singletons, or otherwise. Although you could be mistaken for thinking that the Application object is actually a global, but of course its not. Why, well I’m not sure really, its just not.

I’d rather not go on any further with this, but the point is simple. We know that software systems evolve, and don’t simply get designed and then implemented. And we know that software is not actually re-used until at least some refactoring has been performed (generally more than some). So why can’t we just use our globals while we understand the problem we’re working on, and if they do the job we can just keep them, and if they really are flakey code smells bend on silicon armageddon then we can simply refactor them once we understand how the problem breaks down into the individual problem level (application, subsystem, et cetera) objects.

– Lorenz (feeling slightly better ;)