Archive for September, 2006

Spaceland: A Great Novel of the Fourth Dimension

I just finished Spaceland: A Novel of the Fourth Dimension and heartily recommend it. It’s a story about a guy who is augmented by a species from the fourth dimension. He is then able to see and move in the next dimension, and travels from “spaceland” (our three-dimensional world) to its four-dimensional neighbours, Klupdom and Dronia.

Storywise, it’s a rather ordinary sci-fi novel, what caught me was Rudy Rucker’s intuitive description of how the fourth dimension might be like. The hero travels through one- and twodimensional worlds, and in leaving them when he gains another degree of freedom illustrates how hard to grasp the idea of a higher dimension is. For example, the line segments of a one-dimensional world cannot understand that they could see someone else than their left and right neighbours – nor see a reason for it, since they communicate by sound anyway (which is also their way of reproduction). Illustrated by simple sketches, this book is a great read for anyone slightly interested in maths, physics or other dimensions in general.

Leave a Comment

AppleScript and Natural Languages

Never been a Mac fanatic myself, I found the story of AppleScript to be an interesting look on the development of programming languages, especially for application scripting. A distinguishing feature of the original version of AppleScript was its support for dialects, including natural languages. For example, the following statements generated the same code:

  • the first character of every word whose style is bold (English)
  • { words | style == bold }.character[1] (professional dialect)

However, support for dialects has been dropped in later versions, and the author concludes that

The experiment in designing a language that resembled natural languages (English and Japanese) was not successful. It was assume that scripts should be presented in “natural language” so that average people could read and write them. This lead to the invention of multi-token keywords and the ability to disambiguate tokens without spaces for Japanese Kanji. In the end the syntactic variations and flexibility did more to confuse programmers than help them out. The main problem is that AppleScript only appears to be a natural language on the surface. In fact is an artificial language, like any other programming language. Recording is very successful, but even small changes to the script may introduce subtle syntactic errors which baffle users. It is very easy to read AppleScript, but quite hard to write it.

I believe this is one of the things “readable” languages like Python and Ruby got right: they (often) do resemble natural language sentences, but avoid greater efforts to work around the latent ambiguity of natural language. This makes them both easier to write and easier to maintain, without sacrificing readability – for programmers, that is.

Leave a Comment

Sorting HTML Data in Dojo Tables

We learned the hard way that Dojo‘s SortableTable does not work too well with HTML data in its cells. It’s not sortable, and sometimes markup is discarded or ignored. Googling brought to light the FilteringTable, a clean rewrite with more capabilities and less quirks. It’s available in current 0.4 nightly builds and works pretty well. Its parameters are similar to the SortableTable widget, except that rowClass and alternateRowClass have not been implemented yet – so you have to use td and td.alt of your table class for alternating row styles.

Unfortunately the nightlies made something clear – initialization of a complete Dojo distribution is very slow. Importing a single widget class takes up to 3 seconds on a decent PC. Including all required widgets (about 3 or 4) into a single compressed dojo.js file improves initialization to about 300 ms, but it’s still noticeable and a major issue for a good user experience. I really do hope that Dojo initialization will be tuned considerably before 0.4 is released…

Comments (2)

Some time to kill?

Won’t take longer than five minutes.

  1. PaperCut – so that’s what it was supposed to look like when I was cutting folded paper at the age of five.
  2. Japan Bridges – weird.
  3. An extremely detailed moon photograph taken with a stock Canon EOS-20D (stitched together from 15 photos.)

First seen on the fabulous reddit.com.

Leave a Comment

Back from Vacation

12 days of sailing on the Baltic Sea between Germany and Denmark with 20 wonderful people… it’s been a great time. Spent a lot of time reading, playing games and football, and just hanging around without too much to care for. Except occasionally cooking and doing the dishes for 23 people.

Leave a Comment