liveBook · Manning

Finite-state machine

A finite-state machine is a computational model with a finite set of states and defined transitions that govern changes of state in response to inputs, events, or conditions.

How 9 Manning books explain it

Natural Language Processing in Action, Second Edition

A finite state machine is a computational model that transitions among a finite set of states in response to input symbols.

How it is used
Deploys finite-state machines for regular-expression matching, controlled chatbot responses, and sentence-boundary detection.
How deep it goes
Explains transitions, deterministic matching, halting, and practical regex behavior while deferring detailed FSM theory and mathematics.
Examples
Uses greeting chatbots, regular-expression matches, character-by-character scanning, and sentence-segmentation patterns as concrete demonstrations.
What you can do after
Build it from scratch with regular expressions to recognize greetings, trigger responses, extract information, or segment sentences.

Read how Natural Language Processing in Action, Second Edition explains finite-state machine →

React in Depth

A state machine is a computational model that represents behavior as discrete states and transitions triggered by events or conditions.

How it is used
Manages React application flow and business data by restricting available transitions while keeping shared data in machine context.
How deep it goes
Develops a state diagram into an XState machine, actions, React hooks, and persistence; does not examine XState internals.
Examples
Uses a signup flow and a list-and-detail application with distinct view events, context updates, and persisted state.
What you can do after
Apply it via XState and @xstate/react to define permitted events, update context, expose data to components, and restore machine state.

Read how React in Depth explains finite-state machine →

Akka in Action, Second Edition

A state machine is a computational model whose behavior depends on a finite or otherwise defined current state and its transitions.

How it is used
Uses state-specific actor behaviors to enforce lifecycle rules such as disabling wallet changes or closing conversations.
How deep it goes
Defines FSMs and works through two wallet behaviors, their commands, state transitions, and observable output without formal detail.
Examples
Demonstrates an activated/deactivated wallet and a conversation that changes from started to closed.
What you can do after
Build it from scratch with actor behaviors that retain state, ignore invalid commands, and switch handling for later messages.

Read how Akka in Action, Second Edition explains finite-state machine →

Idiomatic Rust

A state machine is a computational model whose behavior changes according to its current state and explicitly defined transitions.

How it is used
Models stateful user sessions so permitted actions depend on the session's current state.
How deep it goes
Works through marker types, a generic session, and transition methods; leaves real session-ID lookup and validation unimplemented.
Examples
Uses an anonymous-to-authenticated user session with property updates and logout, plus a coroutine that yields before completing.
What you can do after
Build it from scratch using Rust marker types and state-specific methods to restrict session transitions at compile time.

Read how Idiomatic Rust explains finite-state machine →

C++ Concurrency in Action, Second Edition

A finite state machine is a computational model with a finite set of states and transitions triggered by inputs or events.

How it is used
Uses state machines to reason about message-passing threads that update state and send messages.
How deep it goes
Explains state-dependent message handling through ATM code, without formalizing the complete machine.
Examples
Uses ATM interactions, including card insertion, PIN entry, correction, and cancellation.
What you can do after
Apply it by modeling a thread’s behavior as state-dependent message handling with possible outgoing messages.

Read how C++ Concurrency in Action, Second Edition explains finite-state machine →

Secrets of the JavaScript Ninja, Second Edition

A model of a system as a set of states and transitions between those states.

How it is used
Explains generator execution as movement between states triggered by iterator requests.
How deep it goes
Defines four generator states and their transitions, then turns toward execution contexts.
Examples
Uses a generator that yields “Hattori skulk” and returns “Yoshi skulk.”
What you can do after
Understand how iterator requests advance a generator through its lifecycle.

Read how Secrets of the JavaScript Ninja, Second Edition explains finite-state machine →

Build and Orchestrator in Go (From Scratch)

A state machine is a computational model consisting of defined states and transitions between those states in response to events or conditions.

How it is used
Uses explicit state transitions to control task processing inside an orchestration worker.
How deep it goes
Defines states, models valid transitions, and implements lookup helpers, while stopping short of production-scale orchestration complexity.
Examples
Uses Pending, Scheduled, Running, Completed, and Failed states with scheduling, starting, and stopping events.
What you can do after
Build a small task state machine and validate transitions through a map and helper functions.

Read how Build and Orchestrator in Go (From Scratch) explains finite-state machine →

Fabulous Adventures in Data Structures and Algorithms

A finite state automaton, or finite state machine, is a computational model with finitely many states and transitions governed by input-dependent rules.

How it is used
Models input-driven behavior and connects tries to memory-efficient word-list storage.
How deep it goes
Defines states, inputs, transitions, and accepted languages, then frames minimization without detailing a specific algorithm.
Examples
Uses a vending machine and a trie recognizing a word list, with word completion and word-game moves as applications.
What you can do after
Understand how trie nodes encode states and why merging equivalent states can reduce storage without changing accepted words.

Read how Fabulous Adventures in Data Structures and Algorithms explains finite-state machine →

Functional Programming in Scala, Second Edition

A state machine is a computational model whose behavior is determined by a current state and input-driven transitions.

How it is used
Models input-driven behavior while replacing mutable data and side effects with explicit state transitions.
How deep it goes
Defines states and transition rules, then applies them through State combinators in a candy-dispenser exercise.
Examples
Uses a locked or unlocked candy dispenser with coin and turn inputs, tracked candies, and accumulated coins.
What you can do after
Builds a finite-state simulation that processes inputs and returns final machine values through State.

Read how Functional Programming in Scala, Second Edition explains finite-state machine →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.