Interpreter in Rust

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • crates.io

    The Rust package registry

  • nom is another crate you may want to look at for parsing. I personally have no experience with serde_expr. There's also just going on https://crates.io/ and searching for terms like "parsing", "parser", etc. Look for packages that have a decent number of downloads and have been updated fairly recently.

  • mainspring

    A CPU simulator framework built around, and to support the other tools under, the constraints of the first principles of computing project.

  • First off, awesome, interpreters and emulators are really fun projects. I've written a very similar project which might be useful for reference https://github.com/ncatelli/mainspring. As for parsing to your enum representation KerfuffleV2 gave a great example for nom. That being said, if you'd like to peek behind the curtain a bit for combinators and the principles behind nom, Bodil Stokke has a WONDERFUL tutorial on the topic https://bodil.lol/parser-combinators/ which will be directly applicable to what you are trying to do. Additionally, while targetted at using java, https://craftinginterpreters.com/ by Bob Nystrom is available for free online and covers the topic of writing really simple recursive decent parsers.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • chumsky

    Write expressive, high-performance parsers with ease.

  • Instead of nom, you may want to look into a more specialized parser-combinator framework that is targeting language parsing: https://github.com/zesterer/chumsky/

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts