SPy: a new companion static language for Python; thoughts?

Hello,

Do any of you follow SPy (https://github.com/spylang/spy), the new statically compiled variant of Python created by Antonio Cuni?

I have been looking into it recently and became convinced it could have a significant impact on the Python ecosystem, including for numerical computing and libraries like NumPy. I wrote up my thoughts in a post entitled “SPy: a vision for its impact on the Python community”:

https://fluiddyn.pages.heptapod.net/spy-book/impact-on-python/

I would be very interested to hear what this community thinks, both about SPy itself and about the ideas in the post.

Pierre Augier
(CNRS researcher in fluid mechanics, Grenoble)

I’m maintaining several small packages and applications and I think SPy looks very promising.
I typically have a small section of the code where I use dynamic features of python, e.g. to set everything up properly. But I also have a huge chunk of code where I use a very restricted set of python. This code is normally fully annotated with type hints so I am already doing all the hard work. I might as well benefit from the compile time checks and the speed boost.

I guess the success will come down to the ergonomics.
How easy is it to call redshifted python code from “normal” python:
E.g. can I develop a library in SPy with an interface in normal python that I can distribute through pypi?

at the moment SPy offers only a limited and low-level way to integrate with CPython: you can compile a spy module using spy build –output-kind=py-cffi and you get a CFFI module which you can then compile and distribute as a CPython extension “as usual”.

The low-level inteface is good enough to pass simple arrays, numbers and structs, but e.g. there is no way to define a custom type.

Eventually, the plan is to write a full SPy/CPython integration layer which will allow to import CPython modules into spy and viceversa, but it’s not there yet.

Thanks for your reply. That’s unfortunate but I guess I’ll just have to wait.
Just food for thought:
If there is an easy (and documented) way to call SPy code from CPython I could imagine already trying to port some parts of my libraries and provide real world (SPy beginner) feedback.
I’m aware that you’re at a very early stage and things are more pressing (e.g. I would also require a byte type).

I think it’s a very interesting project and I’ll definitely keep an eye on it.