Why AI runs on Python: NumPy's creator, Anaconda's CEO and Mojo's designer explain
Travis Oliphant tells how NumPy united a split community and became the foundation of array and tensor computing in Python, Peter Wang explains what made him fall in love with Python and why the scientific Python stack emerged as it did, and Chris Lattner builds Mojo as a superset of Python because of Python's strengths. Their accounts explain how a language designed for readability ended up as the working language of science and AI, and what its builders are doing about its speed.
What two features made Travis Oliphant keep Python in 1997? Show answer
It had an array library, Numeric, and it supported complex numbers, which he calls essential for engineers.
What moment made Oliphant fall in love with Python? Show answer
In 1998 he reread code he had written a year earlier and could still understand it, unlike his Perl code.
What problem did NumPy solve? Show answer
By 2004 the community was splitting between two array libraries, Numeric and Numarray, which couldn't share data, so Oliphant merged them into one.
When did Oliphant know NumPy had succeeded? Show answer
In 2006, when John Hunter made it a hard dependency of Matplotlib.
Why can NumPy be slower than plain Python? Show answer
Its universal functions carry machinery for broadcasting and type casting, so on single numbers plain Python wins; arrays pay off on larger, compute-bound problems.
How do you speed up a custom Python loop with Numba? Show answer
Add the @jit decorator; Numba infers types and compiles that typed subset of Python through LLVM.
Where does Peter Wang say the great scientific Python projects came from? Show answer
From domain experts scratching their own itch, a kind of "me first collaboration" that no hedge fund could have hired for.
What does Wang say kept Python alive through the move to Python 3? Show answer
The explosion of data science, whose users now make up over half the community.
What does Chris Lattner name as Python's main weakness? Show answer
Speed. Much of it comes from CPython being an interpreter that treats every value as a heap-allocated, reference-counted object, plus the global interpreter lock.
Why is Mojo a superset of Python rather than a new language? Show answer
Lattner learned from Clang that it is easier for engineers to build compatibility than to make programmers rewrite their code, so Mojo keeps Python code working.
How should you set up a Python environment, according to Oliphant? Show answer
Use Conda for the big compiled packages, then pip install the smaller pure-Python ones on top.
What is the data-apis.org effort trying to do? Show answer
Create one unified API across array libraries such as NumPy, PyTorch and TensorFlow, rather than merge them into one array.