HNHacker News
TopNewBestAskShowJobs

lboasso

168 karma · joined July 24, 2014

submissionscomments
lboasso··on Oberon Pi
Author of oberonc here, thanks for trying it out :)
lboasso··on Object-Oriented Programming in Oberon-2 [pdf] (1994)
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...

[1] https://github.com/lboasso/oberonc

[2] http://oberon07.com/compilers.xhtml

lboasso··on A quick look at destination-driven code generation
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....

lboasso··on A quick look at destination-driven code generation
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!

lboasso··on A quick look at destination-driven code generation
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...

[1] http://storage.webhop.net/documents/lazyevaluation.pdf

[2] http://storage.webhop.net/documents/simpleopt.pdf

lboasso··on Ask HN: Why are there no traditional language compilers that target the JVM?
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].

[0] https://github.com/lboasso/oberonc

lboasso··on Oberon (2009)
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]

[0] https://github.com/lboasso/oberonc

[1] http://oberon07.com/compilers.xhtml

lboasso··on Modula-2 and Oberon (2007) [pdf]
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]

[0] https://github.com/lboasso/oberonc

[1] http://oberon07.com/compilers.xhtml

lboasso··on Project Oberon
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]

[0] https://github.com/lboasso/oberonc

[1] http://oberon07.com/compilers.xhtml

lboasso··on Project Oberon Emulator in JavaScript and Java
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
lboasso··on The School of Wirth
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
lboasso··on The School of Wirth
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.

[0] https://github.com/lboasso/oberonc

lboasso··on Selfie – Tiny self-compiling C compiler, RISC-V emulator and hypervisor
You might be interested in oberonc [0] an oberon-07 self-hosting compiler for the JVM.

[0] https://github.com/lboasso/oberonc

lboasso··on Compiler Construction by Niklaus Wirth [pdf]
> 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

lboasso··on Oberon Operating System
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
lboasso··on My First Fifteen Compilers
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).

lboasso··on Let's Build a Compiler (1995)
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.

lboasso··on Let's Build a Compiler (1995)
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.

lboasso··on Let's Build a Compiler (1995)
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.

[0] https://github.com/lboasso/oberonc

lboasso··on OBNC Oberon Compiler
Several other Oberon implementations exist for different platforms, including embedded systems, native windows executables, and the Java virtual machine: http://oberon07.com/compilers.xhtml
lboasso··on “Little Languages” by Jon Bentley (1986) [pdf]
or as pragmatic alternative "Tcl: An Embeddable Command Language" [0].

[0] https://web.stanford.edu/~ouster/cgi-bin/papers/tcl-usenix.p...

lboasso··on A Universal Scripting Framework (1996) [ps]
or as pragmatic alternative "Tcl: An Embeddable Command Language" [0].

[0] https://web.stanford.edu/~ouster/cgi-bin/papers/tcl-usenix.p...

lboasso··on A plea for lean software (1995) [pdf]
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].

[0] https://github.com/lboasso/oberonc

[1] http://oberon07.com/compilers.xhtml

lboasso··on A plea for lean software (1995) [pdf]
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"
lboasso··on A plea for lean software (1995) [pdf]
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...

lboasso··on A plea for lean software (1995) [pdf]
Go was heavily influenced by Oberon, in fact Robert Griesemer is a former Wirth's PhD.
lboasso··on A plea for lean software (1995) [pdf]
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]

[0] http://oberon2005.oberoncore.ru/paper/art3.pdf

lboasso··on C compiler with support for structs written in Assembly
as mentioned in another comment, an example of bootstrapping compiler for Oberon on the JVM is: https://github.com/lboasso/oberonc
lboasso··on C compiler with support for structs written in Assembly
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.

lboasso··on Compiler Construction: The Art of Niklaus Wirth (2000) [pdf]
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".

Page 1 of 2Next →