caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* vm in ocaml
@ 2010-02-03 15:47 Joel Reymont
  2010-02-24 21:36 ` [Caml-list] " Philippe Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Reymont @ 2010-02-03 15:47 UTC (permalink / raw)
  To: caml-list

I have a translator from a Pascal-like trading language written in OCaml and I need the output to run as a DLL embedded in a trading platform. 

I'm thinking of generating bytecode and have the user pass the path to the bytecode file to the DLL during initialization. 

I don't want to load source code into my runtime since I want to do a lot of error checking on it to make sure the runtime experience is smooth. I don't want to ship ocamlc, etc. since I want to have a single executable. I'm not sure if embedding OCaml (and thus a license!) is needed to generate OCaml bytecode in my scenario, so the bytecode I'm talking about is my bytecode.

I understand that a bit of C will be required to wrap the OCaml runtime in a DLL. I would prefer to stay with OCaml for the whole project which prompts my question... 

Has anyone used OCaml to write a virtual machine?

How big is the OCaml runtime when bundled as a DLL or shared library?

	Thanks, Joel

---
http://es.linkedin.com/in/joelreymont


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] vm in ocaml
  2010-02-03 15:47 vm in ocaml Joel Reymont
@ 2010-02-24 21:36 ` Philippe Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Wang @ 2010-02-24 21:36 UTC (permalink / raw)
  To: Joel Reymont; +Cc: caml-list

On Wed, Feb 3, 2010 at 4:47 PM, Joel Reymont <joelr1@gmail.com> wrote:
> I have a translator from a Pascal-like trading language written in OCaml and I need the output to run as a DLL embedded in a trading platform.
>
> I'm thinking of generating bytecode and have the user pass the path to the bytecode file to the DLL during initialization.
>
> I don't want to load source code into my runtime since I want to do a lot of error checking on it to make sure the runtime experience is smooth. I don't want to ship ocamlc, etc. since I want to have a single executable. I'm not sure if embedding OCaml (and thus a license!) is needed to generate OCaml bytecode in my scenario, so the bytecode I'm talking about is my bytecode.
>
> I understand that a bit of C will be required to wrap the OCaml runtime in a DLL. I would prefer to stay with OCaml for the whole project which prompts my question...

I understand that :
- you want to generate some bytecode (with your own bytecode specs)
from the Pascal-like language
- interprete this bytecode with a VM written in OCaml
but actually I don't quite understand your question :-/

> Has anyone used OCaml to write a virtual machine?

Some people (including some colleagues of mine (and me), actually)
have used OCaml to write an OCaml virtual machine.
(I've heard someone say (indirectly) that we were not the first).
It is an interesting exercise... for people who prefer writing in
OCaml rather than in C.
It's also interesting to run an OCaml VM in an OCaml VM ... in an
OCaml VM, the last one being in OCaml compiled with ocamlopt or in C
(or in Java [Cadmium] or in JavaScript [O'Browser], though we haven't
tried), and all the previous one being in OCaml compiled with ocamlc.

> How big is the OCaml runtime when bundled as a DLL or shared library?

Sorry I've no idea for this question.

-- 
Philippe Wang
   mail@philippewang.info


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-24 21:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-03 15:47 vm in ocaml Joel Reymont
2010-02-24 21:36 ` [Caml-list] " Philippe Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).