Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't know where to start.

> using pure immutable structures for frame buffers, shaders and other graphical concepts is simply not an option to write games.

Seeing as people have written games in Haskell, this is clearly not true.

> Haskell is interesting in the sense that it doesn't prevent you from using mutable structures (e.g. Lenses, Writer)

Lenses and Writer both only use immutable data. It is possible to use actual mutable data in the ST and IO monads.

> but it encodes this information in the type system.

This is true of IO, but not of ST. With ST, runST :: (forall s. ST s a) -> a, hides the effects.

> it's often much easier to reason about locks and semaphores than about immutable lazily initialized structures.

I don't know what you mean by this. In terms of functional correctness, immutable data-strucutures, lazy or otherwise, are much easier to reason about. If you are talking about resource-usage, sure, it's a little harder to reason about lazy data-structures than strict ones, but give me a space leak over a race condition to track down any day.



It’ll be interesting to see how the performance issues play out, no? In order to get reliable memory behaviour, you still have to go through a certain amount of voodoo to appease the gods that govern the interplay of laziness and GC. There are comparatively few people who really know how to optimise Haskell code from top to bottom—in part because there is such a distance between top and bottom.


"It’ll be interesting to see how the performance issues play out, no?"

Not really. There's no question whatsoever that GHC can run a fine Wolf3D on fractions of a modern hardware setup. You could do it in pure Python with no NumPy. There's tools to help with the laziness stuff and a 3D rendering loop will fit those perfectly.


Sure, Wolf3D is almost a quarter of a century old by now.

But the performance limits of immutable structures for simulation and graphics are certainly interesting to me.


Absolutely, but it is certainly possible.


>It’ll be interesting to see how the performance issues play out, no?

Not really, 3d rendering in haskell via opengl is not new or interesting at this point. Frag is 8 years old for example: http://www.haskell.org/haskellwiki/Frag




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: