[Info-vax] Rust as a HS language, was: Re: Quiet?
Arne Vajhøj
arne at vajhoej.dk
Wed Apr 6 08:58:07 EDT 2022
On 4/6/2022 1:56 AM, Jan-Erik Söderholm wrote:
> Den 2022-04-06 kl. 01:22, skrev Chris Townley:
>> On 06/04/2022 00:14, Arne Vajhøj wrote:
>>> On 4/5/2022 1:25 PM, Simon Clubley wrote:
>>>> On 2022-04-04, Arne Vajhøj <arne at vajhoej.dk> wrote:
>>>>> (ignoring that I would not call Python a compiler)
>>>>
>>>> In that case, would you have said (for example) UCSD Pascal wasn't
>>>> a compiler ?
>>>
>>> I have never used USCD Pascal, but I assume that it has a compilation
>>> step, so NO.
>>>
>>>> Python can output .pyc files but also has a way of running code
>>>> interactively if desired.
>>>
>>> Modules get saved as .pyc files when first used.
>>>
>>> I would call that "caching of intermediate code for
>>> interpretation" and not "compilation" but the difference
>>> between "caching of intermediate code for interpretation"
>>> and "JIT compilation" is pretty thin.
>>>
>>> But for no other reasons than common custom, then
>>> I do not consider Python (CPython that is)
>>> compiled.
>>
>> UCSD 'compilers' famously compiled to a pseudo code that was then
>> interpreted. Didn't go down well then...
>
> UCSD p-Machine:
>
> https://en.wikipedia.org/wiki/P-code_machine#UCSD_p-Machine
>
> A bit like Java byte-code or Python pyc files.
But Java class files and Python pyc files are a bit different.
Java source code get compiled into class files, optionally
the class files get packaged in a jar file, class files or
jar file get distributed, class files or jar file with
embedded class files get executed.
Python source code get distributed and when interpreted
Python (the most common Python implementation: CPython)
saves modules as pyc files but not the script itself.
But it is really a cache of intermediate code. And it is not
just my interpretation. Newer Python versions like to put
then in a __pycache__directory.
Nobody consider Java class files a cache.
Python storing pyc files has more in common with Java JIT
compilation. Java JIT compilation happens when the
program is actually run just like Python generates pyc files
when run. Most common JVM's does not persist the result
of the JIT compilation, but IBM J9 JVM is actually doing so.
Arne
More information about the Info-vax
mailing list