The history of programming language Python

Source: Internet
Author: User
Python is my favorite language, concise, beautiful, easy to use. Two days ago, I was passionate about the benefits of Python to my friends.

"Well, I admit Python is good, but why is it called Python?" ”

"Well, it seems to be the name of a TV show. ”

"Are you Guido an American?" he said. ”

"He switched from Google to Dropbox, but his name looked like a Dutch man. ”

"Are you sure you're familiar with Python?" ”

So for revenge, I took the time to investigate the history of Python. I saw the origins of many features in Python and Python's design philosophy, and saw the evolutionary history of a programming language, and saw the fascinating link between Python and the open source movement. From the history of Python, we have a glimpse into the ideas and achievements of open source development.

This can also be used as a preface to the Python quick tutorial I wrote.

Origin

The author of Python, Guido von Rossum, is really Dutch. Guido received a master's degree in mathematics and computer Science from the University of Amsterdam in 1982. However, even though he is a mathematician, he enjoys the pleasure of computer. In his words, despite his mathematical and computer credentials, he tends to do computer-related work and is passionate about doing anything and programming.

At that time, Guido contacted and used languages such as Pascal, C, and Fortran. The basic design principles of these languages are to allow machines to run faster. In the 80 's, although IBM and Apple have set off a wave of personal computers, the configuration of these PCs is low. For example, the early Macintosh, only 8MHz CPU frequency and 128KB of RAM, a large array can fill the memory. The core of all compilers is to do optimizations so that the program can run. To improve efficiency, language also forces programmers to think like computers so that they can write programs that are more machine-flavored. In those days, programmers wanted to squeeze every inch of the computer's ability with their hands. Some people even think that the C language pointer is wasting memory. As for dynamic types, memory auto-management, object-oriented ... Don't think about it, it will paralyze your computer.

This way of programming makes Guido feel distressed. Guido knows how to write a function in C, but the whole writing process takes a lot of time, even if he knows exactly how to implement it. Another option for him is the shell. The Bourne shell has long existed as an interpreter for UNIX systems. UNIX administrators often use the shell to write simple scripts to perform some system maintenance tasks, such as regular backups, file system management, and so on. The shell can connect many of the features under UNIX, just like glue. Many of the C-language hundred lines of the program, under the shell only a few lines can be completed. However, the nature of the shell is to invoke the command. It's not a real language. For example, the shell has no numeric data type, and the addition operation is complex. In short, the shell does not fully mobilize the function of the computer.

Guido wants to have a language that, like the C language, can fully invoke a computer's functional interface, and can be easily programmed like a shell. ABC language let Guido see hope. ABC was developed by the Dutch Institute of Mathematics and Computer science. Guido worked at the institute and was involved in the development of the ABC language. The ABC language is aimed at teaching. Unlike most languages at the time, the goal of the ABC language is to "make users feel Better". ABC language wants to make language easy to read, easy to use, easy to remember, easy to learn, and to inspire people to learn programming interest. For example, here is an ABC program from Wikipedia, which is used to count the total number of words that appear in the text:

Copy the Code code as follows:


How to RETURN words document:

PUT {} in Collection

For line in document:

For word in the split line:

IF Word not.in Collection:

INSERT Word in Collection

RETURN Collection

How to defines a function. A Python programmer should be able to understand this program very easily. The ABC language uses colons and indents to represent the program block. There is no semicolon at the end of the line. There is also no parentheses () in the for and if structures. The assignment takes a put instead of a more common equals sign. These changes make the ABC program read like a piece of text.

Despite the good readability and ease of use, the ABC language was not in vogue at the end. At the time, the ABC language compiler needed a high-profile computer to run. Users of these computers are usually proficient in computers, and they think more about the efficiency of the program than the difficulty of learning it. In addition to hardware difficulties, the design of the ABC language also has some fatal problems:

Scalability is poor. The ABC language is not a modular language. If you want to add functionality to the ABC language, such as graphical support, you have to change a lot of places.

IO cannot be done directly. The ABC language cannot directly manipulate the file system. Although you can import data in a way such as text flow, ABC cannot read and write files directly. The difficulty of input and output is fatal for computer language. Can you imagine a sports car that can't open the door?

Over-innovation. ABC uses natural language to express the meaning of the program, such as how to in the above program. For programmers, however, they are more accustomed to using functions or define to define a function. Similarly, programmers are more accustomed to assigning variables with equal signs. Although the ABC language is very special, it is very difficult to learn.

Transmission difficulties. The ABC compiler is large and must be stored on tape. When Guido was visiting, it was necessary to have a large magnet brought to someone to install the ABC compiler. In this way, the ABC language is difficult to spread quickly.

In 1989, in order to pass the Christmas holiday, Guido began to write the Python language compiler. The name Python, from Guido's beloved TV show Monty Python's Flying Circus. He hoped that the new language, called Python, would fit his ideals: create a language that is all-powerful, easy to learn, easy to use, and extensible, between C and Shell. As a language design enthusiast, Guido has tried to design the language. This time, it was just a purely hacking act.

The birth of a language

1991, the first Python compiler was born. It is implemented in C language and can call the C language library file. From birth, Python already has: classes, functions, exception handling, core data types including tables and dictionaries, and module-based expansion systems.

Many of the python grammars come from C, but are strongly influenced by the ABC language. Some of the rules 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 clever choices obey some conventions, especially those of the C language, such as the return equal value assignment. Guido that if the "common sense" on the establishment of things, there is no need to over-tangled.

Python has been particularly concerned about extensibility from the start. Python can be expanded on multiple levels. From the top, you can directly introduce the. py file. At the bottom, you can reference the C-language library. Python programmers can quickly use Python to write. py files as an extension module. But when performance is an important factor to consider, Python programmers can drill down to the bottom, write C programs, and compile into. So files for use in Python. Python is like a steel building, with a large frame set up first. And programmers can be quite free to expand or change in this framework.

The original python was developed entirely by Guido himself. Python has been welcomed by Guido colleagues. They quickly feedback the use of comments and participate in Python improvements. Guido and some colleagues form the core team of Python. They used most of their spare time to hack Python. Later, Python expanded beyond the Institute. Python hides many of the details at the machine level, handing it over to the compiler, and highlighting logic-level programming thinking. Python programmers can spend more time thinking about the logic of the program than the specifics of the implementation. This feature attracts a large number of programmers. Python is getting popular.

Life is short, I use Python

The Times Create Heroes

We had to pause our Python time and take a look at the ever-changing computer industry. In the early 1990, the PC began to enter the ordinary family. Intel released 486 processors, and Windows released a series of windowing systems starting with Window 3.0. The performance of the computer is greatly improved. The programmer began to focus on the ease of use of the computer, compared to the form of interface.

Windows 3.0

With the improvement of computer performance, the world of software has also begun to change. The hardware is sufficient to meet the needs of many PCs. Hardware vendors are even eager for high-demand software to drive hardware upgrades. C + + and Java are popular in succession. C + + and Java provide an object-oriented programming paradigm, as well as a rich library of objects. At the expense of a certain performance, C + + and Java greatly increase the output of the program. The ease of language is referred to as a new height. As we recall, an important reason for ABC failure is the performance limitations of the hardware. In this respect, Python is much luckier than ABC.

Another change that quietly happens is the internet. The 1990 's was the era of personal computers, with Windows and Intel carrying PCs to make the world flourished. Although the Internet-centric information revolution has yet to come, many programmers and veteran computer users have been using the Internet for frequent communication, such as using email and newsgroup. The internet has greatly reduced the cost of information exchange. A new model of software development has become popular: open source. Programmers use their spare time to develop software and open the source code. In 1991, Linus released the Linux kernel source code on the Comp.os.minix News group, attracting a large number of hacker to join. Linux and GNU work together to form a vibrant open-source platform.

Hardware performance is not a bottleneck, and Python is easy to use, so many people start turning to Python. Guido maintains a Maillist,python user to communicate via email. Python users come from many fields, have different backgrounds, and have different needs for python. Python is fairly open and easy to expand, so it's easy to expand or transform Python when the user isn't satisfied with the existing functionality. These users then send the changes to Guido, and the Guido decides whether to add new features to Python or the standard library. This would be a great honor if the code could be incorporated into Python itself or the standard library. Because of the supreme decision of Guido, he was called the "Benevolent dictator of Life".

Python, known as "Battery Included", is a powerful feature of its standard library. These are the contributions of the Community as a whole. Python's developers come from a variety of fields, and they bring the benefits of different areas to python. For example, the regular expressions in the Python standard library refer to Perl, while the lambda, map, filter, and reduce functions refer to Lisp. Some of the features of Python itself and most of the standard libraries come from the community. The python community is expanding to have its own newsgroup, websites, and funds. Starting with Python 2.0, Python has also shifted from Maillist's development approach to fully open source development. Community atmosphere has been formed, work is shared by the entire community, Python has also been more rapid development.

To this day, the Python framework has been established. The Python language organizes code with objects as its core, supports multiple programming paradigms, and uses dynamic types to automate memory recovery. Python supports interpretation runs and can call the C library for expansion. Python has a strong standard library. As the standard library system is stable, the Python ecosystem begins to expand to third-party packages. These packages, such as Django, web.py, Wxpython, NumPy, Matplotlib, and PIL, have upgraded python to a species-rich rainforest.

Revelation

Python advocates beauty, clarity and simplicity, and is an excellent and widely used language. Python ranked eighth in the Tiobe rankings, Google's third-largest development language, Dropbox's base language, and Watercress's server language. The history of Python can serve as a representative and give me a lot of revelation.

The community has played an important role in Python's development process. Guido thinks he is not an all-powerful programmer, so he is only responsible for framing. If the problem is too complicated, he will choose to go around, that is, cut the corner. These issues are ultimately addressed by others in the community. The people in the community are exceptionally rich, and even creating a website, raising funds and so on with the development of something far away, there are people willing to deal with. Today's project development is becoming more complex, larger, more collaborative, and open-minded as the key to the ultimate success of the project.

Python has learned a lot from other languages, whether it's ABC, which is already in the history, or the C and Perl that are still in use, and many other languages that are not listed. It can be said that Python's success represents the success of all the languages it draws upon. Similarly, Ruby draws on Python, and its success also represents some aspects of Python's success. Every language is a mixture, has its excellent place, but also has a variety of defects. At the same time, a language "good and bad" judgment, often constrained by the platform, hardware, the Times and so on external reasons. Programmers have been through a lot of language battles. In fact, with an open mind to accept the language, perhaps one day, the programmer can also be as Guido as a mixture of their own language.

Regardless of Python's future destiny, Python's history is already an interesting novel.

  • Related Article

    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.