Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've been wanting to try out graphics in Haskell. From what I've seen, the available libraries are either front-ends to C/C++ libraries, or an abstraction of them with minimal features. The high-level libraries do not seem to suit my needs, and so I'm left with lower-level front-ends.

What I need is to render tiles and text - basics for a very simple game. I know how to do this with C, and was thinking I could write the graphics in C and interface it with Haskell. The alternative is to write the graphics using a Haskell library.

My question is, can available Haskell libraries achieve what I want? I do not want to bend over backwards; if C can do it better than I would like to know.

share|improve this question
1  
How much should be done is unanswerable if you don't tell us what you need be done. How much could be done is a different question, one that might even be on topic. –  Yannis Rizos Nov 2 '11 at 6:01
    
Hi Pubby8, if you can update your question with what exactly you're trying to do that's got you thinking about this, feel free to flag it for reopening. –  user8 Nov 2 '11 at 7:03
2  
Why not use SDL? It's low-level (for Haskell), yes, but I don't think that writing graphics in C would give you considerable benefits. –  Anton Barkovsky Nov 2 '11 at 19:22
add comment

2 Answers

If you are asking if there is a good C/C++ alternative to haskell that does GUI well, then look no further: http://qt-project.org/

Definitely the strongest GUI framework out there for C++.

If however, your question was "find me something better in haskell" then I can't help you :/

share|improve this answer
add comment

SDL is an excellent library with good Haskell bindings—and related libraries for images, audio, and text—for which enough tutorials exist to get you off the ground; being rather low-level, it requires a bit of care to keep things pretty and functional, but in my experience SDL and Haskell make a superb combination.

share|improve this answer
    
I've used SDL before as a C library. How similar is the Haskell version to the C one? –  Pubby Nov 3 '11 at 2:47
    
@Pubby8: They’re quite similar. All the Haskell version really does is explicate where IO is happening. –  Jon Purdy Nov 3 '11 at 14:07
    
+1, I second this recommendation. I'm using SDL with Haskell to code a small 2D game, so far with no problems. –  Andres F. Nov 23 '11 at 13:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.