0

The most object-oriented language I know is Smalltalk. Its unique feature compared to other languages is to define everything as an object.

However (if we don't take into account historical events), isn't it this particularity that has made it a less used language than most other object-oriented languages (Java, C++, Python, ...)?

The most commonly used object-oriented languages today are not purely so, so it is relatively easy to learn them (they are not all so different from C-like if you don't take the paradigm into account), to use external elements (API, C libraries, DLL,...), or to create your own objects using classes (we will then talk more about class oriented programming).

So I have the impression that most object-oriented languages do not follow the "philosophy" of the original OOP (am I wrong?).

I then wanted to know if a purely object-oriented language could be as widely used as most of the languages in this paradigm, and what should be the characteristics that will make such a language not be isolated from its environment (it was not possible to use C libraries in Smalltalk for example)?

Foxy
  • 980
  • 8
  • 17

1 Answers1

6

Interfacing to C is not hard in modern Smalltalks. And there are other pure OO languages (Erlang, CLOS, Scala to name a few) so I don't think purity is an issue.

Here is the rub: Smalltalk is not only a language. The syntax is secondary.

The superior productivity of Smalltalk comes from it being a live object environment. You program by creating class objects in memory, and adding method objects to it, then creating instances, and reshaping classes and instances iteratively until you have an assembly of objects that does what you want. Binary snapshots of these objects are stored in an image. To work with them again later, the snapshot is resumed.

The source code itself is secondary, it's just an interface to manipulate objects. The source code you type to define a class isn't even stored, the class object generates it when needed. Similarly, the source code of a method is only kept around to preserve formatting and comments and variable names, the primary definition of behavior is a method object.

This makes it very hard to compare to other languages. And it feels very alien to mainstream programmers who think source code in text files is the essence of programming. This, IMHO, is the major factor why there is not a wider adoption of Smalltalk today.

codefrau
  • 4,583
  • 17
  • 17