Rust changed me as a developer blog.startifact.com · 248 points · 150 comments ·...
HN Best 30 @best30
Rust changed me as a developer blog.startifact.com · 248 points · 150 comments · HN thread
TL;DR Startifact's author Mark (blog post) argues that learning Rust changed how he thinks about software: sum types, static dispatch, type-driven design, serde-style compile-time macros, ownership-driven architecture with arenas, and performance as an enabler. The post is a reflective essay rather than an announcement, and the thread is mostly about whether learning very different languages in general makes you a better programmer, with side debates on Rust's enums, null vs Option, and whether the essay still matters in the LLM era.
- Sum types (enums with variants that must be matched exhaustively) are presented as a simpler alternative to interface-based dynamic dispatch for closed sets of cases such as Human/Cat.
- Static dispatch via generics lets a Group compile without per-element runtime type checks, which the author ties to performance awareness.
- Serde and clap use derive macros to generate serialization and CLI parsing code at compile time, comparable to Python's pickle, Pydantic and decorators.
- Rust's ownership rules discourage cyclic object graphs; the author recommends arenas (vectors indexed by integers) for trees with parent references, as in his Xot XML library.
- Faster code opens design options the author would not otherwise consider, such as holding large JSON documents in memory with indexed access in his Colchis library.
Discussion The thread quickly moved from the article to a broader claim: every developer should write a substantial project in several distant language families (Lisp, Prolog, Forth, Verilog and so on). Many commenters agreed and shared their own examples, such as Sudoku solvers, Erlang/BEAM, Verilog and Lua. Others pushed back on the idea that Rust's features are new, pointing to ML-family languages, Ada and Zig. A notable side thread concerned Zig/Ada-style tagged unions versus Rust enums. The mood is mostly appreciative and nerdy, with some wry comments about the cat example and a melancholy minority who think such essays matter less now that LLMs write much of the code.
- Learning very different languages improves programming, regardless of Rust (many): Many commenters endorse the advice that every developer should do a serious project in several language families. They cite Lisp, Erlang, Prolog, Verilog and similar languages as formative, and the 'learn a new language' idea is repeated across the thread.
- Many Rust features predate Rust and come from ML-family languages (some): Several commenters, notably pjmlp, note that sum types, pattern matching and similar features have existed for decades in Standard ML, Haskell and older compilers. They see Rust hype as a sign of weak historical awareness, though others reply that the features are still valuable and that the point is exposure.
- Rust's compile-time safety is valuable because it guards against human error (some): Commenters such as dabinat and slopinthebag praise Rust for forcing explicit handling of failure, like Option and Result, and for newtype patterns that prevent mixing IDs. They contrast this with C and Zig, where they see mistakes being dismissed as skill issues.
- Rust enums cannot be decoupled from their tag type (a few): xeubie argues that Rust conflates a tag enum with the data union, unlike Zig's union(enum) or Ada's variant records, so a discriminant cannot be named or reused without a dummy value or a macro. Others reply with strum, separate discriminant enums, or a generic trait-based workaround that addresses the synchronization concern.
- The essay feels dated in the LLM era (a few): Some commenters, including coldtea, say that reflective posts on learning languages seem strange now that LLMs write much code. Others push back that deep understanding still matters, and that AI does not remove the need to read and reason about code.
- Null and sentinel values are worse than Option types (some): Several commenters argue that null and empty-string sentinels are a worse hack than explicit optionality, since the compiler cannot enforce the check. Others say explicit nullability in Kotlin or C# is a reasonable middle ground, and note that verbosity is the main complaint about Option chains.
Links from the comments
- Van Roy chapter on programming paradigms, recommended by senderista in the context of learning different language families.
- strum's EnumDiscriminants derive, offered as a way to generate a separate discriminant enum in Rust.
- Zig docs on tagged unions, cited in the discussion about separating tag and union types.
- Real Programmers Don't Use Pascal essay, quoted by shagie about writing Fortran or C in any language.
- Overview of linguistic relativity, raised in the thread about whether spoken language shapes thought.
#rust #typeSystems #programmingLanguages #softwareDesign #learningToProgram