Oz (programming language): Difference between revisions

Content deleted Content added
No edit summary
m State and objects: Adding wikilinks
 
(2 intermediate revisions by 2 users not shown)
Line 39:
| isbn = 978-3-540-60105-0
| chapter-url= https://www.ps.uni-saarland.de/Publications/documents/Vol1000.pdf}}
</ref> contains most of the concepts of the major [[programming paradigm]]s, including logic, functional (both [[lazy evaluation]] and [[eager evaluation]]), imperative, object-oriented, constraint, distributed, and concurrent programming. Oz has both a simple formal semantics (see chapter 13 of the book mentioned below) and {{Citation needed-span|date=June 2007|text=an efficient implementation.}} Oz is a [[Concurrency (computer science)|concurrency]]-oriented language, as the term was introduced by Joe Armstrong, the main designer of the [[Erlang (programming language)|Erlang language]]. A concurrency-oriented language makes concurrency easy to use and efficient. Oz supports a canonical [[graphical user interface]] (GUI) language QTk.<ref>{{Cite web |url=http://www.mozart-oz.org/home/doc/mozart-stdlib/wp/qtk/html/ |title=QTk |access-date=6 April 2009 |archive-url=https://web.archive.org/web/20130520060646/http://www.mozart-oz.org/home/doc/mozart-stdlib/wp/qtk/html/ |archive-date=20 May 2013 |url-status=deadusurped }}</ref>
 
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 tolerance|fault-tolerant]] applications within the language. For constraint programming, Oz introduces the idea of ''computation spaces'', which allow user-defined search and distribution strategies [[Orthogonal#Computer science|orthogonal]] to the constraint ___domain.
Line 184:
</syntaxhighlight>
 
Because of the way dataflow variables work, it is possible to put threads anywhere in a program and guaranteed that it will have the same result. This makes concurrent programming very easy. Threads are very cheap: it is possible to have 100,000 threads running at once.<ref>{{Cite web |url=http://www.mozart-oz.org/documentation/tutorial/node8.html#chapter.concurrency |title=Archived copy |access-date=29 November 2008 |archive-url=https://web.archive.org/web/20150224185115/http://www.mozart-oz.org/documentation/tutorial/node8.html#chapter.concurrency |archive-date=24 February 2015 |url-status=deadusurped }}</ref>
 
===Example: Trial division sieve===
Line 282:
=== State and objects ===
 
It is again possible to extend the declarative model to support state and [[object-oriented programming]] with very simple semantics. To create a new mutable data structure called Cells:
<syntaxhighlight lang="erlang">
local A X in
Line 291:
</syntaxhighlight>
 
With these simple semantic changes, the whole object-oriented paradigm can be supported. With a little [[syntactic sugar]], OOP becomes well integrated in Oz.
<syntaxhighlight lang="erlangvisualprolog">
class Counter
attr val
Line 334:
* [http://www.informatik.uni-trier.de/~ley/db/conf/moz/moz2004.html ''Multiparadigm Programming in Mozart/Oz: Proceedings of MOZ 2004'']: Conference which gives a snapshot of the work being done with Mozart/Oz
* [http://people.cis.ksu.edu/~xou/505f10/slides/oz.pdf Programming in Oz]
* [httphttps://strasheela.sourceforge.net/strasheela/doc/01-Basics.html Oz Basics]
 
{{DEFAULTSORT:Oz (programming language)}}