Language page — context, influences, and learning notes on the 100hellos site.
Source on GitHub (100hellos/mercury)
docker run --rm --platform="linux/amd64" 100hellos/mercury:latest
Read the repo README, or fork the project and customize it.
For an interactive shell:
docker run --rm --platform="linux/amd64" --entrypoint="" -it 100hellos/mercury:latest zsh
Mercury is a pure logic programming language that combines the power of Prolog with static typing and functional programming features. It was designed at the University of Melbourne for building large, reliable, and efficient applications.
Mercury is known for its:
Mercury combines the expressiveness of logic programming with the safety of strong typing. The language uses a sophisticated type, mode, and determinism system to ensure program correctness at compile time.
The Mercury compiler generates efficient C code and provides excellent error messages, making it suitable for large-scale software development.
:- module hello_world.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
main(!IO) :-
io.write_string("Hello World!", !IO).
:- module hello_world. - Declares the module name:- interface. - Begins the public interface section:- import_module io. - Imports the I/O module:- pred main(io::di, io::uo) is det. - Declares main as a deterministic predicatemain(!IO) :- - Uses state variables for I/O threadingio.write_string("Hello World!", !IO) - Outputs the stringContent type
Image
Digest
sha256:cd83f828d…
Size
121.5 MB
Last updated
4 months ago
docker pull 100hellos/mercury