Rust Parser and State Machine

Rust it’s a very nice and powerful language. I believe Rust has a place beyond systems and hardware programming. I personally believe we will be seeing more and more Rust in the following years just like Go took some time to liftoff I believe Rust time is yet to come. Rust it’s powerful because favors safe programming not only in sense of memory management but also combined with functional programming we can get the best of all words meaning: Safety, Productivity, Less code, Doing more with less, reducing complexity, and leverage engineering best practices. Today I want to show how easily we can write a cyclic state machine parser with Rust and without using any crates but really 100% on the standard language. So Let’s get started.

The Video

The Code


Diego Pacheco

Originally published at on January 10, 2021.

Brazilian, Software Architect, SWE(Java, Scala, Rust, Go) SOA & DevOps expert, Author. Working with EKS/K8S. (Opinions on my own)