编程语言
首页 > 编程语言> > Python CPU和OS

Python CPU和OS

作者:互联网

如果Python VM本身构建到硬件中,是不是可以完全使用Python?好像旧的Lisp机器?
假设我有一个cpu是python虚拟机的硬件实现,那么用python编写的所有程序都会以汇编的速度执行,不会吗(但Python主要是解释但我们可以编译它)?
如果我们有这样一个’python-microprocessor’,那么内存和其他子系统呢?它是否与当前内存兼容.
是否有关于寄存器和Python VM架构的信息,类似于我们对8086的信息?

解决方法:

Wouldn’t it be possible to have an OS
entirely in Python if the Python VM
itself is build into a hardware?
Something like the good old Lisp
Machine?

是的,从理论上讲,这是可能的.

Suppose I have a cpu that is the
hardware implementation of the python
virtual machine, then all programs
written in python would perform with
the speed of assembly, won’t it (but
Python is mostly interpreted but we
can compile it)?

Python没有速度,它是一种语言.可以测试解释器(在这种情况下是处理器)的速度.但正如很难比较RISC和CISC处理器的性能一样,将Assembly与Python进行比较也很困难.

If we have such a
‘python-microprocessor’, what about
the memory and other subsystems? Would
it be compatible with the current
memory.

python微处理器必须进行内存管理(从而进行垃圾收集).由于这通常由解释器完成,现在微处理器必须这样做.

Is there any information on the
registers and the Python VM
architecture, something similar to
what we have for 8086?

通常,您不直接在Python中访问内存,因此这里的寄存器不应该相关.

标签:python,operating-system,cpu-architecture
来源: https://codeday.me/bug/20190714/1456366.html