3 ms·
I will try to give my 2 cents. As you correctly state, Cython is in effect another language. Now, a core principle in the design of Cython is to be as much as
by pathsjs 11y ago
I will try to give my 2 cents. As you correctly state, Cython is in effect another language.
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.
- andreasvc 11y agoYou 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/ http://spacy.io/blog/writing-c-in-cython/
- pathsjs 11y agoI 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
- andreasvc 11y ago> 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 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...