This is a really vast question and I'm mostly looking for resources where I can learn more about the following.
I know the python interpreter is written in C and produces bytecode to be run on the python virtual machine also written in C (right?). My question is would it be possible to implement both of these in python itself? I guess where I'm going with this is the (technical) possibility of writing something like on OS in python, particularly WITHOUT statically compiling anything?
If I understand correctly, python doesn't have an assembler which would have to be written as well in python. Are these things something that could technically (feasibly?) be done? Or would the dynamic typing of python pose some kind of problem?
I know a bit about microprocessor architecture, assembly and machine code, what a recent EE grad learns in school. But I get lost looking at the whole picture for higher level languages like python.
Step 3: Byte code is then sent to the Python Virtual Machine(PVM) which is the python interpreter. PVM converts the python byte code into machine-executable code.
Bytecode is an intermediate language for the Python virtual machine that's used as a performance optimization. Instead of directly executing the human-readable source code, compact numeric codes, constants, and references are used that represent the result of compiler parsing and semantic analysis.
Bytecode is computer object code that an interpreter converts into binary machine code so it can be read by a computer's hardware processor. The interpreter is typically implemented as a virtual machine (VM) that translates the bytecode for the target platform.
A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes what is required in a JVM implementation.
Compiler, not interpreter. But you're looking for PyPy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With