caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Michael Wohlwend" <micha-1@fantasymail.de>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] question about how to bind c++ classes to ocaml
Date: Mon, 14 Aug 2006 09:17:15 +0200	[thread overview]
Message-ID: <20060814071715.183780@gmx.net> (raw)
In-Reply-To: <20060814.092046.03363783.garrigue@math.nagoya-u.ac.jp>


-------- Original-Nachricht --------
Datum: Mon, 14 Aug 2006 09:20:46 +0900 (JST)
Von: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
An: micha-1@fantasymail.de
Betreff: Re: [Caml-list] question about how to bind c++ classes to ocaml

> Calls from ocaml to C are very cheap. If your access function doesn't
> do any allocation (i.e. never calls the GC), you can even make it
> faster by marking it as "noalloc". Beware many functions do
> allocate, including copy_double or copy_string.

thanks for pointing this out. The "noalloc"-thing isn't really described in the docu? :-)

Another question which came up was: you can only declare normal functions (not methods) as "external", so you have to write a c function for every c++ member function. Do you rebuild the inheritance hierachy somehow through the type system (maybe with those mysterious phantom types?) or just put an ocaml class system on top of it?

cheers
 Michael

ps: I know there is the gtk binding, but understanding the complete source is... not that easy :-)
-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


  parent reply	other threads:[~2006-08-14  7:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-13 20:47 micha
2006-08-14  0:20 ` [Caml-list] " Jacques Garrigue
2006-08-14  7:04   ` Jonathan Roewen
2006-08-14  7:17   ` Michael Wohlwend [this message]
2006-08-14  8:45     ` Jacques Garrigue

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=20060814071715.183780@gmx.net \
    --to=micha-1@fantasymail.de \
    --cc=caml-list@yquem.inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    /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).