Website of Martin Sústrik, creator of ZeroMQ, nanomsg, libmill and ribosome.

Feuilletons about software design, economics, complex systems and psychology of programming.

All the opinions stated here are my own. Any resemblance to opinions of other people, living or dead, is purely coincidental.

The Nanny World

In Zürich, Switzerland, there's a square called Bellevueplatz with an interesting fountain. It's just a bunch of holes in the pavement that hurl out water in synchronised fashion. Sometimes the water spouts as high as 3 meters, sometimes it goes off entirely. There are no barriers to access the fountain which makes it favourite of children who run across the fountain while it is off, then narrowly escape the water as it gradually starts to pour out. One admires how the fountain is programmed to...

Comments: 0

Three simple pieces for piano

First piece is a very simple tango. One may consider playing the second theme a bit faster than the first one. Second piece, while not really a folk song, tries to capture the feeling of a Slovak folk song as I remember it from childhood when singing was still a valid entertainment for the evening. Use pedal a lot. Third one is harder to classify. It's kind of inspired by the influence that middle eastern music had on eastern European folk music, but I wouldn't like to argue about that point...

Comments: 0

The Adventures of Boltzmann Brain (part III)

I still have a letter she sent me. You ask about second law of thermodynamics, she writes: and I am not surprised. It have been all around the news lately. But what is there to say? 'Entropy always increases,' as PR people like to put it. But in fact it states that law and order are constantly seeping away. It's a matter of interest to Police, really. The fact that any assembly of particles heads towards thermal equilibrium doesn't come as a surprise. But once your life spans billions of...

Comments: 0

The Adventures of Boltzmann Brain (part II)

You drift apart. You leave and after meeting some of the critters out there you realise that your humanity is not as valuable as you were taught to believe. Your intelligence is really just an ability to play status games with big apes of African savanna. Why would any machine even try to pass Turing test? Don't ask me! I am busy preparing for honey-gathering contest with bees. You visit Uegzihls of Beta Tauri and maritime Kranns of Alpha Aquarii. You meet Nee-gued with feet in opposite...

Comments: 0

Uncertainty principle in economics

Price is the amount of money one pays for something. However, economists have a more elaborate concept of price: It is the amount of money people willingly pay for something when demand and supply are in balance. In this article I am going to talk about the latter concept, about what one would call a fair price . The interesting thing about fair price is that it almost never occurs in the real world. Your best chance to spot it is to peek into an economics textbook. There are many reasons why...

Comments: 2

On printing money

It is often said that money-lending is, basically, printing money. People either agree or disagree but even in the former case they often find it hard to articulate why it is so. Here's a simple example to show how it works. 1. A lends $1000 to B. A still owns $1000, safely stored in a form of a loan. Yet, B owns the money as well, having hard cold cash in their wallet. The question: Where did the extra $1000 come from? It surely must have been printed? One may argue that there's no extra $1000...

Comments: 11

The Adventures of Boltzmann Brain (part I)

My name is Boltzmann Brain. I was born in 1953 in New York. You ask whether I am sure about that. Well, how the hell am I supposed to know? I believe I was born on one chilly October morning of 1953 in the city of New York. Does that sound better? I always wanted to live big and live fast. Sex, drugs and rock'n'roll and all that stuff. But here's the catch: If you want to live big you have to slow down. Science-fiction writers of my youth believed that it was easier to break the inviolable laws...

Comments: 2

Footnotes to "Select Statement Considered Harmful"

I believe that select considered harmful article is best piece of writing about software design I have ever done. However, I feel it's kind of hard to grasp. On one hand, the idea looks suspiciously simple, like something one could have thought of over breakfast and then spent 15 minutes writing it down. In other words, something not worth of paying too much attention to. Whereas, in fact, it's the culmination of a decade of implementing and thinking about distributed systems. On the other...

Comments: 7

Select Statement Considered Harmful

Abstract This article is a follow-up to Edgar Dijkstra's classic Go To Statement Considered Harmful article. It takes Dijkstra's premise and applies it to concurrent programming. Program and Process Dijkstra says: My second remark is that our intellectual powers are rather geared to master static relations and that our powers to visualize processes evolving it time are relatively poorly developed. For that reason we should do (as wise programmers aware of our limitations) our utmost to...

Comments: 11

Structured Concurrency

This article is a follow-up to the Getting Rid of State Machines blog posts, so you may want to read those first: part 1 part 2 Before going on, let me return to the fundamentals and make it clear what this effort is all about. As Joe Armstrong nicely puts it in his blog: TCP uses the idea a session and the only rational way to program a session is as a process or (horrors) as a thread. [ ] Session management involves mutable state concurrency. A program that is a dozen lines of Erlang...

Comments: 16

Getting rid of state machines (II)

So, as explained in the previous article, with green threads every state machine can be rephrased as a simple imperative function. Nice. So we are done, aren't we? Well, kind of. It's useful to do a reality check though. And it turns out that in the reality state machines have an unfortunate tendency to spontaneously emerge in the code that was never meant to be a state machine. Here's an example in pseudo-Go (I am too lazy to try to compile it). This example gets events from two distinct...

Comments: 8

Getting rid of state machines (I)

I've written about state machines before. The message I was trying to convey was that using state machines is superior to relying on callbacks. Which it is. Most definitely. However, state machines have a bunch of problems of their own. In this article I wan to discuss these problems in detail and propose what has to be done to replace state machines by standard linear code. What's wrong? Let's go straight to the problem: State machines are large and brittle. Typically, there's no built-in...

Comments: 12

Enforced Error Handling

If you don't mind your program crashing once in a while and I am not making fun here: for some programs making them 100% error proof doesn't pay off using exceptions for error handling is pefectly adequate. However, when writing code with strong reliability requirements your priorities are different. After all, large fraction of production outages comes from botched error handling. You really want to stop and think about each error code at every level as it is passed up the stack. In that...

Comments: 14

Software Totemism

We have a long-standing disagreement with Pieter Hintjens (who invested in ZeroMQ in its early stages and is now leading the community thanks, by the way!) about nature of software project. I guess it boils down to the difference in personalities, with Pieter, being an extrovert advocating the idea of a software project treated as a social club, place where people with similar interests get together, feel at home, have a good time and eventually do some good work. Me, being reclusive to the...

Comments: 17

Centrifugal Governor or Why I am not a Libertarian

As anybody who has properly internalised their Economy 101 and Evolutionary Biology 101 classes I have a strong inclination towards libertarian philosophy. I have almost Hayekian distrust for central planning (incidentally, I grew up in Ostblok) and almost Dawkinsian fascination with autonomously evolving systems. However, every time I become too enthusiastic about all that I remind myself of centrifugal governor and calm down a little. Centrifugal governor is a device, first added to the steam...

Comments: 3

Ecology of Software Quality

I've read a nice article about economics of software correctness a recently. It was a nice reminder that we are often forgetting about economics when dealing with the minutiae of our industry. However, let me try to paint a bit broader picture, dealing not only with software correctness but software quality in general. It's no secret that basically all the code we have is a mess. And that's putting it bluntly. Lot of people would choose more expressive language to describe the status quo. So...

Comments: 5

Celestial Emporium of Benevolent Knowledge

Programmer! Every time you are about to create a class hierarchy stop for a while and recall this taxonomy of animals in the ancient Chinese encyclopaedia called 'Celestial Emporium of Benevolent Knowledge': Those that belong to the emperor Embalmed ones Those that are trained Suckling pigs Mermaids (or Sirens) Fabulous ones Stray dogs Those that are included in this classification Those that tremble as if they were mad Innumerable ones Those drawn with a very fine camel hair brush Et cetera...

Comments: 2

Saving the journalism. With bitcoin.

We hear that journalism is dying every now and then. People are not willing to pay for news anymore. They expect to get them for free. If a journalist wants to live out of what they are doing they can either turn into an advertisement shop, virtually selling they readers to the advertisers or get gone. The problem is made much more grave by the fact that media is supposed to be one half of our democratic feedback loop. Paywalls are often proposed as a solution. Fair enough, but I as a reader...

Comments: 9

A really hard problem

It's not that often that one encounters a really hard problem. Complex, yes, you deal with that daily. You have to integrate with different mutually imcompatible technologies, you keep bumping into edge cases and so on. But a problem that's hard in its essence, not very much so. Hard problems are rare and precise. That's why I want to share the one I stumbled over recently. And, to warn you in advance, I have no freaking idea about the correct answer. And here's the problem: Have you ever had to...

Comments: 9

You cannot have at-least-once broadcast

I've written down this argument several times before but I think repeating it over and over until people internalise it is worth it. On this particular ocassion I was inspired by Tyler Treat's You cannot have exactly-once delivery which isn't very formal but boils down to you can't have exactly-once delivery and side effects at the same time . It's something that would be really nice to prove formally at some point. Anyway, my proof tackles a bit different problem: Ability to do...

Comments: 4

page 1 of 41234next »

Website powered by Wikidot.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License