Top all-time · #2466
Hoverbear
Personal blog · hoverbear.orgprogrammingsystems
Hoverbear is a personal blog at hoverbear.org about programming and systems. Since 2014, 30 different Hacker News readers have linked it 38 times, most often “Pretty State Machine Patterns in Rust (2016)”. It is still writing: the last post was on 2026-06-13, and you can follow it by feed.
A computer scientist working in open source towards a more hopeful future.
Most-linked posts?
- Pretty State Machine Patterns in Rust (2016)8 people · 9 mentions · first linked 2019-10-31
- Pretty State Machine Patterns in Rust5 people · 5 mentions · first linked 2016-10-13
- Declarative Gnome Configuration with NixOS2 people · 4 mentions · first linked 2022-06-17
- The Path to Rust on the Web2 people · 2 mentions · first linked 2017-04-16
What Hacker News says?
Here! https://hoverbear.org/blog/rust-state-machine-pattern/
Comment linking /blog/rust-state-machine-pattern/
on “The State of State Machines”Submitted Hierarchical Structures in PostgreSQL (2020) as a story · 248 points
HN discussionHere's a good blog on the topic: https://hoverbear.org/blog/rust-state-machine-pattern/ . The last implementation of Raft uses this pattern.
Comment linking /blog/rust-state-machine-pattern/
on “The State of State Machines”Submitted Pretty State Machine Patterns in Rust (2016) as a story · 135 points
HN discussionThe cited post[1] recommends an enum for this job, which avoids the dynamic dispatch and makes it easier to get at a specific state’s data when you have the whole machine. [1] https://hoverbear.org/blog/rust-state-machine-pattern/
Comment linking /blog/rust-state-machine-pattern/
on “State Machines in Rust”Submitted Option Monads in Rust as a story · 83 points
HN discussionRust's control flow primitives are coming to be defined by libraries, not the language, and tend to grow over time. For a long time, we've been able to get by with a small, well-understood set of control flow primitives, those defined by Wirth many years ago. Now we have this in Rust: Type Option. The 2014 version.[1] The 2016 version.[2] (Coming soon, the "?" operator.[3]) Here's an example of excessive cleverness…
Comment linking /2014/08/12/option-monads-in-rust/
on “The cost of forsaking C”Submitted Pretty State Machine Patterns in Rust as a story · 62 points
HN discussionThere was an article posted here a while back on how to implement a state machine in Rust, purely using its type system to facilitate state transitions. It's a neat concept, even if it's a bit more verbose than what you'll find in other languages. https://hoverbear.org/2016/10/12/rust-state-machine-pattern/
Comment linking /2016/10/12/rust-state-machine-pattern/
on “Designing state machines”Submitted Getting acquainted with Rust's mio as a story · 36 points
HN discussionhttps://hoverbear.org/blog/rust-state-machine-pattern/ Here another article, but with a more classical state machine impl.
Comment linking /blog/rust-state-machine-pattern/
on “Typestates in Rust (2018)”Submitted Option Monads in Rust as a story · 15 points
HN discussionPlease don't let my negative experience put you off learning Rust -- its an important language and worth putting the effort in. I would recommend diving in and seeing if it works for you. For informational purposes, this is what I still find difficult: - The module system. It constantly catches me out. - I think that I understand traits but struggle using libraries that have a lot of traits in the public interface.…
Comment linking /blog/rust-state-machine-pattern/
on “Rust-GPU: Making Rust a first-class language and ecosystem for GPU code”Submitted Pretty State Machine Patterns in Rust as a story · 4 points
HN discussionTo me, the power of it isn't just in dynamic memory but also in that Rust has clear move vs ref vs bit copy vs logical copy (clone) and use-after-free protection. As one example of the benefit of this. This makes me feel a lot more comfortable writing state machines in Rust's type system. See https://hoverbear.org/2016/10/12/rust-state-machine-pattern/
Comment linking /2016/10/12/rust-state-machine-pattern/
on “Should you Rust in embedded yet?”Submitted Evolving How We Learn Systems with Lessons from Programming in the Large as a story · 4 points
HN discussionIt's to create random numbers to make the star field on the home page: https://hoverbear.org/ It's defined in this file: https://github.com/Hoverbear/hoverbear.org/blob/root/sass/_m... Which links to an explanation here: https://medium.com/hypersphere-codes/counting-in-css-unlock-...
Comment linking /
on “Pretty State Machine Patterns in Rust (2016)”Submitted Hierarchical Structures in PostgreSQL as a story · 3 points
HN discussionThere are ways to prevent some logic/protocol problems at the type level using rust: https://hoverbear.org/2016/10/12/rust-state-machine-pattern/ https://blog.tarn-vedra.de/posts/phantom-types-for-safe-apis... https://insanitybit.github.io/2016/05/30/beyond-memory-safet... https://scribbles.pascalhertleif.de/elegant-apis-in-rust.htm... Some libraries use such features to prevent certain kinds of nonce-reuse during e…
Comment linking /2016/10/12/rust-state-machine-pattern/
on “Rust is Software's Salvation”Submitted The Path to Rust on the Web as a story · 3 points
HN discussionThat's a legitimate criticism. As of yesterday, how to convert "String" to "&str" still wasn't nailed down. (".as_string(), or "&[]"?). Things are far better than they were a month ago, though. After using Rust a little, I get the feeling that the borrow system, the big innovation, is in good shape. The type system is clunky. Take a look at this date/time module: https://github.com/lifthrasiir/rust-chrono/blob/maste…
Comment linking /2014/08/12/option-monads-in-rust/%22
on “Graydon Hoare on Rust 1.0.0-alpha”Submitted Declarative Gnome Configuration with NixOS as a story · 2 points
HN discussionThe borrow checker isn't nearly as big a deal as you make it out to be from a complexity perspective. You have to take some time to learn the paradigm but when you do it's easy. The challenge is people assume it writes like C because it looks like C, and are frustrated when it doesn't. After a couple of months, you'll realize the borrow checker is your friend, you just need to feed it stuff in a way it understands.…
Comment linking /2016/10/12/rust-state-machine-pattern/
on “Vulnerabilities found in GE anesthesia machines”Submitted Configurable Nix Packages as a story · 2 points
HN discussionI can't believe this article doesn't mention the (first-party) ltree extension: https://hoverbear.org/blog/postgresql-hierarchical-structure...
Comment linking /blog/postgresql-hierarchical-structures/
on “Postgres: The Graph Database You Didn't Know You Had”Submitted The Path to Rust on the Web as a story · 2 points
HN discussionI found this (old [2016] but still relevant) blog post expanding on this at https://hoverbear.org/blog/rust-state-machine-pattern/ which was very useful for describing type-safe state machines in Rust.
Comment linking /blog/rust-state-machine-pattern/
on “Using enums to represent state in Rust”Submitted A journey into iterators as a story · 2 points
HN discussionThis is the correct one: https://hoverbear.org/blog/exploring-xous/
Comment linking /blog/exploring-xous/
on “Getting Started with Xous and the Precursor”Submitted Rust, Travis, and GitHub Pages in Harmony as a story · 2 points
HN discussion