Target architecture for Tiger-compiler

compiler-construction, platform, target, tiger

Solution

For sheer personal satisfaction, there's no substitute for targeting the hardware you have and and running your compiled code on the bare metal. However, there are reasonable alternatives:

The MIPS is a very clean instruction set and simulators like SPIM are readily available. Your compiler will be simple and your debugging experiences relatively happy.

Depending on why you are writing a compiler, you may be happy targeting a low-level compiler-target language like LLVM or C--. But why should somebody else have all the fun of writing your back end?

If you have Intel or AMD hardware, I highly recommend using the 64-bit instruction set with SSE extensions. You will have twice as many registers to play with, and your floating-point code (if any) will be sane.

Problem

I am writing a Tiger compiler in F# and I have finally reached the point where I can no longer postpone the decision of a target architecture. This is my first compiler, but it will definitely not be my last. So... what would be a good target architecture for a first compiler? I have thought about targeting the CIL (.NET), but the intermediate code in the book seems more suited for a register machine. I would also like to know where I should go when I have finished this compiler. Should I try targeting another architecture? Should I focus on another part of the compiler? Why?

Original source