Entries by Tristram Brelstaff (3025)

Saturday
Mar182006

The Maya project

I have just come across Piet Hut's and Jun Makino's Maya Project .  The aim of this project is to develop software to perform detailed simulations of star clusters.  Now I myself have quite an interest in star clusters and with my trusty copy of Numerical Recipes to hand I could probably work my way through most of the maths, but, to me, by far the most interesting thing about this project is the decision to document the development in the form of a dialogue between two astrophysicists.  These dialogues cover the astrophysics, the maths and the software development and appear to contain a wealth of information and good advice on program development.  The language chosen for the development is Ruby, which is an  interesting decision in itself (and one which is discussed in the dialogues). 

The development dialogues are included in the Development Series (use the link near the foot of the Maya Project home page).

One thing to note  is that the project used to be called the Kali Project and there are quite a few references to this old name still in existence, in particular, the simulation system that is being developed is referred to as the Kali Code (researchers in stellar structure and evolution refer to computer programs as 'codes' - apparently a term left over from the very early days of computing).

Friday
Mar172006

Upside-Down Wood Pigeon

Walking back from after school club this evening, Zoe and I saw a wood pigeon that was hanging upside down from a branch of a tree.  The tree was covered in ivy and it was only after we had got home that we realised that it must have been stretching to reach flowers on the ivy.

Thursday
Mar162006

NaN Nonsense

Gary Leavens has a paper in the current issue of the Journal of Object Technology in which he describes the problems caused by NaN (Not-a-Number) values in the specification of software involving IEEE 754 floating point computations.  It never ceases to dismay me how ready some people are to use single (defined) values to represent undefined values.  They then get themselves tied up in knots over such questions as whether one NaN should be equal to another NaN, or whether NaN should be a number or not.  If you think I am just joking about the latter then read the following quotation from Leaven's paper:

The tricotomy law says that either x < y, x = y, or x > y; but if either x or y is NaN, then all three of these expressions may be false. Violation of tricotomy tells us that, with NaN, floating-point numbers are no longer totally ordered.  Of course, this makes sense if you consider NaN to be “not a number” as only the numbers are totally ordered.  The trouble is that type systems usually consider NaN to be a number.

Type systems consider 'Not-a-Number' to be a number!  And people don't even seem to wonder why they run into difficulties with this approach.  This is precisely the sort of silliness that I was complaining about in my Undefined Values should remain Undefined.

I agree with Leavens that the best solution to the NaN problems is to dispense with them altogether and to throw an exception on the failure of the precondition for a floating point operation.  This would be the 'Design by Contract' approach.

Wednesday
Mar152006

Railway Pheasant

This evening I was on my way home on the train.  We were  100 to 200m from Wokingham station when I glimpsed a long-tailed straw-coloured pheasant on the embankment.  It could have been a female golden pheasant, but I wasn't able to get a close look. 

Thursday
Mar092006

The Search by John Battelle

An account of the rise of Google with some mentions of Altavista, Yahoo! and other search engine companies. I found it most interesting where it was covering the early days; the last few chapters of speculation about the future of search, I thought less good, in particular, I don't think there will be any financial incentive for the creation of a historical archive of the web.

The success of Google can be seen as an example of a technically clean solution (the PageRank algorithm) triumphing over messier, technically inferior ones. I admit, though, that the good business judgement of the Google founders also had something to do with it (also, the algorithm that Google uses has probably now evolved into something hideously complex).