caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Examples of creating C++ library bindings
@ 2007-02-19 14:08 Joel Reymont
  2007-02-19 14:26 ` RE : [Caml-list] " Mathias Kende
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Joel Reymont @ 2007-02-19 14:08 UTC (permalink / raw)
  To: caml-list

Are there any examples of creating C++ library bindings?

	Thanks, Joel

--
http://wagerlabs.com/






^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE : [Caml-list] Examples of creating C++ library bindings
  2007-02-19 14:08 Examples of creating C++ library bindings Joel Reymont
@ 2007-02-19 14:26 ` Mathias Kende
  2007-02-19 14:35   ` Joel Reymont
  2007-02-19 14:43 ` micha
  2007-02-19 23:02 ` Robert Roessler
  2 siblings, 1 reply; 9+ messages in thread
From: Mathias Kende @ 2007-02-19 14:26 UTC (permalink / raw)
  To: caml-list

> Are there any examples of creating C++ library bindings?

http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#htoc232

Is it what you're looking for ?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RE : [Caml-list] Examples of creating C++ library bindings
  2007-02-19 14:26 ` RE : [Caml-list] " Mathias Kende
@ 2007-02-19 14:35   ` Joel Reymont
  2007-02-19 18:32     ` Nathaniel Gray
  0 siblings, 1 reply; 9+ messages in thread
From: Joel Reymont @ 2007-02-19 14:35 UTC (permalink / raw)
  To: Mathias Kende; +Cc: caml-list


On Feb 19, 2007, at 2:26 PM, Mathias Kende wrote:

> http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#htoc232
>
> Is it what you're looking for ?

Mathias, thanks for the pointer. I'm looking for a reasonably small  
but idiomatic (is there such a thing with FFI?) example of C++  
bindings. I would like to know if I should I prefer classes or use  
modules, for example. Do I go with SWIG or do it manually?

	Thanks, Joel

--
http://wagerlabs.com/






^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] Examples of creating C++ library bindings
  2007-02-19 14:08 Examples of creating C++ library bindings Joel Reymont
  2007-02-19 14:26 ` RE : [Caml-list] " Mathias Kende
@ 2007-02-19 14:43 ` micha
  2007-02-19 23:02 ` Robert Roessler
  2 siblings, 0 replies; 9+ messages in thread
From: micha @ 2007-02-19 14:43 UTC (permalink / raw)
  To: Joel Reymont; +Cc: caml-list

Joel Reymont wrote:
> Are there any examples of creating C++ library bindings?
>
>     Thanks, Joel

I have done it few times, mostly just to see how it works. At the moment 
I'm writing a (hopefully) real usable binding to a c++ lib.
For big libs it's better (faster) to generate them but if you want some 
(small) part, you can do it yourself, it's much writing. I can send my 
code as an example and answer questions (no docu yet). It mirrors a c++ 
lib on the ocaml side, with working inheritance and overwritable virtual 
functions and event callbacks

cheers
 Michael


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RE : [Caml-list] Examples of creating C++ library bindings
  2007-02-19 14:35   ` Joel Reymont
@ 2007-02-19 18:32     ` Nathaniel Gray
  2007-02-19 18:46       ` micha
  0 siblings, 1 reply; 9+ messages in thread
From: Nathaniel Gray @ 2007-02-19 18:32 UTC (permalink / raw)
  To: Joel Reymont; +Cc: Mathias Kende, caml-list

On 2/19/07, Joel Reymont <joelr1@gmail.com> wrote:
> Do I go with SWIG or do it manually?

Unless you're willing to do some work on the SWIG OCaml generator you
should avoid it.  The code it generates doesn't compile.  Having said
that, if you *do* want to work on the SWIG OCaml generator it would be
a great service to the community!

Cheers,
-n8

-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RE : [Caml-list] Examples of creating C++ library bindings
  2007-02-19 18:32     ` Nathaniel Gray
@ 2007-02-19 18:46       ` micha
  2007-02-19 19:43         ` Nathaniel Gray
  0 siblings, 1 reply; 9+ messages in thread
From: micha @ 2007-02-19 18:46 UTC (permalink / raw)
  To: caml-list

Nathaniel Gray wrote:
>
> Unless you're willing to do some work on the SWIG OCaml generator you
> should avoid it.  The code it generates doesn't compile.  Having said
> that, if you *do* want to work on the SWIG OCaml generator it would be
> a great service to the community!
>

I also thought about just taking the swig c++ parser and generating some 
similar binding as I now do by hand - would be interessting.

Michael


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RE : [Caml-list] Examples of creating C++ library bindings
  2007-02-19 18:46       ` micha
@ 2007-02-19 19:43         ` Nathaniel Gray
  0 siblings, 0 replies; 9+ messages in thread
From: Nathaniel Gray @ 2007-02-19 19:43 UTC (permalink / raw)
  To: micha; +Cc: caml-list

On 2/19/07, micha <micha-1@fantasymail.de> wrote:
> Nathaniel Gray wrote:
> >
> > Unless you're willing to do some work on the SWIG OCaml generator you
> > should avoid it.  The code it generates doesn't compile.  Having said
> > that, if you *do* want to work on the SWIG OCaml generator it would be
> > a great service to the community!
> >
>
> I also thought about just taking the swig c++ parser and generating some
> similar binding as I now do by hand - would be interessting.

BTW, I have a vague recollection of somebody posting an announcement
of a C++ parser for ocaml recently.

Cheers,
-n8

-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] Examples of creating C++ library bindings
  2007-02-19 14:08 Examples of creating C++ library bindings Joel Reymont
  2007-02-19 14:26 ` RE : [Caml-list] " Mathias Kende
  2007-02-19 14:43 ` micha
@ 2007-02-19 23:02 ` Robert Roessler
  2007-02-20 12:55   ` Dário Abdulrehman
  2 siblings, 1 reply; 9+ messages in thread
From: Robert Roessler @ 2007-02-19 23:02 UTC (permalink / raw)
  To: Caml-list

Joel Reymont wrote:
> Are there any examples of creating C++ library bindings?

Well, on the "Caml Humps", you should be able to find something. :)

In particular, I released a *simple* version of an OCaml binding for 
the PCRE pattern-matching library: "LablPCRE 1.0".  While simple, it 
is also non-trivial (it utilizes "custom" blocks with finalization).

As it happens, the package was originally class-based, and then was 
switched to a module orientation after "input" from the list. ;)

I also have a much larger binding for the Scintilla editing component 
("LablScintilla 0.9pre1"), but it *is* quite a bit larger, *and* 
interfaces with LablGTK (representing a much more interesting can of 
worms).. so it would be better to digest LablPCRE first.

Robert Roessler
roessler@rftp.com
http://www.rftp.com


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] Examples of creating C++ library bindings
  2007-02-19 23:02 ` Robert Roessler
@ 2007-02-20 12:55   ` Dário Abdulrehman
  0 siblings, 0 replies; 9+ messages in thread
From: Dário Abdulrehman @ 2007-02-20 12:55 UTC (permalink / raw)
  To: Caml-list

[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]

More info here on the OCaml/C interface:
http://www.soton.ac.uk/~fangohr/nsim/tutorial/ocaml/lecture5.html

On 2/19/07, Robert Roessler <roessler@rftp.com> wrote:
>
> Joel Reymont wrote:
> > Are there any examples of creating C++ library bindings?
>
> Well, on the "Caml Humps", you should be able to find something. :)
>
> In particular, I released a *simple* version of an OCaml binding for
> the PCRE pattern-matching library: "LablPCRE 1.0".  While simple, it
> is also non-trivial (it utilizes "custom" blocks with finalization).
>
> As it happens, the package was originally class-based, and then was
> switched to a module orientation after "input" from the list. ;)
>
> I also have a much larger binding for the Scintilla editing component
> ("LablScintilla 0.9pre1"), but it *is* quite a bit larger, *and*
> interfaces with LablGTK (representing a much more interesting can of
> worms).. so it would be better to digest LablPCRE first.
>
> Robert Roessler
> roessler@rftp.com
> http://www.rftp.com
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>



-- 
Dário Abdulrehman

[-- Attachment #2: Type: text/html, Size: 2117 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-02-20 12:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-19 14:08 Examples of creating C++ library bindings Joel Reymont
2007-02-19 14:26 ` RE : [Caml-list] " Mathias Kende
2007-02-19 14:35   ` Joel Reymont
2007-02-19 18:32     ` Nathaniel Gray
2007-02-19 18:46       ` micha
2007-02-19 19:43         ` Nathaniel Gray
2007-02-19 14:43 ` micha
2007-02-19 23:02 ` Robert Roessler
2007-02-20 12:55   ` Dário Abdulrehman

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).