Top 1,000 Features Creators Events Podcasts Extensions Blog Explorer CSV Download


< >

Oz is an open source programming language created in 1991 by Gert Smolka.

#386on PLDB 33Years Old 371Repos

Try now: Riju

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. Read more on Wikipedia...

Example from Riju:
functor import Application System define {System.showInfo 'Hello, world!'} {Application.exit 0} end
% Hello World in Oz functor import System Application define {System.showInfo "Hello World!"} {Application.exit 0} end
Example from Linguist:
% You can get a lot of information about Oz by following theses links : % - % - % There is also a well known book that uses Oz for pedagogical reason : % - % And there are two courses on edX about 'Paradigms of Computer Programming' that also uses Oz for pedagogical reason : % - % - % % Here is an example of some code written with Oz. declare % Computes the sum of square of the N first integers. fun {Sum N} local SumAux in fun {SumAux N Acc} if N==0 then Acc else {Sum N-1 Acc} end end {SumAux N 0} end end % Returns true if N is a prime and false otherwize fun {Prime N} local PrimeAcc in fun {PrimeAcc N Acc} if(N == 1) then false elseif(Acc == 1) then true else if (N mod Acc) == 0 then false else {PrimeAcc N Acc-1} end end end {PrimeAcc N (N div 2)} end end % Reverse a list using cells and for loop (instead of recursivity) fun {Reverse L} local RevList in RevList = {NewCell nil} for E in L do RevList := E|@RevList end @RevList end end
Example from Wikipedia:
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

Language features

Feature Supported Token Example
Booleans true false
Line Comments %
% A comment
Semantic Indentation X

View source

- Build the next great programming language · About · Resources · Acknowledgements · Part of the World Wide Scroll