Hello everyone In case anyone is interested, I implemented a new programming language called Micron, which is derived from Oberon and combines it with features known from C and C++. Here is ther repository: https://github.com/rochus-keller/micron/ During the last years I was able to gain a lot of experience with the Oberon language and systems on/for different platforms/targets. Coming from the C/C++ world, where I implemented systems from microcontrollers to servers, the Oberon approach was a revelation in many respects. But the limitations also became apparent. With Oberon+, I took my first steps toward "reinterpreting simplicity for modern systems programming". In 2024 I eventually started the Micron project (with "Micron" = "MicroOberon") to explore the lower system levels. This project has now progressed far enough to be presented to other interested parties. The Readme (https://github.com/rochus-keller/Micron/blob/master/Readme.md) has more information, and there are precompiled versions and also a textbook (http://software.rochus-keller.ch/micron-textbook.pdf). And of course Oberon system versions migrated to Micron, where the advantages of the language can be studied (see https://github.com/rochus-keller/OberonSystem/tree/micron-rv32 and https://github.com/rochus-keller/micronsystem3/). Best regards Rochus Keller
@ Jörg Fair point and I spent a lot of time with the trade-offs. Since Micron lets you take the address of any variable, VAR would duplicate a mechanism the language already has, so following Wirth's rule of keeping a language as simple as possible, Micron keeps only the pointer. In return, "Sorter.Sort(@a,.." shows at the call site that a may change, which you don't see with a VAR param. Oberon made the opposite choice: it kept VAR and confined address-taking to SYSTEM. But SYSTEM.ADR yields a plain LONGINT, and SYSTEM.GET, SYSTEM.PUT and SYSTEM.VAL read, write and reinterpret memory through such integers. From that point on the compiler no longer knows what the address refers to: the element size, bounds and type have to be maintained by hand, and the garbage collector does not see an object whose only reference is stored in an LONGINT. The systems code that needs this is therefore largely written without type checking, and also assuming a pointer has 32 bits. In Micron, @v yields a typed pointer ^T, pointer arithmetic (ptroff, inc) steps in units of T, and a reinterpretation is an explicit cast at the place where it happens, so even the low-level code stays under the type checker. Best regards R.K. _______________________________ From: Jörg Sent on: Sun, 08 Nov 2026 17:23:02 +0100 To: ETH Oberon and related systems Cc: Subject: Re: [Oberon] Micron is a modern Oberon with the power of C PROCEDURE Sort*(a: ^[]INTEGER Sorter.Sort(@a, That is rather C than Oberon :-) Personally, I find it cleaner to hide pointers and adresses as much as possible unless you do low level stuff. PROCEDURE Sort*(VAR a: ARRAY OF INTEGER Sorter. Sort(a, br Jörg
On 2026-11-08 17:22, Rochus Keller wrote:
"Sorter.Sort(@a,.." shows at the call site that a may change, which you don't see with a VAR param.
Agreed - one of my own dialects of Oberon requires VAR in the place of the call as well, because coming from C/C++ I didn't like not seeing that it was a VAR param. I have things like: ... Texts.WriteString(VAR W, "Hello"); Texts.WriteLn(VAR W); Texts.Append(Oberon.Log, W.buf); ... so I can see more easily what are pointers and what are VAR params. A command-line switch relaxes the VAR requirement, e.g. in order to compile Project Oberon code. Cheers Paul
@ Paul Looks like a good approach. In C# we have to write "ref" before the actual parameter in that case which is about the same effort. Are your Oberon dialects online somewhere? Best regards R.K. _______________________________ From: Paul Reed Sent on: Mon, 09 Nov 2026 16:44:59 +0100 To: ETH Oberon and related systems Cc: Subject: [Oberon] VAR params at the call site [WAS: Re: Micron is a modernOberon with the power of C] On 2026-11-08 17:22, Rochus Keller wrote:
"Sorter.Sort(@a,.." shows at the call site that a may change, which you don't see with a VAR param.
Agreed - one of my own dialects of Oberon requires VAR in the place of the call as well, because coming from C/C++ I didn't like not seeing that it was a VAR param. I have things like: ... Texts.WriteString(VAR W, "Hello"); Texts.WriteLn(VAR W); Texts.Append(Oberon.Log, W.buf); ... so I can see more easily what are pointers and what are VAR params. A command-line switch relaxes the VAR requirement, e.g. in order to compile Project Oberon code. Cheers Paul -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On 2026-11-09 17:56, Rochus Keller wrote:
@ Paul ... Are your Oberon dialects online somewhere?
No but the eventual compiler I'm talking about (I think before I added the VAR requirement) is described in my JMLC 2000 and 2003 papers on "Building Your Own Tools" published by Springer, see https://projectoberon.com/About Starting from the original Project Oberon compiler we basically we just added a floating-point binary-coded decimal type for quantities such as money, and open-array variables supporting string concatenation; and the described linker creates native programs for Windows (i386 and x86_64), MS-DOS, Unix/Linux, Macintosh, and Palm OS. The compiler was made portable by migrating all the actual code-generation procedures from OCE and OCH into a pluggable OCG module, so that the user can select a particular OCG target at runtime. Cheers Paul
participants (3)
-
Jörg -
Paul Reed -
Rochus Keller