Hacker News new | past | comments | ask | show | jobs | submit login
Active Oberon Language Report Update 2019 (ethz.ch)
131 points by pjmlp on Nov 17, 2019 | hide | past | favorite | 33 comments



It’s the second time i see this language mentioned on HN. Reading about it made me feel it was coming straight from the 80s, and i must say i didn’t find anything special in its feature set (but i didn’t spend a lot of time). Could anyone provide more info on what makes this language interesting ?


The language in itself is just a member of the Pascal/Modula family stripped to the minimum while still supporting modules and some form of polymorphic objects. What is interesting is what Wirth et al does with it in the Oberon book (http://www.projectoberon.com): building a complete computing environment (including a kernel, compiler and GUI) running on their own CPU. All in 9000 lines of Oberon code, no C or anything else.


Just started reading the book and so far it is quite interesting and informative and it looks like the problem they were trying to solve were that of the massively complicated operating systems which seem to get in the way rather than help. Funny how that resonates just as much today as then.

I have the digilent board from my FPGA experiments and Oberon looks like pascal so should be pretty easy to pick up so I might give the examples a go.

Unfortunately VGA graphics and PS2 keyboards and mice seriously dont cut it these days



Nim mentions that Oberon is one of its inspirations


Active Oberon is one of the final evolution paths that started with Mesa/Cedar at Xerox PARC and influenced Wirth's work on Oberon.

A full workstation OS, written in a strong type safe GC enabled systems language, providing UI interactions similar to Lisp and Smalltalk workstations from Xerox and Lisp Machines.

All of this in the mid-90s, where most PC users where still running Windows 3.x on their computers and Amiga was mostly coded in Assembly.

If you want some screenshots and overview of how it used to look like, https://www.progtools.org/article.php?name=oberon&section=co...


Active Oberon is a small but powerful language with a lot of good ideas within the language.

One of the interesting additions over plain Oberon is the concept and support for active cells. Active Cells provide an abstract mechanism to define systems composed of computing elements that exchange information over message channels. Not new to anyone familiar with Go Channels etc buts its one of the nice things in Active oberon and provides support for both Actor models, concurrency and parallel programming.

How this applies to scalable systems and custom FPGA hardware is described in an older paper - see https://inf.ethz.ch/personal/felixf/pdfs/2012_ActiveCells.pd...

In addition to cells there is math support for tensors (via Math Array) and matlab like array processing as well.

From a language implementation perspective it provides quite a lot in a relatively small, clean and easy to follow code base.


Have you compared it to Go?


I have compared both Modula-2 and Oberon-2 to Go, but have not compared Active Oberon to Go.

This was for purposes of creating a top-down, predictive, recursive descent parser for Go.

I am curious on how Go is being parsed. LR, LL, or ?

I am also curious about the CellType and PortType of Active Oberon. Do these correspond to Go's ChannelType and possibly to OCCAM and CSP Send and Receive Channels?


Go uses a hand-written recursive descent parser.


(Only tangentially related to the OP, but what the hell.)

Does anyone here have an experience programming in Oberon-07? One of the most interesting features of the language for me is the fact that it doesn't have a BREAK statement. Which means that one must use a form of WHILE for linear searches. Probably to force people to think in terms of structured programming instead of the logic of “hidden GOTOs”. Does it ever bother you? Did you ever had a thought like “Sheesh, this would be so much better with a FOR and a BREAK.”?


You can easily emulate break with conditional variable.


Of course, but wouldn't that effectively defeat the purpose of removing BREAK/EXIT in the first place? With something like:

  WHILE ~(lastIteration) & ~(Found(haystackPart, Needle)) DO
    (* Advance the haystackPart.  *)
  END;
I can at least say that after the loop if lastIteration is true, then the needle wasn't found in the haystack. While something like

  WHILE ~(found) DO
    (* Stuff.  *)
  END;
Conveys next to no information. To say nothing about the fact that the body of the loop will probably be full of:

  IF ~found THEN
    (* Stuff.  *)
  END


> Of course, but wouldn't that effectively defeat the purpose of removing BREAK/EXIT in the first place?

Personally, I do like having BREAK/EXIT, but in the eyes of structured programming purists, a loop with an explicit conditional still has a single entrance and single exit, while BREAK/EXIT statements destroy this property.


On a tangent to your tangent: the `while` and `for` loops in Ocaml also do not have a `break` statement. Early exits are typically achieved by raising and catching an exception (which fortunately is quite efficient in Ocaml).


It has LOOP and EXIT, I remember that turned out to be the most used repetition construct when I was using (IIRC) JPI Modula-2.

For me, it was so easy to think about loops that way, with an EXIT/condition in the middle of the loop body.


You're probably thinking of the original Oberon. Wirth has removed both LOOP and EXIT from Oberon-07. See here: http://people.inf.ethz.ch/wirth/Oberon/Oberon07.pdf.


An elegant solution (if applicable) is placing a deliberate sentinel value at the end of your data before looping.

https://en.m.wikipedia.org/wiki/Sentinel_value

Whereas usually loops have 2 tests for checking if the while loop should end (end-of-data-reached? or break-condition-is-true?) you only need to check for the latter.

This is a very Oberonesque programming optimization.


C++ as well, to the point that C++20 ranges have the notion of end sentinel values built in.


I'm sorry, but I don't see how that answers my question. Oberon-07 has real FOR loops over arrays, so it doesn't need sentinel values. My question was about an idiom like:

  WHILE True DO
    (* Stuff.  *)
    IF someCondition THEN
      EXIT;
    END;
    (* More stuff.  *)
  END;


My guess is that Wirth's approach would be to avoid having too much logic in a loop (if really necessary, break it into separate procedures) and if needed to do something like

    WHILE ~someCondition DO
      (* Stuff *)
      IF ~someCondition THEN
        (* More stuff *)
      END;
    END;
In general from a quick look at the projectoberon.com source code (which is largely written by Wirth) the vast majority of WHILE and REPEAT uses seem to be less than 4 lines long.


I answered for a sub space of all the possible problems that can be solved with LOOP and EXIT which lend themselves to a much better structured approach.

Also, you were jumping to FOR loops over arrays. But instead the sentinel values are much better suited for linked lists.

What a programming language allows shapes how you program in it. The Sapir-Whorf Hypothesis is probably much more true with programming languages than natural languages.

One of Wirth's mantras is "don't show me your code, show me your data structures and I'll immediately know if your code is any good".

There are certainly moments when I would like to have certain programming constructs. But then I have to solve the problem in another way.

But this happens in a lot of languages. Be it C, Ruby, Javascript, or Oberon (whatever version).


Compared to the Oberon in http://www.projectoberon.com this is like Oberon++. I mean, it's still a pretty bare bones language, but it has added quite a few fancy features.


Right. The whole point of Oberon is being as simple as possible. If you need all the fancy stuff introduced with Oberon-2 or Active Oberon (which are not the same lange as the one designed by Wirth) then there are better alternatives, e.g. https://en.wikipedia.org/wiki/Object_Pascal, or Java, or C#.



I was taught this language in 1st year of Oxford CS course. While I thought it's a dead language at the time, I'm glad to hear I was wrong ;)


It is a niche language, but it still gets used.

This company is still in business, selling Oberon compilers for embedded development.

https://www.astrobe.com/


I'm curious, would you use it in a business setting today? What's the killer feature?


No. It's not designed for that. It was designed as a minimal lanuage focussing at the bare essentials required to implement a minimal operating system with graphical user interface.


Also for Wirth/Oberon fans: Oberon for the JVM — https://github.com/lboasso/oberonc


Is it peculiar that the language report does not mention "active objects" in its text? Is there a different but equivalent term in use?


Could we perhaps link directly to the PDF (at http://cas.inf.ethz.ch/projects/a2/repository/raw/trunk/Lang...)?


I posted the link to the overview page, because it provides more information about the PDF not being yet final and where to discuss further the issues until it gets the final seal of approval.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: