1

enter image description here NumPy is more the 35% written in other languages how do they work internally?

3

2 Answers 2

1

Python being an interpreted language, code written in it tends to be slow, because the interpreter needs to go through each line of the code being executed

because the performance is everything, modules are written in a lower level language like C which is then compiled to a shared object file. These files can be loaded by the Python interpreter and used like a normal python module. Because these modules are already compiled to machine code, they can be directly executed without going through the interpreter, and thus they are much faster than the equivalent code written in Python.

you can find a lot of modules written in c or c++ with extension .so

Sign up to request clarification or add additional context in comments.

Comments

1

If you are using Python nowadays the most used implementation of Python is CPython wich is written in C, that mean that the interpreter of your python code is written in C

see here the repository of Python on Github,

Using C when creating python allow us to enlarge the ways of possibility

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.