Skip to main content

Posts

Because I am now reading a book about Haskell, but also because when I implemented the gist of Palo in Erlang , I was bitten by - tada! - a typing error, I decided to port the code over to Haskell. While the functional core syntax of the two languages is quite similar, here's one detail that took me a while to figure out: A case construct in Haskell always introduces new name bindings, whereas Erlang uses existing bindings as equality tests. So, in Haskell you have to do something like if atkey == key then ... else ... , while in Erlang you can simply do case AtKey of Key -> ... Other -> ... (which seems more intuitive to me).

The Gist of Palo - Erlang In Action

I have been asked to review the Palo code base. This is an open-source MOLAP database server. To get a feeling for what its core C code does, I reimplemented the gist of it in Erlang. Turns out it's really just a few lines when you have high-level functional constructs at your disposal. Out of curiosity, I then went and extended it so it really mimicks the Palo cube storage more closely, binary array searches and all (loading is still non-optimized, though). Finally, I even added a tweak that I suspect would boost Palo's performance a little. If anyone's interested, the code for loading and finalizing a cube is in cube_load.erl , the basic code for querying - possibly aggregated - cell values is in cube.erl . The latter also contains some tests showing how it's used.

Meta-data Enhanced Wiki

I recently stumbled upon Diamond Wiki . This is a wiki enhanced by meta-data and navigation along meta-data dimensions. Interesting. Maybe a first step in the direction of something like an ad-hoc database. While deeply impressed with DabbleDB , I still think it should be possible to come up with something even more fluent, more ad-hoc .

DDT - Documentation Driven Testing

What JCite really is about is what I am going to call DDT: documentation-driven testing. It is a discipline that complements and, during the conception of an API, really comes before TDD: test-driven development. DDT weeds out them design bugs! :)

Beyond TDD: Documentation Driven Development

There are quite a few articles extolling the virtues of test-driven development these days ( here's one ). And for good reason, too. Having done TDD for quite a while, I recently started combining it with documentation-driven design. This is what my open-source tool, JCite , is all about. With this approach, I sketch out the most important use cases, combine them into the index of a tutorial (links plus teasers summarizing the use-case), flesh out the tutorial topics (and thus use-cases) one by one, develop the use-case tests in parallel to each topic, cite the important parts of the tests as actual code samples into the topic, and only then start doing the implementation (this last step is accompanied by more tests, which are now more like unit-tests). In all, this is like literate programming, but of the use-case tests rather than the implementation code. TDD already helps to make you focus on the user during API design. DDD takes the effect further by making you tell consistent ...

FreeBSD in Virtual PC 2004

I finally managed to install FreeBSD 6.1 in Microsoft Virtual PC 2004 with NATted networking behind a firewall. Here's how: Download the boot ISO image and mount it in the VM. Reset the VM. Run the FreeBSD setup until you have to choose the type of installation. Select "Standard". When asked to slice the disk, type A for "Auto", then Q for "Quit". When asked about the boot manager, select "Standard". Do not select the boot manager. When asked to partition the slice, again type A for "Auto", then Q for "Quit". Select the packages you want. When prompted for the media type, select "FTP Passive". When prompted for the download server, select the "Primary" server ( not the "Main Site"). When prompted for network configuration, skip IPv6, but do use DHCP. In the DHCP results dialog, correct the name server entry. It must be 192.168.131.254. (See this article for details.) Proceed with the inst...

RSpec and BDD - something crucial missing?

RSpec Site : "RSpec provides a framework for writing what we call executable specifications of program behaviour. Since that’s rather wordy, we usually just call them specs. Some other people call these things examples." If I take a look at the examples on the RSpec site, I cannot help but wonder if just doing this (which they term "behaviour-driven development"), misses out on an important aspect of API documentation and the thought processes that should go into an API design. The missing element is explanation . In my experience, unless I force myself to explain my decisions to an audience (even a hypothetical one), I come up with too complex designs, inconsistent naming, and just generally too much hassle for the users of the API. Sometimes, complexity is warranted. But then, I believe it is important to justify it to your users. Show them why it's there. The RSpec approach is, as I see it, simply a very concise way to write your tests twice: once in natural...