Mehdi Akiki

Writing

The main body of this writing follows one system below its interface: a compiler, a runtime, a protocol, a build, a data pipeline. It is organized around four engineering questions.

Investigations run over several parts and keep the programs and experiments that produced their evidence. Articles stand alone. Shorter notes, beginner material and tool guides stay in the archive and in search.

Investigations

Multi-part work backed by code, measurements or reproductions that can be run again.

  1. Through the layers · 10 parts

    Types under the hood

    Ten parts on what a type is and where it goes: sets of values, layouts and padding, erasure and monomorphization, the bits the processor actually sees, and what the checker knows that the binary forgets. Small programs in Rust, C, TypeScript and Python, with one script that reproduces every output.

    Evidence: experiments/rust-atlas/types-under-the-hood/

    1. What Is a Type? A Set of Values, a Promise About Operations, or Both
    2. Does a Type Exist at Runtime? Following One Value From Source to Register
    3. A Type Is a Set: Why Human Has Two Members and Option of Human Has Three
    4. Shape Without Behavior: Two Structs With the Same Fields
    5. Behavior Without Shape: Traits, Interfaces, and Types That Own No Bytes
    6. Where a Type Becomes a Layout: Fields, Padding, and Reordering
    7. Two Ways to Make a Type Disappear: Erasure and Monomorphization
    8. The Processor Has No Types: What add Does to Bits It Does Not Understand
    9. Runtime Type Tags: What Dynamic Languages Keep That Static Ones Throw Away
    10. Types as Proofs: What the Checker Knows That the Binary Forgets
  2. Interrupted execution · 3 parts

    Async Rust under the hood

    Five async Rust problems reproduced in one small tokio program: an oversized future, a future that is not Send, a blocking call, a select! loop that loses data, and a shutdown that hangs. Then the cost of async fn through dyn Trait, and cleanup when Drop cannot await.

    Evidence: experiments/rust-atlas/async-symptoms/

    1. How Async Rust Works Under the Hood: Five Symptoms, One Model
    2. Async fn in a dyn Trait: What the Box Costs, Measured
    3. Async Cleanup in Rust When Drop Cannot Await
  3. Through the layers

    Rust Failure Atlas

    Rust failures that are difficult to name and easy to misdiagnose, organized from symptom to mechanism, with a failing and a repaired fixture for most cases.

Articles

Standalone pieces, grouped by the question they answer.

Through the layers

Following a system through its layers

Source, runtime, protocol, compiler, machine. Each piece follows one behaviour down to the layer that decides it.

Investigations: Types under the hood, Async Rust under the hood, Rust Failure Atlas

All 37 articles in this theme →

Derived state

Derived state, build artifacts and invalidation

What gets stored, what gets recomputed, what becomes stale, and how the system knows.

Investigations: Rust build times

All 22 articles in this theme →

Interrupted execution

Correctness when execution is interrupted

Crashes, retries, cancellation, partial progress, ownership, recovery and idempotency.

Investigations: Async Rust under the hood

All 17 articles in this theme →

Measurement

Measurement-driven systems work

Treating an assumption as a hypothesis, building an experiment, following a surprising result into a lower layer, and rejecting a change when the evidence says it loses.

Investigations: This site as an engineering laboratory, Rust build times

All 13 articles in this theme →

The archive

All 267 published pieces, newest first, each labelled as an investigation, an article or reference. Reference covers beginner Rust, framework and tool guides, AI explainers, interview preparation and older short pieces. The 61 short engineering notes have their own page.

Other ways in