Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-06-01 Thread Jason Dagit
On Mon, May 30, 2011 at 1:19 AM, Jerzy Karczmarczuk
 wrote:
> 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

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-30 Thread michael rice
and then
cabal install soegtk?
Michael
--- On Mon, 5/30/11, John Lato  wrote:

From: John Lato 
Subject: Re: [Haskell-cafe] Haskell School of Expression (graphics)
To: "michael rice" 
Cc: haskell-cafe@haskell.org, "Andrew Coppin" 
Date: Monday, May 30, 2011, 8:48 AM

From: michael rice 


I think this is fixed in the gtk2hs source tree, have you tried building from 
the repo?
> cabal install gtk2hs-buildtools> darcs get --lazy 
> http://code.haskell.org/gtk2hs/
> cd gtk2hs> chmod +x bootstrap.sh> ./bootstrap.sh John Lato




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  wrote:



From: Andrew Coppin 

Subject: Re: [Haskell-cafe] Haskell School of Expression (graphics)

To: haskell-cafe@haskell.org

Date: Sunday, May 29, 2011, 9:45 AM



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
 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-30 Thread John Lato
>
> From: michael rice 
>

I think this is fixed in the gtk2hs source tree, have you tried building
from the repo?

> cabal install gtk2hs-buildtools
> darcs get --lazy http://code.haskell.org/gtk2hs/
> cd gtk2hs
> chmod +x bootstrap.sh
> ./bootstrap.sh

John Lato


> 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  wrote:
>
> From: Andrew Coppin 
> Subject: Re: [Haskell-cafe] Haskell School of Expression (graphics)
> To: haskell-cafe@haskell.org
> Date: Sunday, May 29, 2011, 9:45 AM
>
> 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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-30 Thread 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.
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


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-29 Thread Henk-Jan van Tuyl
On Sun, 29 May 2011 22:50:46 +0200, Andrew Coppin  
 wrote:



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

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-29 Thread 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...)


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-29 Thread michael rice
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  wrote:

From: Daniel Fischer 
Subject: Re: [Haskell-cafe] Haskell School of Expression (graphics)
To: haskell-cafe@haskell.org
Date: Sunday, May 29, 2011, 1:23 PM

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.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-29 Thread Daniel Fischer
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.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-29 Thread Andrew Coppin

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.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-29 Thread michael rice
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  wrote:

From: Andrew Coppin 
Subject: Re: [Haskell-cafe] Haskell School of Expression (graphics)
To: haskell-cafe@haskell.org
Date: Sunday, May 29, 2011, 9:45 AM

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

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-29 Thread Andrew Coppin

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

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell School of Expression (graphics)

2011-05-28 Thread michael rice
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 ~]$ 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe