Convert Figma logo to code with AI

aalhour logoawesome-compilers

:sunglasses: Curated list of awesome resources on Compilers, Interpreters and Runtimes

8,814
643
8,814
52

Top Related Projects

10,422

A Compiler Writing Journey

:snowman: Possibly the smallest compiler ever

9,998

mal - Make a Lisp

9,556

A small C compiler

Quick Overview

The "awesome-compilers" repository is a curated list of resources related to compilers, interpreters, and runtimes. It serves as a comprehensive collection of learning materials, tools, and frameworks for compiler construction and language implementation. The repository aims to be a valuable reference for both beginners and experienced developers in the field of programming language design and implementation.

Pros

  • Extensive collection of resources covering various aspects of compiler design and implementation
  • Well-organized structure with clear categorization of topics
  • Regularly updated with new resources and contributions from the community
  • Includes both theoretical materials and practical tools for compiler development

Cons

  • May be overwhelming for beginners due to the vast amount of information
  • Some listed resources might become outdated over time
  • Lacks detailed explanations or tutorials for specific topics
  • Does not provide a structured learning path for newcomers to the field

Note: As this is not a code library, the code example and quick start sections have been omitted.

Competitor Comparisons

10,422

A Compiler Writing Journey

Pros of acwj

  • Practical, hands-on approach to compiler construction
  • Step-by-step tutorial format with incremental development
  • Focuses on a single, complete compiler implementation

Cons of acwj

  • Limited in scope, covering only one programming language
  • May not provide as comprehensive an overview of compiler theory
  • Less extensive collection of resources compared to awesome-compilers

Code Comparison

acwj (C code for lexical analyzer):

static int next(void) {
  int c;

  if (Putback) {
    c = Putback;
    Putback = 0;
    return c;
  }

  c = fgetc(Infile);
  if ('\n' == c)
    Line++;
  return c;
}

awesome-compilers (no direct code, but example resource link):

- [Compiler Construction](http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf) - Niklaus Wirth

Summary

acwj provides a practical, step-by-step approach to building a compiler, making it ideal for hands-on learning. However, it's limited to a single language implementation. awesome-compilers offers a vast collection of resources covering various aspects of compiler design and implementation, but lacks the guided, practical approach of acwj. The choice between them depends on whether you prefer a focused, practical tutorial or a comprehensive resource list for compiler construction.

:snowman: Possibly the smallest compiler ever

Pros of the-super-tiny-compiler

  • Provides a hands-on, practical implementation of a simple compiler
  • Excellent for learning compiler basics through a concise, well-commented codebase
  • Focuses on core concepts without overwhelming complexity

Cons of the-super-tiny-compiler

  • Limited in scope, covering only basic compiler functionality
  • Lacks comprehensive resources on advanced compiler topics
  • Not suitable for in-depth study of complex compiler architectures

Code Comparison

the-super-tiny-compiler:

function tokenizer(input) {
  let current = 0;
  let tokens = [];
  while (current < input.length) {
    // Tokenization logic
  }
  return tokens;
}

awesome-compilers: No direct code comparison available, as awesome-compilers is a curated list of resources rather than a compiler implementation.

Summary

the-super-tiny-compiler is an excellent resource for beginners to understand compiler basics through a practical, hands-on approach. It offers a concise implementation that's easy to follow and learn from.

awesome-compilers, on the other hand, is a comprehensive collection of resources, tools, and references for compiler design and implementation. It covers a wide range of topics and is suitable for both beginners and advanced learners looking to explore various aspects of compiler technology.

While the-super-tiny-compiler provides a focused learning experience, awesome-compilers offers a broader perspective and extensive resources for in-depth study of compiler concepts and advanced topics.

9,998

mal - Make a Lisp

Pros of mal

  • Hands-on learning experience through building a Lisp interpreter
  • Implementations in 100+ programming languages, showcasing language diversity
  • Practical approach to understanding language design and implementation

Cons of mal

  • Focused solely on Lisp-like languages, limiting broader compiler knowledge
  • Less comprehensive in covering various compiler topics and techniques
  • May not provide in-depth theoretical background on compiler construction

Code Comparison

mal (Python implementation):

def READ(str):
    return read_str(str)

def EVAL(ast, env):
    return ast

def PRINT(exp):
    return pr_str(exp)

def rep(str):
    return PRINT(EVAL(READ(str), repl_env))

awesome-compilers (no direct code, but an example resource):

- [Compiler Construction](https://www.cs.cmu.edu/~aplatzer/course/Compilers/) - Course by André Platzer at Carnegie Mellon University (CMU)

Summary

mal provides a practical, hands-on approach to learning language implementation through building a Lisp interpreter in multiple languages. awesome-compilers, on the other hand, offers a comprehensive collection of resources covering various aspects of compiler design and construction. While mal focuses on a specific language type, awesome-compilers provides a broader overview of compiler topics and resources for in-depth study.

9,556

A small C compiler

Pros of chibicc

  • Practical implementation of a C compiler, offering hands-on learning
  • Compact codebase, making it easier to understand and navigate
  • Actively maintained with frequent updates and improvements

Cons of chibicc

  • Focused solely on C compilation, lacking broader compiler theory coverage
  • Limited educational resources compared to the extensive list in awesome-compilers
  • May be overwhelming for beginners without prior compiler knowledge

Code Comparison

awesome-compilers:

# Awesome Compilers [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)

A curated list of awesome resources, learning materials, tools, frameworks, platforms, technologies and source code projects in the field of Compilers, Interpreters and Runtimes. This list has a bias towards education.

chibicc:

// This is a compiler for the C programming language.
#include "chibicc.h"

int main(int argc, char **argv) {
  if (argc != 2)
    error("%s: invalid number of arguments", argv[0]);

Summary

awesome-compilers serves as a comprehensive resource for compiler-related materials, while chibicc provides a practical implementation of a C compiler. awesome-compilers offers a broader scope and extensive educational resources, making it suitable for various skill levels. chibicc, on the other hand, provides a hands-on approach to learning C compilation but may be more challenging for beginners. The choice between the two depends on the user's learning goals and prior knowledge in compiler theory.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

AWESOME COMPILERS

A curated list of awesome resources, learning materials, tools, frameworks, platforms, technologies and source code projects in the field of Compilers, Interpreters and Runtimes. This list has a bias towards education.


Contents


Learning

Books

General Overview

Introductory

Advanced

Papers

Researchers and Institutes

Specifications

Courses

Talks and Conferences

Channels

Videos

Articles

Tutorials

Community Discussions

Tools and Frameworks

Language Agnostic

  • B3: The Bare Bones Backend - WebKit's optimizing JIT Compiler for procedures containing C-like code.
  • Capstone - Lightweight multi-platform, multi-architecture disassembly framework with bindings to various famous programming languages.
  • Keystone - Lightweight multi-platform, multi-architecture assembler framework with bindings to various famous programming languages.
  • LLILCL - LLVM-based Compiler Backend for .NET Core.
  • LLVM - The LLVM Compiler-Backend Framework.
  • MicroVM - The "Mu" Framewrok for Programming Languages development based on the MuVM Specification.
  • Movfuscator Compiler - The M/o/Vfuscator compiles programs into "mov" instructions, and only "mov" instructions.
  • QBE: The Quick Backend - Pure C embeddable SSA-based compiler backend.
  • Rubinius - Programming Languages Development Platform.
  • Summus - Basic, reusable, compiler-frontend implementation using LLVM as a backend.
  • ZetaVM - Multi-Language Platform for Dynamic Programming Languages.

C / C++

  • AsmJIT - Complete x86/x64 JIT and Remote Assembler for C++.
  • GCC - The GNU Compiler Collection (C as a Backend).
  • LCC - The lcc retargetable ANSI C compiler (C as a Backend).
  • libFirm - C-library that provides a graph-based intermediate representation, optimizations, and assembly code generation suitable for use in compilers.
  • libJIT - Library for generic Just-In-Time compiler functionality independent of any particular bytecode, language, or runtime.
  • myJIT - Library for machine-code generation and execution at run-time.
  • OrangeC - Win32 C11/C++2014 compiler and toolchain.
  • PCC - The Portable C Compiler (C as a Backend).
  • Ragel - Ragel State Machine Compiler.
  • TCC - The Tiny C Compiler (C as a Backend).

CLR

  • Cecil - Library to generate and inspect programs and libraries in the ECMA CIL format.
  • DotNetPELib - Library to read and write .net assemblies in C++11
  • ILSpy - .NET Decompiler.
  • Reflector - .NET Decompiler.
  • Reflexil - Assembly code editor which can be used as a plugin with other .NET/CLR tools.

D

  • dunnart - LALR(1) Parser Generator.
  • FancyPars-lite - Fast parser generator.
  • libdparse - Library allowing to build lexers and parsers. Contains a lexer and a parser for the D language itself.
  • llvm-d - D bindings for LLVM.
  • Pegged - design, test and generate parsers for PEG grammars.

Go

  • goyacc - YACC Implementation in Go. Standard LALR(1) parser generator.
  • LLVM Go binding - Official Go LLVM binding.

Graal

  • Graal - High-Performance Polyglot Runtime.
  • Graal Core - Compiler and Truffel Partial Evaluator.
  • Graal VM - Graal's multi-language VM distribution.

Haskell

JavaScript

  • IRHudra - Tool for displaying intermediate representations used by V8 and Dart VM optimizing compilers.
  • JISON - Context-free grammar parser generator for JavaScript.
  • Nearley - Simple, fast, powerful parser toolkit for JavaScript.
  • Ohm - A library and language for building parsers, interpreters, compilers, etc.
  • PEG.js - Simple parser generator for JavaScript.

JVM

  • ANTLR - Parser generator for reading, processing, executing, or translating structured text or binary files.
  • BYAAC/J - BYACC/Java is an extension of the Berkeley v 1.8 YACC-compatible parser generator for Java.
  • CGLIB - High level API library for generating and transforming Java Byte Code.
  • FCP JVM - JVM Backend for generating Java Byte Code that conforms to the JDK v1.5+ Specification and the Dalvik VM.
  • JavaCC - Java Compiler Construction and Parser Generator Toolkit.
  • JavaCPP Presets for LLVM - Library for easily interacting with the LLVM API.
  • JFlex - JFlex is a lexical analyzer generator for Java with full Unicode support.
  • JLex - JLex is a lexical analyzer generator, that can be used in combination with CUP.

Kotlin

Python

  • AST - Python's builtin Abstract Syntax Tree package.
  • Dis - Python's builtin Disassembler package.
  • Parsing - Pure-Python module that implements an LR(1) parser generator, as well as CFSM and GLR parser drivers.
  • PLY - Implementation of lex and yacc parsing tools for Python.
  • PyParsing - Alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions.
  • RPLY - Port of the PLY project to RPython.
  • RPython - RPython is a framework for the implementatation of dynamic languages.

Lists of Python Parsing Tools

Rust

  • Combine - Parser Combinator Library for Rust.
  • IronLLVM - Safe LLVM bindings for Rust.
  • LALRPOP - LR(1) parser generator for Rust.
  • Nom - Parser Combinator Framework.
  • PEG - PEG Parser Generator.
  • Pest - PEG Parser Generator.
  • RLS - The Rust Language Server implementation (aka RLS).

Compilers and Interpreters

This section aims at listing code projects of Compilers, Interpreters, Translators, Runtimes, Virtual Machines and the like.

Serious Projects

Educational and Toy Projects

  • Akilang - A compiler for a simple language, built with Python and LLVM
  • amacc - Small C Compiler generating ELF executable for Arm architecture.
    • Discussions: HN.
  • Black - Scheme interpreter for the Reflective Programming Language "Black", by Kenichi Asai's.
  • C4 - C Lang in 4 Functions.
    • Discussions: HN.
  • CarpVM - Experimental VM implementation in C.
  • Charly - Interpreter for a dynamically typed language written in Crystal.
  • Dale - Lisp-flavoured C: a system programming language.
  • EasyLang - Easy Programming Language / VM.
  • Eschelle - Open source cross platform multi-paradigm language with VM & JIT
  • Gecho - Simple-stack language implementation in C.
  • gocaml - Minimal functional programming language implementation in Go and LLVM.
  • gone - Compiler for a tiny programming language called Gone, implemented using Python 3.6, SLY and llvmlite. Developed as part of the January 2018 Write a compiler course, under the supervision of David Beazly.
  • Hython - Haskell-powered Python 3 interpreter.
  • llgo - Go frontend for LLVM written in Go.
  • MAL: Make a Lisp - Clojure-inspired Lisp interpreter implemented in 64 languages.
  • MetaScala - Metacircular JVM implementation in Scala.
  • mini-js - Experimental self-hosted JavaScript compiler in 1K LoC.
  • MunVM - Lua VM & Compiler in C.
  • MY-BASIC - An embeddable BASIC dialect interpreter in C with modern paradigms.
  • oberonc - A single pass, self-hosting compiler for the Oberon-07 programming language. It targets the JVM.
  • Poprc - Compiler for the Popr Language.
  • PyCOOLC - Compiler for the COOL Programming Language written in Python 3.
  • RabbitVM - RISC-based VM implementation in C.
  • Squint - A peephole optimizer for educational compilers generating stack based assembly.
  • StackVM - Virtual Machine with an integrated VRAM display.
  • stack_cpu - Stack-machine simulator.
  • The Super Tiny Compiler - Tiny educational compiler project in JavaScript.
    • Discussions: HN.
  • tinyc.c - Tiny-C language compiler in C.
  • tisp - "Time is Space" Programming Language Interpreter.
  • Ultra Tiny Compiler - Another tiny compiler in less then 90 lines of code.

Runtimes and VMs

Blogs

Communities

  • /r/Compilers - Subreddit community about the theory and development of compilers.
  • /r/ProgrammingLanguages - Subreddit community that is dedicated to discussion of programming languages, programming language theory, design, their syntax and compilers.

Verticals

Contributors


License

CC0

To the extent possible under law, Ahmad Alhour has waived all copyright and related or neighboring rights to this work.

The logo was designed using TextCraft.