5 ms·
I’m still waiting for a Python fork with a static type system :) One step closer.
by hansdieter1337 7y ago
I’m still waiting for a Python fork with a static type system :)
One step closer.
- m_ke 7y agoYou should check this out: https://www.youtube.com/watch?v=Z8vsTxzmorE https://www.youtube.com/watch?v=Z8vsTxzmorE https://openteams.com/initiatives/2 https://openteams.com/initiatives/2 > "We will create an embedded domain specific language (DSL) using the Python language itself along with the typing module and specialized objects as necessary to allow nearly all the existing extensions to be written using this DSL. We will then port several key libraries such as NumPy, SciPy, and Pandas to use this DSL. We will also provide a runtime so these extensions can work on PyPy, C-Python, and RustPython." I'm pretty sure we'll see a strict, typed subset of python that is jitted or compiled at some point in the next few years. Edit: Oh also mypyc https://github.com/python/mypy/tree/master/mypyc https://github.com/python/mypy/tree/master/mypyc
- pjmlp 7y agoA "Crystal" version of Python would be quite sweet, I don't feel Nim is quite it.
- qmmmur 7y agoDepending on what you want Nim is definitely closer than Crystal. Support is better for cross platform and the number of bindings available to C libraries, or true native implementations are growing rapidly. For anything ML look into arraymancer[1]. [1] - https://github.com/mratsim/Arraymancer https://github.com/mratsim/Arraymancer
- chubot 7y agoThanks for that link. In that video Travis Oliphant is proposing "EPython", the goal of which is to allow multiple Python implementations to share the same extensions. Currently NumPy and other extensions are very tightly coupled to CPython. But I just saw a very similar project by the name "HPy" on the PyPy blog: https://morepypy.blogspot.com/2019/12/hpy-kick-off-sprint-report.html https://morepypy.blogspot.com/2019/12/hpy-kick-off-sprint-re... The idea of HPy was born during EuroPython 2019 in Basel, where there was an informal meeting which included core developers of PyPy, CPython (Victor Stinner and Mark Shannon) and Cython (Stefan Behnel). The ideas were later also discussed with Tim Felgentreff of GraalPython, to make sure they would also be applicable to this very different implementation, Windel Bouwman of RustPython is following the project as well. And they even say NumPy is a major use case: Eventually, we will also want to try to port parts of numpy to HPy to finally solve the long-standing problem of sub-optimal numpy performance in PyPy. Anyway there's nothing wrong with competing projects. Progress gets made faster that way. But I guess it's weird that the video and the blog post have very similar dates but don't mention each other. The problem they're solving seems essentially identical, and they even mention all the same Python interpreter implementations.
- zmmmmm 7y agoThey do exist - things like nim [1] for example. The sad fact is that the reason people are not using them is not because they don't exist. It's because the lowest common demoninator of programmer out there prefers dynamically typed Python because the short term is generally more highly valued than longer term or even medium term (6 months+) in the vast majority of programming contexts. [1] https://nim-lang.org/ https://nim-lang.org/
- guggle 7y agoI do like Nim, it has a lot to offer and I hope it will gain traction. But honestly when you want to get things done, it's all about the ecosystem, the libraries, third-party help, etc. All things where Python shines. Python 1.0 was in 1994, Nim 1.0 came in 2019... it needs time.
- j88439h84 7y agoMypyc is like that
- globular-toast 7y agoWhat for? For performance gains? What's wrong with Cython?