Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Consider LLVM as an alternative to C #1991
Is this on the roadmap?
The benefits of this change could be enormous, not only for performance and compilation speed but for the quality of the generated code and the build system.
Thanks for your time,
Wrong question. If someone implements this, and proves along the way that it's worth doing, then I doubt that we'd reject the pull requests for it.
However, it's not obvious to me that such an approach has advantages. I consider C (and C++) an excellent language target that results in a very high portability. It makes it rather easy for developers to ship the generated C code to their users and have them compile it on their side with pretty much any C compiler. Restricting that to LLVM would in fact reduce the wideness of Cython's applicability.
Could you elaborate what benefits you expect from targeting LLVM specifically instead of generic C?
changed the title from
Consider directly emitting llvm IR
Consider LLVM as an alternative to C
Nov 17, 2017
As far as I know, Nim and Crystal are two languages that emit optimized C code for the sake of performance and portability.
What makes you think C compiles slow?
As far as I can tell, (from a personal experience) it compiles like a bullet comparing it with C++'s compilation time.
Now, about LLVM IR support; how is LLVM supposed to bridge the CPython API with the intermediate representation?
Will it be able to emit CPython extension code without any possible problem?
If you have any example to make it clearer, it would be really interesting to study it.
Another negative impact I see is that it would force developers to use a compiler other than what they actually use or feel comfortable with.
Cython as it is, it works just fine.
All it needs is love and caring around those nasty bugs, that's all.