17 points · by mikethe · 11mo ago · 37 comments
I recently came accross this thread from a few years ago: https://news.ycombinator.com/item?id=34501352
I am interested, in particular, by the comment by vidarh, that starts with:
"You've been given the answer already: Simplicity. You keep ignoring it."
I find myself highly interested in what this person would have to say about rust. Is it better than, for example, oberon, or it's descendents?
I have heard that Rust is a big language. By that definition, a simpler one must be better, right? And yet rust is a big thing, and .. oberon is ..dusty?
I will keep on searching, and maybe attempt to contact him/her/(other?) directly.
It's a completely different language with different focus and features. "better" depends on the requirements you want to solve with the language. Rust can do memory management at compile time whereas Oberon and its descendants (such as my Oberon+ version) use a garbage collector at runtime. Rust is much bigger and more complex than Oberon, but it also has features which make it more suitable for systems programming. Simpler is not automatically better. If a language is too "simple" (i.e. minimalist), the complexity often shifts from the language specification to the application code, requiring more boilerplate or "clever" tricks to solve complex problems.
And it was not only simplicity (as Vidar assumed), but Oberon indeed had a different approach to OO in that there were no bound procedures, but the idea was (as you can observe e.g. in the Oberon systems and in publication by Wirth an his PhD students) that "type extension" (i.e. inheritance) is used to create extensible message hierarchies, which then are polymorphically handled by procedures accepting a VAR parameter of the most general message type. In this handler, the messages are dispatched by the IS operator or the WITH or CASE statement. This has similar effects as e.g achievable by sum types, and interestingly is closer to e.g. Alan Kay's view of OO than the implementation found in Smalltalk-80 (notably, Wirth arrived at this message-centric model independently of Kay’s work in the Smalltalk lineage).
The same thing when I see mentions of C++. Except that I haven't yet found endorsements of it from anybody of Wirth's stature. Sites like suckless really do not help.
Related: https://plan9.io/wiki/plan9/lfaq/index.html#HARDWARE_AND_SOF...
" Is it object-oriented?
No, not in the conventional sense. It is written in a strict dialect of ISO/ANSI C. In a wider sense, its general design of making all its ``objects'' look like files to which one talks in a well-defined protocol shows a related approach. "
The industry seems to advance not by finding a static "truth," but by lurching between opposing philosophies, each powered by its own wave of activism. I recommend to ignore the "moral" arguments, but to focus on the engineering trade-offs. Most "revolutions" are just rediscoveries of old ideas. Functional Programming is largely Lisp (1958) re-branded. The "Anti-OO" movement is partly a return to procedural modularity (Pascal/C). Our job is not to be "pure"; your job is to build working, maintainable software using the best tools we can find for the specific problem at hand.
I have now read more of the book on oberon, and confess that I lost traction. It seems very clear that he is using objects, and my bias against them is very strong. I have heard it said that both oberon and plan9 are beautiful, but completely different.
I'd be interested in your take on the two of them, when, if, each of them should be used, and why. I am currently attempting to install plan9/9front/9legacy et. al. I understand that oberon, being much smaller, could be very useful for learning purposes, but if you don't actually approve of OO, then.. is it really the kind of thing you want to be teaching people. Obviously, you want people to see a bit of everything, just so they are aware of alternate ways of doing things. At the same time, most people will assume that the first thing you show them is the way you actually want them to do it, and will tread the alternatives as what you present them as, curiosities, potentially useful. So, if the objective is plan9, then what would actually be needed would be a .. well.. a tutorial for plan9. A tutorial that gradually built the operating system, explaining the logic step-by-step. There -is- actually at least one tutorial that does such a thing, that I am aware of, but what it takes as it's inspiration, I haven't checked out yet. This is the one: https://os.phil-opp.com/
That seems off. Kay's comments have always struck me as in line with Brad Cox's views. Cox's book uses this example a lot as a poor/insufficient substitute for dynamic dispatch.
It is unlikely that the two would have agreed on this. Kay's view is actually based on messages, as implemented in Erlang, for example, and to some extent in Smalltalk-72. Cox, on the other hand, has implemented the object and dispatch model of Smalltalk 80, that Ingalls invented and published in 1978, almost exactly, even with the same method lookup caching.
> Cox's book uses this example a lot as a poor/insufficient substitute for dynamic dispatch.
The Wirth and Smalltalk approach are both fundamentally "late-bound search" mechanisms, differing mainly in whether the search state is optimizable by a central engine (VM) or fixed in the user's explicit control flow (Handler). This is a classic example of dualism in computer science, specifically the Expression Problem (or the Data/Operation duality). You are simply traversing a 2D matrix of (Types × Operations), just choosing a different axis as primary. It's mathematically isomorphic, both are performing a directed graph traversal to find the code that matches (CurrentType, CurrentMessage). Only the ergonomics and possibility for caching differ. Smalltalk hides the dispatch loop in the VM, which can do caching and the dispatch effort goes from O(N) to O(1) in time. Wirth exposes the dispatch loop in the WITH statements with a dispatch effort continuously O(N).
I'm not familiar enough with Smalltalk-72 or what Ingalls did that makes it so different from the Smalltalk-80 that Cox read about in Byte.
> differing mainly in whether the search state is optimizable by a central engine (VM) or fixed in the user's explicit control flow (Handler). This is a classic example of dualism in computer science, specifically the Expression Problem (or the Data/Operation duality). You are simply traversing a 2D matrix of (Types × Operations), just choosing a different axis as primary.
If you are doing whole-system development and have control over the entire thing (a "closed world" system), then it is that simple. But whether it's an open world or a closed world changes things.
Cox is fond of a simple example that he repeats in his book (fairly early on—it's on something like page 9) to demonstrate that dynamic dispatch is fundamentally necessary because it means you don't have to have panoptic control/involvement over the objects in a system (with all types known at compile time). If you're programming every operation with switch statements that select code paths based on objects' type tags, not only do you have to go visit all N routines where each of those N operations are implemented to update them when introducing a single type, but it also requires a priori knowledge of all types to be baked into the system that you release at the time of release, whereas OO on a live system means that you can introduce new types even after the initial system has shipped to the user.
..fascinating..
..it always comes down, again and again, to what is the problem you need to solve, and from there, what is the best solution. And at that point, once you have identified the problem.. in a way it's a toss-up whether you implement your own solution, or just happen to have heard of a solution to a similar or equivalent (or the same) problem, developed by somebody else. ..or how willing you are to dig in search of said hypothetical already-existing solution. And said hypotheticals must then themselves be evaluated, which also takes time.
While Odin is a modern and capable language, it belongs to the "C-alternative" school (alongside Zig) rather than the "Wirthian" school (Pascal, Modula-2, Oberon). Odin, by design, retains manual memory management and allows pointer arithmetic. Oberon has a GC and very restricted pointer use. Odin's "joy" and "practicality" come from adding many features that Wirth would have considered "unnecessary complexity".
The ISO module SYSTEM provides pointer arithmetic with "ADR" manipulation.
Argubly, though, ISO Modula 2 is not exactly a Wirthian language any more but "Standardian".
Standardized. Very mature. Proven track record. https://en.wikipedia.org/wiki/Ada_(programming_language)
Maybe the biggest difference between Ada and true Wirth languages is that it is not deliberately minimal.
Would you say that Ada sits close to Modula 2 philosophically, but industrial-scale?
Ada is in every aspect a much bigger and more powerful (e.g. concerning the ability of the compiler to assist you in writing safe low-level code) language than any of the Wirth languages. Wirth famously criticized Ada as being "uneconomical"; he believed that because Ada’s requirements were so "baroque" and contradictory, the resulting language was inevitably overloaded with features whose marginal benefits did not justify their complexity (https://archive.org/details/Computer_Language_Issue_09_1985-...). But when you e.g. study the Oberon system, you see that it depended on "tricks" (e.g. SYSTEM.PUT/GET, VAR ARRAY of SYSTEM.BYTE) which were not properly integrated in the language concepts and had to be used without any typechecking support by the compiler.
I am very curious at the moment about why my post shows up a lighter shade of gray than others. I have done some searching, and apparently this can have something to do with people down-voting something, maybe if it seems to contain disparaging comments. I described oberon as "dusty", could that be it? It wasn't meant to be disparaging. You see rust all over the place. If I hadn't been exploring the text editor vis referred to by suckless, I wouldn't have even known oberon existed.
I am -not- trying to criticize oberon. I am not trying to claim that rust is better. I am just looking for a comparison of the two, from the point of view of the particular poster I referenced. I would have responded to his comment directly if I could.
Thank you very much for your tip about ada. I'll check it out!
- https://github.com/rochus-keller/Oberon
- https://free.oberon.org/en/ (discussion: https://news.ycombinator.com/item?id=38240333)
Your comments will not appear grey unless downvoted more so than upvoted, and that grey will be seen by others but not be seen by you while you are still logged in.
Your account name is new and so appears in green which some users will scrutinize until they are confident it is not a bad actor.