Remix.run Logo
graemep 20 hours ago

The problem with this is that the main value of Python is its ecosystem. SPy aims to be able to import Python libraries, but also not implement all Python features. If you are not 100% compatible how can you reliably import libraries?

SPy seems most likely to be more likely to be appealing as a more Pythonic alternative to Cython rather than a Python replacement.

antocuni 20 hours ago | parent | next [-]

hello, author of the blog post and author of SPy here.

> how can you reliably import libraries?

the blog post specifies it but probably not in great level of detail. Calling python libs from spy will go through libpython.so (so essentially we will embed CPython). So CPython will import the library, and there will be a SPy<=>CPython interop layer to convert/proxy objects on the two worlds.

graemep 19 hours ago | parent [-]

Thanks for the answer. I have to admit I missed the implications of embedding libpython. Sounds great.

rurban 20 hours ago | parent | prev [-]

I did a similar project, a typed perl. cperl. I could import most the modules, and did add types to some of the important modules. Eg testing was 2x faster. I needed typing patches for about 10% for most CPAN packages.

A type is a contract, not a hint!

setopt 19 hours ago | parent [-]

> A type is a contract, not a hint!

In Python it is a hint.

rurban 19 hours ago | parent [-]

Exactly. That was their worst mistake ever

setopt 13 hours ago | parent [-]

I agree. I use Beartype to get runtime type checks, but it shouldn’t be necessary. Some support for type checking, whether at byte compile time or runtime, should land upstream.

almostgotcaught 3 hours ago | parent [-]

Never gonna happen - the fundamental premise of the language is duck typing.