How many lines of code does a compiler contain?

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

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

    CS 4120: A compiler for the Xi language in OCaml (by manishsaha)

  • I cloc'd two compilers for xic, compilers written by cornell students for a compilers class which compile a toy C-like language down to assembly, possibly with some extensions. One compiler was about 11k sloc, the other about 32k. Both compilers are written mainly in OCaml, which is a terse language that is pretty optimal for compiler development, but have some java code in them as well. I think these are good examples of mostly minimal compilers which compile a C-like down to asm, though they are very rudimentary compared to more serious projects. I want to emphasize that this is not very meaningful without more details about what you are looking to know.

  • xic

    A compiler for the Xi programming language

  • I cloc'd two compilers for xic, compilers written by cornell students for a compilers class which compile a toy C-like language down to assembly, possibly with some extensions. One compiler was about 11k sloc, the other about 32k. Both compilers are written mainly in OCaml, which is a terse language that is pretty optimal for compiler development, but have some java code in them as well. I think these are good examples of mostly minimal compilers which compile a C-like down to asm, though they are very rudimentary compared to more serious projects. I want to emphasize that this is not very meaningful without more details about what you are looking to know.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Amun

    A Statically typed, compiled general purpose low level programming language built using C++ and LLVM Infrastructure framework designed to be simple and fast

  • AECforWebAssembly

    A port of ArithmeticExpressionCompiler from x86 to WebAssembly, so that the programs written in the language can run in a browser. The compiler has been rewritten from JavaScript into C++.

  • Well, my AEC-to-x86 compiler contains 2'000 lines of code (click "View Source"), and the much more feature-rich AEC-to-WebAssembly compiler contains 5'500 lines of code.

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