Bitwise»Forums
Roman
25 posts
ups
Hi. I wanna learn how to create compiler. Is bitwise project good for that?

Can I start learn from bitwise videos how create compiler if I noob in languages design? Or I need some knowledge about compilers/intepreters already? Thank you

39 posts / 1 project
Hi. I wanna learn how to create compiler. Is bitwise project good for that?
Edited by graeme on

It's very good for the front-end and there's some good wisdom there it's hard to find elsewhere. But it doesn't really go into code generation in any depth, and the compiler he writes outputs C code. But it's a solid foundation and for what he does cover it's really good

In that reddit post someone links Wirth's books, they are good. Crenshaw's compiler stuff is alright too but kinda ends up cycle-shaving on the lexer which nobody cares about nowadays

3 posts / 1 project
Hi. I wanna learn how to create compiler. Is bitwise project good for that?
Edited by synthnostate on

Bitwise videos look okay to me at first glance - pretty much how I did it many years ago. Besides the Intel/AMD manuals you'll want an x64 opcode cheatsheet like https://wiki.osdev.org/X86-64_Instruction_Encoding or https://cs.brown.edu/courses/cs033/docs/guides/x64_cheatsheet.pdf

In the prototype stage you might prefer to use Python, Lua, JS, etc to output executable files.

If you're more interested in the frontend (parsing) and language design, you could make a simple bytecode interpreter and not worry about efficiency at all.

Mārtiņš Možeiko
2561 posts / 2 projects
Hi. I wanna learn how to create compiler. Is bitwise project good for that?

Have not read it myself, but I have heard good things about A Retargetable C Compiler Design and Implementation book explaining details on how lcc compiler is built.

I myself have learned about creating compilers from Let's Build a Compiler articles.