On May 12, 2004, at 11:43 AM, Ryan Paul wrote:

> I just finished reading about Rite (thx to Mark for bringing it to my
> attention, btw!), and I was wondering if there have been any 
> significant
> recent developments, or if there is a place where such developments are
> chronicled. If ruby is in need of a new virtual machine, why not base 
> it
> on OCaml?
>
> Ocaml has an immensely effecient virtual machine, and it also supports
> generation of native binaries on many platforms. Additionally, it 
> provides
> a top-level interactive shell, and many mechanisms that vastly simplify
> language creation, including a very powerful native parsing system 
> based
> on streams.
>
> OCaml plays well with C, so using the OCaml virtual machine for Ruby 
> would
> probably make it easy to embed it in C programs, and use external C 
> code
> inside of it.
>
> Ocaml also lets you do some really strange tricks that might give ruby
> programmers more deployment options. I have seen OCaml parsers that
> generate c/cpp ASTs, for instance, and I imagine that, using similar
> methodology, it may eventually be possible to use an OCaml based ruby
> parser to generate bytecode for java, parrot, and python VMs.

I think Matz is pretty much dead set on writing his own VM. He says, 
though, that we are free to roll our own VMs for Parrot et al.

 From the Rite wiki page:
"Parrot doesn't affect matz's plans at all: he will make his own VM 
(Rite), which will be the reference implementation if Parrot is ever 
able to run Ruby code and becomes more popular than Rite."

So, while it would certainly be a great idea to create support for 
OCaml, it won't be the reference implementation.

If you would want to contribute to that sort of a project, you might 
want to check out Cardinal (Parrot for Ruby) on RubyForge. The first 
step, IIUC, will be parsing the ruby code. It will, I believe, support 
pluggable emitters for bytecode, etc...

cheers,
--Mark