The tag compiler-construction should be applied to questions concerning the programming of compilers or for questions about the detailed inner workings of compilers. DO NOT USE for questions about *using* specific compilers or compilation errors.
A compiler is a program which translates one language into another. Compiler construction is the process of creating a compiler.
The tag compiler-construction should be applied to questions concerning the programming of compilers or for questions about the detailed inner workings of compilers.
One language to another? I thought they made executables!
Few compilers do exactly that:
They mostly translate a human readable computer programming language (like Fortran, Cobol, Algol, PL/1, Pascal, C, C++, C#, etc.) into an object-code file which has to be subsequently linked.
Many real world compilers translate a high level language into assembly code which is subsequently assembled by a separate program and then linked.
- The standard Java compiler translate Java code into JVM bytecode, which must be run by a dedicated program (the JVM) which may include a Just In Time (JIT) or HotSpot compiler that translates the bytecode into native machine instructions on the fly.
- Early versions of Unix came with a Fortran-to-C compiler.
- The earliest versions of the language that became C++ were compiled into C by a program called
cfront
. - Many other examples of source-to-source compilers exist.
- Some languages such as JavaScript and many other 'scripting' languages don't have compilers at all, but are executed directly from source code.
Big List of Resources:
- A Nanopass Framework for Compiler Education PDF
- Advanced Compiler Design and Implementation Book
- An Incremental Approach to Compiler Construction PDF
- ANTLR 3.x Video Tutorial
- Building a Parrot Compiler
- Compiler Basics
- Compiler Construction Book
- Compiler Design and Construction Book
- Crafting a Compiler with C Book
- Dragon Book Book - Widely considered "the book" for compiler writing.
- Essentials of Programming Languages
- Flipcode Article Archive
- Game Scripting Mastery Book
- How to build a virtual machine from scratch in C# PDF
- Implementing Functional Languages
- Implementing Programming Languages using C# 4.0
- Interpreter pattern - specifies a way to evaluate sentences in a language
- Described in Design Patterns Book
- Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages
- Lets Build a Compiler
- The PDF version PDF
- Linkers and Loaders Google Books
- Lisp in Small Pieces (LiSP) Book
- LLVM Tutorial
- Modern Compiler Implementation in ML Book - widly considered a very good book
- Object-Oriented Compiler Construction
- Parrot Tutorial
- Parsing Techniques - A Practical Guide
- Project Oberon PDF - Look at chapter 13
- Programming a Personal Computer Book
- Programing Languages: Application and Interpretation Book
- Rabbit: A Compiler for Scheme PDF
- Reflections on Trusting Trust PDF - a quick guide
- Roll Your Own Compiler for the .NET framework a quick toturial form MSDN
- Structure and Interpretation of Computer Programs
- Types and Programming Languages Book
- Want to Write a Compiler? - a quick guide
- Writing a Compiler in Ruby Bottom Up