Development History of the programming language Python-Python tutorial

Source: Internet
Author: User
This article mainly introduces the development history of the programming language Python. This article describes the development history of the Python language in detail. For more information, see Python as my favorite language. it is concise, elegant, and easy to use. Two days ago, I was excited about the benefits of Python to my friends.

"Okay, I admit that Python is good, but why is it called Python ?"

"Well, it seems like the name of a TV series ."

"Are you talking about Guido as an American ?"

"He switched from Google to Dropbox, but his name is Dutch ."

"Are you sure you are familiar with Python ?"

So for shame, I spent time investigating the history of Python. I have seen the sources of many functions in Python and the design concepts of Python, The Evolution history of a programming language, and the wonderful connection between Python and 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.

Origin

The author of Python, Guido von Rosum, is indeed a Dutch. In 1982, Guido received a master's degree in mathematics and computer science 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 to do any programming-related work.

At that time, Guido came into contact 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 set off a wave of PCs, their configurations were low. 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 to enable the program to 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.

This programming method 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 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 short, shell cannot fully mobilize computer functions.

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 the Dutch Institute of Mathematics and Computer Science. Guido works in the institute 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, which is used to count the total number of words in the text:

The code is as follows:


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 define a function. A Python programmer should easily understand this program. The ABC language uses colons and indentation to represent program blocks. There is no semicolon at the end of the line. There are no parentheses () in the for and if structures (). The value assignment uses PUT rather than the common equal sign. These changes make the ABC program read a piece of 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.

I/O 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 prefer to use equal signs to allocate variables. Although the ABC language is very special, it is difficult to learn.

Difficult to disseminate. The ABC compiler is large and must be stored on 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.

In 1989, Guido began to write the Python compiler to pass the Christmas holiday. The Python name is from Guido's beloved TV series Monty Python's Flying Circus. He hopes that the new Python language meets his ideal: to create a fully functional, easy to learn, and extensible language between C and shell. As a language design enthusiast, Guido has tried to design a language. This is just a pure hacking behavior.

The birth of a language

In 1991, the first Python compiler was born. It is implemented in C language and can call library files in C language. Since its birth, Python already has core data types including classes, functions, exception handling, tables and dictionaries, and a module-based extended system.

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, such as regression equal sign assignment. Guido believes that there is no need to be overly entangled in things established in "common sense.

Python was particularly designed for scalability from the very beginning. Python can be expanded at multiple levels. You can directly 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 developed entirely 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. Later, Python was extended beyond the institute. 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. This feature attracts a large number of programmers. Python has become popular.

My life is short. I use python

Heroes of the times

We had to pause our Python time and look at the ever-changing computer industry. 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 and the graphical interface.

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 have frequently used the Internet for communication, such as using 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 decide 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. Because of Guido's supreme decision power, he is called a "lifetime benevolent dictatorship ".

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, regular expressions in the Python standard library refer to Perl, while lambda, map, filter, reduce and other 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, and fund. 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.

Today, the Python framework has been established. The Python language organizes code with objects as the core. it supports multiple programming paradigms, uses dynamic types, and automatically recycles memory. Python supports interpretation and operation, and can call the C library for expansion. Python has a powerful standard library. 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.

Revelation

Python is an excellent and widely used language that advocates elegance, clarity, and simplicity. Python ranks eighth in the tibench ranking. it is Google's third-largest development language, the basic language of Dropbox, and the server language of Douban. The History of Python can be represented by 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. Similarly, 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. In fact, to accept various languages with an open mind, programmers may mix their own languages like Guido on a given day.

Regardless of the future fate of Python, The History of Python is an interesting novel.

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.