OZ (PROGRAMMING LANGUAGE)

The Oz Principle Wikipedia Wizard of Oz Programming Programming System Mozart Language Mozart Oz Mozart Systems Mozart Software Penn Treebank Tag Set




Cloud:

| The Oz Principle Wikipedia | Wizard of Oz Programming | Programming System | Mozart Language | Mozart Oz | Mozart Systems | Mozart Software | Penn Treebank Tag Set |

| Oz_(programming_language) | Mozart_Programming_System | Constraint_programming | Concepts,_Techniques,_and_Models_of_Computer_Programming | Dataflow_programming_language | Logtalk_(programming_language) | Prolog_(programming_language) | Multiparadigm_programming_language | Logic_programming_language | Concurrent_programming_language | List_of_educational_programming_languages | List_of_programming_languages_by_type | Mercury_(programming_language) | Scala_(programming_language) | Dataflow | Mozart_(software) | Data-driven_programming | Higher-order_programming | Object-capability_language | Exploratory_programming |



[ Link Deletion Request ]

history of oz programming language



Oz (programming language)


Oz
Paradigm(s) multi-paradigm: logic, functional, imperative, object-oriented, constraint, distributed, concurrent
Appeared in 1991
Designed by Gert Smolka, his students
Developer Mozart Consortium
Stable release 1.4.0 (3 July 2008; 5 years ago (2008-07-03))
Typing discipline dynamic
Major implementations Mozart Programming System
Influenced by Erlang, Lisp, Prolog
Influenced Alice, Scala
Website www.mozart-oz.org

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.

Oz was first designed by Gert Smolka and his students in 1991. In 1996 the development of Oz continued in cooperation with the research group of Seif Haridi and Peter Van Roy at the Swedish Institute of Computer Science. Since 1999, Oz has been continually developed by an international group, the Mozart Consortium, which originally consisted of Saarland University, the Swedish Institute of Computer Science, and the Université catholique de Louvain. In 2005, the responsibility for managing Mozart development was transferred to a core group, the Mozart Board, with the express purpose of opening Mozart development to a larger community.

The Mozart Programming System is the primary implementation of Oz. It is released with an open source license by the Mozart Consortium. Mozart has been ported to different flavors of Unix, FreeBSD, Linux, Microsoft Windows, and Mac OS X.


Oz (programming language) Language features


Oz contains most of the concepts of the major QTk.

In addition to multi-paradigm programming, the major strengths of Oz are in constraint programming and distributed programming. Due to its factored design, Oz is able to successfully implement a network-transparent distributed programming model. This model makes it easy to program open, fault-tolerant applications within the language. For constraint programming, Oz introduces the idea of "computation spaces"; these allow user-defined search and distribution strategies orthogonal to the constraint domain.


Oz (programming language) Language overview



Oz (programming language) Data structures

Oz is based on a core language with very few datatypes that can be extended into more practical ones through syntactic sugar.

Basic data structures:

  • Numbers: floating point or integer (real integer)
  • Records: for grouping data : circle(x:0 y:1 radius:3 color:blue style:dots)
  • Lists: a simple linear structure
'|'(2 '|'(4 '|'(6 '|'(8 nil))))
2|(4|(6|(8|nil))) % syntactic sugar
2|4|6|8|nil % more syntactic sugar
[2 4 6 8] % even more syntactic sugar

Those data structures are values (constant), first class and dynamically type checked.


Oz (programming language) Functions

Functions are first class values, allowing higher order functional programming:

fun {Fact N}
   if N =< 0 then 1 else N*{Fact N-1} end
end
 
fun {Comb N K}
   {Fact N} div ({Fact K} * {Fact N-K}) % integers can't overflow in Oz (unless no memory is left)
end
 
fun {SumList List}
   case List of nil then 0
   [] H|T then H+{SumList T} % pattern matching on lists
   end
end

Oz (programming language) Dataflow variables and declarative concurrency

When the program encounters an unbound variable it waits for a value:

thread 
   Z = X+Y     % will wait until both X and Y are bound to a value.
   {Browse Z}  % shows the value of Z.
end
thread X = 40 end
thread Y = 2 end

It is not possible to change the value of a dataflow variable once it is bound:

X = 1
X = 2 % error

Dataflow variables make it easy to create concurrent stream agents:

fun {Ints N Max}
   if N == Max then nil
   else 
      {Delay 1000}
      N|{Ints N+1 Max}
   end
end
 
fun {Sum S Stream}
   case Stream of nil then S
   [] H|T then S|{Sum H+S T} end
end
 
local X Y in
   thread X = {Ints 0 1000} end
   thread Y = {Sum 0 X} end
   {Browse Y}
end

Because of the way dataflow variables work it is possible to put threads anywhere in the program and it is guaranteed that it will have the same result. This makes concurrent programming very easy. Threads are very cheap: it is possible to have a hundred thousand threads running at once.[1]


Oz (programming language) Example: Trial division sieve

This example computes a stream of prime numbers using the Trial division algorithm by recursively creating concurrent stream agents that filter out non-prime numbers:

fun {Sieve Xs}
   case Xs of nil then nil
   [] X|Xr then Ys in
      thread Ys = {Filter Xr fun {$ Y} Y mod X \= 0 end} end
      X|{Sieve Ys}
   end
end

Oz (programming language) Laziness

Oz uses eager evaluation by default, but lazy evaluation is possible:

fun lazy {Fact N}
   if N =< 0 then 1 else N*{Fact N-1} end
end
local X Y in
  X = {Fact 100} 
  Y = X + 1 % the value of X is needed and fact is computed
end

Oz (programming language) Message passing concurrency

The declarative concurrent model can be extended with message passing through simple semantics:

declare
local Stream Port in
   Port = {NewPort Stream}
   {Send Port 1} % Stream is now 1|_ ('_' indicates an unbound and unnamed variable)
   {Send Port 2} % Stream is now 1|2|_ 
   ...
   {Send Port n} % Stream is now 1|2| .. |n|_
end

With a port and a thread the programmer can define asynchronous agents:

fun {NewAgent Init Fun}
   Msg Out in
   thread {FoldL Msg Fun Init Out} end
   {NewPort Msg}
end

Oz (programming language) State and objects

It is again possible to extend the declarative model to support state and object-oriented programming with very simple semantics; we create a new mutable data structure called Cells:

local A X in
   A = {NewCell 0}
   A := 1  % changes the value of A to 1
   X = @A  % @ is used to access the value of A
end

With these simple semantic changes we can support the whole object-oriented paradigm. With a little syntactic sugar OOP becomes well integrated in Oz.

class Counter
   attr val
   meth init(Value)
      val:=Value
   end
   meth browse
      {Browse @val}
   end
   meth inc(Value)
      val :=@val+Value
   end
end
 
local C in
   C = {New Counter init(0)}
   {C inc(6)}
   {C browse}
end

Oz (programming language) Execution speed


The execution speed of a program produced by the Mozart Compiler (version 1.4.0 implementing Oz 3) is very slow. On a set of benchmarks it is on average about 50 times slower than that of the gcc compiler for the C language, solving the benchmarks-tasks.[2]


Oz (programming language) See also


  • Alice, the concurrent functional constraint programming language from Saarland University
  • Curry, a functional logic programming language
  • Mercury, a functional logic programming language
  • Dataflow programming
  • Visual Prolog, an object-oriented, functional, logic programming language

Oz (programming language) References



Oz (programming language) External links




The Oz Principle Wikipedia Wizard of Oz Programming Programming System Mozart Language Mozart Oz Mozart Systems Mozart Software Penn Treebank Tag Set

| The Oz Principle Wikipedia | Wizard of Oz Programming | Programming System | Mozart Language | Mozart Oz | Mozart Systems | Mozart Software | Penn Treebank Tag Set | Oz_(programming_language) | Mozart_Programming_System | Constraint_programming | Concepts,_Techniques,_and_Models_of_Computer_Programming | Dataflow_programming_language | Logtalk_(programming_language) | Prolog_(programming_language) | Multiparadigm_programming_language | Logic_programming_language | Concurrent_programming_language | List_of_educational_programming_languages | List_of_programming_languages_by_type | Mercury_(programming_language) | Scala_(programming_language) | Dataflow | Mozart_(software) | Data-driven_programming | Higher-order_programming | Object-capability_language | Exploratory_programming

Copyright:
Dieser Artikel basiert auf dem Artikel http://en.wikipedia.org/wiki/Oz_(programming_language) aus der freien Enzyklopaedie http://en.wikipedia.org bzw. http://www.wikipedia.org und steht unter der Doppellizenz GNU-Lizenz fuer freie Dokumentation und Creative Commons CC-BY-SA 3.0 Unported. In der Wikipedia ist eine Liste der Autoren unter http://en.wikipedia.org/w/index.php?title=Oz_(programming_language)&action=history verfuegbar. Alle Angaben ohne Gewähr.

Dieser Artikel enthält u.U. Inhalte aus dmoz.org : Help build the largest human-edited directory on the web. Suggest a Site - Open Directory Project - Become an Editor






Search: deutsch english español français русский

| deutsch | english | español | français | русский |




[ Privacy Policy ] [ Link Deletion Request ] [ Imprint ]