Monday, May 30, 2011

The flare programming language

One of the earliest contributions of our friends at the Singularity Institute for Artificial Intelligence (SIAI) was the flare programming language. When I first saw this language, I was quite impressed. It has strong support for annotations and metadata and some other relatively impressive features.

However as an educated Lisper I now know better. Flare uses XML rather then sexps and its purported advantages are derived from this. This is explained in detail on the site for the language:

LISP, of course, is the traditional king of self-modifying languages, because LISP uses the same representation for program code and program data. Flare also uses the same representation for code and data, except that the common representation is extensible tree structures (XML) rather than lists. The difference is a major one; in a list structure, an object's role is determined by where it is. In Flare, an object's role is determined by its name and its metadata. Extensible tree structures are thus less breakable; in LISP lists, meaning is often conveyed by position, and inserting new elements can change the position of other elements in a list. Adding another Flare subelement, by contrast, does not at all change the behavior or appearance of the other elements.

In Lisp you cannot insert elements into a lists order, without breaking that lists order. However you can instead insert a special kind of node that does not effect the list's order. Lets call this sort of node an attribute and lets express it as (:name value).

    (title "Main Page"))
    (a (:href "home.html") "Welcome")))

And now, with this new construct you have XML in Lisp. Actually what you have is better then XML, because attributes in XML are almost entirely unstructured and they instantiate the attribute/element false dichotomy.

The other alleged advantage of flare is its use of metadata, however, XML leads to a distorted view and improper usage of metadata.

If you want to develop a programming language don't base it upon XML when Lisp is such a better alternative. Even the developers of flare knew that XML is painful, which is why they created flare speak to be used instead. However, the flarespeak language offers nothing over existing languages such as python, it is just another camel-case using, infix ridden, heteroiconic programming language.

Ultimately the flare programming language was abandoned and the SIAI went on to address more important problems like AI morality. For further reading, Erik Naggum provided some interesting insights on XML and flare:

No comments:

Post a Comment