A Brief History of Python

Jerry Zhao
12 min readNov 9, 2020

Python is my favourite language, concise, beautiful, and easy to use. Two days ago, I was very excited to promote the benefits of Python to my friends.

After listening to it, my friend asked me: Okay, I admit that Python is good, but why is it called Python?

I’m not sure: Well, it seems to be the name of a TV show.

The friend asked again: Is Guido you mentioned as an American? (Guido von Rossum, author of Python)

I’m not sure again: he switched from Google to work in Dropbox, but his name is Dutch (with a von in the middle).

So, I spent some time investigating the history of Python later. This is good learning. I have seen the source of many functions in Python and the design philosophy of Python, such as which functions are leftover from history, which functions are repetitive, how to add functions… Moreover, Python is also a successful case of the open-source movement. From the history of Python, we can get a glimpse of the concepts and achievements of open source development.

The origin of Python

The author of Python, Guido von Rossum, is indeed Dutch. In 1982, Guido received a master’s degree in mathematics and computer science from the University of Amsterdam. However, although he can be regarded as a mathematician, he enjoys the fun of computers even more. In his words, although he possesses both mathematics and computer qualifications, he always tends to do computer-related work and is keen to do any programming-related work.

At that time, he was exposed to and used languages ​​such as Pascal, C, Fortran, etc. The basic design principle of these languages ​​is to make machines run faster. In the 1980s, although IBM and Apple had set off a wave of personal computers, the configuration of these personal computers was very low (in today’s view). For example, in the early Macintosh, only 8MHz CPU frequency and 128KB RAM, a large array can fill the memory. The core of all compilers is to optimize so that the program can run. In order to increase efficiency, language also forces programmers to think like computers so that they can write programs that are more in line with machine tastes. In that era, programmers could not wait to squeeze every inch of computer power with their hands. Some people even think that C language pointers are a waste of memory. As for dynamic typing, automatic memory management, object-oriented… Don’t think about it, it will paralyze your computer.

However, this way of thinking makes Guido feel distressed. Guido knows how to write a function in C language, but the whole writing process takes a lot of time (even if he already knows exactly how to implement it). His other option is the shell. Bourne Shell has long existed as an interpreter for UNIX systems. UNIX administrators often use shells to write simple scripts to perform some system maintenance tasks, such as regular backups, file system management, and so on. The shell can be like glue, connecting many functions under UNIX together. Many programs with hundreds of lines in the C language can be completed in just a few lines in the shell. However, the essence of the shell is to invoke commands. It is not a real language. For example, the shell has no numeric data types, and addition operations are very complicated. In short, the shell cannot fully mobilize the computer’s functions.

(For shell, you can refer to How Linux Works and The Linux Command Line )

Guido hopes that there is a language that can fully call the computer’s functional interfaces like C language, and can be easily programmed like a shell. ABC language gave Guido hope. ABC was developed by CWI ( Centrum Wiskunde & Informatica, Institute of Mathematics and Computers) in the Netherlands. Guido works at CWI and participated in the development of the ABC language. ABC language is for the purpose of teaching. Unlike most languages ​​at the time, the goal of ABC language was to “make users feel better. ” ABC language hopes to make the language easy to read, easy to use, easy to remember, easy to learn and to stimulate people’s interest in learning programming. For example, the following is an ABC program from Wikipedia, this program is used to count the total number of words that appear in the text:

HOW TO RETURN words document:
PUT {} IN collection
FOR line IN document:
FOR word IN split line:
IF word not.in collection:
INSERT word IN collection
RETURN collection

HOW TO is used to define a function. A Python programmer should easily understand this program. ABC language uses colons (:) and indentation to indicate program blocks (C language uses {} to indicate program blocks). There is no semicolon at the end of the line. There are no parentheses () in the for and if structures. If you change HOW TO to def, change the PUT line to collection = [] and change the INSERT line to collection.append(word), this is almost a standard Python function. The above function reads like a natural text.

Despite having good readability and ease of use, the ABC language did not become popular in the end. At that time, the ABC language compiler needed a relatively high-end computer to run. The users of these computers are usually proficient in computers, and they consider the efficiency of the program more than the difficulty of learning. In addition to hardware difficulties, the design of the ABC language also has some fatal problems:

  • Poor scalability. The ABC language is not a modular language. If you want to add features to the ABC language, such as graphical support, you must change many places.
  • Cannot directly perform IO. The ABC language cannot directly manipulate the file system. Although you can import data through methods such as text streaming, ABC cannot read and write files directly. The difficulty of input and output is fatal to computer languages. Can you imagine a sports car that can’t open the door?
  • Over-renovation. ABC uses natural language to express the meaning of the program, such as HOW TO in the program above. However, for programmers, they are more accustomed to using the function or define to define a function. Similarly, programmers are also used to assigning variables with the equal sign (=). Although this makes the ABC language special, it actually increases the difficulty of learning for programmers (most programmers master more than one language).
  • Difficult to spread. The ABC compiler is large and must be stored on tape. When Guido was visiting, he had to have a large tape to install the ABC compiler for others. In this way, ABC language is difficult to spread quickly.

In 1989, in order to pass the Christmas holiday, Guido began to write a compiler/interpreter for the Python language. Python comes from Guido’s beloved TV series Monty Python’s Flying Circus (BBC 1960s-70s indoor sitcoms, based on British life at the time). He hopes that this new language called Python can realize his idea (a language between C and shell, with comprehensive functions, easy to learn, easy to use, and extensible). As a language design lover, Guido has already had (not very successful) attempts to design languages. This time, it was just a pure hacking behavior.

The birth of Python

In 1991, the first Python compiler (also an interpreter) was born. It is implemented in C language and can call C library (.so file). From its birth, Python has: classes, functions, exception handling, core data types including lists and dictionaries, and module-based Expand the system.

A lot of Python syntax comes from C, but it is strongly influenced by the ABC language. Some regulations from the ABC language are still controversial today, such as mandatory indentation. However, these provisions allow Python syntax content easy to read . On the other hand, Python cleverly chooses to obey some conventions (especially the conventions of the C language). For example, use the equal sign to assign values ​​and use def to define functions. Guido believes that if something is established on “common sense”, there is no need to over-entangle it.

Python has been particularly concerned with extensibility from the beginning. Python can be extended on multiple levels. At a high level, you can import .py files. At the bottom, you can reference C language libraries. Python programmers can quickly use Python to write .py files as extension modules. But when performance is an important factor to consider, Python programmers can go deep into the bottom layer, write C programs, compile them into .so files and import them into Python. Python is like using steel to build a house, first prescribe a big frame. The programmer can expand or change quite freely under this framework.

The original Python was developed entirely by Guido himself. Python is welcomed by Guido colleagues. They quickly gave feedback on usage opinions and participated in the improvement of Python. Guido and some colleagues form the core team of Python. They spend most of their free time hacking Python (including work time because they use Python for work). Subsequently, Python expanded beyond CWI. Python hides many details on the machine level and hands them to the compiler for processing, and highlights the logic of programming thinking. Python programmers can spend more time thinking about the logic of the program, rather than the specific implementation details (Guido has a T-shirt that says: Life is short, I use Python). This feature has attracted the majority of programmers. Python became popular.

We had to pause our Python time and take a look at the computer overview at this time. In the early 1990s, personal computers began to enter ordinary households. Intel released the 486 processor, and Windows released a series of window systems starting with Window 3.0. The performance of the computer is greatly improved. Programmers began to pay attention to the ease of use of computers (such as graphical interfaces).

Due to the improvement of computer performance, the world of software has begun to change accordingly. The hardware is sufficient to meet the needs of many personal computers. Hardware manufacturers are even eager for the emergence of high-demand software to drive the upgrading of hardware. C++ and Java have become popular one after another. C++ and Java provide an object-oriented programming paradigm and a rich object library. At the expense of certain performance, C++ and Java greatly increase the output of the program. The ease of use of the language has been raised to a new level. We still remember that an important reason for the failure of ABC is the performance limitation of the hardware. In this respect, Python is much luckier than ABC.

Another change that has quietly occurred is the Internet. The 1990s was still the era of personal computers. Windows and Intel took advantage of PCs to make the world flourish. Although the Internet-based information revolution has not yet arrived, many programmers and experienced computer users have frequently used the Internet for communication (including email and newsgroup). The Internet greatly reduces the cost of information exchange. A new software development model became popular: open source. Programmers use their spare time for software development and open-source code. In 1991, Linus released the Linux kernel source code on the comp.os.minix newsgroup, attracting a large number of hackers to join. Linux and GNU cooperate with each other and finally constitute a dynamic open-source platform.

Hardware performance is not a bottleneck, and Python is easy to use, so many people are turning to Python. Guido maintains a maillist, and Python users communicate via email. Python users come from many fields, have different backgrounds, and have different needs for Python. Python is quite open and easy to expand, so when users are not satisfied with the existing functions, it is easy to expand or modify Python. Subsequently, these users send the changes to Guido, and Guido decides whether to add new features to Python or the standard library. If the code can be incorporated into Python itself or the standard library, it will be a great honor. Python itself becomes better because of this.

(Guido had to make many decisions, which is why he is called Benevolent Dictator For Life )

Python is called “Battery Included”, which means that it and its standard library are powerful. These are the contributions of the entire community. Python developers come from different fields, and they bring the advantages of different fields to Python. For example, the regular expression in the Python standard library refers to Perl, while the lambda, map, filter, and reduce functions refer to Lisp. Some functions of Python itself and most of the standard library come from the community. The Python community continues to expand and has its own newsgroup, website (python.org), and fund (Python Software Foundation). Starting from Python 2.0, Python has also changed from the email list development method to a completely open-source development method. A community atmosphere has been formed, the work is shared by the entire community, and Python has also achieved a faster development.

(Since Guido enjoys absolute arbitration rights, in the early days of Python maillist development, many enthusiasts were quite worried about Guido’s life. They even made assumptions: If Guido died, what would happen to Python. See If Guido was hit by a bus )

To this day, the framework of Python has been established. Python language organizes code with objects as the core (Everything is object), supports a variety of programming paradigms (multi-paradigm), uses dynamic typing, and automatically performs garbage collection (garbage collection). Python supports interpret and can call the C library for expansion. Python has a powerful standard library (battery included). Since the standard library system has been stable, the Python ecosystem has begun to expand to third-party packages. These packages, such as Django, web.py, wxpython, numpy, matplotlib, PIL, upgrade Python to a species-rich tropical rain forest.

Today Python has entered the 3.0 era. Since Python 3.0 is not backward compatible, the transition from 2.0 to 3.0 is not easy. On the other hand, the performance of Python is still worthy of improvement, and the computing performance of Python is lower than that of C++ and Java (see Google’s discussion ). Python is still a developing language. I look forward to seeing the future of Python.

Python Apocalypse

Python advocates beauty, clarity, and simplicity. It is an excellent and widely used language (TIOBE language ranks eighth, Google’s third-largest development language, Dropbox’s basic language, and Douban’s server language). There is no shortage of excellent languages ​​in this world, but the history of Python as a representative has brought me a lot of enlightenment.

During the development of Python, the community played an important role. Guido thinks he is not an all-round programmer, so he is only responsible for formulating the framework. If the problem is too complicated, he will choose to go around, that is, cut the corner . These issues are ultimately resolved by others in the community. The talents in the community are extremely rich. Even the creation of a website and raising funds are something that is far from development, and some people are willing to handle it. Nowadays, project development is becoming more and more complex and larger, and cooperation and an open mind are the keys to the ultimate success of the project.

Python has learned a lot from other languages, whether it is ABC that has entered history, C and Perl that are still in use, and many other languages ​​that are not listed. It can be said that the success of Python represents the success of all its borrowed languages. Similarly, Ruby draws on Python, and its success also represents the success of some aspects of Python. Every language is a hybrid and has its advantages, but it also has various flaws. At the same time, the judgment of a language’s “good and bad” is often subject to external factors such as platform, hardware, and times. Programmers have experienced many language disputes. I think, why not use an open mind and objective analysis to distinguish the specific advantages and disadvantages of each language, to distinguish internal and external factors. Maybe one day I find that a language I don’t like contains what I need.

Regardless of the future fate of Python, the history of Python is already a very interesting novel.

If you are interested in Python because of this article, welcome to read my Awesome Python Books List.

The main references of this article:

Guido’s speech at Dropbox

--

--