I've managed to re-use the appropriate part of the OCaml compiler, and
run my hand-made lambda code. I believe you wanted runtime type
inspection for Neko, and I agree that OCaml is not distributed in a
way which encourages backend re-use. It's a bit late to ask, but was
it worth re-building everything from scratch ? What's your opinion, is
there something I missed, did you considered it at first, etc ?
Thanks for Neko anyway, I'll have a closer look soon !
As a long-time OCaml user, I can try to answer this interesting
question. First, the short answer :
"but was it worth re-building everything from scratch ?"
Yes. It opens a lot of new possible applications.
Long answer :
As you noticed, Neko have very interesting features such as exceptions
traces and full introspection. They bytecode is right now less efficient
than OCaml since OCaml VM does not not do any typecheck at runtime. That
also means that OCamlVM is inheritanly unsafe so you cannot embed it for
example in a browser plugin that will run on the client side. It has no
sandbox either, and you need often to recompile a lot of different
bytecode files if you modify only one.
I would say that OCaml VM is very good for what it's doing : runnning
OCaml bytecode. But I don't think it's suitable to do more than that.
Some people managed to run a mod_ocaml on Apache but that's very hard
due to the fact that modules are not garbaged when no longer used (while
they are in Neko) so it eat up your memory everytime you modify a script.
I really like OCaml (apart from the syntax) but the only reason I'm
still using it is that it can produce very fast native executables, and
that's the only thing missing to NekoML + NekoVM to replace it for the
usages I'm making of it.
Now there was always the possibility of patching the OCaml VM in order
to get it doing what was needed, but it was (a) very big work and (b)
the Ocaml license does not permit to fork the project.
Hope this answer your question,
Neko : One VM to run them all