Author of oberonc here, thanks for trying it out :)
HN user
lboasso
I think Fogus was able to summarize it quite well in his "Six works of Computer Science-Fiction" blog post [0]:
"Wirth’s magnum opus is the quintessential example of Computer Science alternative-history world-building."
Note that Oberon was not only the name of a programming language, it was also the name of an innovative (at that time) operating system. It is possible to program real-world programs today in Oberon depending on the used implementation. For example oberonc [1] is a compiler targeting the JVM and allows you to leverage the JVM ecosystem by invoking Java code (or any other language that compiles to Java bytecode). For more Oberon implementations see [2]
[0] http://blog.fogus.me/2015/04/27/six-works-of-computer-scienc...
You are right, but as you can see at page 11 (Figure 4 rightmost AST) of The Oberon System Family paper [0], Wirth's approach was extended to "hint" destinations as well.
[0] https://www.research-collection.ethz.ch/bitstream/handle/20....
It would be great to have a simple Virgil x86-64 backend based only on the destination-driven code generation technique, and compare the performance of the generated code (and compilation speed) with the official optimizing x86-64 backend. Would the implementation effort be comparable to the JVM backend?
BTW I really like the design of Virgil described in "Harmonizing Classes, Functions, Tuples,and Type Parameters in Virgil III", bravo!
It is interesting to see that this approach has been used by Niklaus Wirth in most of his compilers, see "Compiler Construction - The Art of Niklaus Wirth" by Hanspeter Mössenböck [0]. This technique was also described by David R. Hanson in "Code Improvement via Lazy Evaluation", 1980 [1] and "Simple Code Optimizations", 1983 [2].
[0] https://github.com/lboasso/oberonc/blob/master/doc/Moe00b.pd...
The Oberon programming language is 37 years old. Since it is a memory safe language a compiler for the JVM can be written (with some workarounds), for example see the self-hosting compiler oberonc [0].
If you want to try out only the Oberon language, you might be interested in oberonc [0] an oberon-07 self-hosting compiler for the JVM. There are other several Oberon implementations for different platforms listed here[1]
If you want to try out only the Oberon language, you might be interested in oberonc [0] an oberon-07 self-hosting compiler for the JVM. There are other several Oberon implementations for different platforms listed here[1]
If you want to try out only the Oberon language, you might be interested in oberonc [0] an oberon-07 self-hosting compiler for the JVM. There are other several Oberon implementations for different platforms listed here[1]
If you want to try out only the Oberon language, there are several Oberon implementations for different platforms, including embedded systems, native windows executables, and the Java virtual machine: http://oberon07.com/compilers.xhtml
When I read this book I had an hard time running and compiling the source code included. If you want to read the book and try out the example compiler (oberon0), you can follow the instructions here: https://github.com/lboasso/oberon0. You just need a JVM >= 8 and the oberonc compiler: https://github.com/lboasso/oberonc
When I benchmarked oberonc [0], an oberon-07 self-hosting compiler for the JVM, it took about 100 ms with a hot VM on a old Intel i5 @ 2.80GHz. That compiler follows the same one-pass compilation approach.
You might be interested in oberonc [0] an oberon-07 self-hosting compiler for the JVM.
And a lot of the compilers and tooling seems to be weirdly Windows-oriented
When I read this book I had an hard time running and compiling the source code included. If you want to read the book and try out the example compiler (oberon0), you can follow the instructions here: https://github.com/lboasso/oberon0. You just need a JVM >= 8 and the oberonc compiler: https://github.com/lboasso/oberonc
If you want to try out the Oberon language, there are several Oberon implementations for different platforms, including embedded systems, native windows executables, and the Java virtual machine: http://oberon07.com/compilers.xhtml
I wrote a self-hosted one pass compiler exactly to showcase Niklaus Wirth's approach to writing compilers: https://github.com/lboasso/oberonc
We often forget this alternative way (with its pros and cons).
Here is the repo: https://github.com/lboasso/oberon0
Yes, you can write small Oberon-0 programs and compile them with an Oberon-07 compiler, but it is simpler to just use the Oberon-0 compiler from the repo above.
With oberonc you can compile the source code at http://www-oldurls.inf.ethz.ch/personal/wirth/CompilerConstr... with minor changes to the I/O library calls. I can push the changes in a repo if you are interested.
Oberon-0 is too limited to easily bootstrap itself. I wrote oberonc first in Java and then I rewrote it in Oberon-07 for the final bootstrap step. Oberon-0 is a toy subset of the full Oberon-07 language.
For the excellent introductory book "Compiler Construction" by Niklaus Wirth, you could find compilers for the implementation language at http://oberon07.com/compilers.xhtml.
If you have a JVM installed, you could use oberonc[0]. I have a local branch where I test that each release of the compiler can compile and run the examples in that book.
Several other Oberon implementations exist for different platforms, including embedded systems, native windows executables, and the Java virtual machine: http://oberon07.com/compilers.xhtml
or as pragmatic alternative "Tcl: An Embeddable Command Language" [0].
[0] https://web.stanford.edu/~ouster/cgi-bin/papers/tcl-usenix.p...
or as pragmatic alternative "Tcl: An Embeddable Command Language" [0].
[0] https://web.stanford.edu/~ouster/cgi-bin/papers/tcl-usenix.p...
If you are interested in the Oberon-07 language, I made a port of Wirth's compiler for the JVM, see [0]. Several other implementations exist for different platforms [1].
I enjoyed most of it.
In particular:
* Ch. 4 "Modules Should Be Deep"
* Ch. 10 "Define Errors Out Of Existence"
* Ch. 20 "Designing for Performance"Another excellent resource is "A Philosophy of Software Design" [0], from John Ousterhout (known for Tcl/Tk, Raft, RAMCloud, Log-Structured File System). Like Niklaus Wirth, he is striving for designs that fight complexities and yield simple and powerful abstractions. This book is so much better than overrated books like "Code Complete" and "Clean Code" for a fraction of the page count.
[0] https://www.amazon.com/Philosophy-Software-Design-John-Ouste...
Go was heavily influenced by Oberon, in fact Robert Griesemer is a former Wirth's PhD.
I have been following the development of Oberon-07 (and submitted minor fixes to Prof. Wirth) over the years. The compiler's source code is the fruit of refinements and simplifications accumulated over 30+ years (more if you include his compilers for previous languages). His approach for compiler writing, and system design in general, is outstanding. For more information about his compilers see "Compiler Construction - The Art of Niklaus Wirth" [0]
as mentioned in another comment, an example of bootstrapping compiler for Oberon on the JVM is: https://github.com/lboasso/oberonc
Bootstrapping a compiler is fun. I wrote a self-hosting compiler for the Oberon-07 language, targeting the JVM: https://github.com/lboasso/oberonc
Initially the project was written in Java, after enough features were working the bootstrap phase could start.
Wirth's compilers generated reasonably good code: 80% of the performance of optimizing compilers with 20% of the effort.
The first Java client jit compiler, was developed by Robert Griesemer (former PhD student of Wirth). The design of the compiler is described in the paper "A compiler for the java hotspot virtual machine", published in the same book: "The School of Niklaus Wirth: The Art of Simplicity".