Opal (programming language)

From HandWiki
Revision as of 17:44, 6 February 2024 by Wincert (talk | contribs) (add)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

OPAL (OPtimized Applicative Language) is a functional programming language first developed at the Technical University of Berlin.

There is a later framework for static code analysis also called Opal.[1]

Example program

This is an example OPAL program, which calculates the GCD recursively.

Signature file (declaration)
   SIGNATURE GCD
   FUN GCD: nat ** nat -> nat
Implementation file (definition)
   IMPLEMENTATION GCD
   IMPORT Nat COMPLETELY
   DEF GCD(a,b) == IF a % b = 0 THEN b
                       ELSE IF a-b < b THEN GCD(b,a-b)
                           ELSE GCD(a-b,b)
                       FI
                   FI

References

External links