0

I'm writing a compiler, but if I want it to be on more than one platform, it seems I have to learn every assembly language for the different platforms. I've seen a number of languages which try to be 'portable assembly languages' such as Linolium and C--, but they all seem to be incomplete or abandoned.

Is there any such language which can be used as a compiler back-end language?

If this is a stupid question for any reason, please say so, as I am new to writing compilers/interpreters.

--PieSquared

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by PieSquared
0

I'm writing a compiler, but if I want it to be on more than one platform, it seems I have to learn every assembly language for the different platforms. I've seen a number of languages which try to be 'portable assembly languages' such as Linolium and C--, but they all seem to be incomplete or abandoned.

Yes, people try these ideas but they tend to go nowhere because this approach works against itself. Assembly is the language that the CPU understands ... therefore it is a highly hardware dependent language and this is where all the benefits come from -- take away this "close bond with the hardware" and you will loose all of the benefits. This is why C is still widely used today -- it is as close as one can get to ASM and still be portable.

Is there any such language which can be used as a compiler back-end language?

Actually, the Java byte-code runs on a virtual machine (VM) and so does the MSIL for .NET (and mono) -- of course, this is managed code (runs in a "sandbox") but either of these could function as a 'portable assembly-like language' to be used as a compiler back-end.

Nathan.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.