Earlier quoted context omitted.
Writing a much faster language runtime for a language that looks quite a bit like Python is easy. The hard problem is writing a faster language runtime that is 100% compatible with all current python programs (and their extensions) out in the world.
But this is not necessary. The python developers just need to specify this fast subset of the language, and let people use to create libraries. Over time, we would have a growing set of libraries written in the fast subset.
Cython is 20
41–50 of 71 posts
Re: Cython is 20
#42Re: Cython is 20
#43I love Cython. I really feel like it's the right balance of usability and allowing you to do what you want/need. Want to make your code a bit faster? Write Python with type annotations. Want to call a C library? Just import the header, and then use it from a function. Pybind11 is also great, but quite different in aims - I feel like it's more like a project for C++ programmers wanting to expose functionality to Pytho…
Python with type annotations isnt faster using python runtime. But some packages can utilize it for higher performance but most of the time it'll be slower cause you need to parse extra information if you want to reuse it in pure python.
Re: Cython is 20
#44Earlier quoted context omitted.
But this is not necessary. The python developers just need to specify this fast subset of the language, and let people use to create libraries. Over time, we would have a growing set of libraries written in the fast subset.
People have. See PyPy and Pythran for two examples currently under active development. Instagram has such a project as well that they recently released. I know there have been others. None of them seem to catch on. It seems that most people don't actually want a faster subset of python. They want either all of python or none of python (by switching to another language all together)
I would guess that there's a clear separation of responsibilities, and each of the two languages is very well-suited to what it's being used for. There's not really a whole lot of anxiety about getting Lua (or whatever) to pull out all the stops you see in a compiler like SBCL or interpreter like V8, because these communities were never looking for a single language that could cover all uses cases in the first place. To steal an analogy I used the other day from myself, I'm guessing they don't want a spork all that badly because they're plenty happy with using a fork and a spoon.
That's how the community of people doing scientific computing and suchlike in Python tends to feel about things, too.
Re: Cython is 20
#45I love Cython. I really feel like it's the right balance of usability and allowing you to do what you want/need. Want to make your code a bit faster? Write Python with type annotations. Want to call a C library? Just import the header, and then use it from a function. Pybind11 is also great, but quite different in aims - I feel like it's more like a project for C++ programmers wanting to expose functionality to Pytho…
Python with type annotations isnt faster using python runtime. But some packages can utilize it for higher performance but most of the time it'll be slower cause you need to parse extra information if you want to reuse it in pure python.
Re: Cython is 20
#46I believe there was a time very early on (like 2003) when there was discussion about maybe including Pyrex in CPython proper to get a more Common-Lisp like gradually typed system. (I mostly recall some comment of Greg's along the lines of being intimidated by such. I'm not sure how seriously the idea was entertained by PyCore.)
Re: Cython is 20
#47Earlier quoted context omitted.
Julia is great if you can afford to spend 5 minutes sitting around for your session to load, but most people have things to do.
How many times a day are you starting sessions?
Re: Cython is 20
#48Earlier quoted context omitted.
Julia is great if you can afford to spend 5 minutes sitting around for your session to load, but most people have things to do.
Julia has its own heap of issues, but five minutes is a load of bull: > time julia -e 'using Plots; plot(rand(10, 5), rand(10))' ________________________________________________________ Executed in 5.77 secs fish external usr time 5.74 secs 214.00 micros 5.74 secs sys time 0.57 secs 0.00 micros 0.57 secs This is also on a fairly old version at that: > julia -v julia version 1.6.3 Regardless, this conversation was to…
Re: Cython is 20
#49I would recommend considering using NanoBind, the follow up of PyBind11 by the same author (Wensel Jakob), and move as much performance critical code to C or C++. https://github.com/wjakob/nanobind If you really care about performance called from Python, consider something like NVIDIA Warp (Preview). Warp jits and runs your code on CUDA or CPU. Although Warp targets physics simulation, geometry processing, and proced…