Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Dynamically evaluating OCaml code
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-08 (07:47)
From: Oleg Trott <oleg_trott@c...>
Subject: Re: [Caml-list] Dynamically evaluating OCaml code
Brian Hurt wrote:

>Two examples of this in action.  First, consider the different ways you 
>can run Ocaml code.  You can interpret it (like Perl or Lisp, although 
>Ocaml doesn't provide eval), you can compile it to native (like Fortran or 
>C/C++), or you can use a virtual machine (like P-system Pascal or Java).  

Actually, any decent Lisp implementation compiles to native code (like 
Fortran or C/C++). In my experience, after you add a bunch of type 
declarations to Lisp, it runs about as fast as OCaml native, but it runs 
interactively (with eval and everything). The issues of

1. compilation to native code
2. interactivity & runtime eval
3. strict typing (i.e. variables have types, not values)

are all orthogonal. Lisp provides 1 & 2, Ocamlopt provides 1 & 3, Ocaml 
(toplevel) provides 2 & 3, which covers all possible combinations of 2 
out of 3. I think SML/NJ gives all 3, but I don't use it, so I'm not sure.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: