Archive for the ‘News’ Category

Experiments in Emacs

Saturday, July 26th, 2008

One of the most difficult challenges facing me when beginning to work with both Erlang and Haskell, was the significant lack of good IDEs… Well, at least that was the theory, anyway. Instead it turned out to be a real motivator to finally get around to investigating the only IDE that counts.

The real problem wasn’t that I couldn’t use Emacs for basic editing, rather I didn’t really have any idea how to use any of the extra features. Essentially it was like working with a semi-decent TextEdit.app, with code highlighting and unfamiliar keyboard shortcuts. Even after reading some of Steve Yegge’s essays I still didn’t really have any idea what I was doing.

Ok, so basically I’m now writing this in Emacs’ SGML mode and carefully trying to get around the perverse limitations of Wordpress. (Where the heck did the allow raw HTML checkbox go for author text?) Ironically I don’t think I’ve yet gained the productivity advantages from my efforts yet, but honestly that can probably just be attributed to a slow down in my typing speed and the rather unexpected work schedule I’ve been (you never realize just how much you appreciate sleep until you don’t get enough).

If I haven’t gained any real productivity, the question becomes why then am I still using Emacs to write this post? Well, as it turns out its not actually too bad for even when you don’t know all of the keyboard commands (all commands come from the keyboard, and most important commands really never migrate to them menu or at least don’t indicate they’re keyboard equivelent).

Even more importantly perhaps is the gains that I’ve achieved in other tasks…writing blog posts in Emacs may not be any faster for me (although I do seem to see much more of the post at any one time)…but writing code sure is. I seriously doubt that I’d change from using things like XCode for Cocoa applications or DrScheme for PLT Scheme applications (although I may change my mind on Scheme), but at least I have direct access to the REPL in Haskell and Erlang.

The way most of the editing modes in Emacs actually work, it essentially will even load up a file your working directly into a REPL running side by side in another text buffer. From there you can test smaller parts of your program or even just run the whole thing from the top if you needed to. Anyone who’s worked with a Lisp dialect or even Python or Erlang (among others) should be able to apreciate that.

There are a couple of things that have been bugging me so far. The first is the lack of a spell checker. Emacs does have built-in support for ispell, but as you probably guessed, it doesn’t work on my machine (actually it isn’t even installed on my cygwin install). Too make matters worse, I still need to teach Emacs how to find my Cygwin install and use programs from it before the windows paths…ugh…

And the other thing doesn’t even have anything to do with Emacs, but rather, its a limitation with the Haskell code I’m working on. Essentially I don’t have a framework for OpenGL work that allows me to substitute the code on my side of the framework after the application has been started…or more to the point I can’t stop the application after it has started, forcing me to quit the entire REPL every time I test the Game.

Of course the simple workaround is to just keep restarting the REPL or move out of Emacs into a Cygwin shell, but its still very inconvenient (damn you GLUT).

All in all I can only really see how it goes, but at the very least it should make life just that little bit easier. At worst, I’ll just have to resort to my aging Mac Powerbook (for the BSD layer).

Until next time…

– Lorenz

More Parsing and Lisp

Friday, February 22nd, 2008

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

Wednesday, February 6th, 2008

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