2008/05/31

Yet another language.

Any programmer worth their salt knows a dozen or more languages. It's a well known
anti-pattern to find dodgy developers.

Personally I am fairly happy with my mental language collection, although I've slowed down over the past few years, even as the hints about ocaml get stronger from certain places. However one thing that has always been on my todo list is write my own language.

Problem is... to do what? There hasn't been a major itch that I saw I could uniquely fill, or at least fill better than others. Language design is hard, and I really didn't want to be famous for the next generation of PHP. The world has suffered enough.

However I realised it had snuck up on me. I have written a programming language. It's horribly domain specific, it's not even close to Turing complete (not in any sane way), and it only exists inside a C framework. But damn it, it's a language.

The language is the FancyPants Test Suite, it operates directly on graphical objects, and is used to layout, interrogate, compare, manipulate and display objects for testing.

The only flow control is the various test operations, which exit the test if a condition is false. So you can test the widget is visibly the same as a reference image, that calling a particular function has a particular result on screen, that there is something on the screen, that there are no leaking canvas objects, and a number of other tests. It can manipulate multiple objects, using a prefix notation.

It is interpreted from it's own bytecode. Unfortunately the only front end is the C compiler to generate the byte code at the moment (so the compiler is... painful).

Running programs in this language produces pretty reports, including a fairly comprehensive trace of the operations performed on what objects. The reports are in a pretty ugly (ie typical) xml syntax, but I have a html and pdf stylesheet to produce human readable documents. Also it keeps history of any images created during the process so you can graphically see what has changed.

Annoyingly the language/program will probably never leave Fluffy, although it would mainly (read only) be of interest to the enlightenment project in the outside world.

No comments: