Learn Functional Programming from the ground-up by writing a simple compiler, step-by-step.
MinCaml: A Simple and Efficient Compiler for a Minimal Functional Language
SubC is a fast and simple compiler for a clean subset of the C programming language. It can compile itself and passes gcc -Wall -pedantic.
Optimizing code via compiler flags
Emscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode (which can be generated from C/C++, using llvm-gcc or clang, or any other language that can be converted into LLVM) and compiles that into JavaScript, which can be run on the web (or anywhere else JavaScript can run).