What makes Smalltalk such a special and unique programming language?
First of all, it’s extremely small and simple. The complete syntax fits on a post card!
Second, it’s purely object-oriented, reflecting Alan Kay’s brilliant conception of OOP which I regard as canonical. Alan Kay has said that when he conceived OOP, he did not have C++ in mind.
As Alan Kay said:
Smalltalk is a Software Internet
A parallel to the ARPA internet ideas: virtual computers universally connected through virtual networks
There are only objects (objects are made from objects, the network is made from objects, etc.)
(No applications, no file system, just synergies of the virtual computers)
The language is the language of messages between objects
Some objects act as places for making combinations of objects
Objects may be viewed at a place and be integrated with each other
This idea also directly inspired the design of the Erlang language, which can rightly be called “object-oriented” according to Alan Kay’s conception.
An object is very much like a computer with its own private internal state and a communications protocol. You communicate with an object by sending it messages. You ask an object to do something for you by sending it a message and it responds, just as a real computer server in a network might do. And just like in a real computer server, you are not privy to its internal state.
An object is not an Abstract Data Type
…where Abstract Data Type is a highfalutin term for a type of data structure.
OOP languages like Java and C++ are a bastardization of Alan Kay’s OOP conception. They make OOP harder than it has to be, and are an endless source of confusion for many. As Robert C. Martin says in “OOP vs FP,” objects are bags of functions, not bags of data. Objects are not data structures.
Inheritance is not mandatory in Smalltalk. You may use composition or aggregation as appropriate for your programming solution. Any hysteria over the “flaws” of inheritance is just that: hysteria…and ignorance. As a tool, inheritance is certainly applicable and appropriate in many situations, for example, GUI programming. Especially if you employ inheritance as a means of specialization and not code reuse.
Third, it has a built-in IDE that supports live coding, which helps make Smalltalk the most productive programming language in the world. With live coding, you can easily alter the program code while it’s running!
Fourth, it’s fully reflective and has great metaprogramming capabilities. Read “Lisp, Smalltalk, and the Power of Symmetry.”
A Smalltalk program is able to inspect its own structure and computation at runtime. This confers enormous power allowing programs to extend themselves with new classes and methods or ask “who sent this message to me?”
Computational reflection is used to implement a powerful way to handle errors. When an object is sent a message it doesn’t implement, it receives a doesNotUnderstand: message, along with a reification of the original message. There are many things that the program can do with the doesNotUnderstand: message, including extending itself with new functionality!
Fifth, it’s image-based which confers a number of unique advantages such as portability and persisting execution context. The Smalltalk image allows you to save the execution state of your program at any time and resume execution later on from exactly where you left off! This is very similar to how the system image in OS virtualization software like VMware and VirtualBox works. This is also similar to how the web browser’s DOM or Excel spreadsheet works.
Sixth, it has full support for lambdas which makes Smalltalk great for functional programming, too!
Individually, these things are not unique, but it is the synergistic whole that makes Smalltalk one of the most remarkable programming languages in history.
Who uses Smalltalk?
You’d be surprised.
Cincom, Instantiations, and GemTalk are major Smalltalk vendors. Between them, they have many prominent enterprise users:
- Florida Power & Light
- Texas Instruments
- Telecom Argentina
- Orient Overseas Container Lines
- Siemens AG
Just to name a few. In my home country, Smalltalk is used by Communications Security Establishment (CSE), Canada’s national cryptologic agency.
Pharo, a Smalltalk modernized for the Twenty-First Century, has prominent users too, for example:
How versatile is Smalltalk?
Smalltalk is endlessly versatile:
- Smalltalk is good for data science and numerical computing, thanks to PolyMath and Roassal (also see Numerical Methods with Pharo)
- Smalltalk is good for Internet of Things and robotics
- Smalltalk is good for ERP (enterprise resource planning)
- Smalltalk is good for machine learning and neural network processing
- Smalltalk is good for natural language processing
- Smalltalk is good for virtual reality (example, 3D Immersive Collaboration)
- Smalltalk is being used to fight Ebola!
- Smalltalk is used in wide-scale data visualization for medicines in 16 countries
- Smalltalk can be used to write front-end web apps and cross-platform mobile apps using Apache Cordova
- Smalltalk is good for server-side web development, thanks to the Seaside web framework and the Teapot micro framework
And I’ve just barely scratched the surface!
So what’s holding you back? Give Smalltalk a try. It may transform your view of programming forever.