What does translate mean in pypy?
Question: I'm reading [pypy's document](http://doc.pypy.org/en/latest/getting-started-
python.html), which has a section called _Translating the PyPy Python
interpreter_. But i don't understand what does the word _translate_ mean. Is
it the same as _compile_?

The document says:

> First download a pre-built PyPy for your architecture which you will use to
> translate your Python interpreter.

Is the **pre-built PyPy** here refer to the source code? Because there is no
pypy/goal directory in the binary I have downloaded. If so, there is something
wrong with the document. It is misleading.

Is the pypy-c created in the translation the same thing as bin/pypy in the
binary?


Answer: > i don't understand what does the word translate mean. Is it the same as
> compile?

What "translation" means is described in detail in [The RPython
Toolchain](http://doc.pypy.org/en/latest/translation.html). There's also some
higher-level introductory information in the [Coding
Guide](http://doc.pypy.org/en/latest/coding-guide.html) and
[FAQ](http://doc.pypy.org/en/latest/faq.html).

Summarizing their summary:

  1. Compile and import the complete RPython program.
  2. Dynamically analyze the program and annotate it with flow graphs.
  3. Compile the flow graphs into lower-level flow graphs.
  4. Optimize the compiled flow graphs.
  5. Analyze the compiled and optimized flow graphs.
  6. Generate C source from the flow graphs and analysis.
  7. Compile and link the C source into a native executable.

So, step 1 uses the normal Python compiler, step 7 uses the normal C compiler
(and linker), and steps 3 and 4 are similar to the kind of thing an optimizing
compiler normally does. But calling the overall process "compilation" would be
misleading. (Also, people would probably interpret it to mean something akin
to what Shedskin does, which is definitely not right.)

> Is the pypy-c created in the translation the same thing as bin/pypy in the
> binary?

What ends up in a binary distribution is basically the same as if you run the
install process on the translation goal. So, yes, `goal/pypy-c` and `bin/pypy`
are effectively the same thing.

> Is the pre-built PyPy here refer to the source code?

No. It refers to a `bin/pypy` from a binary distribution. As the docs say, you
can actually use _any_ Python 2.6+, including CPython, or a `goal/pypy-c` left
over from a previous build, etc. However, the translator will probably run
fastest on the standard PyPy binary distribution, so that's what you should
use unless you have a good reason to do otherwise.

