Website of Martin Sústrik, creator of ZeroMQ, nanomsg, libdill, Cartesian.

Musings about random stuff. No attempt at scientific rigor. Take with a grain of salt.

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

The Politics of Age (the Young vs. the Old)

Few days ago I've read an article in the local newspaper about Switzerland considering to lower the voting age to 16. The reason I found it interesting was that it was not one of the old tired political discussions supported by the same old tired arguments that you typically encounter. In fact, it's a question that I have never thought of before. Apparently, the discussion was triggered by the recent school strike for climate that went quite big in Switzerland. I've attended the demonstration in...

Comments: 0

Muqaata'a by Fahad Himsi (I.)

When Black Panther came out I went to cinema hoping to finally see a science fiction movie about Sub-Saharan Africa. (District 9, for obvious reasons, doesn't count.) Needless to say, I was disappointed. The film wasn't really about Africa. It was about America, pretending, half-heartedly, to be about Africa. I was not sure how to feel about it. On one hand trying to relate it to my own cultural background a Hollywood movie about Slovak shepherds with laser weapons would be hilarious. On the...

Comments: 4

Programmatic Code Generation: Composability

After working some more with Tiles, my mini-library for programmatic code generation, I've realized it has a feature that I haven't knowingly baked in, but which makes it a really good tool for the job. Namely, the code you write is composable. Here's what I mean: If you want to generate a C function that prints out names of countries' capitals then you can generate the code that does the actual printing first: data = { Afghanistan : Kabul , Brazil : Brasilia , Canada : ...

Comments: 2

Lydian song

Now, I know that this is super-weird and probably makes sense to nobody by myself. First, it's in lydian scale which is nowadays used nowhere but in some Slovak (and, allegedly, also in Polish) folk songs. Second, the base chord is dissonant (C maj). It's meant to be played by strings so that dissonances do not fade out. Use as you see fit. Feb 25th, 2019

Comments: 0

Tiles: Report on Programmatic Code Generation

Writing programs that generate programs is hard. The programmer has to think at two levels of abstraction at once. She has to follow the logic of the generator. At the same time she can't lose the focus on the logic of the generated code. And the two don't even have to be written in the same language! That's a hard enough feat even when the tools aren't putting obstacles in your way. But, unfortunately, that's exactly what they are doing. Consider this Python program that outputs the classic C ...

Comments: 3

Graceful Shutdown

WARNING: The claims about composability of the graceful shudown construct have been defeated in the discussion here. Or maybe not. Judge for yourself. However, most of the analysis in this article is still relevant. Introduction Within a structured concurrency world, graceful shutdown is a little understood, little addressed and confusing topic. I've been fighting with it myself for almost a year (longer than with any other problem I can recall) and it haven't been a pleasant experience. If felt...

Comments: 1

Structured Concurrency Cross-language Forum

There are structured-concurrency-related efforts going on for different programming languages but the entire effort is kind of scattered, without people being aware of each other and speaking to each other. If we had a common forum, we could share the use cases, the problems, the ideas and the solutions. Each of us, irrespective of which language they are working with, could benefit from this common pool of knowledge And here we go! The forum now exists. Thanks to Nathaniel Smith for setting it...

Comments: 0

Confessions of an Abstraction Hater

I've written about the cost of abstraction before. Once you are in the IT industry for couple of decades and once you've read couple of millions lines on legacy code you become healthily suspicious of any kind of abstraction. Not that we can do without abstraction. We need it to be able to write code at all. However, each time you encounter an abstraction in the code that could have been avoided you get a little bit sadder. And some codebases are sadder than Romeo and Juliet and King Lear...

Comments: 10

Announcement: A talk about structured concurrency at FOSDEM

Generally, I don't tend to give talks (the last one I gave was six or seven years ago) but this time I am going to make an exception. I am going to give a short talk about structured concurrency as FOSDEM 2019. If you are interested in the topic, meet me in Brussels on February 2nd! Details about the event can be found here. If you have no idea what structured concurrency is about, good intro article can be found here. EDIT: The video of the talk can be found here.

Comments: 1

State Machines and the Strange Case of Mutating API

State machines are widely used to implement network protocols, or, generally, objects that have to react to external events. Consider TCP state machine: During its lifetime TCP socket moves throught different states in the diagram. When you start connecting it's in SYN SENT state, when the initial handshake is over, it's in ESTABLISHED state and so on. And here's an interesting observation: The API of the socket changes as you move from one state to another. For example, it doesn't make sense...

Comments: 19

Equivalence of State Machines and Coroutines

In the past I often referred to the equivalence between state machines and coroutines as a kind of obvious fact that doesn't need any additional explanation. It was brought to my attention, however, that that may not always be the case. This article therefore doesn't attempt to express and deep and ground-breaking truth, rather, it illustrates the equivalence of state machines and coroutines using a practical example. The example is stolen from Wikipedia's article on finite state machines: A...

Comments: 4

On Rigorous Error Handling

In my long career as a programmer I've seen a lot of projects with a lot of error handling practices and, sadly, almost none that actually worked. We are facing facing few high-level problems here: For many applications error handling is not critical. Error handling code is rarely executed. Consequently, it looks like it works until it doesn't. Programmers want to implement new features. Writing error handling is just an annoyance that slows them down. Who cares about error handling? For many...

Comments: 0

Two Approaches to Structured Concurrency

I am the author of libdill, a library that brings structured concurrency to C language. However, the concept of structured concurrency is still evolving and we haven't yet reached the final consensus on what's the right way of doing it. To broaden my horizon, I've recently played with Trio), a library for strucutured concurrency in Python. Also, to be able to compare the two approaches I've implemented Happy Eyeballs algorithm (RFC 8305) using libdill, so that it can be compared to Trio's...

Comments: 7

Unikernels: No Longer an Academic Exercise

Introduction I've been following the unikernel area for years and I really liked the idea, but I was unconvinced about the possibility of the wide-scale adoption of the technology. The cost was just too high. It required you to forget everything you knew, to drop all the existing code on the floor, to rewrite all your applcations and tools and start anew. (I am exaggerating, but not by much.) If microkernels never made it, the unikernels are not going to either. Whatever the benefits, the cost...

Comments: 9

Update on Structured Concurrency

Since I've written the article on structured concurrency and implemented libdill the progress went on. Most importantly, Nathaniel J. Smith has published his Notes on structured concurrency, or: Go statement considered harmful article. (If you prefer to watch a video, go here.) It's better, more detailed and more eloquent than anything I have ever written on the topic. If you want to read one thing about structured concurrency go read Nathaniel's article. After C-based libdill we've also got...

Comments: 24

Coordination Problems in Evolution: The Rise of Eukaryotes

Introduction This is a series of posts about coordination problems, as they appear in the course of biological evolution. It is based on the book The Major Transitions in Evolution by John Maynard Smith and Eörs Szathmáry. Previous part, discussing Eigen's paradox as well as the origin of chromosomes, can be found here. In this part we are going to look at the origin of eukaryotic cell, specifically at its acquisition of endosymbiotic organelles, and at the origin of multicellularity....

Comments: 0

Coordination Problems in Evolution: Eigen's Paradox

Introduction Lately I've written couple of posts that discuss coordination problems. Not the idealized, game-theoretical stuff but rather the real, messy coordination problems encountered by real people in the real world. Here, I will explore very different territory. I will look at coordination problems between between molecules, chromosomes, cells and individuals as they occurred and as they were solved in the course of biological evolution. This article is based on the book The Major...

Comments: 0

One-person Universe

One day, professor Wheeler from Princeton called Richard Feynman and exclaimed: Feynman, I know why all electrons have the same charge and the same mass! Why? asked Feynman. Because they are all the same electron, travelling back and forth in time! Upon hearing this story, Zarathustra said: Wheeler was right. Likewise, all the living men are the same man, revived after he dies and carried back in time, for ever and ever, infinitely. October 9th, 2018

Comments: 4

What Can Philosophers Learn from Programmers?

On Definitions At the college were studying a lot of maths. The books were quite boring. All they contained was a never-ending sequence of definitions, lemmas, theorems and proofs. Later on we've had lectures on logic where we learned how the sausage machine works. We've learned a lot of what's true and what's false , what's a theorem and how to construct a proper proof. However, there was nothing about how to make a good definition. On occasions I spoke about this omission with random people...

Comments: 7

Anti-social Punishment

Introduction There's a trope among Slovak intellectual elite depicting an average Slovak as living in a village, sitting a local pub, drinking Borovička, criticizing everyone and everything but not willing to lift a finger to improve things. Moreover, it is assumed that if you actually tried to make things better, said individual would throw dirt at you and place obstacles in your way. I always assumed that this caricature was silly. It was partly because I have a soft spot for Slovak rural life...

Comments: 5

page 1 of 8123...78next »

Website powered by Wikidot.

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