Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
That doesn't even make any sense. You'd just slow down the runtime by basically evaluating everything twice.
-
@nitwhiz They boast it's faster because it's a JIT interpreter.
And to be fair as soon as the interpreter is interpreted it doesn't need to be interpreted again -
@AlgoRythm what. Still you'd have to interpret the statement "alloc memory" and tell the engine to do so. With pypy it's intetpreting "alloc memory", issues "alloc memory", which then is interpreted by the engine. Or not?
-
@nitwhiz While there are more steps involved, it isn't equivalent to interpreting something twice as if reading the same file twice
-
@AlgoRythm the thing that makes me wonder.. if there is such a weird workaround to gain performance, wouldn't be implemented already?
-
@nitwhiz Actual production CPython moves somewhat slowly. Read up on their GIT (different from JIT) issue :)
Implementing JIT would require large portions of the codebase to be re-written -
ojrask2915y@nitwhiz it is actually faster than CPy but consumes much more memory from what I've heard.
-
For clarification PyPy isn't written in normal Python, but RPython.
It is a special language by the PyPy team to create JIT compiled interpreters for any language. This is the reason PyPy may actually be faster for Python code (overall faster, but depends on the code).
The downside is a "warmup phase" (to determine which code can be practically compiled natively?), higher memory usage (at least on my systems) and slow interaction with C modules (as long as not accessed by CFFI).
There also exists a PyPy variant without GIL for x64-Linux. -
@ewpratten Most languages end up doing that. Java, for example, is largely implemented in Java. I'm sure you know more than me about c compilers but I'm assuming they are, in large part, written in c. I'm sure they Python interpreter is written in Python. It's all just one recursive clusterfuck.
Lua is still pure C though! -
Jifuna37405y@AlgoRythm I don't know much about compilers and interpreters but isn't it the point that you write a interpreter in a compiled language? If you're interpreter is written in Python what does interpret the interpreter?
TIL there's a Python Interpreter written in Python (PyPy)
My head hurts
rant