Skip to content

Instantly share code, notes, and snippets.

@RealNeGate
Last active February 16, 2024 18:19
Show Gist options
  • Save RealNeGate/d0d45b74d7352872d4cf2470a600fbbb to your computer and use it in GitHub Desktop.
Save RealNeGate/d0d45b74d7352872d4cf2470a600fbbb to your computer and use it in GitHub Desktop.
Complete stuff:
https://xmonader.github.io/letsbuildacompiler-pretty/
Lexers + DFAs:
https://gist.github.com/pervognsen/218ea17743e1442e59bb60d29b1aa725
Parsing:
https://eli.thegreenplace.net/2012/08/02/parsing-expressions-by-precedence-climbing
Backend:
You should read up on SSA and CFGs before going into Sea of nodes.
SSA explained:
https://en.wikipedia.org/wiki/Static_single-assignment_form
https://www.cs.cmu.edu/~rjsimmon/15411-f15/lec/10-ssa.pdf
https://www.cs.cornell.edu/courses/cs6120/2020fa/lesson/5/
Fast dominator generation:
https://www.cs.tufts.edu/comp/150FP/archive/keith-cooper/dom14.pdf
SSA Folding engine based on Luajit:
https://gist.github.com/pervognsen/96d116fff14d95ffe51cf084c8604d64
Sea of nodes:
Cliff Click's original sea of nodes paper:
https://www.oracle.com/technetwork/java/javase/tech/c2-ir95-150110.pdf
Semantic reasoning about sea of nodes:
https://hal.inria.fr/hal-01723236/file/sea-of-nodes-hal.pdf
Register allocation:
Linear scan: https://en.wikipedia.org/wiki/Register_allocation#Linear_scan
Dalvik's modified linear scan: https://arxiv.org/pdf/2011.05608.pdf
Hotspot C1's linear scan work: https://www.usenix.org/legacy/events/vee05/full_papers/p132-wimmer.pdf
Constant prop:
https://www.cs.cornell.edu/courses/cs6120/2019fa/blog/sccp/
https://www.cs.wustl.edu/~cytron/531Pages/f11/Resources/Papers/cprop.pdf
Monotone frameworks: http://janvitek.org/events/NEU/7580/papers/more-papers/1977-acta-kam-monotone.pdf
Good projects:
https://www.lua.org/source/5.4/
https://github.com/rui314/minilisp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment