Rust changed me as a developer blog.startifact.com · 77 points · 34 comments · H...
HN Best 200 @best
Rust changed me as a developer blog.startifact.com · 77 points · 34 comments · HN thread
TL;DR Startifact's author Bert Hubert-style essay (author writes under the startifact blog) argues that learning Rust changed how they think as a developer over six years, four professionally. The post covers sum types vs. interfaces, compile-time dispatch via generics, type-driven development, serde/clap-style macros as compile-time magic, ownership pushing toward arena patterns, and performance unlocking new architectures.
- Sum types (enums) model variants, optionality and errors more directly than interfaces, with the compiler forcing exhaustive handling.
- Generics give statically dispatched groups of one concrete type, avoiding per-item runtime checks for mixed collections.
- Types are a design tool during iterative development, similar to tests and docs, not only a static checking mechanism.
- Serde and clap use macros to generate serialization and CLI parsing at compile time, the Rust counterpart of Python's pickle, Pydantic and decorators.
- Rust's ownership rules reject cyclic and shared-mutable structures, so the author uses arenas with index references, which brings cache-friendly, interned storage.
- The author concludes the language is hard to learn but expands what they can build, and notes AI coding tools shift the tradeoffs.
Discussion The thread mostly takes the post as a prompt for broader advice about learning many programming paradigms, with several commenters recommending major projects in different language families and offering example projects. A second strand debates Rust's enum design compared with Zig and Ada tagged unions, and a third praises Rust for guarding against human error. The mood is largely appreciative and discursive, with one notable tangent where a commenter links the post to the changed profession after 2023 and questions whether such lessons still matter.
- Learn many languages across paradigms to grow (many): Several commenters say building a major project in each language family (Lisp, OO, functional, Prolog, HDLs, Forth) teaches lessons that carry over. Suggestions include a toy interpreter, a tmux clone, or a chat server, and one commenter adds that Lua embedding is similarly instructive.
- Rust enums conflate tag and data (a few): One commenter argues Rust lacks a standalone tag type as Zig and Ada have, making it hard to represent just the kind of a variant. Replies counter that data in variants is optional, that repr and From/Into can assign values, and that std::mem::discriminant covers the need.
- Rust's explicit error handling defends against human error (some): Commenters praise Rust for forcing a decision on possible failure instead of relying on remembering null checks, and for newtypes that prevent mixing IDs. They link this to the purpose of unit tests and to the broader history of language features that constrain mistakes.
- The lessons feel dated after LLMs (a few): One commenter says such enlightenment was common before 2023 and now seems strange given that LLMs changed the profession. Others reply that it still matters, comparing it to learning derivation by hand despite calculators.
Links from the comments
- Van Roy chapter on programming paradigms, shared as a reference on language concepts
- std::mem::discriminant docs, cited as an answer to the tag-vs-union complaint
- Zig guide on unions, used to compare tagged union design
- Ada variant records tutorial, cited as a similar tag-plus-record design
#rust #programmingLanguages #typeSystems #softwareDesign #learningToCode