Haskell School of Expression (graphics)

I installed the Haskell Platform (7.0.2) earlier, and I just downloaded package soegtk with cabal, apparently unsuccessfully. Any suggestions? Michael [michael@sabal ~]$ cabal updateConfig file path source is default config file.Config file /home/michael/.cabal/config not found.Writing default configuration to /home/michael/.cabal/configDownloading the latest package list from hackage.haskell.org[michael@sabal ~]$ cabal list SOE* soegtk Synopsis: GUI functions as used in the book "The Haskell School of Expression". Default available version: 0.11.1 Installed versions: [ Not installed ] Homepage: http://www.haskell.org/gtk2hs/ License: LGPL-2.1 [michael@sabal ~]$ cabal install soegtkResolving dependencies...Downloading cairo-0.11.1... /tmp/cairo-0.11.12906/cairo-0.11.1/Gtk2HsSetup.hs:25:2: warning: #warning Setup.hs is guessing the version of Cabal. If compilation of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when building (prefixed by --ghc-option= when using the 'cabal' command) [-Wcpp][1 of 2] Compiling Gtk2HsSetup ( /tmp/cairo-0.11.12906/cairo-0.11.1/Gtk2HsSetup.hs, /tmp/cairo-0.11.12906/cairo-0.11.1/dist/setup/Gtk2HsSetup.o ) /tmp/cairo-0.11.12906/cairo-0.11.1/Gtk2HsSetup.hs:190:70: Couldn't match expected type `[PackageDB]' with actual type `PackageDB' Expected type: PackageDBStack Actual type: PackageDB In the sixth argument of `registerPackage', namely `packageDb' In the expression: registerPackage verbosity installedPkgInfo pkg lbi inplace packageDbDownloading glib-0.11.2... /tmp/glib-0.11.22906/glib-0.11.2/Gtk2HsSetup.hs:25:2: warning: #warning Setup.hs is guessing the version of Cabal. If compilation of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when building (prefixed by --ghc-option= when using the 'cabal' command) [-Wcpp][1 of 2] Compiling Gtk2HsSetup ( /tmp/glib-0.11.22906/glib-0.11.2/Gtk2HsSetup.hs, /tmp/glib-0.11.22906/glib-0.11.2/dist/setup/Gtk2HsSetup.o ) /tmp/glib-0.11.22906/glib-0.11.2/Gtk2HsSetup.hs:190:70: Couldn't match expected type `[PackageDB]' with actual type `PackageDB' Expected type: PackageDBStack Actual type: PackageDB In the sixth argument of `registerPackage', namely `packageDb' In the expression: registerPackage verbosity installedPkgInfo pkg lbi inplace packageDbcabal: Error: some packages failed to install:cairo-0.11.1 failed during the configure step. The exception was:ExitFailure 1gio-0.11.1 depends on glib-0.11.2 which failed to install.glib-0.11.2 failed during the configure step. The exception was:ExitFailure 1gtk-0.11.2 depends on glib-0.11.2 which failed to install.pango-0.11.2 depends on glib-0.11.2 which failed to install.soegtk-0.11.1 depends on glib-0.11.2 which failed to install.[michael@sabal ~]$

On 28/05/2011 08:06 PM, michael rice wrote:
/tmp/glib-0.11.22906/glib-0.11.2/Gtk2HsSetup.hs:190:70: Couldn't match expected type `[PackageDB]' with actual type `PackageDB' Expected type: PackageDBStack Actual type: PackageDB In the sixth argument of `registerPackage', namely `packageDb' In the expression: registerPackage verbosity installedPkgInfo pkg lbi inplace packageDb cabal: Error: some packages failed to install: cairo-0.11.1 failed during the configure step. The exception was: ExitFailure 1
There's some sort of glitch with Gtk2hs (on which SOE depends) that causes it to not build with GHC 7.x (?) unless you hand-edit some of the files (!) http://hackage.haskell.org/trac/gtk2hs/ticket/1203

Is this worth chasing down? I loaded the Haskell Platform, which I assume has some graphics capability (Cairo?). Maybe my time would be better spent getting familiar with that?
Michael
--- On Sun, 5/29/11, Andrew Coppin
/tmp/glib-0.11.22906/glib-0.11.2/Gtk2HsSetup.hs:190:70: Couldn't match expected type `[PackageDB]' with actual type `PackageDB' Expected type: PackageDBStack Actual type: PackageDB In the sixth argument of `registerPackage', namely `packageDb' In the expression: registerPackage verbosity installedPkgInfo pkg lbi inplace packageDb cabal: Error: some packages failed to install: cairo-0.11.1 failed during the configure step. The exception was: ExitFailure 1
There's some sort of glitch with Gtk2hs (on which SOE depends) that causes it to not build with GHC 7.x (?) unless you hand-edit some of the files (!) http://hackage.haskell.org/trac/gtk2hs/ticket/1203 _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 29/05/2011 02:52 PM, michael rice wrote:
Is this worth chasing down? I loaded the Haskell Platform, which I assume has some graphics capability (Cairo?). Maybe my time would be better spent getting familiar with that?
As far as I'm aware, the Haskell Platform doesn't come with any graphics-related packages, except low-level bindings to either X11 or Win32 (depending on which platform you're running on, obviously.) Cairo is part of the Gtk2hs collection of packages (i.e., the ones that aren't building right). The fix that makes Gtk2hs build isn't difficult, it's just tedious and error-prone.

Of which I was speaking, just saw it there this morning. Is there an adequate basic tutorial available?
Michael
--- On Sun, 5/29/11, Daniel Fischer
As far as I'm aware, the Haskell Platform doesn't come with any graphics-related packages
I thought OpenGL was in the platform. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 29/05/2011 06:23 PM, Daniel Fischer wrote:
On Sunday 29 May 2011 19:14:57, Andrew Coppin wrote:
As far as I'm aware, the Haskell Platform doesn't come with any graphics-related packages
I thought OpenGL was in the platform.
Uh... yes, you might be right about that. However, AFAIK you still need something with which to create a rendering surface in the first place. (Not sure if HP includes GLUT...)

On Sun, 29 May 2011 22:50:46 +0200, Andrew Coppin
On 29/05/2011 06:23 PM, Daniel Fischer wrote:
On Sunday 29 May 2011 19:14:57, Andrew Coppin wrote:
As far as I'm aware, the Haskell Platform doesn't come with any graphics-related packages
I thought OpenGL was in the platform.
Uh... yes, you might be right about that. However, AFAIK you still need something with which to create a rendering surface in the first place. (Not sure if HP includes GLUT...)
As you can see in the HP documentation at http://lambda.haskell.org/hp-tmp/docs/2011.2.0.0/index.html , both OpenGL and GLUT are present. Regards, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html --

Henk-Jan van Tuyl commenting Andrew Coppin
... (about HOpenGL and H.Platform) ...
Uh... yes, you might be right about that. However, AFAIK you still need something with which to create a rendering surface in the first place. (Not sure if HP includes GLUT...)
As you can see in the HP documentation at http://lambda.haskell.org/hp-tmp/docs/2011.2.0.0/index.html , both OpenGL and GLUT are present.
Or simply download and execute the examples before raising doubts... (the Haskell translation of the NeHe tutorials, etc.) No need for speculation. Now, I have a personal pedagogical comment. A few months ago I gave to some 30 students an assignment (a family of, with freely chosen variants). A long one, to complete in 2 months or more, and the subject was - the implementation, coding and running some nice 3D scenes with HOpenGL. I teach Haskell for years, usually the projects, which should be "applied" are devoted to some exercices in AI / games, compilation, text processing, graph manipulation, lazy numerics, etc., you know the song. This time I decided to propose something more visual. The results? A true DISASTER! They did "something", all of them, and all their realisations were the nec plus ultra of mediocrity... Since my students were as clever and laborious as always, and I didn't drink much vodka during this process, I asked them what happened? The short "standard" assignments went smoothly as always... The answers (concentrated) were as follows: The OpenGL bindings in Haskell are hardly "functional". You make us sweat with generic functional patterns, laziness, exquisite typing, non-determinism monad, parsing tools, etc., and then you throw us into this ugly imperativism ! Nobody liked your assignment, it was no pleasure for us, and our results are the consequence thereof. Where is Haskell?? Of course, we had to execute the typical syntactic gymnastics, but without understanding the functioning of all those "variables", and other stuff relevant to the stateful OpenGL engine. Perhaps, if we had before a semester of OpenGL, and at least two months of a true course/tutorial (not your pseudo-tutorial on the Web...) we could be more productive. That's it... I don't want to generalize, but there is a huge work to do in this context. All the best. Jerzy Karczmarczuk Caen, France

On Mon, May 30, 2011 at 1:19 AM, Jerzy Karczmarczuk
Henk-Jan van Tuyl commenting Andrew Coppin
... (about HOpenGL and H.Platform) ...
Uh... yes, you might be right about that. However, AFAIK you still need something with which to create a rendering surface in the first place. (Not sure if HP includes GLUT...)
As you can see in the HP documentation at http://lambda.haskell.org/hp-tmp/docs/2011.2.0.0/index.html , both OpenGL and GLUT are present.
Or simply download and execute the examples before raising doubts... (the Haskell translation of the NeHe tutorials, etc.) No need for speculation.
Now, I have a personal pedagogical comment.
Wow, this is great feedback! Thank you. I'm CC'ing the opengl list.
A few months ago I gave to some 30 students an assignment (a family of, with freely chosen variants). A long one, to complete in 2 months or more, and the subject was - the implementation, coding and running some nice 3D scenes with HOpenGL. I teach Haskell for years, usually the projects, which should be "applied" are devoted to some exercices in AI / games, compilation, text processing, graph manipulation, lazy numerics, etc., you know the song. This time I decided to propose something more visual.
The results? A true DISASTER! They did "something", all of them, and all their realisations were the nec plus ultra of mediocrity... Since my students were as clever and laborious as always, and I didn't drink much vodka during this process, I asked them what happened? The short "standard" assignments went smoothly as always...
The answers (concentrated) were as follows:
The OpenGL bindings in Haskell are hardly "functional". You make us sweat with generic functional patterns, laziness, exquisite typing, non-determinism monad, parsing tools, etc., and then you throw us into this ugly imperativism ! Nobody liked your assignment, it was no pleasure for us, and our results are the consequence thereof. Where is Haskell?? Of course, we had to execute the typical syntactic gymnastics, but without understanding the functioning of all those "variables", and other stuff relevant to the stateful OpenGL engine. Perhaps, if we had before a semester of OpenGL, and at least two months of a true course/tutorial (not your pseudo-tutorial on the Web...) we could be more productive.
I think the opengl bindings themselves should be have a level that closely matches the C API so that people can use famous books like the redbook to learn it. I wouldn't really expect us Haskellers to stop there though, as that's the OpenGLRaw library. I think we need something a bit higher level on top that lets you use non-FFI types. That's the OpenGL library. Then we need something that Haskellers *actually* use that provides resource loading, management, type typing etc. I think we need scene graphs and what have you. There is a summer of code student working on the OpenGL library part of it, or HGL as he likes to call it. I know someone else has been working on a scene graph / scene management library. I don't think the opengl creators meant for people to develop at that level. I think they really did mean for people to build "middleware" on top of it and I think that's what we in the Haskell community need to do. By the way, did you show your students gloss? http://hackage.haskell.org/package/gloss Thanks, Jason
participants (6)
-
Andrew Coppin
-
Daniel Fischer
-
Henk-Jan van Tuyl
-
Jason Dagit
-
Jerzy Karczmarczuk
-
michael rice