caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Matthieu Dubuget <matthieu.dubuget@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Shared libraries with ocamlopt callable from C (without main())?
Date: Fri, 09 Jan 2009 09:21:43 +0100	[thread overview]
Message-ID: <49670917.3040103@gmail.com> (raw)
In-Reply-To: <fa75c1020901081445w400a4dcfwd96f914d5af16566@mail.gmail.com>

Ben Aurel a écrit :
> I'm thinking about the possibility to use OCaml as an extension
> language. If I wanted to call a OCaml function from langX I had to use
> a C wrapper.
>
>     langX -> ( C API of langX | C Wrapper | C API of OCaml ) -> OCaml
>   

Yes

> But could somebody tell me if ( and maybe how ) this can be done. I made some attempts, but
> there is always a main() function involved. But this C wrapper would be a shared library.
>   

Exactly. You can deliver your OCaml code as shared library, and then
call it from
any language that can call a shared library.

Could you point out what problem you faced?

Salutations

Matt



  reply	other threads:[~2009-01-09  8:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-08 22:45 Ben Aurel
2009-01-09  8:21 ` Matthieu Dubuget [this message]
2009-01-09  8:44   ` [Caml-list] Shared libraries with ocamlopt callable from C(without main())? RABIH.ELCHAAR
2009-01-10  1:22   ` [Caml-list] Shared libraries with ocamlopt callable from C (without main())? Ben Jakb
2009-01-10 11:50     ` Matthieu Dubuget
2009-01-10 15:28       ` Ben Jakb
2009-01-10 15:36         ` Matthieu Dubuget
2009-01-10 18:08           ` Ben Jakb
     [not found]       ` <200901101911.41594.monnier.florent@gmail.com>
2009-01-10 18:18         ` Ben Jakb
2009-01-11 16:27     ` [Caml-list] " Xavier Leroy

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=49670917.3040103@gmail.com \
    --to=matthieu.dubuget@gmail.com \
    --cc=caml-list@inria.fr \
    /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).