Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Base language of Python

Tags:

python

What is the base language Python is written in?

like image 880
Dewsworld Avatar asked Feb 26 '12 09:02

Dewsworld


People also ask

Is Python built on C or C++?

In Python's tutorial one can read that Python's original implementation is in C; On the other hand, the Python implementation, written in C, (...) I'm very curious why was Python written in C and not C++?

Is Python developed using C?

Python is written in English. It is specification of the language itself. It has official interpreter called CPython which is written in C. Note that CPython is interpreter so it doesn't compile (translate) Python code to C.


2 Answers

You can't say that Python is written in some programming language, since Python as a language is just a set of rules (like syntax rules, or descriptions of standard functionality). So we might say, that it is written in English :). However, mentioned rules can be implemented in some programming language. Hence, if you send a string like 'import this' to that program called interpreter, it'd return you "Zen of Python".

Since most modern OS are written in C, compilers/interpreters for modern high-level languages are also written in C. Python is not an exception - its most popular/"traditional" implementation is called CPython and is written in C.

There are other implementations:

  • IronPython (Python running on .NET)
  • Jython (Python running on the Java Virtual Machine)
  • PyPy (A fast python implementation with a JIT compiler)
  • Stackless Python (Branch of CPython supporting microthreads)
like image 147
Roman Bodnarchuk Avatar answered Sep 28 '22 06:09

Roman Bodnarchuk


The sources are public. Python is written in C (actually the default implementation is called CPython).

like image 29
wRAR Avatar answered Sep 28 '22 05:09

wRAR