Oz

Mozart2

Installation

Ubuntu
# Download mozart2-{version}-{arch}-{os}.deb from https://github.com/mozart/mozart2/releases
apt install ./mozart2-{version}-{arch}-{os}.deb
Alma Linux
# Download mozart2-{version}-{arch}-{os}.rpm from https://github.com/mozart/mozart2/releases
dnf install ./mozart2-{version}-{arch}-{os}.rpm
Arch Linux
yay -S mozart2

Examples

Fibonacci Numbers
% Fibonacci Numbers
functor

import
    System
    Application

prepare
  fun {Fib N}
    if N < 2 then
      N
    else
      {Fib N - 2} + {Fib N - 1}
    end
  end

define
  N in
    [N] = {Application.getArgs plain}
    {System.showInfo {Fib {String.toInt N}}}
    {Application.exit 0}
end

/*
    example
        compile:
            ozc -x fib.oz
        run:
            ozengine fib 39
*/