Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-11-01 (14:17)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Stdlib
On Tuesday 01 November 2005 00:07, Jonathan Bryant wrote:
> On another note, I would love to do this other project in OCaml, but it
> is OpenGL intensive (read: based) and LablGL drives me nuts.  The named
> argument thing drives me up the wall because it's more information that
> I don't want to have to learn and internalize.  If the author of that
> package reads this list, then I apologize.  You've done a fantastic job
> of mapping the API, but I really do not like the OCaml syntax for both
> Labeled and Optional arguments in general.  Does anyone know of an
> OpenGL package that is /complete/ and /not/ labeled?  There is, of
> course, the option of writing a module/set of modules that use the
> existing C stubs an are not labled, but that would be a last-ditch
> effort.

You can omit the labels in most cases. I've done my fair share of OpenGL 
programming, both from C/C++ and from OCaml, and I was quite surprised to 
hear that Jacques has had complaints about his API. The C interface is flat 
and unlabelled because C doesn't support hierarchical interfaces, polymorphic 
variants and labelled/optional arguments. There is still room for improvement 
with lablGL but the API alone is a significant step in the right direction, 

After all, if you have an aversion to labelled arguments you can always omit 
the labels. :-)

I would value safety above completeness but writing a safe (and still 
efficient) interface to OpenGL is difficult.

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists