Toxic Elephant

Don't bury it in your back yard!

WNT Online

Posted by matijs 27/01/2007 at 12h40

As of today, the ‘Woordenboek der Nederlandsche Taal’ (Dictionary of the Dutch Language) or WNT is online. It is a massive dictionary of Dutch, apparently comparable to the Oxford English Dictionary. I first heard about this dictionary when I was a young boy, and my father made a documentary about it (sorry, those links are in Dutch). At the time, the WNT was not finished and already occupied several bookshelves. People had been working on it for 125 years, and it seemed it would not ever be finished. Since then, they’ve clearly come a long way.

[Unfortunately, their interface is in Flash. Why, why, why? Three of the ten questions in their FAQ have to do with problems caused by choosing Flash. That should have made some bells ring.]

By the way, I was alerted to this historical event by the invaluable Language Log. Be sure to also read the resulting discussions of Babel Fish name mangling.

Tags , no comments no trackbacks

I Want Cells-GTK for Ruby

Posted by matijs 22/01/2007 at 13h21

For some applications, a spreadsheet is the perfect development environment. The UI is a no-brainer, while the relations between the different values is clearly visible, and changes are automatically propagated from what could be called properties to derived values.

The problem is, of course, that you’re missing out on the features a programming language could offer. Macros are basically a dead end, unless you like to solve user issues like ‘It doesn’t work because I disabled all macros.’

What I want is something that gives me this easy linking within a model and between model and UI, but from withing Ruby. It is my prefered solution to the Gnome on Rails problem.

Cells for Common Lisp promises to take care of the automatic propagation and dependencies between cells:

Cells is a mature, stable extension to CLOS that allows you to create classes, the instances of which have slots whose values are determined by a formula. Think of the slots as cells in a spreadsheet (get it?), and you’ve got the right idea. You can use any arbitrary Common Lisp expression to specify the value of a cell. The Cells system takes care of tracking dependencies among cells, and propagating values.

That seems to take care of the automatic updating of derived values. The second part is the no-brain-UI. What’s needed for that is a dead-simple way to link settable values to input widgets (text boxes, spin buttons, etc.), and to link derived cell values to labels. By dead-simple I mean that it should be done in at most one line per widget/value pair.

It seems for that part, the solution would be to use cells-gtk:

Cells transparently link GUI elements with each other and the application model to greatly simplify development of rich interfaces. Cells also automate how Lisp GUI instances drive their GTK+ counterparts.

Sounds great!

The problem (for me at least) is that this is all in Lisp, and I don’t know Lisp yet. So, I want this, but in Ruby (since that’s the language I like to use most right now). Some basic ingredients are already there: We can use blocks as formulas for the derived values, and there’s the Observable module. Also, Ruby has bindings for Gtk+.

I have some more wishes, but they’re mostly about Gtk+, so I leave those till later.

Tags no comments no trackbacks

Hurray! A Forum That Doesn't Suck

Posted by matijs 20/01/2007 at 10h28

Wow, compare the eye-friendly layout and colors of a Twelve Stone forum thread, to a completely random example of pbpBB.

There’s also a refreshing lack of the unwelcoming five *cannot*’s that grace nearly every forum I anonymously surf to.

Tags no comments no trackbacks

Skipping Python for Ruby

Posted by matijs 18/01/2007 at 18h59

Without an e writes

Well, ruby just isn’t that much better than python. If I’m going to relearn everything, why would I bother with ruby? Why not just jump straight to lisp?

I can really appreciate this argument, since it resonates with my reasons for not learning Python: I knew Perl, and was doing most of my programming in it, making nicely structured, readable, object-oriented programs. To me, Python didn’t seem like such a big step forward: It’s like a Perl with enforced readability.

And then came Ruby.

My introduction to Ruby was not through Rails, but through reading the online version of the Pickaxe Book. After reading the first chapter, I was sold. Here was a language that truly embraced object-orientation, and gave access to all kinds of interesting abstractions that I had only vaguely heard of (such as coroutines). There also was a pleasant lack of boilerplate.

So to me, Ruby is that much better than Perl, whereas Python is not. I wouldn’t know if I agree that Ruby is not that much better than Python, but at least I can understand the argument. Ruby is certainly no Lisp, although it comes close.

So what’s next? Lisp’s features certainly look appealing, giving basically the pinnacle of power of abstraction, in exchange for slightly unappealing syntax. I believe the syntax can be overcome, so my next language to learn may well be a Lisp. Which Lisp is still an open question. On the other hand, there are interesting languages like Erlang, ML and the like.

[Incidentally, Without an e is the creator of Scarlet Lambda, which is roughly a web framework written in, or at least used with, a functional style of programming in Python, with a Lisp-like syntax. Wow.]

Tags no comments no trackbacks

Hello, World

Posted by matijs 26/11/2006 at 21h30

On November 2nd our daughter Sophia Emiko was born. At birth, she weighed 3050 grams, and was about 48 cm tall.

In the photograph, she is about three and a half hours old.

Tags no comments no trackbacks

Finally, B'stilla

Posted by matijs 30/10/2006 at 21h36

More than ten years after my only trip to Morocco, I have finally had the pleasure of eating B'stilla. Amazing! It's sweet, hearty, rich, succulant and crunchy.

What I wanted to try but found hard to actually order in Morocco -- as I recall, few restaurants served it, and if they did it had to be ordered a day or so in advance -- I can now get right here in Amsterdam, at a restaurant just a short bikeride away.

Hurray!

Tags no comments no trackbacks

Trackback Spam

Posted by matijs 22/10/2006 at 11h23

The less said about it the better. I just blocked three IP ranges completely. I don't really like to take these kinds of measures, for two reasons:

  1. I don't want to block legitimate access to my web site.
  2. I don't want to spend my days adjusting my firewall, adding rules whenever new spam seeps through the cracks.

Since I was spending my days cleaning up trackback spam, reason #2 stopped applying. There also didn't seem to be any legitimate access from the blocks in question.

Damn Spam has more details on these particular spammers. You can see they've been at it for a while now.

Before, I only blocked one IP address. It was from a company called Webrescuer with a very impolite bot. Aparrently, being impolite wasn't a very good business model, as they seem to be gone now. I removed the block.

Tags no comments

How to write software

Posted by matijs 18/10/2006 at 10h29

Peter Armstrong hits it right on the head:

People Need Gaudy Shit

Instead of having a loose set of things that work, that are generally or even just sometimes good, that we mix and match according to the circumstances, we get everything put together in a box with a nice bow on top. Then, if you don’t use everything in the box, you’re an infidel.

I remember the first time I came across Extreme Programming (XP). I was at a bookshop looking to buy Design Patterns. This was some time ago, but there already were lots of books on XP. Most titles sounded like “XP explained yet again in a different way”. Marketing, indeed.

The thing is, talking a lot to your customers and pair programming have nothing to do with each other. Nothing at all. Both can be good ideas, depending on the circumstances.

When I write software at home, for myself, of course I can’t do pair programming. When I write something that only I will use, there’s no point in talking to my customers. I almost always use unit testing and version control. Using that for a one-off script written in ten minutes is insane.

I could make my own list of what works here, but Robert Fuller has done a pretty good job.

Tags 1 comment 1 trackback

New Language Features in .NET

Posted by matijs 06/09/2006 at 16h36

One of the reasons I have a dislike for both Java and the main .NET langauges, VB.NET and C#, is the ridiculous verbosity involved in creating and filling an object variable. Typically, what you get is something like:

Some.Deep.Namespace.Structure.SomeClass foo = new Some.Deep.Namespace.Structure.SomeClass();

The repitition of the class name makes the horrid namespace nesting twice as bad. And no, this is not about typing, this most definitely is about reading.

So, you can imagine my pleasant suprise when, belatedly, I came across a discussion of var. Basically, var is a new keyword in the upcoming C# 3.0 that allows you to do this:

var foo = new Some.Deep.Namespace.Structure.SomeClass();

And then, and this is the good part, the C# compiler will infer that foo is a variable of type Some.[..].SomeClass and will complain if you try to store anything else in it1.

Same type safety with half the reading. Excellent.

Now, that’s not all. It turns out there’s a lot more interesting stuff coming in C# 3.0, making it more concise and powerful.

1 Yes, I’m aware that ML does this and even more.

Tags no comments no trackbacks

Abstractions

Posted by matijs 01/09/2006 at 16h31

One of the reasons I enjoyed learning Ruby is that it allowed me to
understand and then use new abstractions. Not all of these are absent from
other languages, but Ruby made them comprehensible for me, so they became
part of my toolbox, if you will.

What this means is that I can write code that does the same thing in fewer
lines, and this in turn makes it easier to keep an overview of all of that
code.

At the same time, there is a whole group of programmers who completely
seem to have missed the abstractions train, or even the abstractions
road. They’re plowing along in the fields, barely able to divide their code
into subroutines beyond the ones forced upon them by their IDEs. These are
the people who write (whitespace added for clarity):

do\_d do\_a do\_b do\_c do\_e do\_a do\_b do\_c do\_f

If the same five things need to be done a hundred times in a given source
file, that’s five hundred lines right there. The abstraction of the
subroutine is not an automatism for them.

So what does it matter whether people get taught programming in Java or in
Ruby, if no-one stops them from creating thousand-line subroutines? I really
wouldn’t know.

Tags no comments no trackbacks