How can a language implementation in one language be faster than a language?

If I create a JVM in Java, for example, can the implementation that I made be actually faster than the original implementation that I used to create this implementation, although my implementation is built on top of the original implementation and may even depend on this implementation?

(Confusing ...)

Take a look at PyPy . This is a JIT compiler for Python created in Python. That's fine, but how can he claim to be faster than the original Python implementation that he uses, and depends on?

+5
source share
5 answers

You are confused between a language and a runtime device for that language.

, PyPy CPython, , PyPy CPython .

, , , , .
+10

, . JVM - Java . , JVM, Java, .

Java .

, PyPy - JIT Python ( ). Python . , PyPy , CPython. CPython, JIT'd , , . .

+7

PyPy Python, Python, Python, RPython, Python:

RPython - Python, . , , . , , , .

- , CPython, -, PyPy (JIT) ( ) RPython.

+2

, ( A), ( B) ( P), P (A B) , P, B.

A B. B A, , , A B, , B A.

+ JIT- , JIT - , P (A B) , P B. P, JIT, ( , ), JIT- "" P , B, .

. (C), (D) , , , . , ; , , D, C, , C.

, , (, GCC C) , , , ; JIT- , . - , , ; .

. PyPy Python- Python. PyPy Python, RPython. RPython - Python, , ; RPython Java , . PyPy RPython, Python ( ) JIT- , .

PyPy , , RPython, , CPython , C . PyPy Python ( , RPython Python, not ), , CPython .

+1

The pypy translation process is done in CPython, but the output is a list of .c files (19 files the last time I checked), which are then compiled into a binary file: pypy-c. At run time, pypy-c has nothing to do with CPython, so it can be faster.

-1
source

All Articles