Is the bottom layer of Python written in C?

爱喝马黛茶的安东尼
Release: 2019-06-19 13:45:22
Original
10411 people have browsed it

Is the bottom layer of Python written in C?

The bottom layer of python is written in c. Let me introduce to you the connection between Python and c:

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 libraries (.so files). Since its birth, Python has had: classes, functions, exception handling, core data types including lists and dictionaries, and module-based Expand the system.

Guido hopes to have a language that can fully call the functional interface of the computer like C language, and can be easily programmed like shell. The ABC language gave Guido hope. ABC was developed by CWI (Centrum Wiskunde & Informatica, Mathematics and Computer Research Institute) in the Netherlands. Guido works at CWI and is involved in the development of the ABC language. ABC language is for teaching purposes. Unlike most languages ​​at the time, the goal of the ABC language was to "make users feel better." ABC Language hopes 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.

Related recommendations: "Python Video Tutorial"

Python and c

Many of Python syntax comes from C, but it is also influenced by ABC Strong influence of language. Some rules from the ABC language are controversial to this day, such as forced indentation. But these syntax rules make Python easy to read. Python, on the other hand, cleverly chooses to obey some conventions (especially those 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 based on "common sense", there is no need to get too hung up on it.

Python has paid special attention to extensibility (extensibility) from the beginning. Python can be expanded on multiple levels. At a high level, you can import .py files. Under the hood, you can reference C libraries. Python programmers can quickly use Python to write .py files as expansion 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 introduce them into Python for use. Python is like building a house with steel. First define the large frame. Programmers can expand or change quite freely under this framework.

The original Python was developed entirely by Guido himself. Python is popular among Guido's colleagues. They provide quick feedback and participate in Python improvements. Guido and some colleagues form the core team of Python. They spend most of their free time hacking Python (including work time, since they use Python for work). Subsequently, Python expanded beyond CWI. Python hides many machine-level details and leaves them to the compiler to handle, and highlights logical-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 reads: Life is short, I use Python). This feature attracts a large number of programmers. Python became popular.

Development of python

Today, the framework of Python has been established. The Python language organizes code with objects as the core (Everything is object), supports multiple programming paradigms (multi-paradigm), uses dynamic typing, and automatically performs memory recycling (garbage collection). Python supports interpreting and can call C libraries for expansion. Python has a powerful standard library (battery included). Since the standard library system has stabilized, the Python ecosystem has begun to expand to third-party packages. These packages, such as Django, web.py, wxpython, numpy, matplotlib, PIL

Python has learned a lot from other languages, whether it is ABC that has entered history, or C and Perl that are still in use, and many No other languages ​​listed. It can be said that Python's success represents the success of all the languages ​​it draws from. Similarly, Ruby borrows from Python, and its success also represents the success of Python in some aspects. Every language is a hybrid, with its strengths and weaknesses. At the same time, the judgment of "good or bad" of a language is often subject to external factors such as platform, hardware, era, etc.

The above is the detailed content of Is the bottom layer of Python written in C?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!