Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this be a better Cython? #1

Open
honnibal opened this issue Jun 26, 2015 · 8 comments
Open

Can this be a better Cython? #1

honnibal opened this issue Jun 26, 2015 · 8 comments

Comments

@honnibal
Copy link

I find this very interesting.

My main project, the spaCy NLP pipeline, is written in Cython. Cython's great and terrible — it's a messy language, but it allows a lot.

I've often thought what a cleaned-up version could look like, if it didn't have to maintain compatibility, and could just be its own language.

So: have you thought about generating Python extension modules with this? Really it shouldn't be so hard, I'd think.

@alehander92
Copy link
Owner

What do you mean by that, generating Python extension modules from Hermetic code, or supporting some standard kind of C extension modules, that can be used from Hermetic?

@frol
Copy link

frol commented Jun 27, 2015

@alehander42 I am interested to hear about both described situations. And also what about performance? Does it improve (I hope so)?

There is also Nuitka project, that compiles Python 2/3 into shared libraries or executables via LLVM, but it bundles libpython, which is good from compatibility point of view (it compiles any valid Python 2/3 code without any problem), but performance is still limited by CPython implementation. My extra question would be: how compatible hermetic with Python 3 (it seems that it should work fine if I use static typing everywhere, but I would like to double-check)?

@Carreau
Copy link

Carreau commented Jun 27, 2015

What do you mean by that, generating Python extension modules from Hermetic code, or supporting some standard kind of C extension modules, that can be used from Hermetic?

I think it means generating a .so that export its function through a Python API, a bit like CFFI, so it's easy to port only part of a project to this.

@datnamer
Copy link

datnamer commented Jan 5, 2017

@honnibal perhaps you would be interested in the discussion here: python/mypy#1862

@zanellia
Copy link

This project looks very interesting! Where can I find more info about which features are/are planned to be implemented?

@alehander92
Copy link
Owner

Hey, thank you for the interest.

This project remains only a proof of concept. Attaching different type systems to a small language core(e.g. subset of Python) is very interesting, but if there are usecases for that, I'd rather implement it again in a better way making it easy to add custom type systems.

What is your usecase for it ? (Or is it just general interest?) If you want something closer to Python but with a powerful type system, you have to try Nim : it also has great metaprogramming and it's very fast. (And it's already used for some science libraries)

If you're interested in Python language experiments, I was more focused on pseudo-python which I'll probably continue develop in one way or another one day

@zanellia
Copy link

Just general interest, I would say. I would definitely use a high-level language from which I could generate standalone C/C++ code.

Nim looks like a great option, especially given the fact that it can generate completely standalone C code (unlike Cython-like projects). Thanks for the tip.

I was indeed having a look at pseudo-python and pseudo too. Are you still planning to implement support for C++ and support for multi-file projects?

@alehander92
Copy link
Owner

Probably, when I hit a period with some more free time. However even then pseudo-python would be limited without a system to specify dependency interfaces (which would be neeeded to use native libraries with it).

Nim is excellent at interoperating with C/C++ code, so it's just way more real world ready (however depending on the usecase pseudo can still be useful with some more work)

Repository owner deleted a comment Feb 3, 2024
Repository owner deleted a comment Feb 3, 2024
Repository owner deleted a comment from akashakki Mar 1, 2024
Repository owner deleted a comment from thangtq-pionero Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants