The origins of Python: the ABC language - Rolf Zwart

Tags: python

(Summary of a talk at the Amsterdam python meetup)

How to compare python to ABC? ABC is the unsuccessful language that was the inspiration for python. Guido van Rossum was originally the main implementor of the ABC language.

ABC was intended for the casual user. Home users. But also experts in other fields, but that were not programming experts. The focus was on friendliness of the language and on programmer productivity, not program efficiency.

It also was used as a teaching/research language.

Research on ABC was started before 1980. The first version was released in 1987. In the end of 1989, Guido started developing python, with the 0.9.0 version being released to Usenet in february 1991. His research group needed an easy-to-use scripting language for the distributed OS they were working on, that was why he started building Python. (He chose the name because he was a fan of the English TV series monty python’s flying circus).

ABC was, like python, developed at the CWI (centrum voor wiskunde en informatica) in the Netherlands. The claim of ABC was that the programs build with it were typically around a quarter of the size of the equivalent Pascal or C programs. Some key features:

  • Statement grouping by indentation. Now you know where python got that from!

  • Only two basic data types.

  • Strong dynamic typing.

  • It had an interactive interpreter (nice: it also uses the >>> prompt).

A syntax example:

>>> WRITE 2**1000
1071....
>>> PUT 1/(2*1000) in x
>>> WRITE 1 + 1/x

In python, functions sometimes return something, sometimes not. In ABC, they were different:

>>> HOW TO MAKE fun WITH x:
        function body

>>> HOW TO RETURN pi:
        RETURN ~22/7

Some similarities and features inspired by ABC:

  • Dynamic typing, no type declarations.

  • High level data structures (lists, dicts) that can be combined.

  • Interactive interpreter, >>> prompt.

  • Focus on programmer efficiency.

  • All types have a canonical representation (like __repr__).

  • Readability counts: the syntax should be clean.

  • Grouping by indentation.

  • A block is introduced by a colon (:).

  • Slicing in strings.

  • Automatic garbage collection.

  • The C implementation compiles to byte code. It is interpreted by a high level VM.

ABC also had its problems and deficiencies:

  • It perhaps was ahead of its time.

  • It was too strict, too pure. It tried too hard to be perfect.

  • It wanted to stand on its own, in a closed world, so no interface with the outside world except text via stdin/stdout. Even no file I/O.

  • No interaction with external devices.

    He had to work on interaction with a graphical terminal. To get that to work, he had to hack escape codes into his unix shell to get commands from the closed ABC program to the external terminal…

  • One single namespace (instead of a separate namespace per function/module/etc, for instance, like in python).

The strong points of python:

  • It adopted the well-designed, high level elements of ABC…

  • … but it was pragmatic. It dropped the fundamentalist harness and jargon from ABC.

  • Terminology and notation is familiar from C-like languages.

  • It took good ideas from Smalltalk (OO), modula-3 (modules, exceptions).

  • Interfaces via the OS. No problems with that.

  • Files are OK, of course.

  • Guido released it as open source (well, that term didn’t exist yet, but ok).

A quote by Tim Peters on Python: in many ways, it’s a dull language, borrowing solid old concepts from many other languages & styles: boring syntax, unsurprising semantics, few automatic coercions, etc etc. But that’s one of the things I like about it.

Should you want to look at ABC: https://homepages.cwi.nl/~steven/abc/

 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):