|
|
|
|
|
by jdswain
2 days ago
|
|
The language is Wirth's Oberon-07, as his 2016 report defines it, with additions for objects, interfaces and literals, and with the data sizes of the 16-bit 65C816. INTEGER and SET are 16 bits, LONGINT is 32, BYTE is 8 bits unsigned, and REAL is 32 bits, with LONGREAL as another name for it. Records can have type-bound procedures, chosen at run time by the record's actual type, and the language adds OVERRIDE, SUPER, initialisers declared with PROCEDURE INIT and called as T.Make(...), and WEAK pointers. INTERFACE types are implemented by records that declare IMPLEMENTS. There are constant arrays, record and array literals such as Point{x := 1; y := 2}, an ELSE in a numeric CASE, and _ in names. Modules can be declared LARGE (code over a bank) or FRIENDS (named modules may assign to their exported variables). Like Oberon itself, it has no exceptions and no concurrency in the language: errors are compiler messages, traps or result codes, and processes come from the OS16 library. The compiler grew from Wirth's Project Oberon compiler, and follows his structure. It was initially written in C, then ported to Oberon so it could compile itself. It comes in two builds that compile the same language to the same files: oc on OS16 and oc816 on Mac/Linux, using LLVM. The OO type features were primarily added to support the UI toolkit. OS16 is the associated operating system. |
|