Luon is a general-purpose, procedural and object-oriented programming language in the tradition of Oberon+, Oberon-07 [Wi16] and Oberon-2 [Mo91], with elements of Pascal [Wi73]. Even though Luon has many similarities with those languages, backward compatibility is not a goal.
Luon is conceived as a statically typed alternative to scripting languages like e.g. Lua and targets the virtual machines of such dynamic languages. The name "Luon" is a combination of "Lua" and "Oberon".
The most important features of Luon are block structure, modularity, separate compilation, static typing with strong type checking, generic programming , garbage collection, and type extension with type-bound procedures.
The language allows several simplifications compared to previous Oberon versions: reserved words can be written in lower case, all semicolons are optional, and for some reserved words there are shorter variants; a declaration sequence can contain more than one CONST, TYPE and VAR section in arbitrary order, interleaved with procedures.
Furthermore, enumeration types, dictionary types, constructors, type-bound procedure types, explicit bit operations and exception handling have been added to the language.
This report is not intended as a programmer’s tutorial. It is intentionally kept concise. Its function is to serve as a reference for programmers, implementors, and tutorial writers. What remains unsaid is mostly left so intentionally, either because it can be derived from stated rules of the language, or because it would require to commit the definition when a general commitment appears as unwise.
Listing 1. Luon example featuring syntactic simplifications and type parameters
module Lists(T)
type
List* = record
value* : T
next* : List
end
proc (l : List) Add* (v : T)
begin
new( l.next )
l.next.value := v
end Add
proc (l : List) Print*()
begin
println(l.value)
end Print
end Lists
module ListTest
import
L := Lists(integer)
var
l : L.List
begin
new(l)
l.value := 123
l.Add(456)
l.Print()
l.next.Print()
end ListTest
See here for more examples.