Jump to content

Alice (programming language)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Vorov2 (talk | contribs) at 19:33, 8 February 2011 (Removed vandalism by Christopher Monsanto according to RBI). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Alice
ParadigmMulti-paradigm: imperative, functional, distributed, concurrent
Designed bySaarland University
First appeared2000
Stable release
1.4 / May 3, 2007; 17 years ago (2007-05-03)
Typing disciplinestrong, static, inferred
OSCross-platform
Website[1]
Influenced by
ML, Oz

Alice ML is a functional programming language designed by the Programming Systems Lab at Saarland University. It is a dialect of Standard ML, augmented with support for lazy evaluation, concurrency (multithreading and distributed computing via remote procedure calls) and constraint programming.

The Alice implementation from Saarland University uses the SEAM (Simple Extensible Abstract Machine) virtual machine. It is free software, and features just-in-time compilation to bytecode as well as native code for the x86 architecture.

Early versions of Alice ran on the Mozart/Oz VM, allowing interfacing between Alice and Oz code.

Alice's remote procedure calling depends on the virtual machine, because it may actually 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". When an operation requires the actual 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

Books about Alice ML

  • ML Programming Language Family: ML, Standard ML, Objective Caml, Mythryl, F Sharp, Nemerle, Alice, Standard ML of New Jersey, Concurrent ML, Books LLC, ISBN-10: 1155461290, ISBN-13: 978-1155461298