From: Ben Tilly Date: 2001-02-21T01:54:01+09:00 Subject: [ruby-talk:11178] Re: RFC: RubyVM (long) Mathieu Bouchard wrote: > >On Tue, 13 Feb 2001, John van V. wrote: [...] >"Writing L in L" is called metacircularity. > >For as long as I've been thinking about writing a compiler, I've >considered metacircularity as an essential feature. This was in 1995 or >so... The idea was already pretty common in the 80's. That Perl people >begin to talk about it now is pure coincidence (or not). The idea is, of course, much older than that. The first interpreted language that I know of was Lisp. The first Lisp interpreter was written in Lisp, and then that was unexpectedly translated into assembly, turning Lisp from a theoretical language into a practical reality: http://www-formal.stanford.edu/jmc/history/lisp/node3.html > > There was also talk of attaching various interperters (translators?) to >a > > single VM, > >I am interested in modular interpreters more than in adding translators >for other languages, but the former allows for the latter. I suspect that the original idea was mine. I suggested that if the front end and back end for Perl were being made independent anyways, then the front end should be made pluggable. This is an extension of hacks like Lingua::Romana::Perligata (accept source-code that looks like Latin). I am not sure it is a good idea (in fact I called it a bad idea whose time may have come), but it certainly is an interesting one. > > (presumably the perl one) using expertise from blackdown, python, etc. > >I doubt you'll be able to make, say, Ruby and Perl and Java people >agree on something about a common runtime environment. Absolutely. Perl and Ruby use hashing as a low level construct. Java does not. This is one reason that the Java VM can be faster than Perl's internal VM, but real programs written in Perl can still be faster than equivalent programs in Java - the Perl programs use hashing. Perl's scalars are hideous beasts. Basically a scalar can switch between types essentially at will, and an SV will store what the value is as a string, number, etc at the same time to speed this up. Scalar values in Ruby are far, far simpler since everything is a straightforward object. So there we have technical differences in the VMs for all three that reflect visible language differences which I do not think are going away at any time soon. >BTW, I don't think "virtual machine" is an appropriate word to describe >anything in what I want to do. Virtual machine can be used to mean virtually anything. Can't you stretch the term to fit what you want? :-) Cheers, Ben _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com