2017-05-08

Lua

I got to thinking about the design of programming languages. It may be a recency effect, but it seems to me there’s been a plethora of programming languages designed and supported by a single person in the last decade or so. Usually their existence is very clearly due to some pet peeve of the designer, which is reflected in the grammar and feature set of the language. Some, like Ruby, have syntactical features which, while I find them annoying, presumably save the designer some typing in their typical idioms.

I presume that older languages have gone through processes of standardisation that have worn off the most idiosyncratic bits, if they weren’t designed by a committee to begin with. (Which does not mean that there aren’t disgusting bits in those languages too.)

The latest of these vanity languages I’ve run in to is Lua, which, on the whole, is not too bad. I still haven’t decided if I like the concept of metatables, but I have to admit it allows some nifty and powerful tricks.

So, how does it do the usual Hailstone program?

function hailstone(n)
   while (n > 1) do
      n = (n % 2 == 0) and n // 2 or n * 3 + 1
      print(n)
   end
end

I was a bit disappointed that assignment isn’t an expression and thus couldn’t be fed into the print(). Of note is also that Lua does not adhere to the C syntax patterns used by Java, JavaScript, awk, or even Perl, in particular the conditional assignment is done through short-circuiting logical expressions instead.

2017-04-28

Veckans ord: pelargon

Det är klart att en stylit vill vara ensam för en stunds pelargon i solskenet.

2017-04-21

Viikon sana: hummustuhnu

Huononlaatuisen falafelannoksen seuraus: hummustuhnu.

2017-03-25

Finished model 2017-I

Something a bit unusual. A Relocatable Equipment Building in 1:76 scale from Scale Model Scenery’s kit. The material is cardboard and paper. I have to say the kit was of impressively high quality and the pieces making up a quite easy build. (I still managed in a moment of distraction to confuse the roof and floor, so had to tear them off and swap before the glue had set.)

I expect it will eventually find its place in some diorama context. In particular, it is my entry in the prestigious competition between me and Kipper, both of us known for never finishing our models, in who will get the most models finished during 2017.

Model donated by Big Mike.

2016-11-06

Finished model 2016-III

Due to my travels in the UK, the OBS was long since aware of Warhammer when they became popular in his class and he eventually worked up a little collection of figures. When he moved to a student flat and clearly hadn’t touched them for a long time, I asked for them as practice subjects for painting. I’m now slowly working through them. Here’s a Wood Elf Lord I painted at the recent Hobby Fair.

2016-10-07

Emotions with Björn Afzelius

I should have posted this five years ago, but I only first heard it a few days ago. Still worthy of listening to.

2016-09-01

Beautiful betrayals

When the Iron Curtain fell, there were great hopes and expectations on both sides and one of the buzz phrases of the day was “joint venture”, so at the computer graphics conference I attended in St Petersburg in 1993, there was a hall dedicated to various proposed joint ventures between Russian and Western companies, hopeful Western computer manufacturers showing off their latest hardware to Russian customers who couldn't afford to buy any of it. The hall was, as such things are wont to be, pretty noisy, but suddenly something like a sonic blowtorch cut through the noise and on one of the screens I saw things you people wouldn’t believe, but then it ended and I realised I had just caught the last few seconds of a computer animation with music, but of what, I did not know.

A couple of years later I attended a computer graphics seminar at a conference hotel in Linköping. The speaker was fast-forwarding through a VHS tape and I glimpsed this same animation, but it was not part of the presentation. However, I asked for, and received!, permission to return to the room and go through the tapes on my own after dinner.

So, there I sat, late at night in a dark conference room in Linköping, watching and listening to the L’Opéra imaginaire version of « Dôme épais le jasmin » from Lakmé, tears streaming down my face.

As soon as I could I bought the full opera recording with Sutherland, Vanzo, Bacquier, and Berbié, conducted by Bonynge. I immediately brought it to the lab to share all this beauty with my coworkers. They were mostly amused by my excitement, but one person, composer of electro-acoustic music, rushed out of his room, screaming: “Of all the noise you make here, this was the worst!” and slammed the lab door closed, so as to keep the rest of the institute secure from the noise pollution.

I myself was pleased to find that apart from the Flower Duet there were several other songs that lingered in my ears. I was however a bit put off by the orchestra crescendo at the death of Lakmé, I felt a solemn fadeout would have been more respectful.

I noted that the plot, with a Western officer seducing and then abandoning an Asian woman, was quite similar to that of Madama Butterfly. Only much later did I find out that both operas may have been based on stories by Pierre Loti—the English Wikipedia entry for Madama Butterfly asserts that it is based on his novel Madame Chrysanthème, whereas the French entry denies this. (The Italian does not mention Loti at all.)