caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ANN: ocaml-ctypes 0.5.0, a library for calling C functions directly from OCaml
@ 2016-03-21 19:42 Jeremy Yallop
  2016-03-22 10:12 ` sp
  2016-03-22 10:20 ` Goswin von Brederlow
  0 siblings, 2 replies; 7+ messages in thread
From: Jeremy Yallop @ 2016-03-21 19:42 UTC (permalink / raw)
  To: ctypes, Caml List

I'm pleased to announce release 0.5.0 of ocaml-ctypes, which is now
available on OPAM.

== About ocaml-ctypes ==

The ocaml-ctypes library makes it possible to call C functions from
OCaml without writing any C code.  The core of the library is a set of
combinators for describing C types -- scalars, functions, structs,
unions, arrays, and pointers to values and functions.  Type
descriptions can then be used to bind native functions and values.
Here's a simple example:

    # let puts = foreign "puts" (string @-> returning int);;
    val puts : string -> int = <fun>
    # puts "Hello, world!";;
    Hello, world!

Ctypes includes many more features, including functions for retrieving
constants, values and details about object layout from C, a way of
building C libraries from OCaml modules, and a variety of binding
strategies such as dynamic linking and static stub generation. Further
information is available at the links below:

  Tutorial: https://github.com/ocamllabs/ocaml-ctypes/wiki/ctypes-tutorial
  Examples: https://github.com/ocamllabs/ocaml-ctypes/tree/master/examples
  Some packages using ctypes:
http://opam.ocaml.org/packages/ctypes/ctypes.0.5.0/
  API documentation: http://ocamllabs.github.io/ocaml-ctypes/
  Github repository: https://github.com/ocamllabs/ocaml-ctypes
  Direct download:
https://github.com/ocamllabs/ocaml-ctypes/archive/0.5.0.tar.gz

== Selected new features in 0.5.0 ==

* Improved support for various standard C and POSIX integer types
  (time_t, ssize_t, ptrdiff_t, intptr_t, uint8_t, and many more).

* Improved support for conversions between function pointers and other
pointer types

* Support for releasing the runtime lock in the Cstubs_inverted module.

* An experimental interface for managing OCaml roots.

See the release notes for the full list of changes:

    https://github.com/ocamllabs/ocaml-ctypes/blob/0.5.0/CHANGES.md

== Thanks ==

I'm grateful to Andreas Hauptmann, David Sheets, Etienne Millon,
Goswin von Brederlow, Leonid Rozenberg, @orbitz, Max Mouratov, and
Peter Zotov for contributions to this release.

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

* Re: [Caml-list] ANN: ocaml-ctypes 0.5.0, a library for calling C functions directly from OCaml
  2016-03-21 19:42 [Caml-list] ANN: ocaml-ctypes 0.5.0, a library for calling C functions directly from OCaml Jeremy Yallop
@ 2016-03-22 10:12 ` sp
  2016-03-22 11:08   ` Jeremy Yallop
  2016-03-22 10:20 ` Goswin von Brederlow
  1 sibling, 1 reply; 7+ messages in thread
From: sp @ 2016-03-22 10:12 UTC (permalink / raw)
  To: Jeremy Yallop; +Cc: ctypes, Caml List

On Mon, Mar 21, 2016 at 07:42:05PM +0000, Jeremy Yallop wrote:
> I'm pleased to announce release 0.5.0 of ocaml-ctypes, which is now
> available on OPAM.

Great work, thank you!

Are there areny plans to support C++ in a similar approach?

-- 
	SP

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

* Re: [Caml-list] ANN: ocaml-ctypes 0.5.0, a library for calling C functions directly from OCaml
  2016-03-21 19:42 [Caml-list] ANN: ocaml-ctypes 0.5.0, a library for calling C functions directly from OCaml Jeremy Yallop
  2016-03-22 10:12 ` sp
@ 2016-03-22 10:20 ` Goswin von Brederlow
  2016-03-22 11:11   ` Jeremy Yallop
  1 sibling, 1 reply; 7+ messages in thread
From: Goswin von Brederlow @ 2016-03-22 10:20 UTC (permalink / raw)
  To: caml-list

On Mon, Mar 21, 2016 at 07:42:05PM +0000, Jeremy Yallop wrote:
> I'm pleased to announce release 0.5.0 of ocaml-ctypes, which is now
> available on OPAM.

Does anyone have an example of using ctypes with stub generation using
oasis?

MfG
	Goswin

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

* Re: [Caml-list] ANN: ocaml-ctypes 0.5.0, a library for calling C functions directly from OCaml
  2016-03-22 10:12 ` sp
@ 2016-03-22 11:08   ` Jeremy Yallop
  0 siblings, 0 replies; 7+ messages in thread
From: Jeremy Yallop @ 2016-03-22 11:08 UTC (permalink / raw)
  To: sp; +Cc: ctypes, Caml List

On 22 March 2016 at 10:12,  <sp@orbitalfox.com> wrote:
> On Mon, Mar 21, 2016 at 07:42:05PM +0000, Jeremy Yallop wrote:
>> I'm pleased to announce release 0.5.0 of ocaml-ctypes, which is now
>> available on OPAM.
>
> Great work, thank you!
>
> Are there areny plans to support C++ in a similar approach?

It'd be possible to support some of C++ fairly straightforwardly.  For
example, binding overloaded functions should work with the current
ctypes release if you use stub generation (i.e. the Cstubs module),
and calling function templates will probably work too.  It'd be a bit
more work to support exceptions and member functions, but it could
probably be done.  C++ support is not currently high up on the
priority list, but I'd be happy to help out if someone wanted to start
looking at a design.

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

* Re: [Caml-list] ANN: ocaml-ctypes 0.5.0, a library for calling C functions directly from OCaml
  2016-03-22 10:20 ` Goswin von Brederlow
@ 2016-03-22 11:11   ` Jeremy Yallop
  2016-03-22 15:00     ` Gabriel Scherer
  0 siblings, 1 reply; 7+ messages in thread
From: Jeremy Yallop @ 2016-03-22 11:11 UTC (permalink / raw)
  To: Goswin von Brederlow; +Cc: Caml List

On 22 March 2016 at 10:20, Goswin von Brederlow <goswin-v-b@web.de> wrote:
> On Mon, Mar 21, 2016 at 07:42:05PM +0000, Jeremy Yallop wrote:
>> I'm pleased to announce release 0.5.0 of ocaml-ctypes, which is now
>> available on OPAM.
>
> Does anyone have an example of using ctypes with stub generation using
> oasis?

OPAM suggests that there are a few:

$ comm -12 <(opam list --short --depends-on oasis) <(opam list --short
--depends-on ctypes)
flock
nocrypto
ocephes
sanlock
tsdl-image
zstd

Here's the link to the homepage for the first result, which has some
oasis and ocamlbuild rules for ctypes stub generation:

$ opam show -f homepage flock
https://github.com/simonjbeaumont/ocaml-flock

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

* Re: [Caml-list] ANN: ocaml-ctypes 0.5.0, a library for calling C functions directly from OCaml
  2016-03-22 11:11   ` Jeremy Yallop
@ 2016-03-22 15:00     ` Gabriel Scherer
  2016-03-22 15:07       ` Jeremy Yallop
  0 siblings, 1 reply; 7+ messages in thread
From: Gabriel Scherer @ 2016-03-22 15:00 UTC (permalink / raw)
  To: Jeremy Yallop; +Cc: Goswin von Brederlow, Caml List

> [flock] has some oasis and ocamlbuild rules for ctypes stub generation.

Maybe it would be a good time for the ctypes+ocamlbuild users to agree
on a set of common rules and distribute them as a separate plugin. (I
wouldn't mind helping on the ocamlbuild part if necessary, but I don't
use ctypes myself.)

On Tue, Mar 22, 2016 at 12:11 PM, Jeremy Yallop <yallop@gmail.com> wrote:
> On 22 March 2016 at 10:20, Goswin von Brederlow <goswin-v-b@web.de> wrote:
>> On Mon, Mar 21, 2016 at 07:42:05PM +0000, Jeremy Yallop wrote:
>>> I'm pleased to announce release 0.5.0 of ocaml-ctypes, which is now
>>> available on OPAM.
>>
>> Does anyone have an example of using ctypes with stub generation using
>> oasis?
>
> OPAM suggests that there are a few:
>
> $ comm -12 <(opam list --short --depends-on oasis) <(opam list --short
> --depends-on ctypes)
> flock
> nocrypto
> ocephes
> sanlock
> tsdl-image
> zstd
>
> Here's the link to the homepage for the first result, which has some
> oasis and ocamlbuild rules for ctypes stub generation:
>
> $ opam show -f homepage flock
> https://github.com/simonjbeaumont/ocaml-flock
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

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

* Re: [Caml-list] ANN: ocaml-ctypes 0.5.0, a library for calling C functions directly from OCaml
  2016-03-22 15:00     ` Gabriel Scherer
@ 2016-03-22 15:07       ` Jeremy Yallop
  0 siblings, 0 replies; 7+ messages in thread
From: Jeremy Yallop @ 2016-03-22 15:07 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: Goswin von Brederlow, Caml List

On 22 March 2016 at 15:00, Gabriel Scherer <gabriel.scherer@gmail.com> wrote:
>> [flock] has some oasis and ocamlbuild rules for ctypes stub generation.
>
> Maybe it would be a good time for the ctypes+ocamlbuild users to agree
> on a set of common rules and distribute them as a separate plugin. (I
> wouldn't mind helping on the ocamlbuild part if necessary, but I don't
> use ctypes myself.)

I think that's an excellent idea.  I don't use ocamlbuild, but I can
certainly help on the ctypes side.  There's an issue already open on
the issue tracker:

   https://github.com/ocamllabs/ocaml-ctypes/issues/299

Contributions that make it simpler to build libraries that use ctypes
would be very much appreciated, both by me, and by a number of ctypes
users.

Kind regards,

Jeremy.

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

end of thread, other threads:[~2016-03-22 15:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-21 19:42 [Caml-list] ANN: ocaml-ctypes 0.5.0, a library for calling C functions directly from OCaml Jeremy Yallop
2016-03-22 10:12 ` sp
2016-03-22 11:08   ` Jeremy Yallop
2016-03-22 10:20 ` Goswin von Brederlow
2016-03-22 11:11   ` Jeremy Yallop
2016-03-22 15:00     ` Gabriel Scherer
2016-03-22 15:07       ` Jeremy Yallop

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