Add documentation passes to DOCUMENTATION.md
This commit is contained in:
parent
f9fe031532
commit
6b7fefc5e7
@ -1,5 +1,7 @@
|
||||
# Nectar Reference Compiler Source Documentation
|
||||
|
||||
<img src="https://mid.net.ua/git/mid/nctref/raw/branch/master/documentation_passes.svg" width="256" align="right" />
|
||||
|
||||
When writing a program, I usually make the most primitive and smallest code I can that does the job. If it turns out I miscalculated the complexity, or I must add some feature that isn't compatible with the codebase, I'll obviously have to refactor it. Still, I've been programming this way for probably my entire life.
|
||||
|
||||
That being said, if you know this compiler took since 2019 to get to its current state, you will correctly guess that I DO NOT KNOW WHAT I AM DOING. Compiler literature and online discussion is abstract to the point where it is not useful for real-world archs. When it gets specific, it's often too simplistic. It's common to say instruction selection should happen before register allocation, but how can you know which instructions to emit when some of them only work with specific registers? People say spilling causes more loads and stores, but that's false; x86 has memory operands! Imagine how long it took me to realize real-world IRs are not at all generic, and are actually quite close to their target architectures. As a result, much of what you see in the source is me basically banging rocks. There's definitely better ways to do the things I show here, but I figured it's better to have at least some resource on how a "real" compiler works.
|
||||
|
Loading…
Reference in New Issue
Block a user