A Gopher Meets a Crab

· coding · Source ↗

TLDR

  • A decade-long Go developer builds a Tokio chat server to learn Rust, using Claude as a pair programmer, and documents the mental model gaps.

Key Takeaways

  • Rust’s exhaustive enum matching replaces Go codegen and forget-prone tests; missing variants become compile errors, not runtime bugs.
  • The ? operator condenses Go’s if err != nil chains, but stacked ? on nested Result/Option types still reads awkwardly.
  • Rust’s async runtime is not built into the language; Tokio is an imported library, making the scheduler visible and pokeable unlike Go’s hidden goroutine machinery.
  • tokio-console live-tails tasks, channels, and mutexes in real time; the axum accept loop burned 29 microseconds across 10 minutes, confirming near-zero async overhead.
  • Trait bounds with SinkExt, Unpin, and associated error types hit complexity fast; for app-level code, writing the concrete type is a valid escape hatch.

Hacker News Comment Review

  • No substantive HN discussion yet.

Original | Discuss on HN