Hacker News new | ask | show | jobs
by theamk 3691 days ago
I used to program in Pascal long time ago (Turbo Pascal dialect), but the link does not show any of Pascal-specific functionality. Where are types with unusual range (var i: 0..15)? Where are arrays with non-zero based ranges? Where is the neat interface/implementation separation? Is there runtime-based range checking? Because I do not see it, and I bet if I changed this "17" to "117", it will just send extra 100 bytes of un-initialized memory over the socket.

This particular code does not have any pascal-y language features. What is the point of the post? If it was to demonstrate that Oberon is good for teaching / real stuff / general purpose programming / something else, then it failed.

To me, the points of the post is: "hey, this language is not dead! We can now fork() and do socket ops!". Is this intentional?

1 comments

The hard-coded string length is some test code. It's not an indicator of a weakness in the language. Oberon has Strings.Length(), which returns the length of a string.

The OP's link points to a test directory. Go look at the actual source code:

    https://github.com/norayr/voc/tree/master/src
Oberon has all the features you describe: Range types, bounded arrays, and so on. It doesn't have the interface/implementation split (though it has a "DEFINITION" block you can use); modules contain both the interface and implementation, and you export symbols with "*" (or "-" for read only).

Basically, Oberon-2 > Oberon > Modula-2 > Modula > Pascal. Oberon adds interfaces, open arrays, type-bound procedures (similar to Go's struct methods), etc. It's an evolutionary improvement/tweak over the previous languages. If you know any of them, Oberon-2 will be very familiar.