PLDB
Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon

Mercury

Mercury

Mercury is a pl created in 1995 by Zoltan Somogyi.

#219on PLDB 27Years Old 591Users
0Books 16Papers 715Repos

Mercury is a functional logic programming language made for real-world uses. The first version was developed at the University of Melbourne, Computer Science department, by Fergus Henderson, Thomas Conway, and Zoltan Somogyi, under Somogyi's supervision, and released on April 8, 1995. Mercury is a purely declarative logic programming language. Read more on Wikipedia...


Example from hello-world:
:- module hello. :- interface. :- import_module io. :- pred main(io::di, io::uo) is det. :- implementation. main(!IO) :- io.write_string("Hello World\n", !IO).
Example from Linguist:
% "Hello World" in Mercury. % This source file is hereby placed in the public domain. -fjh (the author). :- module hello. :- interface. :- import_module io. :- pred main(io::di, io::uo) is det. :- implementation. main(!IO) :- io.write_string("Hello, world\n", !IO).
Example from Wikipedia:
:- module fib. :- interface. :- import_module io. :- pred main(io::di, io::uo) is det. :- implementation. :- import_module int. :- func fib(int) = int. fib(N) = (if N =< 2 then 1 else fib(N - 1) + fib(N - 2)). main(!IO) :- io.write_string("fib(10) = ", !IO), io.write_int(fib(10), !IO), io.nl(!IO). % Could instead use io.format("fib(10) = %d\n", [i(fib(10))], !IO).

Language features

Feature Supported Example Token
Strings
"Hello world"
"
Print() Debugging io.write_string
Comments
% A comment
Line Comments
% A comment
%
Semantic Indentation ϴ

Publications about Mercury from Semantic Scholar

title authors year citations influentialCitations
Termination Analysis for Mercury Chris Speirs and Z. Somogyi and H. Søndergaard 1997 54 5
Binding-Time Analysis for Mercury W. Vanhoof and M. Bruynooghe and M. Leuschel 1999 48 0
Code Generation for Mercury T. Conway and F. Henderson and Z. Somogyi 1995 28 4
Practical Aspects for a Working Compile Time Garbage Collection System for Mercury Nancy Mazur and Peter Ross and Gerda Janssens and M. Bruynooghe 2001 23 3
Type classes in Mercury D. Jeffery and F. Henderson and Z. Somogyi 2000 20 1
Compiling Mercury to High-Level C Code F. Henderson and Z. Somogyi 2002 16 1
Advanced Stochastic Petri Net Modeling with the Mercury Scripting Language Danilo Oliveira and Rúbens de Souza Matos Júnior and J. Dantas and João Ferreira and B. Silva and G. Callou and P. Maciel and A. Brinkmann 2017 16 1
A Module Based Analysis for Memory Reuse in Mercury Nancy Mazur and Gerda Janssens and M. Bruynooghe 2000 15 0
Use of an Integrated Mercury Food Web Model for Ecological Risk Assessment J. G. Hunter and J. Burger and K. Cooper 2003 13 0
Binding-Time Analysis by Constraint Solving. A Modular and Higher-Order Approach for Mercury W. Vanhoof 2000 12 0
Adding Constraint Solving to Mercury Ralph Becket and M. G. D. L. Banda and K. Marriott and Z. Somogyi and Peter James Stuckey and M. Wallace 2006 12 0
Runtime support for region-based memory management in Mercury Quan Phan and Z. Somogyi and Gerda Janssens 2008 8 0
Static Region Analysis for Mercury Quan Phan and Gerda Janssens 2007 7 0
Inductive Mercury Programming B. Fisher and J. Cussens 2007 2 0
Binding-Time Analysis for Mercury D. D. Schreye 1999 1 0
Automatic Parallelism in Mercury P. Bone 2011 1 0
boo.html · mercury.html · microsoft-basic.html

View source

PLDB - Build the next great programming language · v2022 · Day 33 · Docs · Build · Acknowledgements · Traffic Today · Traffic Trends · Mirrors · GitHub · feedback@pldb.com