I recall that Google had a project to compile Python to LLVM (Unladen Swallow @ https://code.google.com/archive/p/unladen-swallow/ ), but work stopped on it a long time ago. If I recall it really wasn't that much faster than CPython given the overhead, but it's been a long time; if it was faster I assume it wouldn't have been abandoned.
Quite. Unladen Swallow was unfortunately a failure, in part because LLVM at the time was quite buggy, and in part because LLVM wasn't (isn't?) magic enough to speed up a dynamic language. The blog post here mentions they do their own optimization passes, before handing over to LLVM. I imagine that's pretty important.
Mapping Python to LLVM
31–34 of 34 posts
Re: Mapping Python to LLVM
#32Earlier quoted context omitted.
Quite. Unladen Swallow was unfortunately a failure, in part because LLVM at the time was quite buggy, and in part because LLVM wasn't (isn't?) magic enough to speed up a dynamic language. The blog post here mentions they do their own optimization passes, before handing over to LLVM. I imagine that's pretty important.
LLVM really wasn't that buggy at the time (circa 2009); the project I was using it for at the time, a .NET compiler that targeted video game consoles, was quite stable from a code generation point of view, and we were shipping games with it.
[1] https://qinsb.blogspot.com/2011/03/unladen-swallow-retrospec...
Re: Mapping Python to LLVM
#33Re: Mapping Python to LLVM
#34Earlier quoted context omitted.
LLVM has an optimization pass that takes care of that. https://llvm.org/docs/Passes.html#passes-mem2reg
That's not the only way to do that tho? Or is that the recommended way to do it?