zlacker

[return to "Nanolang: A tiny experimental language designed to be targeted by coding LLMs"]
1. fizleb+Im[view] [source] 2026-01-20 00:16:03
>>Scramb+(OP)
Looks a bit like Rust. My peeve with Rust is that it makes error handling too much donkey work. In a large class of programs you just care that something failed and you want a good description of that thing:

  context("Loading configuration from {file}")
Then you get a useful error message by unfolding all the errors at some point in the program that is makes sense to talk to a human, e.g. logs, rpc error etc.

Failed: Loading configuration from .config because: couldn't open file .config because: file .config does not exist.

It shouldn't be harder than a context command in functions. But somehow Rust conspires to require all this error type conversion and question marks. It it is all just a big uncomfortable donkey game, especially when you have nested closures forced to return errors of a specific type.

◧◩
2. wazzap+io[view] [source] 2026-01-20 00:30:00
>>fizleb+Im
You just described how the popular "anyhow" and "snafu" crates implement error handling
[go to top]