4 ms·
A typed and fast Python with concurrency is something I've wanted for the longest time. I really hope that this will take off.
by strictfp 11y ago
A typed and fast Python with concurrency is something I've wanted for the longest time. I really hope that this will take off.
- dagw 11y agoHave you looked at cython? It's (optionally) typed, fast (with only a little bit of effort extra effort over writing normal python), makes the GIL optional (for a reasonable subset of cases) and, most importantly, stable and ready to use today (so no waiting).
- Demiurge 11y agoYes, Cython is exactly that, typed python.
- kevin_thibedeau 11y ago+1 for cython. The only criticism I could make is that the real speedups come when you can avoid using PyObjects which means the easiest way to employ it is in the inner loops of numeric code where it truly is phenomenal. Complex data structures have to be boiled into C-style structs to get any significant speedup with them although there is still a base level performance boost from having everything compiled into cpython API calls.
- dagw 11y agoComplex data structures have to be boiled into C-style structs to get any significant speedup I've never really played with it, but cython does have mappings between python builtin types and STL containers, as well as letting you create C++ classes using cython syntax that you can inherit from and access in python.
- Fede_V 11y agoYes, that's correct, but if you are using semi-complex objects, then you have to invoke the python interpreter and lose most of the advantage of going to Cython in the first place. Even for things like ints, floats, etc - if you want to see a significant speed up, you have to convert them into c ints and floats.
- david-given 11y agoHave you tried Nim? The syntax is Python-inspired rather than Python-like, but it seems to combine a lot of the nice features of dynamic languages with the rigour of a static language. https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programm... http://nim-lang.org/ http://nim-lang.org/ Haven't played with it myself, as I'm still waiting for a compiler to show up in Debian, but I plan to.