Hacker News new | ask | show | jobs
by sontek 5019 days ago
Whats the benefits of this over cython?
2 comments

From the FAQ:

How is mypy different from Cython?

Cython is a variant of Python that supports compilation to efficient C modules. Mypy differs in the following aspects, among others:

Mypy will have a powerful type system that can detect many type errors while supporting a very Python-like programming model. Cython has simpler types that primarily serve to speed up code.

Mypy will be able to speed up most programs, even programs that heavily use object-oriented features. Cython is primarily focused on speeding up numerical code and tight loops.

Mypy will have new virtual machine that allows speeding up all parts of the VM, including standard libraries and the garbage collector. Cython uses the normal Python VM.

Cython supports accessing C functions directly and many features are defined in terms of translating them to C. Mypy is not bound to any particular target language and can support both C and Java backends, for example. However, accessing C library functionality in mypy will not be as easy as in Cython.

It's a new programming language rather than a tool to generate C code that ties in with the CPython API.