Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. ClojureScript
  3. Automat

Automat

Clojure

A Clojure/ClojureScript library for building and using finite-state automata through functional composition.

GitHubGitHub
592 stars48 forks0 contributors

What is Automat?

Automat is a library for creating and using finite-state automata in Clojure and ClojureScript through functional composition. It solves the problem of defining complex state machines without a custom DSL, offering high performance and seamless integration with Clojure's functional paradigms.

Target Audience

Clojure and ClojureScript developers who need to implement finite-state machines for tasks like parsing, stream processing, or behavioral tracking.

Value Proposition

Developers choose Automat for its blend of Ragel-like power with Clojure's composability, enabling fast, declarative automata that are easy to extend and visualize.

Overview

better automata through combinators

Use Cases

Best For

  • Parsing and validating sequences of inputs in Clojure applications
  • Implementing high-performance stream processing with stateful reduction
  • Tracking user behavior patterns in web applications (e.g., e-commerce flows)
  • Building composable, declarative automata for protocol or format validation
  • Creating reusable FSM components for complex event-driven logic
  • Precompiling automata in Clojure for use in ClojureScript to optimize startup time

Not Ideal For

  • Projects that don't involve sequence processing or state-based logic, as Automat is specifically designed for finite-state automata
  • Teams needing a drag-and-drop GUI for FSM design, since visualization is code-based and Clojure-only
  • Real-time systems requiring asynchronous event handling, as Automat processes inputs synchronously in streams
  • Environments where Clojure is not an option, limiting use to JVM and JavaScript runtimes

Pros & Cons

Pros

Functional Composition

Allows building automata using pure functions and combinators like `or`, `and`, `*`, making it declarative and easy to extend, as shown in the README examples with interposed patterns.

High Performance

Compiled automata process 100 million elements in 500ms with mean transition times of 5ns, optimized for speed in high-throughput use cases.

Stateful Reduction

The `$` operator enables attaching reducer functions for pattern-matching reduction, useful for accumulating state over input streams, like tracking user behavior in e-commerce flows.

Cross-Platform Support

Works in both Clojure and ClojureScript, with macros for precompilation in Clojure to improve startup times in ClojureScript applications.

Visualization Tools

Provides `automat.viz/view` to visualize automata states and transitions in Clojure, aiding in debugging and understanding complex FSMs.

Cons

Performance Trade-Offs

Using the `$` operator for reduction can impact performance, as the README notes it's better to use `:start-index` and `:stream-index` for bulk processing in high-throughput cases.

Limited Visualization

Visualization via `automat.viz/view` is only available in Clojure, not in ClojureScript, reducing debugging capabilities in browser environments.

Steep Learning Curve

Requires familiarity with functional programming and state machine concepts, making it less accessible for developers new to these paradigms or Clojure's macro system.

Ecosystem Lock-In

Tied to the Clojure ecosystem, so it doesn't integrate with non-Clojure tools or libraries, which can be a constraint in polyglot projects.

Frequently Asked Questions

Quick Stats

Stars592
Forks48
Contributors0
Open Issues12
Last commit7 years ago
CreatedSince 2013

Tags

#stream-processing#functional-programming#clojurescript#fsm#pattern-matching#combinators#clojure

Built With

C
Clojure
C
ClojureScript

Included in

ClojureScript1.1k
Auto-fetched 1 day ago

Related Projects

core.asynccore.async

Facilities for async programming and communication in Clojure

Stars2,049
Forks215
Last commit19 days ago
markdown-cljmarkdown-clj

Markdown parser in Clojure

Stars571
Forks120
Last commit2 months ago
om-toolsom-tools

Tools for building Om applications

Stars434
Forks29
Last commit8 years ago
reagent-formsreagent-forms

Bootstrap form components for Reagent

Stars341
Forks75
Last commit6 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub