Re:Show HN: A Python with Hindley-Milner-like type annotatio...
by strictfp on Friday June 26, 2015 @01:43AM
(#9782669)
A typed and fast Python with concurrency is something I've wanted for the longest time. I really hope that this will take off.
[ Parent
| on HN ]
Re:Show HN: A Python with Hindley-Milner-like type annotatio...
by david-given on Friday June 26, 2015 @04:12AM
(#9782950)
Have 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-Programm... 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.
Re:Show HN: A Python with Hindley-Milner-like type annotatio...
by dagw on Friday June 26, 2015 @04:03AM
(#9782928)
Have 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).
Re:Show HN: A Python with Hindley-Milner-like type annotatio...
by kevin_thibedeau on Friday June 26, 2015 @08:32AM
(#9783847)
+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.
Re:Show HN: A Python with Hindley-Milner-like type annotatio...
by dagw on Friday June 26, 2015 @09:33AM
(#9784166)
Complex 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.
Re:Show HN: A Python with Hindley-Milner-like type annotatio...
by Fede_V on Friday June 26, 2015 @09:48AM
(#9784280)
Yes, 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.