News for hackers. Stuff that matters.
Re:Tetris in Haskell by amichail on Saturday August 08, 2009 @07:06PM (#749964)
Presumably this is newsworthy because building Tetris in Haskell is harder than in an imperative/OO language? Why is that a good thing?
Re:Tetris in Haskell by christopherdone on Saturday August 08, 2009 @08:06PM (#750053)
Presumably this is newsworthy because everyone assumes building Tetris in Haskell is harder than in an imperative/OO language. This is a good thing because it proves that it's not.
Re:Tetris in Haskell by boblol123 on Saturday August 08, 2009 @09:13PM (#750130)
He says its taken him a week to do it and has had to ask lots of people for help. So I'd say its much harder than in a language like C#. I could (and so could most other people here) make tetris in 1-2 days without help.
Re:Tetris in Haskell by jrockway on Sunday August 09, 2009 @01:24AM (#750379)
FWIW, I would need a week and lots of help to do it in C, but I could probably do it in a few days with Haskell.

This says nothing about Haskell or C, but it does say something about me.

Re:Tetris in Haskell by boblol123 on Sunday August 09, 2009 @09:36AM (#750786)
This is a blog about functional languages, so this man obviously knows a lot about Haskell but still required help for a game that would be prettymuch a hello world for someone in almost any other language.

I know nothing of your abilities, even so, if haskell is the only language you know well, I'd be impressed if you could make the game as fast as me or most ppl here.

Re:Tetris in Haskell by mbrubeck on Sunday August 09, 2009 @05:28PM (#751323)
The first paragraph of the post explains, "it’s my first, real foray into Haskell."

If your first real program in any language was a Tetris game, you'd probably need some help getting started too.

As shown by the various games posted elsewhere in this thread, there are perfectly trivial and straightforward ways to write games in Haskell. If nothing else, Haskell's "do notation" makes it easy to safely mix imperative programming with pure functional programming.

When people do post about writing a game in a new language as a notable achievement, it's usually because they did it in part to learn a new language (as in this case) or a new concept (like using FRP or Erlang-style message passing, instead of imperative programming with mutable state).

Re:Tetris in Haskell by boblol123 on Sunday August 09, 2009 @07:27PM (#751506)
Sorry, I missed that sentence, yes you're right. I read the bit to the right of the blog and the blog title which give the impression that he was experienced with Haskell.
Re:Tetris in Haskell by jcw on Saturday August 08, 2009 @09:54PM (#750175)
But the thing is, functional game development techniques are nowhere near as developed or established as those of OO game development. The solutions to the problems at hand aren't as immediately obvious.

This comes to mind: http://prog21.dadgum.com/23.html

Re:Tetris in Haskell by xenoblitz on Wednesday August 19, 2009 @08:55AM (#772607)
All this hinges on the fact that functional languages are only now being appreciated: functional languages seem to be popping up like daisies now either via stand-alone languages such as F#, multiparadigm languages or even in OOP languages (I believe I read somewhere that C# is integrating ideas from the functional paradigm). Still I can't pretend that any functional language has so far become as remotely popular as say Java or C++. Due to this the work done on functional programming and games is quite a niche area which is often explored to do a fun project while learning a language.
Re:Tetris in Haskell by amichail on Saturday August 08, 2009 @10:04PM (#750184)
You don't need to do anything non-trivial for imperative/OO game programming.

If something non-trivial is required for functional programming, then it is more difficult.

Re:Tetris in Haskell by xenoblitz on Wednesday August 19, 2009 @08:57AM (#772612)
As far as I know there is nothing non-trivial that I had to use apart from introducing state when it was needed by the game via monads and muteable variables. At first they were tricky because I was used to taking such things for granted.

What I can tell you is that the backend (which really needs no state) is much more easier to write in Haskell IMHO.

Re:Tetris in Haskell by xenoblitz on Wednesday August 19, 2009 @08:46AM (#772587)
Actually I never said it took me a week :P And I did ask for help because I was learning Haskell as I was implementing the game.