What are the filter / map / reduce of error handling?

The Ladder of Intent Assembly consists of direct instructions to CPU. The code says exactly what happens and nothing about what you are trying to achieve. Command is a command, a JMP is a jump. Only reading the code around the jump and the landing location, and also in between, gives you a clue about the intent of the jump. If we climb our ladder higher, to C language, which is very low level by today’s standards, it starts to discern small amounts of intent. Jump is not just a jump, it can be an if, a for loop or a function. Variables and blocks of code (functions) get names. I think the whole story about GOTO considered harmful is about the absolute lack of intent. ...

November 24, 2026 · Janko

Each layer adds only what it knows

People bring habits with them. After years of Go or Python, a first Rye loader often looks like this: try, is-error, a long concatenated string, and something like die. It works on the happy path. It also does and says things at the wrong level. eval-rye-file-OLD: fn { path } { src: try { Read file path } if is-error src { ^fail "Error loading config file, cannot read " ++ path ++ ": " ++ message? src } code: try { load src } if is-error code { ^fail "Error loading config file, cannot parse " ++ path ++ ": " ++ message? code } c: try { context code } if is-error c { ^fail "Error loading config " ++ path ++ ": " ++ message? c } c } load-config-OLD: fn { path } { eval-rye-file-OLD path } Rye has no die builtin — I used ^fail here so the example actually runs — but the habit is the same, and many ports would exit at that point. The problem is not that this is longer. It talks about config in a function that is supposed to evaluate any Rye file. It pastes the path and the inner message into a new string, so the original error stops being a cause and becomes text. And if you really do stop the process there, a REPL, a server, or a caller that wanted a default no longer gets a say. fix cannot recover from an exit. ...

November 17, 2026 · Janko

Don't turn failures into fake success

An LLM wrote a small helper for some Rye tooling I was working on. The helper looked up an environment variable. If the lookup failed, it returned an empty string. The caller then checked for an empty string to find out whether the lookup had failed. Something like this, in Python: def get_rye_home(): return os.environ.get("RYE_HOME", "") home = get_rye_home() if home == "": print("RYE_HOME is not set") This is ordinary code. You can find versions of it everywhere. It is also a strange little round trip: we discard the information that an operation failed, then inspect its replacement value to try to recover that information. The problem isn’t the empty string itself. It’s that we have quietly made it mean two things. ...

September 25, 2026 · Janko

Go Error Handling is Great, Rye Builds Upon It

Go Got It Right: Errors as Values Go developers already internalized something many others still resist: errors are values. An error is just a piece of information — not fundamentally different from any other data your program works with. Go made a bold choice by rejecting exceptions in favor of explicit error values. This gives you: Predictable control flow: no hidden jumps or stack unwinding Local reasoning: you know exactly where errors come from Composable error handling: errors are just data you can transform user, err := getUser(123) if err != nil { return fmt.Errorf("failed to get user: %w", err) } permissions, err := getPermissions(user.ID) if err != nil { return fmt.Errorf("failed to get permissions: %w", err) } This is explicit, honest, and debuggable. But it’s also… repetitive. ...

August 23, 2026 · Janko

What are the filter / map / reduce of error handling?

Intent A loop can transform values, select a subset, or accumulate a result. Until we read its body, we don’t know which. map, filter, and reduce put that intent in the name. An error branch has a similar property: if err != nil { // Return it? Add context? Recover? Try again? } The conditional tells us when we act. Its body tells us what we intend to do. Some of those intentions recur often enough to deserve names. ...

August 23, 2026 · Janko