Back-ends
Mercury has several back-ends, which means it is possible to compile Mercury code into the following languages:
Production level:
- Low-level C for GCC (the original Mercury back-end)
- High-level C
Beta quality:
- Java bytecode for the JVM
- C#
- Erlang
Alpha quality (may not work well, or even be completely broken):
- IL for Microsoft's .NET
- Assembly via the GCC back-end
Past back-ends:
- Aditi, a deductive database system also developed at the University of Melbourne. Mercury-0.12.2 is the last version of Mercury that will support Aditi.
Mercury also features a foreign language interface, allowing code in other languages (depending on the chosen back-end) to be linked with Mercury code. The following foreign languages are possible:
Back-end | Foreign language(s) |
---|---|
C (both levels) | C |
Java | Java |
Erlang | Erlang |
IL | IL or C# |
Other languages can then be interfaced to by calling them from these languages. However, this means that foreign language code may need to be written several times for the different backends, otherwise portability between backends will be lost.
The most commonly used back-end is the original low-level C back-end.
Read more about this topic: Mercury (programming Language)