Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can PyPy compile normal Python programs?

normal Programs pypy Python
0
Posted

Can PyPy compile normal Python programs?

0

No, PyPy is not a Python compiler. In Python, it is mostly impossible to prove anything about the types that a program will manipulate by doing a static analysis. It should be clear if you are familiar with Python, but if in doubt see [BRETT]. What could be attempted is static “soft typing”, where you would use a whole bunch of heuristics to guess what types are probably going to show up where. In this way, you could compile the program into two copies of itself: a “fast” version and a “slow” version. The former would contain many guards that allow it to fall back to the latter if needed. That would be a wholly different project than PyPy, though. (As far as we understand it, this is the approach that the LLVM group would like to see LLVM used for, so if you feel like working very hard and attempting something like this, check with them.) What PyPy contains is, on the one hand, an non-soft static type inferencer for RPython, which is a sublanguage that we defined just so that it’s poss

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123