Back to the Future with Smalltalk

Written by richardeng | Published 2018/03/05
Tech Story Tags: smalltalk | programming | startup | back-to-the-future | programming-languages

TLDRvia the TL;DR App

Software development has been mired in ancient technologies for decades. The way we create software today isn’t much different from the way we did it in the 1960s and 1970s. Back then, we used textual programming languages like FORTRAN, LISP, COBOL, BASIC, Pascal, and C whose programs were written using text editors like TECO, QED, vi, and Emacs. We stored the program source code in files and folders. We compiled these programs from the command line.

To ensure that a program worked correctly, we had to test it and if it failed, we had to diagnose the problem, edit the source code to include a possible fix, compile the program, and run it again. And if it failed again, we had to do this all over. This edit-compile-test-debug cycle was time-consuming and inefficient.

Fast forward to 2018. Guess what? We’re still creating software the same way! Except now, we’re using Java, Python, JavaScript, Ruby, Swift, and Golang. We’re writing code with text editors like Vim, Emacs, Sublime Text, Atom, and Visual Studio Code. We’re storing program code in files and folders. We’re still compiling from the command line, even if implicitly within an IDE.

We are still slaves to the edit-compile-test-debug cycle! After more than half a century, we haven’t made any real progress. In this “modern” age we live in, we are effectively programming using stone knives and bearskins.

Star Trek: “The City on the Edge of Forever”

And it’s hurting our productivity. Software is taking longer and more effort to write as it grows ever larger and more complex. We need better tools. We need to escape our past.

Ironically, the future of software development has been staring us in the face for more than 40 years. It’s called Smalltalk.

Genesis: Alan Kay’s Vision

Smalltalk began with Alan Kay, Dan Ingalls, and Adele Goldberg at Xerox PARC in the 1970s. They were part of the Learning Research Group and Smalltalk was created to investigate teaching programming to children.

Smalltalk was an object-oriented programming (OOP) language. It was objects all the way down. Smalltalk’s purity and clarity in this regard made it the archetype for nearly all other OOP languages.

To understand the essence of Smalltalk’s philosophy, watch this video clip of Alan Kay’s tribute to Ted Nelson (start at 2:18):

Alan Kay’s tribute to Ted Nelson

Some more insight comes from Alan Kay’s “The Early History Of Smalltalk” (©1993 ACM):

Smalltalk is a recursion on the notion of computer itself. Instead of dividing “computer stuff” into things each less strong than the whole — like data structures, procedures, and functions which are the usual paraphernalia of programming languages — each Smalltalk object is a recursion on the entire possibilities of the computer. Thus its semantics are a bit like having thousands and thousands of computers all hooked together by a very fast network.

and

Smalltalk’s contribution is a new design paradigm — which I called object-oriented — for attacking large problems of the professional programmer, and making small ones possible for the novice user. Object-oriented design is a successful attempt to qualitatively improve the efficiency of modeling the ever more complex dynamic systems and user relationships made possible by the silicon explosion.

Smalltalk was an illustrious language with a storied history. Here were some of its greatest achievements:

  • Smalltalk introduced the world to the language virtual machine, on which Java and Ruby are based, as well.
  • Smalltalk pioneered JIT (just-in-time) compilation.
  • From Smalltalk came the first modern IDE (integrated development environment), which included a text editor, a class browser, an object inspector, and a debugger.
  • Smalltalk was the first graphical language tool to support live programming and advanced debugging techniques such as on-the-fly inspection and code changes during execution in a very user-friendly format.
  • Since Smalltalk-80 (in 1980), it has had first-class functions and closures which, oddly enough, make Smalltalk quite good for functional programming.
  • Smalltalk introduced the software architectural pattern MVC (Model-View-Controller).
  • To a large extent, Smalltalk was responsible for giving us Test-Driven Development (TDD) and extreme programming (XP), which are both very influential in today’s standard agile practices.
  • Smalltalk made “duck typing” a household word.
  • Smalltalk pioneered the development of object databases of which GemStone/S is a great example.
  • Smalltalk gave us the first refactoring browser.
  • Smalltalk was instrumental in developing the graphical user interface (GUI) and the “what you see is what you get” (WYSIWYG) user interface.
  • Steve Jobs was inspired by Xerox PARC’s GUI and WIMP (windows, icons, menus, pointer) to completely realign Apple’s strategy; the GUI was a direct outflow of Smalltalk work.

Emergence: August 1981 BYTE and Apple

Smalltalk was once a very popular language. It made its debut in August of 1981 on the cover of BYTE magazine:

Since then, Smalltalk directly inspired a number of other OOP languages including Objective-C, Python, Ruby, PHP, Perl, Erlang, CLOS, Dart, Java, Groovy, and Scala. Apple even created a Smalltalk for the Macintosh.

Objective-C, in particular, had a powerful impact in the IT industry. Its syntax was essentially a cross between C and Smalltalk.

Objective-C was used to write the NeXTStep operating system for Steve Jobs’ NeXT computer company. NeXTStep eventually evolved into macOS and Objective-C has since been used to write the bulk of iOS apps.

Zenith: The Enterprise Challenge

Smalltalk’s popularity peaked in the 1990s when it was the most popular OOP language after C++. According to a 1995 IDC report, OOP language market shares were:

  1. C++ — 71.3%
  2. Smalltalk — 15.1%
  3. Objective-C — 5.7%
  4. Object Pascal — 4.2%
  5. CLOS — 2.5%
  6. Eiffel — 1.1%
  7. all others — 0.2%

However, C++ was large, complex, and cumbersome to use.

Here’s a page from Computerworld, November 6, 1995, showing Smalltalk and C++ duking it out:

Smalltalk was so good for business use that in the 1990s, IBM chose Smalltalk as the centrepiece of their VisualAge enterprise initiative to replace COBOL:

Java arrived in 1995 and it was free; Smalltalk licensing was expensive.

Java was Internet-ready; Smalltalk was not. Java overtook Smalltalk.

Two free Smalltalk dialects from the 1990s survive to this day: GNU Smalltalk (1991) and Squeak (1996). But it wasn’t enough.

In the early 2000s, the U.S. joint military used Smalltalk to write a million-line battle simulation program called JWARS. It actually outperformed a similar simulation called STORM written in C++ by the U.S. Air Force. That by itself was an astonishing testament to the capabilities of the language.

Redemption: The Seaside Story

Smalltalk redeemed itself in the web space with the Seaside web framework which broke new ground in how to write web applications.

From Seaside’s website, here are the framework’s main selling points:

  • Programmatic HTML generation. A lot of markup is boilerplate: the same patterns of lists, links, forms and tables show up on page after page. Seaside has a rich API for generating HTML that lets you abstract these patterns into convenient methods rather than pasting the same sequence of tags into templates every time.
  • Callback-based request handling. Why should you have to come up with a unique name for every link and form input on your page, only to extract them from the URL and request fields later? Seaside automates this process by letting you associate blocks, not names, with inputs and links, so you can think about objects and methods instead of ids and strings.
  • Embedded components. Stop thinking a whole page at a time; Seaside lets you build your UI as a tree of individual, stateful component objects, each encapsulating a small part of a page. Often, these can be used over and over again, within and between applications — nearly every application, for example, needs a way to present a batched list of search results, or a table with sortable columns, and Seaside includes components for these out the box.
  • Modal session management. What if you could express a complex, multi-page workflow in a single method? Unlike servlet models which require a separate handler for each page or request, Seaside models an entire user session as a continuous piece of code, with natural, linear control flow. In Seaside, components can call and return to each other like subroutines; string a few of those calls together in a method, just as if you were using console I/O or opening modal dialog boxes, and you have a workflow. And yes, the back button will still work.

Teapot is a new micro web framework in the spirit of Python’s Flask and Ruby’s Sinatra.

Front-end web development can be done with Amber Smalltalk and PharoJS.

Regeneration: The Modern Smalltalk

In 2008, Pharo was released. It was an open source Smalltalk modernized for the Twenty-First Century.

Pharo joins the ranks of several language hopefuls, for example, Clojure, Crystal, Dart, Elixir, Elm, F#, Haskell, Haxe, Julia, Nim, Racket, and Rust. The potential is there for Pharo to rise.

The Pharo Consortium helps to make the language enterprise-ready. Some notable Consortium members:

  1. JPMorgan Chase, a major American banking and financial services company
  2. Thales, a giant French engineering firm specializing in aerospace, defence and security
  3. GemTalk Systems, a leading vendor in object-oriented DBMS
  4. Inria, the French Institute for Research in Computer Science and Automation
  5. ESUG (European Smalltalk User Group)

TechBeacon: Advocacy through Social Media

The digital marketing of Smalltalk began in 2015 with a WordPress blog called “Smalltalk Renaissance” and a Medium blog called “Smalltalk Talk.” Dozens of articles were published and promoted through social media.

On July 18, 2016, TechBeacon published an article entitled “How learning Smalltalk can make you a better developer” which launched a second major marketing campaign.

The article has since been read by more than 70,000 people around the globe, including republications.

It has been reprinted at Medium, Tech In Asia, LinkedIn, and a Russian blog called Хабрахабр (Habrahabr).

It has spawned dozens of Smalltalk articles, including several tutorials, promoted through Medium, Hacker News, Reddit, Twitter, Facebook, Google+, LinkedIn, Flipboard, and Quora.

The campaign has been covered in media such as The New Stack and Slashdot.

At Quora, thousands of people who ask what programming language they should use to learn programming receive the stock answer: they should start with Smalltalk!

Smalltalk is the best teaching language because:

  1. It’s one of the simplest and easiest-to-learn languages. It has all of six reserved words! The complete syntax fits on a post card.
  2. It’s purely object-oriented and its clarity and consistency in this regard makes learning object-oriented programming supremely easy.

Object-oriented programming is the most widely used programming paradigm in the IT industry. It is crucial to know OOP well.

Here’s the post card:

Smalltalk can provably make a programmer 2–3X more productive than in any other programming language!

According to a Namcook Analytics study (Table 16), based on “economic productivity” in terms of number of work hours to deliver 1,000 function points, Smalltalk requires 6,879 hours, whereas Python requires 12,697 hours and JavaScript requires 15,929 hours. C requires 26,273 hours!

The key is live coding using Smalltalk’s extraordinary built-in IDE. It’s similar to Visual Studio and Eclipse but much smaller and simpler to use. Here is the Pharo IDE:

Pharo’s System Browser

Conclusion

Alan Kay famously said, “The best way to predict the future is to invent it.” And, indeed, he did this over 40 years ago with the creation of Smalltalk and the embodiment of his vision of object-oriented programming.

Today, Pharo shines like a beacon pointing to the future of software development. The time is long overdue to give Smalltalk a second look.


Published by HackerNoon on 2018/03/05