The Missing Piece in Rust Error Handling

Rust already has most of what I want from error handling: explicit control flow, errors as values, and concise propagation with ?. The friction comes when deciding what to put in the error half of Result. We often end up choosing between precise types that require boilerplate and convenient types that hide which errors can occur. But precision and convenience do not have to be competing goals. Error types should compose as easily as the functions that return them.

6 min read

Bun Has Bun Shell But So Does Deno

One reason I considered picking bun over deno was bun shell. Bun shell allows one to write cross-platform JavaScript & TypeScript scripts with bash-like interop. Bun shell has a growing set of built in commands: cd, ls, rm, echo, pwd, bun, cat, touch, mkdir, which, mv, exit, true, false, yes, seq, dirname, basename. When these are encountered in a statement like $`echo hi` a cross-platform execution is used. If a command is not recognized, like $`sd world planet helloWorld.ts`, the local system command is executed. This allows for writing simple cross-platform scripts and breaking out when needed.

Patterns for Modeling Overlapping Variant Data in Rust

When building complex systems in Rust, one of the fundamental challenges developers face is how to organize their data structures to maintain type safety, avoid code duplication, keep their API clean, and remain flexible to changes. This article explores six different approaches to data modeling using a search engine as our example, examining the trade-offs between each approach where fields between search types are overlapping.

8 min read

The Result Type In Dart

Every modern programming language has error handling. Like Python, Dart chose the unchecked try-catch catch pattern, Java went with checked try-catch pattern, Zig went with Error Unions, and Rust went the Result type.

3 min read