Live data from Hacker News

Active Oberon Language Report Update 2019

cas.inf.ethz.ch

31–35 of 35 posts

Re: Active Oberon Language Report Update 2019

#31
post #18

Earlier quoted context omitted.

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.…

> 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.

Re: Active Oberon Language Report Update 2019

#32
post #28

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/

Re: Active Oberon Language Report Update 2019

#33
post #6

(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…

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).

Re: Active Oberon Language Report Update 2019

#35
post #26
post #19

Earlier quoted context omitted.

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.

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;

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).

Post reply on HN