The Luon programming language
Language design and goals
- Luon is presented as a statically typed “Lua + Oberon” hybrid: Oberon/Modula-style syntax with Lua-like constructs (constructors,
pcall, familiar control/loop forms). - It replaces Lua’s “everything is a table” with explicit records, arrays, and hashmaps; some see this as a welcome clarification and improvement.
- The language aims for Wirth-style simplicity: minimal features, strong typing, garbage collection, and high productivity without the complexity of modern mainstream languages.
Types, nullability, and data structures
- Structured types are records, arrays, and hashmaps; they all have reference semantics and are
nilby default. - Only structured (reference) types may hold
nil; basic types are value types. - Locals cannot be used before declaration, which users note would catch some common Lua mistakes.
- Luon does not expose Lua tables directly; hashmaps are built on them internally.
Indexing debate (0-based vs 1-based)
- Luon follows Oberon’s 0-based arrays. This sparked a large subthread.
- Pro–0-based:
- Works naturally with half-open intervals (
[start, end)), simplifies slice/interval math, and makes modulo-based grouping straightforward. - Aligns with thinking in offsets (“i steps from the start”), and with conventions like time 0:00 and angle 0°.
- Works naturally with half-open intervals (
- Pro–1-based:
- Matches natural language (“the ith element”) and much mathematical notation and pedagogy.
- Gives a clear role to index 0 as “before the first element,” avoids mixing negative indices with “last element” semantics.
- Some argue the choice is mostly convention and cultural habit; others reference Wirth languages that allowed arbitrary index ranges, though Oberon later standardized on 0..n−1.
IDE, tooling, and platforms
- The project includes its own IDE, built with a custom LeanQt wrapper. Users report it as extremely fast compared to mainstream editors.
- The author prefers a lean, self-contained IDE over Language Server Protocol tools, partly due to working on older hardware.
- Others suggest an LSP daemon to enable support in existing editors; the parsing infrastructure reportedly exists for someone else to build this.
Use cases, ecosystem, and licensing
- Luon has been used to reimplement a Smalltalk‑80 VM and is being considered for an Interlisp VM, replacing earlier LuaJIT-based approaches.
- The compiler outputs LuaJIT bytecode; discussion concludes this output is not affected by the compiler’s GPL license.
- Runtime libraries provide a GPL exception and alternative LGPL/MPL licensing, so commercial/closed-source use is considered permissible.
Comparisons and alternatives
- Some Lua users find Luon too radical syntactically and would prefer a “TypeScript for Lua”; Teal and TypeScript-to-Lua are mentioned as such options.
- Others value the Oberon/Modula lineage and see Luon as reviving a family of languages they feel should have seen wider adoption.
Naming and miscellaneous
- The name is seen as simple and meaningful; associations include Lua+Oberon, a Finnish verb meaning “I create,” and humorous confusion with similar-sounding brands and regions.
- A brief side discussion touches on music that inspired the language’s creation, but this is peripheral to the technical discussion.