
After a few HOpenGL-free years caused by personal and job-related circumstances, I'd like to work on this again. First of thanks to all the people involved in keeping the binding alive, especially Jason! Having the packages in the Haskell platform is simply great, because it improves the visibility of the binding a lot and will keep new users (and new bug reports ;-) coming. I've browsed through the mailing list archives, so here are a few miscellaneous remarks: * The StateVar/Tensor/ObjectName packages are now in the OpenGL package itself (in a different namespace), and the previous standalone packages are still available, too. Although I don't think it is a perfect solution, it was probably done to get the OpenGL packages into the Haskell platform, right? If this was the motivation, I think the price to pay was well worth it. The OpenAL/ALUT packages use the assimilated packages, too, so I should probably update the former ones to use the latter ones. This will introduce a dependency of OpenAL/ALUT on OpenGL, something I wanted to avoid. But I think there are very few programs using OpenAL without OpenGL, and the latter is now universally available via the Haskell platformm, so this should be the right way to proceed. * What was the exact motivation for using type synonyms instead of the former renamings (newtypes) for the OpenGL types? Were there any *real* problems or only potential/hypothetical ones? I am a bit torn between those alternatives, so I'd like to learn the experience of other people, including their opinions. * The examples have bit-rotted, e.g. SmoothOpenGL3.hs yields an InvalidOperation in triangle's vertexAttribPointer calls, 'catch' should probably be replaced by Control.Exception.{catch,IOException}, etc. Apart from fixing them, having GLUT versions of nehe-tuts in the GLUT package would be great. I really like the idea of GLUT being a one-stop-shop for tons of examples regarding the usage of the OpenGL/OpenGLRaw packages. * Currently the binding doesn't work out-of-the box with ghci on Ubuntu 12.04 if you have NVIDIA drivers installed in addition to the Mesa ones. I have an ugly fix (adding /usr/lib/nvidia/current to OpenGLRaw's library-dirs), but I'd like to solve this more cleanly. More about this in a separate mail. * Finally Khronos has released the OpenGL registry in a less braindead format (http://www.opengl.org/discussion_boards/showthread.php/181927-New-XML-based-...), so there is a good chance now that the OpenGLRaw package can be completely autogenerated, something I wanted to do for ages. Judging from the HOpenGL mailing list, Lars is already looking into it, so let's coordinate our efforts here, preferably in a separate mail thread. My main concerns here are: Include the generator (plus pre-generated bindings) in the OpenGLRaw package, it really belongs there. Don't put anything clever into OpenGLRaw, it should really, really be a plain, straightforward 1:1 mapping of the registry. No name mangling, structural modifications etc. apart from things automatically derivable from the XML registry. A big question remains: Can we generate the (un-)marshaling functions already in OpenGLRaw? The XML registry has <groups>/<group> tags, but I fear that they are still too incomplete/incorrect to be of any use for the Haskell binding. On the positive side, I think that it should be possible to upstream changes to the registry to make it more useful in general. I had contact with Jon Leech in the past, and he has always been very open and helpful. * Given the fact that OpenGL 4.3 is quite different from OpenGL in the "old days", there are quite a few design decisions in the OpenGL (convenience) package that I would do differently nowadays. But I think with the feedback from the community we can gradually tweak this layer to something more useful and up-to-date. Perhaps we can somehow re-arrange things to be more in line with OpenGL versions/profiles, but whatever we do, we should not drop support for "old skool" OpenGL, there are *tons* of tutorials, books and courses relying on it, and even NVIDIA has effectively promised to support this forever. Cheers, S.

I made very little contribution to the decision (just submitting an issue
on github a while ago), but I'm very positive about the decision to switch
to type synonyms instead of newtypes.
In my experience, the newtypes added an inconvenience that seemed to imply
that the only safe way to convert between GL* types and their corresponding
C* types is to use fromIntegral/realToFrac, which can be *very*
inconvenient, especially if your data is in a Ptr (as OpenGL often expects
for anything but the fixed-function pipeline). When binding to C libraries,
you have to create wrappers around your functions to convert between GL
types and C types (provided they use C types and their GL typedefs), if you
buy into GL types truly being different.
A specific problem I ran into was (see ) that GLchar being a newtype meant
that I had to use castPtr to convert to and from CString or Ptr CString to
Ptr (Ptr GLchar).
On https://github.com/haskell-opengl/OpenGLRaw/pull/11 is my issue. Jason
Dagit's response is probably of interest to you as well.
As for more modern OpenGL things, for my recent game (that excusively used
"modern" OpenGL, aside from glRaster* to draw text with ftgl), I made some
nice wrappers around OpenGL things, that had no overhead while still being
more than just convenience wrappers (something that can't be said about
OpenGL, the package, today), and I'd like to get them into a package
sometime, when I have more time.
Mike
On Mon, Jul 22, 2013 at 7:23 PM, Sven Panne
After a few HOpenGL-free years caused by personal and job-related circumstances, I'd like to work on this again. First of thanks to all the people involved in keeping the binding alive, especially Jason! Having the packages in the Haskell platform is simply great, because it improves the visibility of the binding a lot and will keep new users (and new bug reports ;-) coming.
I've browsed through the mailing list archives, so here are a few miscellaneous remarks:
* The StateVar/Tensor/ObjectName packages are now in the OpenGL package itself (in a different namespace), and the previous standalone packages are still available, too. Although I don't think it is a perfect solution, it was probably done to get the OpenGL packages into the Haskell platform, right? If this was the motivation, I think the price to pay was well worth it. The OpenAL/ALUT packages use the assimilated packages, too, so I should probably update the former ones to use the latter ones. This will introduce a dependency of OpenAL/ALUT on OpenGL, something I wanted to avoid. But I think there are very few programs using OpenAL without OpenGL, and the latter is now universally available via the Haskell platformm, so this should be the right way to proceed.
* What was the exact motivation for using type synonyms instead of the former renamings (newtypes) for the OpenGL types? Were there any *real* problems or only potential/hypothetical ones? I am a bit torn between those alternatives, so I'd like to learn the experience of other people, including their opinions.
* The examples have bit-rotted, e.g. SmoothOpenGL3.hs yields an InvalidOperation in triangle's vertexAttribPointer calls, 'catch' should probably be replaced by Control.Exception.{catch,IOException}, etc. Apart from fixing them, having GLUT versions of nehe-tuts in the GLUT package would be great. I really like the idea of GLUT being a one-stop-shop for tons of examples regarding the usage of the OpenGL/OpenGLRaw packages.
* Currently the binding doesn't work out-of-the box with ghci on Ubuntu 12.04 if you have NVIDIA drivers installed in addition to the Mesa ones. I have an ugly fix (adding /usr/lib/nvidia/current to OpenGLRaw's library-dirs), but I'd like to solve this more cleanly. More about this in a separate mail.
* Finally Khronos has released the OpenGL registry in a less braindead format ( http://www.opengl.org/discussion_boards/showthread.php/181927-New-XML-based-... ), so there is a good chance now that the OpenGLRaw package can be completely autogenerated, something I wanted to do for ages. Judging from the HOpenGL mailing list, Lars is already looking into it, so let's coordinate our efforts here, preferably in a separate mail thread. My main concerns here are: Include the generator (plus pre-generated bindings) in the OpenGLRaw package, it really belongs there. Don't put anything clever into OpenGLRaw, it should really, really be a plain, straightforward 1:1 mapping of the registry. No name mangling, structural modifications etc. apart from things automatically derivable from the XML registry. A big question remains: Can we generate the (un-)marshaling functions already in OpenGLRaw? The XML registry has <groups>/<group> tags, but I fear that they are still too incomplete/incorrect to be of any use for the Haskell binding. On the positive side, I think that it should be possible to upstream changes to the registry to make it more useful in general. I had contact with Jon Leech in the past, and he has always been very open and helpful.
* Given the fact that OpenGL 4.3 is quite different from OpenGL in the "old days", there are quite a few design decisions in the OpenGL (convenience) package that I would do differently nowadays. But I think with the feedback from the community we can gradually tweak this layer to something more useful and up-to-date. Perhaps we can somehow re-arrange things to be more in line with OpenGL versions/profiles, but whatever we do, we should not drop support for "old skool" OpenGL, there are *tons* of tutorials, books and courses relying on it, and even NVIDIA has effectively promised to support this forever.
Cheers, S.
_______________________________________________ HOpenGL mailing list HOpenGL@haskell.org http://www.haskell.org/mailman/listinfo/hopengl

Sven, first of all it's very nice to see you back again! HOpenGL was one of
my early, and influential Haskell experiences.
I prefer one big package opposed to separate StateVar etc, but that's just
a subjective opinion.
The newtypes (GLDouble etc) are both inconvenient and very slow because GHC
sees fromRational/toRational which it cannot optimize away. In my personal
projects I actually used unsafeCoerce, which kind of illustrates the
seriousness of this issue...
I fully agree with supporting old-school OpenGL, it's much much easier to
start with than modern OpenGL.
I'm not up to date with the latest versions, both because I don't really
have modern hardware, and because I use what is basically a fork of the old
version (with render-to-texture and other stuff added). It's probably
horribly outdated, but in any case, I think the patches are here:
http://code.haskell.org/~bkomuves/hopengl_2009-03-13.patch
Offtopic, but examples of "real-world" Haskell OpenGL stuff can be seen
here: http://moire.be/misszio/ (almost all of that is Haskell, sometimes
with minor C code)
Balazs
On Mon, Jul 22, 2013 at 11:23 AM, Sven Panne
After a few HOpenGL-free years caused by personal and job-related circumstances, I'd like to work on this again. First of thanks to all the people involved in keeping the binding alive, especially Jason! Having the packages in the Haskell platform is simply great, because it improves the visibility of the binding a lot and will keep new users (and new bug reports ;-) coming.
I've browsed through the mailing list archives, so here are a few miscellaneous remarks:
* The StateVar/Tensor/ObjectName packages are now in the OpenGL package itself (in a different namespace), and the previous standalone packages are still available, too. Although I don't think it is a perfect solution, it was probably done to get the OpenGL packages into the Haskell platform, right? If this was the motivation, I think the price to pay was well worth it. The OpenAL/ALUT packages use the assimilated packages, too, so I should probably update the former ones to use the latter ones. This will introduce a dependency of OpenAL/ALUT on OpenGL, something I wanted to avoid. But I think there are very few programs using OpenAL without OpenGL, and the latter is now universally available via the Haskell platformm, so this should be the right way to proceed.
* What was the exact motivation for using type synonyms instead of the former renamings (newtypes) for the OpenGL types? Were there any *real* problems or only potential/hypothetical ones? I am a bit torn between those alternatives, so I'd like to learn the experience of other people, including their opinions.
* The examples have bit-rotted, e.g. SmoothOpenGL3.hs yields an InvalidOperation in triangle's vertexAttribPointer calls, 'catch' should probably be replaced by Control.Exception.{catch,IOException}, etc. Apart from fixing them, having GLUT versions of nehe-tuts in the GLUT package would be great. I really like the idea of GLUT being a one-stop-shop for tons of examples regarding the usage of the OpenGL/OpenGLRaw packages.
* Currently the binding doesn't work out-of-the box with ghci on Ubuntu 12.04 if you have NVIDIA drivers installed in addition to the Mesa ones. I have an ugly fix (adding /usr/lib/nvidia/current to OpenGLRaw's library-dirs), but I'd like to solve this more cleanly. More about this in a separate mail.
* Finally Khronos has released the OpenGL registry in a less braindead format ( http://www.opengl.org/discussion_boards/showthread.php/181927-New-XML-based-... ), so there is a good chance now that the OpenGLRaw package can be completely autogenerated, something I wanted to do for ages. Judging from the HOpenGL mailing list, Lars is already looking into it, so let's coordinate our efforts here, preferably in a separate mail thread. My main concerns here are: Include the generator (plus pre-generated bindings) in the OpenGLRaw package, it really belongs there. Don't put anything clever into OpenGLRaw, it should really, really be a plain, straightforward 1:1 mapping of the registry. No name mangling, structural modifications etc. apart from things automatically derivable from the XML registry. A big question remains: Can we generate the (un-)marshaling functions already in OpenGLRaw? The XML registry has <groups>/<group> tags, but I fear that they are still too incomplete/incorrect to be of any use for the Haskell binding. On the positive side, I think that it should be possible to upstream changes to the registry to make it more useful in general. I had contact with Jon Leech in the past, and he has always been very open and helpful.
* Given the fact that OpenGL 4.3 is quite different from OpenGL in the "old days", there are quite a few design decisions in the OpenGL (convenience) package that I would do differently nowadays. But I think with the feedback from the community we can gradually tweak this layer to something more useful and up-to-date. Perhaps we can somehow re-arrange things to be more in line with OpenGL versions/profiles, but whatever we do, we should not drop support for "old skool" OpenGL, there are *tons* of tutorials, books and courses relying on it, and even NVIDIA has effectively promised to support this forever.
Cheers, S.
_______________________________________________ HOpenGL mailing list HOpenGL@haskell.org http://www.haskell.org/mailman/listinfo/hopengl

On Mon, Jul 22, 2013 at 2:23 AM, Sven Panne
After a few HOpenGL-free years caused by personal and job-related circumstances, I'd like to work on this again. First of thanks to all the people involved in keeping the binding alive, especially Jason! Having the packages in the Haskell platform is simply great, because it improves the visibility of the binding a lot and will keep new users (and new bug reports ;-) coming.
Welcome back!
I've browsed through the mailing list archives, so here are a few miscellaneous remarks:
* The StateVar/Tensor/ObjectName packages are now in the OpenGL package itself (in a different namespace), and the previous standalone packages are still available, too. Although I don't think it is a perfect solution, it was probably done to get the OpenGL packages into the Haskell platform, right?
Yes, that is exactly why. I prefer to have the packages split up.
If this was the motivation, I think the price to pay was well worth it. The OpenAL/ALUT packages use the assimilated packages, too, so I should probably update the former ones to use the latter ones. This will introduce a dependency of OpenAL/ALUT on OpenGL, something I wanted to avoid. But I think there are very few programs using OpenAL without OpenGL, and the latter is now universally available via the Haskell platformm, so this should be the right way to proceed.
That's probably right. It looks like OpenAL is now proprietary. (See license information: http://en.wikipedia.org/wiki/OpenAL). So I don't really know if it makes sense to bother with OpenAL bindings. I know several folks have stopped considering it completely.
* What was the exact motivation for using type synonyms instead of the former renamings (newtypes) for the OpenGL types? Were there any *real* problems or only potential/hypothetical ones? I am a bit torn between those alternatives, so I'd like to learn the experience of other people, including their opinions.
It's a mix. Andy Gill sent patches at one point that introduce a {-# RULE #-} that removed the conversion, it looked like this: {-# RULES "realToFrac/a->GLfloat" realToFrac = \x -> GLfloat (realToFrac x) #-} {-# RULES "realToFrac/GLfloat->a" realToFrac = \(GLfloat x) -> realToFrac x #-} He did that because it had very real performance implications. The default implementation of realToFrac goes through Rational :( With the type synonyms it's trivial to use the GL types with unboxed Data.Vectors. With the newtype wrappers you have to dig pretty deep into GHC to get the unboxing magic. To me that sounded like a maintenance headache. The other benefit is that the C types have more instances in the standard library than the GL types. So that makes it just that much easier to use them with other libraries (for example, vector-space). Admittedly this issue is minor. As we could provide a separate package with common instances or make sure to include all the RULES necessary to make it efficient to convert.
* The examples have bit-rotted, e.g. SmoothOpenGL3.hs yields an InvalidOperation in triangle's vertexAttribPointer calls, 'catch' should probably be replaced by Control.Exception.{catch,IOException}, etc. Apart from fixing them, having GLUT versions of nehe-tuts in the GLUT package would be great. I really like the idea of GLUT being a one-stop-shop for tons of examples regarding the usage of the OpenGL/OpenGLRaw packages.
Ah, that would be my fault. I haven't been updating the examples. I don't like GLUT for various reasons. For example, the translation of the nehe-tuts that I maintain use OpenGLRaw and GLFW-b instead of OpenGL and GLUT.
* Currently the binding doesn't work out-of-the box with ghci on Ubuntu 12.04 if you have NVIDIA drivers installed in addition to the Mesa ones. I have an ugly fix (adding /usr/lib/nvidia/current to OpenGLRaw's library-dirs), but I'd like to solve this more cleanly. More about this in a separate mail.
We should fix that.
* Finally Khronos has released the OpenGL registry in a less braindead format (http://www.opengl.org/discussion_boards/showthread.php/181927-New-XML-based-...), so there is a good chance now that the OpenGLRaw package can be completely autogenerated, something I wanted to do for ages. Judging from the HOpenGL mailing list, Lars is already looking into it, so let's coordinate our efforts here, preferably in a separate mail thread. My main concerns here are: Include the generator (plus pre-generated bindings) in the OpenGLRaw package, it really belongs there. Don't put anything clever into OpenGLRaw, it should really, really be a plain, straightforward 1:1 mapping of the registry. No name mangling, structural modifications etc. apart from things automatically derivable from the XML registry. A big question remains: Can we generate the (un-)marshaling functions already in OpenGLRaw? The XML registry has <groups>/<group> tags, but I fear that they are still too incomplete/incorrect to be of any use for the Haskell binding. On the positive side, I think that it should be possible to upstream changes to the registry to make it more useful in general. I had contact with Jon Leech in the past, and he has always been very open and helpful.
Sounds good.
* Given the fact that OpenGL 4.3 is quite different from OpenGL in the "old days", there are quite a few design decisions in the OpenGL (convenience) package that I would do differently nowadays. But I think with the feedback from the community we can gradually tweak this layer to something more useful and up-to-date. Perhaps we can somehow re-arrange things to be more in line with OpenGL versions/profiles, but whatever we do, we should not drop support for "old skool" OpenGL, there are *tons* of tutorials, books and courses relying on it, and even NVIDIA has effectively promised to support this forever.
That's fine with me. Send me your Github username and I can give you a commit bit in the haskell-opengl organization. Thanks! Jason

2013/7/22 Jason Dagit
[...]. It looks like OpenAL is now proprietary. (See license information: http://en.wikipedia.org/wiki/OpenAL). So I don't really know if it makes sense to bother with OpenAL bindings. I know several folks have stopped considering it completely.
As a previous maintainer of the OpenAL SI, this saddens me... :-( I didn't follow the OpenAL changes lately, but I should probably do that now. At least OpenAL Soft seems to be still alive, and it is the default implementation installed on my Ubuntu box. So it probably makes at least some sense to fix the OpenAL binding, and it shouldn't be too hard.
It's a mix. Andy Gill sent patches at one point [...] With the type synonyms it's trivial to use the GL types with unboxed Data.Vectors. [...] The other benefit is that the C types have more instances in the standard library than the GL types. So that makes it just that much easier to use them with other libraries [...]
All those reasons make sense, and other replies favored synonyms, too, so I think I am convinced now. :-) Thinking about it a bit more, the main use of the GL types is for OpenGLRaw, and there you are basically "driving without safety belts", anyway. So the little bit of additional type safety is probably not worth the trouble. The newtype hac^H^H^H technology originates from ancient times, when there was no distinction between OpenGL and OpenGLRaw, and there it made some sense.
Ah, that would be my fault. I haven't been updating the examples. I don't like GLUT for various reasons. For example, the translation of the nehe-tuts that I maintain use OpenGLRaw and GLFW-b instead of OpenGL and GLUT.
As a previous freeglut contributor, I am shocked! ;-) More seriously: Perhaps I can put GLUT versions of nehe-tuts into the GLUT package, if that's OK for you and I have time. Examples are still our best documentation, so the more there are, the better it is.
We should fix that.
I think the breakage with the NVIDIA drivers on Ubuntu are a result of http://ghc.haskell.org/trac/ghc/ticket/5289: The "fix" of using 'gcc --print-file-name' is basically wrong, because it doesn't mirror what gcc is actually doing during linking via ld. I think I'll comment on that issue in the bug tracker, because having to manually modify a Haskell package description every time one switches the GL implementation via update-alternatives is not the way to go.
Send me your Github username and I can give you a commit bit in the haskell-opengl organization.
Very surprisingly, it is "svenpanne". ;-) Cheers, S.

On 2013-Jul-23, Sven Panne and/or a Mail User Agent wrote:
2013/7/22 Jason Dagit
: [...]. It looks like OpenAL is now proprietary. (See license information: http://en.wikipedia.org/wiki/OpenAL). So I don't really know if it makes sense to bother with OpenAL bindings. I know several folks have stopped considering it completely.
As a previous maintainer of the OpenAL SI, this saddens me... :-( I didn't follow the OpenAL changes lately, but I should probably do that now. At least OpenAL Soft seems to be still alive, and it is the default implementation installed on my Ubuntu box. So it probably makes at least some sense to fix the OpenAL binding, and it shouldn't be too hard.
The Wikipedia article points out that the _implementation_ of OpenAL by Creative Technology has gone proprietary (how dare they continue to call it "Open" AL!) but that the _other implementation_ called "OpenAL Soft" is open source. Wikipedia's link to OpenALSoft is dead; plausible alternatives include - http://sourceforge.net/projects/openal-soft/ ("License: GNU Library or Lesser General Public License version 2.0 (LGPLv2)" - http://kcat.strangesoft.net/openal.html - referenced from http://opensource.creative.com/pipermail/openal/2012-March/012511.html - http://repo.or.cz/w/openal-soft.git I wonder if people have stopped using OpenAL because they don't know about OpenAL Soft or because there is something inferior about it. *** And -- delightful to see you back, Sven! -- Gregory D. Weber, Ph. D. http://mypage.iu.edu/~gdweber/ Associate Professor of Informatics Tel (765) 973-8420 Indiana University East FAX (765) 973-8550

On Tue, Jul 23, 2013 at 12:05 AM, Sven Panne
2013/7/22 Jason Dagit
: Ah, that would be my fault. I haven't been updating the examples. I don't like GLUT for various reasons. For example, the translation of the nehe-tuts that I maintain use OpenGLRaw and GLFW-b instead of OpenGL and GLUT.
As a previous freeglut contributor, I am shocked! ;-) More seriously: Perhaps I can put GLUT versions of nehe-tuts into the GLUT package, if that's OK for you and I have time. Examples are still our best documentation, so the more there are, the better it is.
That's fine with me. Many of the examples used to use GLUT and OpenGL, just look through the git history. When I work on those tutorials again I have two directions I want to work in: * Add font support/examples using my freetype2 binding. * Clone each example and do it using the more modern OpenGL concepts instead of the fixed function immediate mode.
Send me your Github username and I can give you a commit bit in the haskell-opengl organization.
Very surprisingly, it is "svenpanne". ;-)
Done. :) Jason

On Mon, Jul 22, 2013 at 11:23 AM, Sven Panne
After a few HOpenGL-free years caused by personal and job-related circumstances, I'd like to work on this again. First of thanks to all the people involved in keeping the binding alive, especially Jason! Having the packages in the Haskell platform is simply great, because it improves the visibility of the binding a lot and will keep new users (and new bug reports ;-) coming.
I've browsed through the mailing list archives, so here are a few miscellaneous remarks:
* The StateVar/Tensor/ObjectName packages are now in the OpenGL package itself (in a different namespace), and the previous standalone packages are still available, too. Although I don't think it is a perfect solution, it was probably done to get the OpenGL packages into the Haskell platform, right? If this was the motivation, I think the price to pay was well worth it. The OpenAL/ALUT packages use the assimilated packages, too, so I should probably update the former ones to use the latter ones. This will introduce a dependency of OpenAL/ALUT on OpenGL, something I wanted to avoid. But I think there are very few programs using OpenAL without OpenGL, and the latter is now universally available via the Haskell platformm, so this should be the right way to proceed.
* What was the exact motivation for using type synonyms instead of the former renamings (newtypes) for the OpenGL types? Were there any *real* problems or only potential/hypothetical ones? I am a bit torn between those alternatives, so I'd like to learn the experience of other people, including their opinions.
* The examples have bit-rotted, e.g. SmoothOpenGL3.hs yields an InvalidOperation in triangle's vertexAttribPointer calls, 'catch' should probably be replaced by Control.Exception.{catch,IOException}, etc. Apart from fixing them, having GLUT versions of nehe-tuts in the GLUT package would be great. I really like the idea of GLUT being a one-stop-shop for tons of examples regarding the usage of the OpenGL/OpenGLRaw packages.
* Currently the binding doesn't work out-of-the box with ghci on Ubuntu 12.04 if you have NVIDIA drivers installed in addition to the Mesa ones. I have an ugly fix (adding /usr/lib/nvidia/current to OpenGLRaw's library-dirs), but I'd like to solve this more cleanly. More about this in a separate mail.
* Finally Khronos has released the OpenGL registry in a less braindead format (http://www.opengl.org/discussion_boards/showthread.php/181927-New-XML-based-...), so there is a good chance now that the OpenGLRaw package can be completely autogenerated, something I wanted to do for ages. Judging from the HOpenGL mailing list, Lars is already looking into it, so let's coordinate our efforts here, preferably in a separate mail thread. My main concerns here are: Include the generator (plus pre-generated bindings) in the OpenGLRaw package, it really belongs there. Don't put anything clever into OpenGLRaw, it should really, really be a plain, straightforward 1:1 mapping of the registry. No name mangling, structural modifications etc. apart from things automatically derivable from the XML registry. A big question remains: Can we generate the (un-)marshaling functions already in OpenGLRaw? The XML registry has <groups>/<group> tags, but I fear that they are still too incomplete/incorrect to be of any use for the Haskell binding. On the positive side, I think that it should be possible to upstream changes to the registry to make it more useful in general. I had contact with Jon Leech in the past, and he has always been very open and helpful.
* Given the fact that OpenGL 4.3 is quite different from OpenGL in the "old days", there are quite a few design decisions in the OpenGL (convenience) package that I would do differently nowadays. But I think with the feedback from the community we can gradually tweak this layer to something more useful and up-to-date. Perhaps we can somehow re-arrange things to be more in line with OpenGL versions/profiles, but whatever we do, we should not drop support for "old skool" OpenGL, there are *tons* of tutorials, books and courses relying on it, and even NVIDIA has effectively promised to support this forever.
Cheers, S.
_______________________________________________ HOpenGL mailing list HOpenGL@haskell.org http://www.haskell.org/mailman/listinfo/hopengl
A bit overtime (I've been incredibly busy with some other things) but welcome back! Some notes on generating. For OpenGLRaw I had build a generator which works with the old spec format. Discussion on starting to use it was at https://github.com/haskell-opengl/OpenGLRaw/issues/3 . Though with the new spec files the generator requires major overhaul. The starting point for this would be to parse the new format. For this I did start on a project https://github.com/Laar/opengl-xmlspec , but I've not had the time to work on it nor could I choose an xml library (it seems that there are too many of them out there, suggestions are welcome). Generating (un)marshalling code is quite a bit harder, but I think doable for quite some functions. From my experience on extending OpenGL to include version 3.0 I think that even more is possible. Though the question is then how much information the user would need to supply to a helper tool and how complex it should be. But before starting such project the OpenGLRaw generator should probably be finished and in use. Lars

2013/8/11 L Corbijn
[...] nor could I choose an xml library (it seems that there are too many of them out there, suggestions are welcome).
That's my impression, too: XML parsing in Haskell is somehow in a pitiful state, caused by what I consider unhealthy competition. :-/ There are tons of competing libraries and tools out there, but it is very hard to see which projects are mature/dead/usable, which handle the given use case, which have helpful up-to-date documentation/tutorials, etc. For our use case, things should be very simple: There is a Relax NG schema (registry.rnc) and we need a corresponding bunch of Haskell data types generated from that plus a validating parser. Of course one could write the former by hand and hack together the latter, but I have the feeling that there is already a solution out there. Hints are highly appreciated.
Generating (un)marshalling code is quite a bit harder, but I think doable for quite some functions. [...]
I think that generating (un)marshalling code should be a non-goal of the generator. It is exactly that point where one needs to think about sensible abstractions, data types, etc. In its current state, the XML registry is unusable even for the relatively simple task of automatic generation of data types, because the <groups> / <group> support is basically the same as it was before with the .spec files, i.e.: none. :-P Generating the enumerant values and the API entries automatically, structured in a way that follows the <feature> tags, would already be tremendously helpful.
participants (6)
-
Balazs Komuves
-
Gregory Weber
-
Jason Dagit
-
L Corbijn
-
Mike Ledger
-
Sven Panne