I want to write my own compiler for my own language. Yes, it's going to be hard, and it will take long, but I think it will be worth it.

I have looked into OSDev.org, and read about executable formats there, but they aren't much help. I am looking for information beyond what they have there.

So, anything will help. Books, websites, PDFs, anything.

I am looking into 32-bit, not 64- or 16-bit.

  • meta.stackexchange.com/questions/25840/…. He gives a list of stackoverflow posts that will answer this question. He's not downvoted because of the list (the list of posts are useful).
    – jmq
    Commented Mar 2, 2012 at 23:27
  • Hello Marcus Szanto and welcome to Programmers! This is an extremely broad question, and can not be reasonably answered. Please do some research of your own, and when you start building your compiler feel free to ask specific questions.
    – yannis
    Commented Mar 2, 2012 at 23:54

1 Answer 1


I would think the best place to start in practical terms would be a solid foundation in using lex and yacc (or flex and bison), since these are likely the tools you'll use to actually build the compiler. There's a tutorial here, and O'Reilly has a great book about them.

From a theoretical standpoint, you'll want to study compiler design. Google turns up plenty of quality resources, but the the classic book on the subject is Compilers: principles, techniques, and tools by Alfred V. Aho. I can't recommend it highly enough.


Not the answer you're looking for? Browse other questions tagged or ask your own question.