如何用 Java 编写 JVM [英] How can a JVM be written in Java

查看:27
本文介绍了如何用 Java 编写 JVM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在简要阅读 Maxine 这是一个用 Java 编写的开源 JVM 实现.这对我来说听起来很循环.如果java需要虚拟机来运行,那么虚拟机本身如何用Java编写(VM代码不会需要在其中运行的VM,等等?).

I was briefly reading about Maxine which is an open source JVM implementation that written in Java. This sounds circular to me. If java requires a virtual machine to run in, how can the virtual machine itself be written in Java (won't the VM code require a VM in which to run, and so on?).

编辑:好的,所以我发现我忽略了 Java 不必在 VM 中运行的事实.那么如何解释如何用 LISP 编写 LISP 编译器呢?还是应该完全是一个新问题?

Edit: Ok, so I see I overlooked the fact that Java doesn't have to run in a VM. How then does one explain how a LISP compiler can be written in LISP? Or should this be a new question altogether?

推荐答案

您一开始就认为 Java 需要虚拟机是不正确的.查看项目 GCJ:GNU 编译器用于 Java 编程语言.

Your assumption that Java requires a virtual machine is incorrect to begin with. Check out the project GCJ: The GNU Compiler for the Java Programming Language.

这篇关于如何用 Java 编写 JVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆