Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
service
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
Freenet DSL
Who's Online
16 user(s) are online (15 user(s) are browsing encyclopedia)

Members: 0
Guests: 16

more...
partner

Mercury programming language

Mercury is a Functional programming logic programming programming language based on Prolog, but more geared towards practical applications. The latest official release was version 0.12, on the 9th September, 2005.

Mercury has several features intended for better software engineering than is possible with Prolog. It is compiled rather than interpreted, as is traditional for logic programming languages. It features a sophisticated, strict Data type and mode system. Its authors claim these features combined with logic programming s abstract nature speeds writing of reliable programs. Mercury s module system enables division into self-contained units, a problem for past logic programming languages. (But note that several existing Prolog implementations also include module systems.)

Mercury is a more pure , and therefore more Declarative programming, language than Prolog, since it does not have extra-logical Prolog features like the cut (a Prolog construct which prevents backtracking) and imperative programming I/O. This makes the coding of sequential algorithms somewhat more cumbersome, but it makes automated program Optimization (computer science) easier. This means that it can produce significantly faster code than Prolog.

Hello World in Mercury:

:- module hello. :- interface. :- import_module io. :- pred main(io.state, io.state). :- mode main(di, uo) is det.

:- implementation. main(!IO) :- io.write_string( Hello, World! , !IO).

(adapted from Ralph Becket s [http://www.cs.mu.oz.au/research/mercury/tutorial/book/book.pdf Mercury tutorial]).

Mercury is developed at the University Of Melbourne Computer Science department under the supervision of Zoltan Somogyi.

Mercury is still highly experimental, and virtually unused outside the team of its creators.

Mercury has several back-ends, including low-level C (the original Mercury back-end), high-level C, Microsoft s IL for .NET, Sun s JVM, and assembler via the gcc back-end (the last three are only considered alpha or beta quality). This makes it useful for targeting multiple platforms, or linking with code written in multiple back-ends. The ability to include native code across these platforms is helpful, though it limits the portability to other Mercury back-ends.

Mercury is available for most Unix platforms, for Mac OS X, and for Microsoft Windows using the Cygwin toolset.

=External links=

  • [http://www.cs.mu.oz.au/research/mercury/ Official Mercury Homepage]