From: skaller <skaller@users.sourceforge.net>
To: Gordon Henriksen <gordonhenriksen@mac.com>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] JIT VM in OCaml: Impossible?
Date: Fri, 17 Aug 2007 03:37:31 +1000 [thread overview]
Message-ID: <1187285851.6017.17.camel@rosella.wigram> (raw)
In-Reply-To: <4DB2486A-4E68-4843-A02C-B058DB2CA28D@mac.com>
On Thu, 2007-08-16 at 12:24 -0400, Gordon Henriksen wrote:
> On 2007-08-16, at 10:10, Joel Reymont wrote:
>
> > Is it possible to write a JIT VM in OCaml?
> >
> >
> > It seems that this should not be possible as OCaml does not allow
> > for code generation at runtime. Am I mistaken?
>
>
> Sure. You could write a compiler and assembler in ocaml.
> But you'd need to write glue code in C or assembly to
> convert the ocaml representation to machine data structures,
Why? Ocaml is just as capable of generating binary data as C ..
if not more capable. You would need some glue to actually
*execute* this code, but that is also true in C. For Unix,
mmap() would probably be used.
The question is: why would you do this? Why not just generate
C (or C++ as Felix does) and compile it to a shared library,
then link and execute it?
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
next prev parent reply other threads:[~2007-08-16 17:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-16 14:10 Joel Reymont
2007-08-16 14:37 ` Sylvain Le Gall
2007-08-16 15:32 ` [Caml-list] " Oliver Bandel
2007-08-16 15:56 ` Joel Reymont
2007-08-16 16:15 ` Jon Harrop
2007-08-16 15:11 ` [Caml-list] " Oliver Bandel
2007-08-16 16:24 ` Gordon Henriksen
2007-08-16 17:37 ` skaller [this message]
2007-08-16 18:05 ` Taras Glek
2007-08-17 2:50 ` skaller
2007-08-17 3:09 ` Erick Tryzelaar
2007-08-17 5:42 ` skaller
2007-08-17 7:52 ` Joel Reymont
2007-08-17 8:36 ` Jon Harrop
2007-08-17 9:20 ` Joel Reymont
2007-08-17 8:39 ` Jon Harrop
2007-08-16 18:49 ` Jon Harrop
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1187285851.6017.17.camel@rosella.wigram \
--to=skaller@users.sourceforge.net \
--cc=caml-list@inria.fr \
--cc=gordonhenriksen@mac.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).