[mercury-users] Back end

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Mar 13 01:45:30 AEDT 2003


On 11-Mar-2003, suja c <suja_cin at yahoo.com> wrote:
> How can we convert mercury programs into different
> languages like c and Aditi. Where can I get resources
> for that. Is there any compiler options for that?

There are compiler options for it.
In particular:

	For this language...		Use this option...
	--------------------		------------------
	C				--target c	(this is the default!)
	Assembler			--target asm
	MSIL				--grade il
	Java				--grade java
	Aditi-RL bytecode		--aditi
	Mercury bytecode		--generate-bytecode

For converting to Aditi, you need to also mark the relevant procedures
with `pragma aditi' or `pragma base_relation'.

> do we have to install any other tools for that.

The assembler back-end is not included in most of our binary distributions.
The binary distributions that do include it are the ones named
"*i686-pc-linux-gnu-O4*" (but NOT the ones named "*i686-pc-linux-gnu-O4-hlc").
If you're building from source, some additional steps
need to be taken to build the assembler back-end.  See
<http://www.cs.mu.oz.au/research/mercury/download/gcc-backend.html>
for details.

The other back-ends (C, MSIL, Java, Aditi, and Mercury bytecode) are all
included in the standard Mercury distribution and are enabled by
default.  So you can generate code in those target languages.  However,
to actually compile and run the generated code, you will need to install
the appropriate tools for processing the target language.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list