Re:Python C API, PyPy and the road into the future
by andreasvc on Monday November 16, 2015 @09:14PM
(#10578770)
You have a point that adding static types can mean having to rewrite. But in practice I often start out with Cython and static types, making this a non-issue. If you use Cython in this way it can approach C with Python syntax. See also http://spacy.io/blog/writing-c-in-cython/
Re:Python C API, PyPy and the road into the future
by pathsjs on Tuesday November 17, 2015 @03:22AM
(#10579823)
I am not only saying that one needs to write things differently in Cython. I am arguing that the whole language needs to be designed differently, to take into consideration the presence of types. This includes adding features to recover the lost dynamism, such as interface or macros, and modifying the standard library to a style that best suits a typed language. Just grafting types onto Python is not enough
Re:Python C API, PyPy and the road into the future
by andreasvc on Tuesday November 17, 2015 @07:11AM
(#10580544)
> I am arguing that the whole language needs to be designed differently
No I think you are arguing that you want it to be designed differently. It's like the contrast between having a high and low level language (Python, C/Cython) versus having a unified middle-level language such as Julia (see http://graydon2.dreamwidth.org/189377.html ). It's a matter of preference which is better, and an empirical matter which approach will be more successful in the end.
> Just grafting types onto Python is not enough
Clearly it is already successful though...
Now, a core principle in the design of Cython is to be as much as possible source compatible with Python, which is a language without static types. This is not a very good principle for me - I would rather work in a language that is not literally identical to Python, but has its own design. Adding static types often requires to do things slightly differently. In Nim a find a very principled and well designed language, and PyMod seems a great to tool to make interoperability with Python easy.