r/programming • • Dec 20 '22

10 Most(ly dead) Influential Programming Languages

https://www.hillelwayne.com/post/influential-dead-languages/
270 Upvotes

186 comments sorted by

View all comments

24

u/Laugarhraun Dec 20 '22 edited Dec 20 '22

If you crack open any general theory OOP book from the mid-80’s or early 90’s, they’ll be in Smalltalk

My Art of the meta-object protocol disagrees.

3

u/Timbit42 Dec 20 '22

How is OOP implemented in Lisp? Is it implemented correctly as in Smalltalk and Ruby, or incorrectly like in C++, Java and most other so-called OOP languages.

15

u/Laugarhraun Dec 20 '22

CLOS (common lisp object system) is definitely on the correct side. Alan Kay (creator of Smalltalk) himself is fond of it.

Here is his opinion on the book I mentioned:

 "the best book anybody's written in ten years", and contended that it contained "some of the most profound insights, and the most practical insights about OOP"

9

u/Timbit42 Dec 20 '22

Nice! It's interesting to see the backlash against OOP in the past 5 or so years. As far as I can tell, it's against incorrectly implemented OOP.

3

u/start_select Dec 20 '22

Anyone that wants to argue with me about OOP in the real world never seems to have any good reasoning. It’s just “I thought we didn’t need to know and use classes anymore”.

You didn’t NEED to use them ever but that doesn’t mean that classes, inheritance, and protocols aren’t super useful.

3

u/Timbit42 Dec 20 '22

Some languages force OOP everywhere but either way, when they aren't implemented correctly, there is a loss of the full benefit of OOP. I posted a link to Alan Kay's reasoning nearby.

7

u/WallyMetropolis Dec 20 '22

However you like. It's lisp, it can be anything. But the clos is a really nice implementation of oo.

5

u/agumonkey Dec 21 '22

Lisp had at least two competing OO ideas (loops and flavors) then common lisp got the CLOS (Object System). It's very much not like cpp/java.. and yeah much more reflexive, like smalltalk. It's also much more generic, via multiple dispatch. So methods live between classes and can be specialized in any which way.

(display (person p) (terminal t))
(display (person p) (html h))
(display (child c) (vector v))

you have method combination to override existing methods (object decorators in a way), and then the builtin metaobject layer to adjust the meaning of any implementation decision made by the standard.

1

u/gobi_1 Dec 21 '22

Is common lisp used nowadays?

5

u/WallyMetropolis Dec 21 '22

It's probably second to clojure among lisps in terms of professional use. But a distant second. Lisp's biggest strength is also perhaps its largest barrier to wide spread adoption. Because everything is possible, including creating entirely new syntax or paradigms -- you can make your own OO lisp in like 20 lines of code -- nothing is standardized. So every codebase is a bit like learning a new language.

2

u/agumonkey Dec 21 '22

Some companies are still using CL. Some new projects too like the nyxt browser (emacs like system with a web renderer).

C. Schafmeister used a custom made CL compiler to work on spiroligomer simlulations but that was a few years ago.

You hear a few every year, nothing world altering of course but still.

3

u/ResidentAppointment5 Dec 21 '22

The Common Lisp Object System (CLOS) faced some interesting design challenges, particularly given the generally applicative nature of the LISP family. It grew out of earlier research on LISP object systems, such as Flavors, and arrived at kind of an uneasy marriage of the class-based approach and more of the prototype-based approach that (to the best of my knowledge) originated in Object Lisp and lives on today in JavaScript. CLOS features classes and inheritance, but I would argue its generic functions, multimethods, and especially method qualifiers set it apart from the majority of other object systems in any language.

The metaobject protocol is exactly what it says on the tin: an approach to making it possible to roll your own object system that, on one hand, would integrate with CLOS in predictable ways, and on the other, would provide programmer-defined constructs and semantics to CLOS. Again, to the best of my knowledge, no Common Lisp ever fully implemented the MOP, but significant subsets of it appeared in various Common Lisp implementations, and an attempt at creating a unified compatibility layer appears here.

2

u/fragbot2 Dec 20 '22

It's kinda trippy. It's specified object system is neither class-based nor prototype-based but uses something called generic functions instead. R's most common object system uses this method as well.

1

u/bzxt Dec 20 '22

What do you mean by OOP being implemented the wrong way in C++? I don't have much experience with it.

5

u/Timbit42 Dec 20 '22

Read it from Alan Kay, the creator of OOP & Smalltalk, himself: http://xahlee.info/comp/Alan_Kay_on_object_oriented_programing.html

7

u/cancerouslump Dec 21 '22

Interesting read. To quote: "OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things.". Interestingly, microservices embody these concepts very well (assuming they are well-built I guess).

1

u/profesjonalista Dec 20 '22

What's incorrect about Java, C++ and other languages to you are relating to ?

2

u/Timbit42 Dec 20 '22

Read it from Alan Kay, the creator of OOP, himself: http://xahlee.info/comp/Alan_Kay_on_object_oriented_programing.html

-1

u/profesjonalista Dec 20 '22

So the non OOP things are primitive types with no behaviour and "static" that allows for imperative structure ?

5

u/manzanita2 Dec 21 '22

My take on it is that C++ and Java and some other languages were trying to be performance pragmatic. So they allowed primitives and they swapped "message passing" for "function call". Today it seems impure enough, but in the late 80's early 90's, this was the difference between a research project and something people would use in the "real world".

6

u/Timbit42 Dec 21 '22

I don't understand what you are referring to there.

I think the key parts of that article are:

  • “I invented the term object oriented, and I can tell you that C++ wasn't what I had in mind.” —Alan Kay.

  • OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them.

He made these statements in 2003.

I think a good way to understand what he is saying would be to try Smalltalk. You could use Squeak or the newer Pharo.