A Brief History of Python

Source: Internet
Author: User

Python is a simple, elegant, and easy to use language. Two days ago, I was excited about the benefits of Python to my friends.

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

I'm not sure: Well, it seems like the name of a TV series.

My friend asked: Are you talking about Guido as an American? (Guido von rosum, author of Python)

I'm not sure again: he switched from google to Dropbox, but his name is like Dutch (there is a von in the middle ).

So later I spent some time investigating the history of Python. This is a good learning. I have seen the sources of many functions in Python and the design concepts of Python. For example, what functions are left behind by history, what functions are repeated, and how to add functions ...... In addition, Python is also a successful case of the open source movement. From the history of Python, we can look at the concepts and achievements of open-source development.

This can also be used as an example of my Python quick tutorial.

Python Origin

The author of Python, Guido von rosum, is indeed a Dutch. In 1982, Guido received a master's degree in mathematics and computer from the University of Amsterdam. However, although he is a mathematician, he enjoys the pleasure of computer. In his words, despite his mathematics and computer dual-material qualifications, he tends to do computer-related work and is keen on doing anything programming-related.

Guido von rosum

At that time, he was familiar with and used languages such as Pascal, C, and Fortran. The basic design principle of these languages is to make machines run faster. In 1980s, although IBM and Apple had already set off a wave of PCs, their configurations were very low (in today's opinion ). For example, for the early Macintosh, only 8 MHz CPU clock speed and kB RAM, a large array can occupy full memory. The core of all compilers is optimization so that programs can run. To improve efficiency, the language also forces programmers to think like computers in order to write programs that better suit machine tastes. In that era, programmers were reluctant to extract every inch of computer power from their hands. Some people even think that pointers in C language are a waste of memory. For dynamic types, automatic memory management, object-oriented ...... Don't think about it. It will paralyze your computer.

However, this way of thinking upset Guido. Guido knows how to write a function in C language, but the entire writing process takes a lot of time (even if he knows exactly how to implement it ). Another option is shell. The Bourne Shell has long existed as an interpreter (interpreter) for UNIX systems. UNIX administrators often use shell to write simple scripts for system maintenance, such as regular backup and file system management. Shell can connect many functions in UNIX like glue. Many programs with hundreds of lines in C language can be completed with only a few lines in shell. However, the essence of shell is to call commands. It is not a real language. For example, shell does not have a numeric data type, and addition operations are complex. In summary, shell cannot fully mobilize computer functions.

(For more information about shell, see Linux architecture and Linux Command lines and commands)

Guido hopes to have a language that can fully call computer functional interfaces like the C language, and programming as easily as shell. The ABC language allows Guido to see what they want. ABC was developed by CWI (Centrum Wiskunde & Informatica, Institute of mathematics and computer science) in the Netherlands. Guido works in CWI and participates in the development of ABC. The ABC language aims at teaching. Unlike most languages at the time, ABC aims to "make users feel better ". The ABC language is intended to make the language easy to read, easy to use, easy to remember, and 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 in the text:

 
 
  1. HOW TO RETURN words document: 
  2.    PUT {} IN collection 
  3.    FOR line IN document: 
  4.       FOR word IN split line: 
  5.          IF word not.in collection: 
  6.             INSERT word IN collection 
  7.    RETURN collection 

How to define a function. A Python programmer should easily understand this program. The ABC language uses colons (:) and indentation to represent the program block (the C language uses {} to represent the program block ). 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 def, change PUT row TO collection = [], and Change INSERT row TO collection. append (word), which is almost a standard Python function. The above function reads like a natural text.

Despite the good readability and ease of use, the ABC language is not popular in the end. At that time, the ABC language compiler needed a relatively high-configuration computer to run. These computer users are generally proficient in computers. They are more concerned with program efficiency than their learning difficulty. In addition to hardware difficulties, the design of the ABC language also has some fatal problems:

· Poor scalability. ABC is not a modular language. If you want to add features in the ABC language, such as graphical support, you have to change a lot.

· IO cannot be performed directly. The ABC language cannot directly operate the file system. Although you can import data through text streams, ABC cannot directly read and write files. The difficulty of input and output is critical to computer languages. Can you imagine a sports car that cannot open the door?

· Excessive innovation. ABC expresses the meaning of a program in a natural language, such as how to in the above program ). For programmers, however, they are more accustomed to defining a function using function or define. Similarly, programmers are used to allocating variables with equal signs (=. Although this makes the ABC language appear special, it actually increases the learning difficulty of programmers (most programmers have more than one language ).

· Difficult dissemination. The ABC compiler is large and must be stored on tape (tape. At that time, when Guido was accessing, there was a large tape to install the ABC compiler for others. In this way, the ABC language is difficult to spread quickly.

IBM tape drive: read/write tape

In October 1989, Guido began to write Python compilers/interpreters to pass the Christmas holiday. Python comes from Guido's beloved TV series Monty Python's Flying Cirque (the indoor Scene TV series played by bbc1960-february 1970, taking British life as the material ). He hopes that the new Python language can implement his philosophy (a fully functional, easy to learn, and extensible language between C and shell ). As a language design enthusiast, Guido has tried to design languages (not very successful. This is 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 the C library (. so file ). Since its birth, Python already has core data types including: class, function, exception, and list and dictionary, and a module-based expansion system.

Original Python logo: Designed by Guido's brother Just von rosum

Many Python syntaxes come from C, but are strongly influenced by the ABC language. Some regulations from the ABC language are still controversial today, such as forced indentation. But these syntax rules make Python easy to read. On the other hand, Python's smart choice follows some conventions (especially the C language conventions ). For example, assign values with equal signs and define functions using def. Guido believes that there is no need to be overly entangled in things established in "common sense.

From the very beginning, Python was particularly interested in extensibility ). Python can be expanded at multiple levels. You can introduce the. py file at the higher level. At the underlying layer, You can reference the C language library. Python programmers can quickly use Python to write. py files as expansion modules. However, when performance is an important factor in consideration, Python programmers can go deep into the underlying layer, write C Programs, compile the. so file into Python for use. Python is like building a house with steel structures. It requires a large framework first. In this framework, programmers can freely expand or change.

Initially, Python was completely developed by Guido. Python is welcomed by colleagues from Guido. They quickly gave feedback on usage and participated in Python improvements. Guido and some colleagues form the core Python team. They spent most of their spare time on hack Python (also including working hours because they used Python for work ). Later, Python was extended to CWI. Python hides many machine-level details and gives them to the compiler for processing, highlighting the logic-level 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 attracts a large number of programmers. Python has become popular.

We had to pause our Python time and look at the computer overview. In the early 1990 s, personal computers started to enter ordinary homes. Intel released the 486 processor, and windows released a series of windows systems starting with windows 3.0. The computer performance is greatly improved. Programmers began to focus on the ease of use of computers (bi-shaped interfaces ).

Windows 3.0

With the improvement of computer performance, the world of software has begun to change. Hardware is sufficient to meet the needs of many pcs. Hardware manufacturers even desire the emergence of high-demand software to drive the upgrade of hardware. C ++ and Java have become popular. C ++ and Java provide the object-oriented programming paradigm and rich object libraries. C ++ and Java greatly increase program output at the cost of certain performance. The ease of use of the language has been raised to a new height. We still remember that one important reason for ABC failure is the performance limitation of hardware. In this regard, Python is much luckier than ABC.

Another quiet change is the Internet. In the 1990 s, it was still the era of personal computers. windows and Intel held a peak in the world with PC. Although the Internet-based information revolution has not yet arrived, many programmers and senior computer users are already using the Internet frequently (including email and newsgroup ). Internet greatly reduces the cost of information exchange. A new software development model is becoming popular: open source ). Programmers use their spare time for software development and open source code. In 1991, Linus released the Linux kernel source code in the comp. OS. minix news group, attracting a large number of hackers. Linux and GNU work together to form a dynamic open-source platform.

Hardware performance is not a bottleneck, and Python is easy to use, so many people begin to switch to Python. Guido maintains a maillist, which allows Python users to communicate via emails. Python users come from many fields with different backgrounds and different requirements for Python. Python is quite open and easy to expand. Therefore, when users are not satisfied with the existing functions, it is easy to expand or transform Python. Then, these users send the changes to Guido, and Guido decides whether to add the new features to Python or the standard library. This will be a great honor if the code can be incorporated into the Python itself or the standard library. Python itself has become better.

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

Python is called "Battery sorted ded", which means it and its standard library are powerful. These are contributions of the entire community. Python developers come from different fields and bring their advantages to Python. For example, the regular expression in the Python standard library references Perl, while the lambda, map, filter, and reduce functions refer to Lisp. Some features of Python and most of the standard libraries come from the community. The Python community continues to expand and has its own newsgroup, website (python.org), and fund (Python Software Foundation ). Since Python 2.0, Python has also changed from the maillist development method to a fully open-source development method. The Community atmosphere has been formed, and the work has been shared by the whole community. Python has also achieved a higher speed of development.

(Because Guido enjoys absolute Arbitration rights, many fans are quite worried about the life of Guido in the maillist Development era in the early days of Python. They even made assumptions: what will happen to Python if Guido fails. See If Guido was hit by a bus)

Today, the Python framework has been established. The Python language organizes code (Everything is object) with objects as the core. It supports multiple programming paradigms (multi-paradigm) and uses dynamic typing ), automatic Memory collection ). Python supports interpreting (interpret) and can call the C library for expansion. Python has a powerful standard library (battery supported DED ). As the standard library system has been stable, the Python ecosystem began to expand to third-party packages. These packages, such as Django, web. py, wxpython, numpy, matplotlib, and PIL, upgraded Python to a rich tropical rain forest.

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

Python revelation

Python advocates elegance, clarity, and simplicity. It is an excellent and widely used language (ranking eighth in Tianyi language, Google's third-largest development language, Dropbox's basic language, and Douban's server language ). The world does not lack excellent languages, but the development history of Python, as a representative, has brought me many inspirations.

The community plays an important role in Python development. Guido thinks that he is not a full-fledged programmer, so he is only responsible for formulating the framework. If the problem is too complex, he will choose to bypass, that is, cut the corner. These problems are eventually solved by others in the community. Talent in the Community is exceptionally rich, and some people are willing to deal with the process of creating a website and raising funds, which is a little farther away from development. Today, project development is becoming more and more complex, and cooperation and openness become the key to project success.

Python has learned a lot from other languages, including ABC, C, Perl, and many other languages not listed. It can be said that the success of Python represents the success of all the languages it draws on. In the same way, Ruby draws on Python, and its success also represents the success of Python in some aspects. Every language is a mixture of excellent places, but it also has various defects. At the same time, the judgment of a language "good and bad" is often subject to external reasons such as platforms, hardware, and the times. Programmers have experienced many language competitions. I think, why not distinguish between the advantages and disadvantages of each language with an open mind and objective analysis, and between 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 an interesting novel.

If you are interested in Python in this article, please read my quick Python tutorial.

This article mainly references:

Guido's speech at Dropbox

Http://v.youku.com/v_show/id_XNTExOTc1NTU2.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.