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.

Happy Petrov Day!

I don't care much about feast days or memorial days. Assumption of Mary? Meh. Slovak Constitution Day? Shrug. Labour Day? Real socialism had sucked all the joy out of that one. The only one that I do observe is Petrov Day. Not that I do anything special. I don't even take a day off from work. I just take few minutes to contemplate. But now I am thinking that maybe, on this festive occasion, I should do a little bit more, maybe something that's public, something that has at least a slight feeling...

Comments: 0

On Becoming Clueless

It is said that every year the IQ needed to destroy the world drops by one point. Well, yes, but let me add a different spin on the problem: Every year, the IQ needed to make sense of the world raises by one point. If your IQ is 100 and you want to see yourself in 2039 just ask somebody with IQ 80 and listen carefully. I know that some people are troubled about prospects of those less intellectually gifted in the modern knowledge-based economy. And yes, it's troubling that we are heading towards...

Comments: 0

Type-safeness in Shell

Since writing the post on a hypothetical hull language as an alternative to shell I cannot stop thinking about the shortcomings of shell. And one think that comes to mind over and over is type-safeness. Shell treats everything as a string and that's the source of both its power and its poor maintainability. So when I ask whether shell can be improved, the question is actually more subtle: Can it be improved without compromising its versatility? Can we, for example, be more type-safe without...

Comments: 13

Hull: An alternative to shell that I'll never have time to implement

Here's an idea. It's kind of crazy but it's also fun to think about. Imagine a language which has every piece of its state stored in the filesystem. Yes, I know it sounds weird but do read on! Datatypes Let's say we do this: a = 1 What will happen under the covers is that file a will be created that contains nothing but 1 . Lists could be represented as files where each line corresponds to an item. b = [1, 2, 3] The above would simply create file b with the following content: 1 2 3 ...

Comments: 18

On the Nature of Programming Languages

What are we doing when designing a programming language? We decide whether it's going to be imperative or declarative. We add a bunch of operators. We add some kind of objects and visibility rules. We decide to make it either strongly-typed or weakly-typed. Maybe we add generics or inheritance, or maybe multiple inheritance. And so on. The question that interests me is whether the nature of these tools is determined by the problems we want to solve, whether they are, in some way, inherent to or,...

Comments: 1

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: 3

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: 3

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: 2

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: 1

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: 8

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

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