Target architecture for the Tiger compiler

I am writing a Tiger compiler in F #, and I have finally reached the point at which I can no longer delay the solution to the target architecture.

This is my first compiler, but it will definitely not be my last. So ... what would be good target architecture for the first compiler?

I was thinking of targeting CIL (.NET), but the intermediate code in the book seems more appropriate for the registration machine.

I would also like to know where to go when I finish this compiler. Should I try targeting a different architecture? Should I focus on another part of the compiler? Why?

+3
source share
3 answers

For personal satisfaction, there is no alternative to targeting your existing equipment and executing your compiled code on a bare thrower. . However, there are reasonable alternatives:

  • MIPS is a very clean set of instructions and simulators like SPIM . Your compiler will be simple and your debugging experience will be relatively happy.

  • Depending on why you are writing a compiler, you may be happy with a lower-level compiler language like LLVM or C-- . But why is anyone else very interested in writing the back end?

  • Intel AMD, 64- SSE. , ( ) .

+3

F # , CIL, , , CodeDOM ..

, .NET, ( ). - , , :)

+1

x86? Tiger , , , . C ( ) .

Targeting an existing virtual machine is pragmatic if you create a production language, but removes many of the learning opportunities from the exercise.

If I were you, I would take a closer look at the various optimization methods later in the project.

+1
source

Source: https://habr.com/ru/post/1711909/


All Articles