Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Overview  





2 Example  





3 See also  





4 References  





5 External links  














Alice (programming language)






Español
فارسی

Italiano

Português
Русский
Українська

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Alice
ParadigmsMulti-paradigm: imperative, functional, distributed, concurrent, constraint
FamilyML: Standard ML
DeveloperSaarland University
First appearedJune 16, 2000; 24 years ago (2000-06-16)
Stable release

1.4 / May 3, 2007; 17 years ago (2007-05-03)

Typing disciplinestrong, static, inferred
OSCross-platform
LicenseMIT
Websitewww.ps.uni-saarland.de/alice[1]
Influenced by
ML, Oz

Alice ML is a general-purpose, high-level, multi-paradigm, functional programming language designed by the Programming Systems Laboratory at Saarland University, Saarbrücken, Germany.[2] It is a dialectofStandard ML, augmented with support for lazy evaluation, concurrency (multithreading and distributed computing via remote procedure calls) and constraint programming.

Overview[edit]

Alice extends Standard ML 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 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 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. It is free software, and features just-in-time compilationtobytecode 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[edit]

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 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[edit]

References[edit]

  1. ^ "Alice". DE: Saarland University.
  • ^ "Programming Systems Lab". Archived from the original on 5 October 2006. Retrieved 8 August 2006.
  • External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Alice_(programming_language)&oldid=1223948836"

    Categories: 
    ML programming language family
    High-level programming languages
    Logic programming languages
    Functional logic programming languages
    Programming languages created in 2000
    Hidden categories: 
    Articles needing additional references from February 2011
    All articles needing additional references
    Use dmy dates from April 2024
    Official website different in Wikidata and Wikipedia
     



    This page was last edited on 15 May 2024, at 10:02 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki