A lightweight JIT compiler based on MIR (Medium Internal Representation) and C11 JIT compiler and interpreter based on MIR - GitHub - vnmakarov/mir: A lightweight JIT compiler based on MIR (Medium Internal Representation) and C11 JIT compiler and interpreter based on MIR
Resources for Amateur Compiler Writers
I know complete pans of the literature are left
out, but this is a page for
amateur compiler
writers. Anything that I did not find practical is
not listed here. (I also did not include the things
that I do not yet know!)
All the remarks in grey and even the selection of
documents are personal. If you have suggestions of
papers to include, please contact me! Finally, the
order of items in the various sections is totally
arbitrary.
Philosophy What every compiler writer should know about programmers. M. Anton Ertl. [pdf] Contains some good warnings about taking the
12.5 (one two dot five) and return a 64-bit double-precision
floating point number like
12.5 (twelve point five). Some numbers (like
12.3) aren’t exactly representable as an
f64 but
ParseNumberF64 still has
to return the best approximation. In March 2020, Daniel Lemire
published
some source code for a new,
fast algorithm to do this, based on an original idea by Michael Eisel. Here’s
how it works.
Preliminaries
Fallback Implementation
First, a caveat. The Eisel-Lemire algorithm is very fast (Lemire’s blog
post
contains impressive benchmark numbers, e.g. 9 times faster than the C standard
library’s
strtod) but it isn’t comprehensive. There are a small proportion of
A Complete Guide to LLVM for Programming Language Creators
December 24, 2020
I have a small request:
Share This On Twitter
Who’s this tutorial for?
This series of compiler tutorials is for people who don’t just want to create a
toy language.
You want objects. You want polymorphism. You want concurrency. You want garbage collection. Wait you don’t want GC? Okay, no worries, we won’t do that :P
If you’ve just joined the series at this stage, here’s a quick recap. We’re designing a Java-esque concurrent object-oriented programming language
Bolt. We’ve gone through the compiler frontend, where we’ve done the parsing, type-checking and dataflow analysis. We’ve desugared our language to get it ready for LLVM - the main takeaway is that objects have been desugared to structs, and their methods desugared to functions.