I’m not sure if this is an acceptable question, but compiler-os-design-where-to-start was, so I figured that I’d take a shot at it.
I have taken no formal Computer Science classes. I have programmed in Python and attempted C# without success. My technical vocabulary is expansive, yet scattered over a very wide range of computer science topics.
I have a very long way to go before I can get to a level where I could reasonably read a book about compiler design/theory. I am asking what steps I need to take before attempting compiler design. I have some examples here already:
- Computer architecture
- Binary
- How booting/kernels/OSes work
- Imperative vs. Comparative language design
- “Grammars”
At least these are some examples of what I’ve seen.
Edit: I can’t for the life of me see how this problem is unclear. I quite clearly bolded what I was asking. I was expecting it to be marked as biased, vague/broad, or too generalized, but certainly not unclear. Don’t be afraid to say it’s unconstructive (just make sure whatever it is classified under is accurate).
13
Compilers are not some mythical creatures, even though some people might like you to think that.
A compiler is a program like any other program. It takes some input, tries to make sense of it, and generates some output. Have you ever written a program which reads a text file in some format and outputs some HTML based on that text? Well, congratulations: you already have written a compiler. A very simple one, I admit, but it is a compiler.
You approach it like any other program: try, fail, learn, repeat.
Some resources to help you fail less and learn more 🙂
- Let’s Build a Compiler, by Jack Crenshaw
- A Nanopass Framework for Compiler Education, by Dipanwita Sarkar, Oscar Waddell, and R. Kent Dybvig
1
Nicklaus Wirth’s text on compiler construction is arguably one of the two most approachable texts on the subject. The other is Jack Crenshaw’s series of articles, cited by the other guy.
If you want to go the Dragon Book route, there’s no easy approach, but you can start by working your way through Course 6 at ocw.mit.edu. You’ll have to pick and choose the Computer Science classes.