4 Oct 2001 raph   » (Master)

maelstorm: I took a look at Joy, and find myself slightly intrigued. It looks a lot like PostScript to me. In fact, I can't really find anything that Joy has that PostScript doesn't, except of course for being purely functional and having formal semantics written down.

All the usual functional programming tricks work just fine in PostScript:

GS>/map { [ 3 1 roll forall ] } bind def
GS>[ 1 2 3 ] { dup mul } bind map
[1 4 9]

Once you wrap your brain around the stack, PostScript is a surprisingly modern, powerful language. In addition to all the advanced "combinator" stuff seemingly rediscovered by Joy, it has the usual strings, lists, and maps (dictionaries in PS jargon) as first class data types. In fact, Joy doesn't have the map natively, so in some ways it's even more primitive than PostScript.

PostScript is even fairly well suited to object oriented programming, using the combination of code as first class objects and maps.

Even so, RPN makes readability worse, because you have to keep the stack in your head at all times. 3 1 roll, dup, exch, index, etc., are just poor substitutes for named variables. You can do named variables in PostScript, but it's not popular (or idiomatic), in part because of the nontrivial performance penalty on most implementations (the "activation records" need to be heap allocated and then garbage collected).

I think stack languages are destined to become curiosities, but well worth knowing about for any serious student of languages. I hope the Joy people have fun.

Bad patents

Apple has a patent on alpha compositing. I'm sure there are worse patents, but I don't come across them all that often. I have a short rant about it on my website now.

Incidentally, delphion.com, which used to be the wonderful womplex patent server at IBM, is now a really annoying site in which just about every link brings you to the paid subscription sign up screen. They would appear to be a model of how a company can make money selling free (in the case of US patents, public domain, even) information. Fortunately, the US PTO site is still moderately usable, and offer the bulk data at cost, as well.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!