Let's write a compiler, part 1: Introduction, selecting a language, and planning

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

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Let-s-build-a-compiler

    A C & x86 version of the "Let's Build a Compiler" by Jack Crenshaw

  • cbfc

    an optimizing brainfuck compiler and interpreter

  • 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
  • racket

    The Racket repository

  • Cool :).

    The thing is to have an always start-to-end working compiler for an increasingly (even if the steps are very small) complex language.

    Another point would be to use simple tools at least to begin with. Racket [1] provides good lexer/parser tools [2] and you can use pattern matching [3] to browse and transform your AST. You can also target MIPS assembly [4] using the SPIM platform [5] for example, it is easy to learn and has very good debugging tools (basically the whole platform behaves like a gdb session).

    For the compiler implementation language OCaml is also a very good choice (even better because static typing will actually help you a lot with the horizontal approach) but it is less easier to setup as you need to install a lot more tools: ocaml itself, ocamllex (lexer), menhir (parser), ocamlbuild (automated build system), etc.

    [1] https://racket-lang.org/

    [2] https://docs.racket-lang.org/parser-tools/

    [3] https://docs.racket-lang.org/guide/match.html

    [4] http://www.cburch.com/cs/330/reading/mips-ref.pdf

    [5] http://spimsimulator.sourceforge.net/

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