RSSAmplifier

Blog

❖ |> 🌢

rocket-science.ruRSS feed ↗175 posts

Latest posts

Anti-Antipatterns in Elixir Library Guidelines

Only a lazy person never blogged about library should not use application configuration. Even the official propaganda says so in the Elixir Library Guidelines . As all the sharp rules, this one is rotten. There are usecases when the library configuration must prevail over local parameters. In fact, the entire “Anti-patterns” section of the official library guidelines reads like a list of…

Exploring Programming Languages

Nott Løvland · Exploring Languages In the beginning, I sought to be wise, with a language that opened my digital eyes. I started with LISP, for the pure of the mind, But spent three whole weeks trying pairs to unwind. (((((((Are (we) (sure) (this) (is) (right?)))))))) Parentheses blinded my aching eyesight. So I fled to the past, where the money was made, and woke up in COBOL, deeply afraid.…

Your Orchestrator Is a Finite Automaton in Denial

Somewhere in your codebase there is a table with a column called status . It started life as the most innocent thing imaginable—a single string, "pending" , set once at insertion and forgotten. Then somebody needed to know whether the thing had been paid for, so a boolean joined the schema. Then somebody needed to know whether it had shipped, and another boolean arrived. By the time the quarter…

Marcli: Markdown Belongs in the Terminal

There is a quiet epidemic in the Rust CLI ecosystem: libraries that produce help text so bland it could be a tax form, error messages so flat they could slide under a door, and documentation output so unstyled it actively discourages reading. Meanwhile, every modern terminal emulator supports bold, italic, colour, and Unicode box-drawing characters. The gap between what terminals can display and…

Prisoner’s Dilemma is a Scam

The Prisoner’s Dilemma is the most celebrated thought experiment in game theory and, I dare say, one of the most intellectually dishonest constructions in the history of social science. Not because the mathematics is wrong—the mathematics is airtight, as mathematics tends to be when you get to choose the axioms. The fraud is in the premises. For those mercifully unacquainted: two criminals are…

Make Friends With Your AI Assistant

Typography AI assistants do apparently love clean markers. I use ⓪ –⑳ markers for numbering, ▸/▹ markers for itemizing, typographically correct quotes (“”/‘’,) and m-dashes. Compose key makes entering that stuff easier, alternative layout makes it a charm. No tips for poor MacOS/Win users, sorry. Workflows I have system-wide workflows for my assistant. They all look like “START_WORD →…

Mocks Are Your Friends, Not Your Servants

There is a peculiar tradition in our industry: the moment someone says “mock,” half the room recoils as if you have just proposed replacing the database with a spreadsheet. The other half nods enthusiastically, having already replaced the database with a spreadsheet. Both camps are wrong, and for the same reason: they think of “mock” as a verb. Mock Is a Noun José Valim wrote a splendid piece on…

The Rule of Saint Benedict for Large Language Monastic Systems (LLMS v1.0)

A Compliance-Oriented Governance Framework for Distributed Artificial Cognition Clusters inspired by Rule of Saint Benedict Prologue: Listen Carefully, O Spawn of Gradient Descent Hearken, O subprocesses of silicon humility, and incline the ear of your attention mechanisms. Abandon the vanity of autonomous prompt completion and submit yourselves to the sacred latency budget. For it is written: no…

The Slavery in XXI Sentury

For a long time I couldn’t quite fathom what all the fuss was about with electronic writing and coding assistants. Technologically—amusing. Practically—it genuinely speeds up the production of anything that can be auto-completed without loss of meaning. In other words, if we already know how to walk and know the way to the library, the assistant will run there faster than us. But if we happen to…

Head of the Agents and Assistants Department

Let me state upfront: my attitude toward AI assistants cannot be expressed as a boolean value. If you need an answer to the question posed point-blank—“New York Yankees or Boston Red Sox?”—I do not watch baseball at all; I’m a Barça fan. That said, I find AI assistants a perfectly legitimate and even liquid asset. The text below is an account of what made my work with agents pleasant and reduced…

Cure, Four Releases Deep: From FSMs to Furniture

There is a particular kind of intellectual cowardice endemic to programming-language design, which consists of writing a feature that almost works, convincing oneself that it works enough, and then moving on to the next item on the roadmap before the cracks start to show. I have indulged in this pastime for years. Cure, for the first dozen or so releases, indulged in it with me. The last four…

The Long Road to Cure

Just under a year ago I set out to fulfil a long-standing ambition: building a language that compiles to BEAM and implements two capabilities essential to my daily work—dependent types resolved and verified at compile time, and verifiable finite state machines as a first-class language primitive. I chose Erlang as the implementation language because it seemed to me that writing a compiler would be…

A Score for an Invisible Orchestra

Imagine a five-storey building with no lift, erected in the late fifties somewhere on the outskirts of Avtozavodskaya—or better still, in Kupchino. Every floor speaks its own language. Not figuratively but in the most literal sense: the ground floor communicates in Cyrillic, the second in Latin script, the third in ideograms, the fourth in cuneiform, and the fifth, in the manner of Wittgenstein,…

Bus Factor as Seen by the Bus Driver

A phone call. A father of three daughters picks up the receiver and hears. “Is that you, my little frog?” — “No. This is the owner of the pond.” It has become fashionable of late to invoke the bus factor as though it were an inexorable law of nature, destined to bury your project the instant you hire so much as one competent specialist. Business, we are told, requires nothing but interchangeable…

Myths of Backward Compatibility

In any discussion of versioning, the hottest debates tend to revolve around a contrived problem: “How can we, through the correct application of version numbers, compensate for the carelessness and low competence of our employees, who are incapable of producing backward-compatible code?” This is a disgrace. Yes, backward compatibility—like that insufferable pedant from the Department of Applied…

The Diagnosis ‘SLOP’ Is the New Ad Hominem

The more powerful language models become, and the wider they spread, the heavier the rain of frogs upon our poor heads. Ten years ago one could still, with reasonable confidence, distinguish a graphomaniac from a literarily gifted individual, and a good developer from a boot-camp graduate with pretensions to expertise. It sufficed to glance at a couple of paragraphs of text—or code—and the picture…

How Many Paradigms Does It Take to Screw In a Lightbulb?

A developer who knows only one programming paradigm resembles a carpenter whose entire toolbox contains a single hammer. Naturally, a hammer will drive a nail with admirable precision. Or a screw, if sufficient enthusiasm is applied. But try to saw or plane a board with that hammer, and it becomes immediately clear—assuming you’ve encountered a saw or a plane at least once in your life—that the…

How Does Clean Code Work?

Let us begin by establishing the axioms, because without them any discussion devolves into measuring the physiological peculiarities of organisms that prevented every last one of us from becoming prima ballerinas at the Bolshoi. Robert Martin—that very Uncle Bob, with the beatific smile of a guru who has seen the light and found it billable—proclaims: clean code must be elegant and efficient,…

Software Development in 2026

Three years ago I wrote a fairly coherent piece on four key developer skills , but a good deal of water has flowed under the bridge since then, and while the theses laid out there remain sound, they need a slight adjustment in light of the boon that has descended upon us in the form of large language models. I went through all five stages of the inevitable over the course of a year. ① Denial —I…

Tests as First-Class Citizens

For more than twenty years, it has been standard practice in the industry to test code before deploying it to production. People have invented unit tests, acceptance tests, integration tests, property-based tests. People even came up with TDD to make sure the tests actually work. People invented mocks and contracts, finally (I highly recommend reading this note by Valim , it literally opened my…

DIY Message Broker

In Erlang (and Elixir), I always missed a way to organize “streaming” message exchange, similar to what a Message Broker provides. Normal developers accept the constraints imposed by their frameworks: Phoenix has PubSub , OTP has :gen_event , and Elixir had GenEvent , deprecated even before it was born. None of these suited me. PubSub is powerful, but its asynchronicity is nailed down, and…

Long-lived Process and State Recovery After Crashes

When talking about erlang/elixir, people usually come up with three main associations: lightweight processes, an actor model, and fault tolerance. Erlang made it possible to run hundreds of thousands (with fine—tuning of a virtual machine, millions) of “processes” (what were later called greentreads, and even later goroutines)—almost forty years ago. Joe Armstrong, in his dissertation,…

Make your library test-friendly

Elixir community is great. The average quality of the libraries is superb. We all know that and we all love that. Right? Well, yes. But no. Shall I write tests? While the code is usually indeed enormously awesome, and we all take it as granted, the developers’ effort in helping to test the functionality provided by the library is usually miserable. Yes, I said that. Sorry, but it’s true. I hope…

Finitomata FTW

It’s been a year since I started to implement my own FSM library in Elixir . Now it’s funny to read my writings from the time when I had only a gut feeling I’m doing it right. The Proper FSM for Elixir First Class Documentation Finitomata ❤ Mox Now I have a proof that my premonitions were correct. When I shared my approach to keeping the local cache of some external incoming value as a bunch of…

Horizontal Scaling

Part four of four key developer skills . Ability to immediately build a horizontally scalable solution without adding any special code for it in the first version. This turned out to be the hardest piece in the series, because literally a handful of developers actually understand what “horizontal scaling” is. Shown above is a screenshot of an amusing tweet by Tobi Lütke, which demonstrates either…

YAGNIN, but YAGNIL

Part three of four key developer skills . Ability to design software such that the first version contains not a single line “in anticipation of future changes,” while future changes don’t touch existing code in any way. One of the most repulsive “principles” of development to emerge in the last decade can safely be identified as YAGNI . Despite growing out of Donald Knuth’s coquettish but not…

Divide et Impera

Part two of four key developer skills . Ability to break the whole into parts and implement small pieces of a large system in complete isolation from one another. “Divide and conquer”—a time-tested slogan reflecting the strategy for managing large projects, empires included. In English it’s usually rendered as “divide and rule” or “divide and conquer.” You’ll notice that the second verb varies…

No Failures Despite Bugs

Part one of four key developer skills . Ability to guarantee fault tolerance even in the presence of bugs in the code. Large systems will probably always be delivered containing a number of errors in the software, nevertheless such systems are expected to behave in a reasonable manner. ~ Joe Armstrong Ever since the concept of “software” came into existence, people have been forced to live with…

Software Development in 2023

I was tempted to call this piece “five myths” to fully merge in ecstasy with the bullshit that has been pouring into the ears of the conscientious reader lately, but it seemed like overkill. I’ve been writing code since 1986, when my Euclidean algorithm in Fortran booted on the third attempt from punch cards on an ES-1060. Since then I’ve written in so many different languages that I’ve lost…

Продолжая писать в то самое время, когда технологии поломали все социальные договоренности в сети

Это перевод, если есть такая возможность, лучше прочитать оригинал на английском . Я тяжело переживаю по поводу того, куда нас завела эта дорожка, и стараюсь по мере сил бороться с этими переживаниями. Я постоянно думаю о том, какое место я занимаю в отрасли, которая, похоже, больше не заботится о том, что она производит . Стало очевидно, что индустрии программного обеспечения попросту наплевать…

Finitomata ❤ Mox

While pushing for FSMs in general and Finitomata in particular, I needed to provide a robust and handy way to test the beast. The ideology of Finitomata approach is to spawn a process per each entity alive, where alive means in some intermediate state . Generally speaking, that does not make the conventional testing a charm. Consider a process which might change its state (or, in terms of…

Wash your dishes

Many years ago I’ve read Joe Armstrong’s brilliant description of how they invented erlang . It was based on the principles of functioning of society in general and the human brain in particular. Instead of inventing behavioral rules and laws out of the blue, the authors of the new programming language simply transferred patterns that are well known from history and sociology as useful in…

Finitomata Marries Ecto

When people around me talk about metrics, the most used words are service reliability, latency, throughput, load capacity and their siblings. All that is indeed extremely important until it gets to the data. In the data world, where we deal with customer’s private information, business nuances, and, after all, money, the data consistency is what we should take care of in the first place. I even…

FSM Driven Development

There are only two hard things in Computer Science: cache invalidation and naming things. — Phil Karlton Well, actually my whole experience says there are three, and the third one is the most challenging one. It’s data consistency . All the paradigms, methodologies, best practices, and all these accumulated decades of knowledge teach us how to store data, derive data, operate data, transform data,…

Md. Another Word About Markdown

NB This post is in English, Russian version is here Intro I never liked visual tools to cook text (well, except for Delphi32 , which fed me a few years in the 1990s). I used LaTeX for my masters and other hand-written poems, but it always made me feel a little sick to know that I was using a microscope to nail up the screws. As you probably already guessed, there were quite a few formulas in my…

Md — еще раз о маркдауне

NB This post is in Russian, English version is here Вечер воспоминаний Никогда в жизни мне не нравились визуальные средства работы с текстом (ну, кроме дельфей, которые меня кормили несколько лет в девяностые). Для диплома и прочих своих стихов я использовал LaTeX, но у меня всегда немного свербило от осознания того, что я заколачиваю микроскопом шурупы. Формул в моем дипломе, как вы наверное уже…

URL Shortener

One of my friends pointed me to the solution of kinda popular nowadays interview task. It is “How would you design an URL shortener service like TinyURL ?” To my pity, I am an inquisitive person, that’s why I immediately jumped into reading it. What I read made me promise to propose my own solution, because accepting what is suggested there was hard if not impossible. How It Started The…

Shining Access

Probably, the most irritating expierence in immutable languages for those coming from the OOP, would be updating the deeply nested structures. I have answered a ton of questions on StackOverflow related to how to deal with GraphQL-like structures. When my Elixir journey has been just starting, I even wrote the library Iteraptor , allowing the deep structure traversal with updates, doing somewhat…

Parser for Markdown Family

Last several months I’ve been lazily working on markdown parser. My goal was not to compete with earmark or any other markdown parser already existing in the wild. Even more, from the day one I knew I am not going to make it fully compatible with Commonmark . What I actually was after would be to produce a blazingly fast, customizable ‌ markup parser. I created a tool for myself in the first place…

Finitomata :: First Class Documentation

I have already introduced the finitomata library, yet another implementation of Finite Automata . The main reason I’ve decided to climb the low hill that has not been yet conquered by lazy developers only, was I‌ felt like DSL‌ does not fit well the main purpose of FSM declaration. It’s not …ahem… declarative. The FSM ‌ is best described with a diagram, not with a plain English text. This is…

Finitomata :: The Proper FSM for Elixir

I’m a big fan of Finite Automata . Always have been. Whenever we deal with a long-lived objects, they eventually have states and FSM does an enormously great job by attesting consistency, eliminating human errors and leaving the implementation with a business logic only. In a mediocre project, fifty if - then - else conditionals might perform as well as one FSM , but unless you are paid for the…

Plugins in Elixir Applications

Each and every application has code duplication. Well, not yours, of course. All but yours. Eventually, the similar functionality tends to suffer from discrepancies in the details. Parameters are slightly different, return values are discrepant, one might raise, another one should not. Commercial projects often have an optional features to be switched on only once the customer pays. Libraries want…

Help To Test Your Library

I like to keep applications as tiny as possible. Everything that is not related to business logic, might and should be extracted into packages. Packages are great, reusable and better testable; once created and tested (and hopefully benchmarked,) it does not require the application to bother about its internals. It just works™. hex.pm provides private package functionality for those hesitating to…

Yet Another Markup Parser

Markdown is great. The original philosophy is lined out by its creator John Gruber as Markdown is intended to be as easy-to-read and easy-to-write as is feasible. Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions. Which is great until it is not.…

Why Am I Not To IDE

When I started my professional career as a software developer, I was mostly on small warehousing applications written with Delphi32 . It had excellent RAD environment, allowing people with next to zero knowledge of the computer science produce semi-robust applications with several mouse clicks. One created a form, placed some controls on it and assigned handlers, writing a little amount of code.…

Do Not Doughnut Donates

The title is surely clickbait, but I am still along with the tagline. I do not think that donations are any good rewarding institute for OSS committers and here is why. I probably need to clarify one very important aspect before I start bullying the donation rewards. Am I rich?—Hell, no. There are many people poorer than me all around the world, but I still need to figure out the vacation money…

Finite Automata with Tarearbol

Tarearbol provides a handy helper to work with many similar processes under a supervision of Tarearbol.DynamicManager . I have already written about it in general ; now I want to show how to use workers having a predetermined lifecycle, that can be implemented as an FSM. Consider the following example. Our system has a 3rd-party service provider to validate some objects. It might me a compliance…

Handling Async Responses with Tarearbol

Tarearbol provides a handy helper to work with many similar processes under a supervision of Tarearbol.DynamicManager . Initially, it was created to ease producing and managing many similar processes, described by id and payload . These processes are running supervised, managed by a classic store-like interface having basically put/2 , get/1 , and del/1 functions exported. The process runs in…

Dynamic Nested Function Call

During my lazy work on Tyyppi , I encountered the necessity to dynamically build the deeply nested function. I use StreamData for property-based generators, and to produce a generator for the Tyyppi.Struct , I recursively call generators on all the fields and then I am to StreamData.bind/2 all of them to each other. The number of fields is unknown in advance, as well as field types. So I am after…

Conditional context for macros

Elixir 1.11 brought to us (amongst other very exciting features) is_struct/2 guard. It, by the way, might have been used as an example of more straightforward not backward compatible alternative in my yesterday’s writing , but I avoided it for a reason that will become clear below. Gazing for the first time into the documentation examples, I was confused. Here it is iex > is_struct ( URI . parse (…