Python Concepts - What is a Python Compiler and Python Virtual Machine?

preview_player
Показать описание

The notes for this video can be found here:

Additional resources that may be helpful can be found here:

Рекомендации по теме
Комментарии
Автор

Explained as one of the best way. Thank you.

bipulkumar
Автор

A perfect explanation. Thanks a lot for the video!

Mike-ogwc
Автор

Thanks, you explained the concepts very well

itisdawit
Автор

Thanks for taking the time to explain this.

elenaperez
Автор

This has helped me a lot... Forthrightly, thank you so much!

kevinfernandodelgadosantos
Автор

This is a nice video, except I don't agree with your characterization of the virtual machine. The virtual machine is just a metaphor - I don't even know what it would mean for a piece of software to work in the same way as a piece of hardware, seeing that hardware is a real, physical object and software is a conceptual device that is dependent on that hardware for its realization. A virtual machine is a concept manifested as an arrangement of electrical charges in the memory of a real machine, and the only way those electrical charges can do anything useful is by running through the real, hardware CPU.

Imagine that you write some python code that displays a single pixel on the screen. The interpreter translates the python into bytecode that runs on the virtual machine. Now, how does the virtual machine display the pixel on the screen? It needs to write it to the screen memory - does it do that directly, bypassing the hardware CPU? I can't see any way for that to happen. The virtual machine has to convert the bytecode into machine code which with then run through the physical CPU, which will then write this to the screen.

Conceptually, bytecode is a kind of assembly language for a virtual machine that operates a stack and a set of virtual registers in a way similar to a CPU running machine code instructions, but that is just an analogy and ultimately the bytecode needs to be translated into machine code and run through the CPU. Really, the virtual machine is just another layer of translation in the journey from high-level code to machine code.

I would also say that there is no way to build a CPU that runs bytecode directly. How would you even manifest a single character of the alphabet in silicone and electricity, without reducing it down to a code in the old 'ones and zeros'?

Like I say, I think this is a useful video, but I do think these things are quite serious mischaracterizations.

danluba
Автор

Great work! very well explained... Keep them coming...

DuopolyJul
Автор

Are PVMs architecture independent? Will the logical VM be the same regardless of whether it is being run on an intel or AMD processor?

quicksilver
Автор

Thank you so much! This really helped!

fractionofstuff
Автор

So why does Python need a virtual machine instead of building directly into machine code?

ethanjyx
Автор

What gets confusing to me at the end of the video is if the code ever really gets to be executed by the real machine (aka hardware) or it's the virtual machine (Python software) which actually does all the work.

Gabriel
Автор

So to be clear:
The Python Virtual Machine (PyVM) runs the byte code acting as the CPU running the machine code.

So does PyVM uses the exact same resources of the CPU as the CPU would if it were running the machine code? My answer: PyVM must have same or better performance, other wise I see it as an unnecessary layer.

lightninginmyhands
Автор

I keep wondering why people are saying python is better than C/C++ while the whole python is runnjng on C layer.

hussainimagaji
Автор

Thanks for sharing. It really helps me. One doubt, If I try to user IDLE then, it is compiler or interpreter?

reddysrinivasrao
Автор

You sound confused. What you describe as a Python compiler is really an interpreter. However the Python interpreter inteprets the byte codes and not the original Python source code.

georgechristoforou
Автор

I started to laugh at this video because I was thinking if I don’t understand the background of compiler and many of the terms of Python And IT in general (i.e. as a normal person) I would think this speech like a puzzle or Abracadabra😊

abdoontube