caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Automatic interfacing of ocaml to c?
@ 2005-10-04 20:43 Chris Campbell
  2005-10-04 21:56 ` [Caml-list] " Jon Harrop
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Campbell @ 2005-10-04 20:43 UTC (permalink / raw)
  To: caml-list

Message copied below, I sent it to the caml-list@inria.fr but it
doesn't show.  Which is correct?  caml-list@inria.fr or
caml-list@yquem.inria.fr?

==
Hi,

Has anyone done any work on this?  I'm in the process of attempting a
semi autogenerated binding to opengl using the mesa xml specifications
of the interface and lablgl.  This is very early days; so far all I've
done is map the flat (a portion of the) gl enumeration space to a set
of types and values, then auto generate tables mapping the ml variants
to gl enumeration values ala lablgl.

I have a good idea of what it will do and am just looking for advice
from anyone who has done this sort of thing before (if any).  The main
problems so far arise from the flat gl space and wanting to split that
up into a more friendly set of types and modules. In fact, I will only
be generating the mundane stuff as some of this mapping is quite
tricky and using that as a base.  Many of the opengl functions are
trivially mapped to OCaml but those that don't will be hand coded.

Any thoughts?


Regards,
Chris


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

* Re: [Caml-list] Automatic interfacing of ocaml to c?
  2005-10-04 20:43 Automatic interfacing of ocaml to c? Chris Campbell
@ 2005-10-04 21:56 ` Jon Harrop
  2005-10-05 20:30   ` Chris Campbell
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Harrop @ 2005-10-04 21:56 UTC (permalink / raw)
  To: caml-list

On Tuesday 04 October 2005 21:43, Chris Campbell wrote:
> Message copied below, I sent it to the caml-list@inria.fr but it
> doesn't show.  Which is correct?  caml-list@inria.fr or
> caml-list@yquem.inria.fr?

I received both the original and this duplicate.

> Has anyone done any work on this?

camlidl

> I'm in the process of attempting a 
> semi autogenerated binding to opengl using the mesa xml specifications
> of the interface and lablgl.

Have you seen Isaac Trott's idlgl bindings, written using camlidl?

> This is very early days; so far all I've 
> done is map the flat (a portion of the) gl enumeration space to a set
> of types and values, then auto generate tables mapping the ml variants
> to gl enumeration values ala lablgl.
>
> I have a good idea of what it will do and am just looking for advice
> from anyone who has done this sort of thing before (if any).

I have tried and failed to write bindings to the more complicated (read 
"hideous") parts of OpenGL and GLU, specifically the GLU tesselator.

> The main 
> problems so far arise from the flat gl space and wanting to split that
> up into a more friendly set of types and modules.

There are also problems with typing, e.g. sets of related functions that 
handle polymorphic metadata of the same type between each of the functions. 
This could be implemented using functors, records of functions or objects. 
I'm not sure if it would be better to do more on the OCaml side using Obj or 
to use C.

> In fact, I will only 
> be generating the mundane stuff as some of this mapping is quite
> tricky and using that as a base.  Many of the opengl functions are
> trivially mapped to OCaml but those that don't will be hand coded.

I'm keen to see your results! :-)

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists


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

* Re: [Caml-list] Automatic interfacing of ocaml to c?
  2005-10-04 21:56 ` [Caml-list] " Jon Harrop
@ 2005-10-05 20:30   ` Chris Campbell
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Campbell @ 2005-10-05 20:30 UTC (permalink / raw)
  To: Jon Harrop; +Cc: caml-list

On 04/10/05, Jon Harrop <jon@ffconsultancy.com> wrote:
> On Tuesday 04 October 2005 21:43, Chris Campbell wrote:
> > Message copied below, I sent it to the caml-list@inria.fr but it
> > doesn't show.  Which is correct?  caml-list@inria.fr or
> > caml-list@yquem.inria.fr?
>
> I received both the original and this duplicate.

I think gmail hides the emails the lists sends back until a reply shows up.

> > Has anyone done any work on this?
>
> camlidl
>
> > I'm in the process of attempting a
> > semi autogenerated binding to opengl using the mesa xml specifications
> > of the interface and lablgl.
>
> Have you seen Isaac Trott's idlgl bindings, written using camlidl?

I think so, but iirc this used integers for the glEnum values and as
such wasn't as safe as the LablGL approach.  Can't remember specifics
tho.  It could be wrapped it in a more typesafe binding.

> > I have a good idea of what it will do and am just looking for advice
> > from anyone who has done this sort of thing before (if any).
>
> I have tried and failed to write bindings to the more complicated (read
> "hideous") parts of OpenGL and GLU, specifically the GLU tesselator.

Heh.

> There are also problems with typing, e.g. sets of related functions that
> handle polymorphic metadata of the same type between each of the functions.
> This could be implemented using functors, records of functions or objects.
> I'm not sure if it would be better to do more on the OCaml side using Obj or
> to use C.

Hmm... can you explain what you mean?

> > In fact, I will only
> > be generating the mundane stuff as some of this mapping is quite
> > tricky and using that as a base.  Many of the opengl functions are
> > trivially mapped to OCaml but those that don't will be hand coded.
>
> I'm keen to see your results! :-)

Don't expect too much. :)  The initial release will only translate a
small set of functions automatically and maybe a few hand coded bits
to see what people think of it and maybe garner help. :)  Once the
parts that are easily translated are done, that's when the fun begins.


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

end of thread, other threads:[~2005-10-05 20:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-04 20:43 Automatic interfacing of ocaml to c? Chris Campbell
2005-10-04 21:56 ` [Caml-list] " Jon Harrop
2005-10-05 20:30   ` Chris Campbell

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