HOME

TheInfoList



OR:

Alice ML is a general-purpose, high-level,
multi-paradigm Programming languages can be grouped by the number and types of Programming paradigm, paradigms supported. Paradigm summaries A concise reference for the programming paradigms listed in this article. * Concurrent programming language, Concurrent ...
, functional
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
designed by the Programming Systems Laboratory at Saarland University,
Saarbrücken Saarbrücken (; Rhenish Franconian: ''Sabrigge'' ; ; ; ; ) is the capital and largest List of cities and towns in Germany, city of the state of Saarland, Germany. Saarbrücken has 181,959 inhabitants and is Saarland's administrative, commerci ...
,
Germany Germany, officially the Federal Republic of Germany, is a country in Central Europe. It lies between the Baltic Sea and the North Sea to the north and the Alps to the south. Its sixteen States of Germany, constituent states have a total popu ...
. It is a
dialect A dialect is a Variety (linguistics), variety of language spoken by a particular group of people. This may include dominant and standard language, standardized varieties as well as Vernacular language, vernacular, unwritten, or non-standardize ...
of
Standard ML Standard ML (SML) is a General-purpose programming language, general-purpose, High-level programming language, high-level, Modular programming, modular, Functional programming, functional programming language with compile-time type checking and t ...
, augmented with support for
lazy evaluation In programming language theory, lazy evaluation, or call-by-need, is an evaluation strategy which delays the evaluation of an Expression (computer science), expression until its value is needed (non-strict evaluation) and which avoids repeated eva ...
, concurrency ( multithreading and
distributed computing Distributed computing is a field of computer science that studies distributed systems, defined as computer systems whose inter-communicating components are located on different networked computers. The components of a distributed system commu ...
via
remote procedure call In distributed computing, a remote procedure call (RPC) is when a computer program causes a procedure (subroutine) to execute in a different address space (commonly on another computer on a shared computer network), which is written as if it were a ...
s) and constraint programming.


Overview

Alice extends
Standard ML Standard ML (SML) is a General-purpose programming language, general-purpose, High-level programming language, high-level, Modular programming, modular, Functional programming, functional programming language with compile-time type checking and t ...
in a number of ways that distinguish it from its predecessor. Alice provides concurrency features as part of the base language through the use of a ''
future The future is the time after the past and present. Its arrival is considered inevitable due to the existence of time and the laws of physics. Due to the apparent nature of reality and the unavoidability of the future, everything that currently ex ...
'' type that represents a value being provided by an independent thread of execution. A thread that uses a future value will block on an attempt to access the value until the thread performing it has completed the computation. A related concept is also provided termed a '' promise'', allowing a thread to provide a future value that it will compute to another thread. Future and promise typed variables are used to implement data-flow synchronizing. Like the Haskell functional language, Alice provides facilities to allow a
lazy evaluation In programming language theory, lazy evaluation, or call-by-need, is an evaluation strategy which delays the evaluation of an Expression (computer science), expression until its value is needed (non-strict evaluation) and which avoids repeated eva ...
strategy in programs, unlike the traditional eager evaluation strategy of Standard ML. While Haskell uses the lazy model by default, Alice uses an eager evaluation model by default, needing an explicit programming statement for a computation to evaluate lazily. The Alice implementation from Saarland University uses the Simple Extensible Abstract Machine (SEAM)
virtual machine In computing, a virtual machine (VM) is the virtualization or emulator, emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve ...
. It is
free software Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
, and features just-in-time compilation to
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (normal ...
and native code for the x86 architecture. Early versions of Alice ran on the Mozart Programming System (Oz) virtual machine (VM), allowing interfacing between Alice and Oz code. Alice's remote procedure calling depends on the virtual machine, because it may send code to be computed from one computer to another.


Example

Alice extends Standard ML with several primitives for lazy evaluation and concurrency. For example, threads may be created using the spawn keyword. Consider the naive algorithm for computing the Fibonacci numbers: fun fib 0 = 0 , fib 1 = 1 , fib n = fib(n-1) + fib(n-2); For large values of ''n'', fib ''n'' will take a long time to compute. This computation can be performed in a separate thread by val x = spawn fib n; The variable x is now bound to a so-called ''
future The future is the time after the past and present. Its arrival is considered inevitable due to the existence of time and the laws of physics. Due to the apparent nature of reality and the unavoidability of the future, everything that currently ex ...
''. When an operation requires the value of x, it blocks until the thread is done with the computation. To exploit parallelism one could even define fib as follows: fun fib 0 = 0 , fib 1 = 1 , fib n = spawn fib(n-1) + fib(n-2);


See also

*
Oz (programming language) Oz is a multiparadigm programming language, developed in the Programming Systems Lab at Université catholique de Louvain, for programming-language education. It has a canonical textbook: Concepts, Techniques, and Models of Computer Programming ...


References


External links

*
Multiple publications about Alice ML and its concepts
{{ML programming ML programming language family High-level programming languages Logic programming languages Functional logic programming languages Programming languages created in 2000