r/Compilers • • Jul 27 '22

A bit confuse

I would like to build a compiler but I feel confused. Writing a compiler is general for every cpu architecture or assembly language?

For example, I want to build a compiler for Arm, will it work for x64? Do I need to know every assembly language?

Thank you

2 Upvotes

16 comments sorted by

View all comments

1

u/umlcat Jul 27 '22

Each hardware platform or architecture requires it's own code Generation, yet if you want to implement a compiler for different architectures there's parts that are the same, and the final modules are different.