Implementation tools

Lingua.NET: Discontinued/archived CodePlex parser generator. Archived content copied locally here.

GCC Front-end HOWTO: How to build a GCC front-end (so GCC can take care of the rest)

Background, Books, Lists

68 resources on creating programming languages

Awesome Compilers

A Compiler Writing Journey

An Incremental Approach to Compiler Construction: Scheme and Functional Programming 2006; Abdulaziz Ghuloum -- Github Step-by-step development of a Scheme-to-x86 compiler

An Introduction to GCC - Brian Gough

Basics of Compiler Design (Anniversary Edition) - Torben Mogensen

Compiler Design in C (1990) - Allen Holub, Prentice Hall

Compiler Design: Theory, Tools, and Examples, C/C++ Edition - Seth D. Bergmann (PDF)

Compiler Design: Theory, Tools, and Examples, Java Edition - Seth D. Bergmann (PDF)

Computer Language Notes: Compilers and Interpreters

Compiling Scala for the Java Virtual Machine - Michel Schinz (PDF)

Compiling Techniques (1969) - F.R.A. Hopgood, Macdonald

Essentials of Compilation: An Incremental Approach by Siek, Newton: A book about compiling Racket to x86-64 assembly

Essentials of Programming Languages: EOPL, as it’s better known, introduces readers to the internal workings of programming languages by describing small programming languages and creating an interpreter for each one. The book is very hands-on, with lots of exercises for the reader to modify the interpreters with new features. It touches on the ideas of reasoning about languages and formal semantics, but mostly sticks to the interpreter-as-semantics approach.

How to Design Programs

Implementing Functional Languages: A Tutorial - Simon Peyton Jones, David Lester

Introduction to Compilers and Language Design | Introduction to Compilers and Language Design - Douglas Thain (PDF)

Let's Build a Compiler (PDF)

Practical and Theoretical Aspects of Compiler Construction (class lectures and slides)

Programming Language Pragmatics by Michael L Scott. Covers theoretical background behind languages beyond syntax.

Programming Languages: Application and Interpretation

Programming languages and techniques (PDF)

Resources for Amateur Compiler Writers

Semantics Engineering with PLT Redex: The PhD-level programming languages course at Northeastern uses the Redex book, and I found it to be a good introduction. The tool itself (Redex) is a great way to experiment with semantics, including reduction relations (roughly, the part of the semantics that says how the program runs) and type systems. You could use this book as a substitute for TAPL (at least for learning the basics of formal semantics), or you could use Redex to experiment with the languages described in TAPL.

mpri-2.4-public: Resources for course MPRI 2-4 on functional programming and type systems.

Lists of recommended reading

GCC Wiki - List of compiler books | Jordan Rose (Swift team) recommendations | http://jschuster.org/blog/2016/11/29/getting-started-in-programming-languages/ | Jonathan Turner’s Reading List: Turner is an engineer on Mozilla’s Rust team and recently posted his reading list for getting up-to-speed on programming languages. The list starts with some resources on how to build interpreters and compilers, but also points to more academic material later. | 10PL: This is a list compiled by Northeastern’s PL faculty of (roughly) ten academic papers that they think every student in PL should know. Not all of them are PL papers themselves, and they don’t form a full foundation on their own, but they form a kind of “great books” list for PL. | Benjamin Pierce, the author of TAPL, also has a similar list (although with a slightly more type-heavy and theoretical bent). | Classic Papers in Programming Languages and Logic by Karl Crary

Tutorials/Intros/Walkthroughs

FreeCompilerCamp.org: Online Training for Extending Compilers Github:
- Clang/LLVM Tutorials
- http://freecompilercamp.org/clang-llvm-landing
- Alok Mishra, Anjia Wang, Chunhua Liao, Yonghong Yan, Barbara Chapman
- https://sc19.supercomputing.org/proceedings/tech_poster/tech_poster_pages/rpost138.html
- FreeCompilerCamp.org: Training for OpenMP Compiler Development from Cloud
- https://sc19.supercomputing.org/proceedings/workshops/workshop_pages/ws_bphpcte103.html

College/University Courses

Functional programming and type systems; supplemental repo

Stanford OpenEdX: Compilers - Alex Aiken

Brown CS: CSCI 1730: Programming Languages Videos

OPLSS (Oregon Programming Languages Summer School)
- 2019-2017, 2003: https://www.youtube.com/channel/UCDe6N9R7U-RYWA57wzJQ2SQ/playlists
- 2016-2015: https://www.youtube.com/channel/UCsON_8vogp4nCQFTnfu43kA/playlists
- free video lectures available, including the introductory ones based on Practical Foundations for Programming Languages: http://www.cs.cmu.edu/~rwh/pfpl/

Principles of Programming Languages

Programming Language Implementation Summer School (PLISS) YouTube

University of Utah: Advanced Compilers - John Regehr
- Weeks 1 and 2: http://blog.regehr.org/archives/1419
- Weeks 3-5: http://blog.regehr.org/archives/1428

UW professor Dan Grossman's teaching materials

UW CSE CSEP 501: Compilers - Hal Perkins
- Winter 2018
- Homepage: https://courses.cs.washington.edu/courses/csep501/18sp/
- Lecture Videos: https://courses.cs.washington.edu/courses/csep501/18sp/video/
- Winter 2016
- Homepage: https://courses.cs.washington.edu/courses/csep501/16wi/
- Playlist: https://www.youtube.com/playlist?list=PLTPQEx-31JXhfAWGnGzwbfhB2zUB7Jd4C
- Topics: https://courses.cs.washington.edu/courses/csep501/16wi/calendar/lecturelist.html

SFU CMPT 886: Program Analysis and Reliability - Nick Sumner, Spring 2015 YouTube playlist

UCB CS294-113: Virtual Machines and Managed Runtimes
- A Concise and Opinionated History of Virtual Machines or YouTube
- Virtual Machines Summer School 2016

UCSD CSE 131: Compiler Construction
- Fall 2019; Joseph Gibbs Politz
- https://ucsd-cse131-f19.github.io/
- https://podcast.ucsd.edu/watch/fa19/cse131_a00
- Winter 2018; Ranjit Jhala
- https://ucsd-progsys.github.io/131-web/
- https://podcast.ucsd.edu/watch/wi18/cse131_a00

UCSD CSE 231: Advanced Compiler Design
- Winter 2019; Sorin Lerner
- https://podcast.ucsd.edu/watch/wi19/cse231_a00
- https://ucsd-pl.github.io/cse231/wi19/

NPTEL: Compiler Design (YouTube playlist): 2011; Y.N. Srikant


Posts

Interview with Jesper Louis Andsersen about a ton of languages. | "Less is more: language features" | "Languages I want to write" | "A wish list for a new programming language"


Implementation and Optimization

Escape analysis

Escape analysis is an optimization for identifying objects which do not escape the dynamic extent of a function; such objects can be stack-allocated, or 'flattened' so that usages of them are replaced with a series of local variables (the latter optimization is known as "scalar replacement").

An overview of the escape analysis algorithm used in Factor's Optimizing compiler: http://factor-language.blogspot.com/2008/08/algorithm-for-escape-analysis.html http://en.wikipedia.org/wiki/Escape_analysis

Register allocation

Static Single Assignment (SSA)

Instruction selection

Notes on Graph Algorithms Used in Optimizing Compilers - Carl Offner

Superoptimization

Detection

Pre-defined Compiler Macros - https://sourceforge.net/p/predef/wiki/
- Architectures - https://sourceforge.net/p/predef/wiki/Architectures/
- Compilers - https://sourceforge.net/p/predef/wiki/Compilers/
- Endianness - https://sourceforge.net/p/predef/wiki/Endianness/
- Language Standards - https://sourceforge.net/p/predef/wiki/Standards/
- Operating Systems - https://sourceforge.net/p/predef/wiki/OperatingSystems/
- Standard Libraries - https://sourceforge.net/p/predef/wiki/Libraries/

SPY: Friendly Neighborhood C++17 Constexpr Predef Wrapper
- OS, compiler, libc, stdlib detection
- https://github.com/jfalcou/spy


Conferences

Compilers Call For Papers for Conferences, Workshops and Journals at WikiCFP - http://www.wikicfp.com/cfp/call?conference=compilers

Computer Architecture and Compilers Conference Map - http://archconfmap.com/

Documentation

Sanitizers

Talks

2019

2018

2017

2016

2015

2014

2013


Tags: language   reading   llvm   native  

Last modified 06 October 2022