Let's write a compiler, part 3: A parser

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • Appwrite - The open-source backend cloud platform
  • SonarQube - Static code analysis for 29 languages.
  • Mergify - Updating dependencies is time-consuming.
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • pl0c

    Self-hosting PL/0 to C compiler to teach basic compiler construction from a practical, hands-on perspective.

    > Using the character constants in the code as in expect('+') or whatever is clearer.

    That's not how it works, TOK_* represent whole elements, the element may happen to be a single character, but it can be a word. It would be highly confusing to pass single characters to expect() as you wouldn't know at first sight whether it expects a simple character or an element. The TOK_* could as well be assigned a random number as you say in your following sentence. And they were until yesterday :-) I guess it is easier to debug with mnemonic characters.


  • swifties

    a custom language construction kit

    What few seem to realize is that it's perfectly possible to abstract out some of the work and create an extensible foundation for manual parsers.

    Since it's all regular code, you can use the full power of the host language to deal with the problem.


  • Appwrite

    Appwrite - The open-source backend cloud platform. The open-source backend cloud platform for developing Web, Mobile, and Flutter applications. You can set up your backend faster with real-time APIs for authentication, databases, file storage, cloud functions, and much more!

  • FLOX

    An adaptation of the interpreter from the book 'Crafting Interpreters' by Robert Nystrom written in F# (by BazookaMusic)

    The code isn't perfect, it's a learning project and still WIP, but you can check the code for a parser for the LOX language ( c-like) from 'Crafting Interpreters' in this project. 'Ast.fs' and 'Parser.fs' should be enough to get an idea of what it's doing.You can also google the grammar of the language which is quite simple:


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