caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: Joel Reymont <joelr1@gmail.com>
Cc: O'Caml Mailing List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] embedding ocaml into a windows app: need gcc?
Date: Sat, 27 Sep 2008 20:48:54 +0100	[thread overview]
Message-ID: <20080927194854.GA11374@annexia.org> (raw)
In-Reply-To: <1253374D-FC84-4394-99E5-46C02D26C54C@gmail.com>

On Sat, Sep 27, 2008 at 08:27:18PM +0100, Joel Reymont wrote:
> Can I do without gcc if I want to embed the OCaml compiler into a  
> commercial Windows app?

The OCaml compiler uses gcc in various stages (linking IIRC).  Also
needs an assembler.

> Do I need to become part of the OCaml consortium to do this?

You certainly need to read the license very carefully.

However is it necessary to embed the compiler?  Can you not just call
out to the compiler as a separate process?  It's surely easier to do
Sys.command, rather than working out the licensing and technical
issues involved in linking your program to the compiler.

> Ideally, I would like to generate OCaml code at runtime and compile it  
> into something that can be loaded by a runtime of some sort.
> 
> Compiling into a DLL would be ideal, is it possible?

ocamlopt -fPIC ... should be able to do it.

Or compile the code with ocamlc and use Dynlink.

Or wait for OCaml 3.11 which can use Dynlink on native code.

Rich.

-- 
Richard Jones
Red Hat


  reply	other threads:[~2008-09-27 19:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-27 19:27 Joel Reymont
2008-09-27 19:48 ` Richard Jones [this message]
2008-09-27 19:52 ` [Caml-list] " David Teller
2008-09-27 22:53 ` Mikkel Fahnøe Jørgensen
2008-10-03 21:34   ` 'Compiler' module (was: embedding ocaml into a windows app: need gcc?) Dawid Toton
2008-10-03 21:58     ` [Caml-list] " Lukasz Stafiniak
2008-10-03 22:23     ` David Teller
2008-10-04  2:39     ` Jon Harrop
2008-10-06 17:15       ` [Caml-list] 'Compiler' module Dawid Toton

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=20080927194854.GA11374@annexia.org \
    --to=rich@annexia.org \
    --cc=caml-list@yquem.inria.fr \
    --cc=joelr1@gmail.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).