[M3devel] Modula 3 and Oberon, some random thoughts
dirk muysers
dmuysers at hotmail.com
Sat Oct 8 19:01:06 CEST 2016
In another life, my favorite Pascal child had been Oberon, and for many years now I use Modula 3, because of some programmer-friendly, or let's say laziness-encouraging :-) features such as constructors, default values and nested blocks, but the main reason was that I needed to make stand-alone distributable programs, while Oberon runs in a closed workstation IDE environment. Also Oberon --unlike Modula 3-- has no make facility, modules are compiled one par one interactively as they are written. To remain honest, it now also has a rather complicated release tool that kind of imitates Quake. I still prefer writing relatively big (but not huge) modules rather than a multitude of very small modules. What I still miss in Modula 3 is the possibility of read-only global and field exports, which let you avoid making many types opaque and providing their corresponding xxxRep modules.
What makes compiling Modula 3 rather difficult is the possibility of n:m relationships between modules and interfaces, rather than the module and its interface like in Oberon. It also makes dynamic loading near impossible. An other sensitive point is the existence of packages. Note that the ComponentPascal dialect of Oberon also has packages (called subsystems) but modules are known as belonging to the package named by the characters until the first LC/UC transition of the module name which obviates the need to deal with it at the m3makefile level.
Let's face it, the Modula 3 compiler with its four packages and hundreds of modules, is what I call a monster and what the French call "une usine 'a gaz". In comparison, the Fox compiler of the last Active Oberon avatar is much simpler, consisting of some 60 modules and compiles ultra fast. It doesn't need a Quake and yet, being used in a research environment, offers a great flexibility with regard to platforms, architectures and backends.
Many problems that plague the Modula 3 implementations could be solved by having a look at Oberon. Unfortunately not many community members seem to be familiar with the Oberon world. In addition most of them are Linux based which makes them --unlike the Oberonists-- neglect the different Windows systems which still represent 80% of all desktop computers.
I think the whole compiler should be rewritten from the ground. As for me, I am, at 82, just too old for such a workload. Having a look at Oberon's new very clever cooperative multitasking system<http://e-collection.library.ethz.ch/eserv/eth:47094/eth-47094-02.pdf> that runs on as much processes as there are system processors (also heard about Go?) would be very beneficial for the Modula 3 community.
As a final rant, if cm3 improved in many ways the compiler, many features were better in pm3 like texts and threading. I would have left the text system as it was, just encoding it in UTF-8 as nearly everybody does nowadays, and also --just a peanuts detail-- I prefer RUNE over WIDECHAR because it just has four letters that make RUNE/CHAR written one above the other as it often happens in selects and conditionals, more readable.
I love readable programs.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20161008/ab1548fc/attachment-0001.html>
More information about the M3devel
mailing list