문제

What application virtual machines are out there that are written in higher level languages? C/C++ looks like the languages of choice (for obvious reasons).

What I have found on google is at least two written in Java (both meta-circular) : JikesRVM and Maxine.

Anything else that you have found?

도움이 되었습니까?

해결책

  • Many Scheme implementations are written in Scheme and although many of those are compilers or interpreters, some of those are VMs,
  • some CommonLisp implementations are written in CommonLisp and although many of those are compilers or interpreters, some of those are VMs,
  • the PyPy VM is written in RPython, which is a subset of Python with "syntax and semantics of Python, speed of C, restrictions of Java and compiler error messages as penetrable as MUMPS",
  • the Squeak Smalltalk VM is written in Slang (a subset of Squeak Smalltalk) and
  • the Klein Metacircular VM is written entirely in Self.

Of those, the most interesting are Klein and Maxine (whose design is actually based on Klein). Metacircular Lisp and Scheme implementations usually assume the existence of some basic primitive special forms, which then have to be implemented in assembler, C or a limited subset of the language in a low-level style. Squeak and PyPy use a limited subset of the language. Jikes uses "magic" methods and low-level style.

The idea of Klein and Maxine is that everything is written in high-level, object-oriented, expressive, idiomatic style. In the current version of Klein, there are only two tiny places where the style is hampered by some restriction: in the implementation of message sending, you cannot send any messages and in the implementation of object cloning you cannot clone any objects. However, the current compiler can actually inline or even completely optimize away object cloning and message sending, so those two places could be rewritten in normal OO Self style – it's just that nobody has done it yet.

All of that was just metacircular VMs. There's also other VMs written in high-level languages:

  • HotRuby is a Ruby VM (actually, a YARV VM) written in JavaScript,
  • Red Sun is a Ruby VM (actually, a YARV VM) written in ActionScript,
  • Rava is a JVM-like VM written in Ruby by Koichi "ko1" Sasada, the author of YARV and
  • Ruva is a JVM-like VM written in Ruby

다른 팁

Some more VM implementations are in TCL (tool command language) and lua (sometimes named as java) and some are written in an assembler. Other variants are written in a computer hardware system programming language of the manufacturer.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top