How about Haskell's GC performance for soft realtime application like games?

2.3k views Asked by At

Because I realized game rule logic should handle huge complexity, I'm considering using of non-typical language in game field as in-game logic script language. The reason of in-game script is representing complex logic with less code. So extremely well abstracted language required.

But most well-abstracted languages use GC. And normally the GCs make CPU burst load. Basically it defers clearing memory operation, and do it at once. Really critical to realtime graphics including games and GUI.

AFAIK, Haskell's GC is little bit different with other GC based languages cause of it's immutable attribute. It's hard to imagine. I couldn't find any document this in detail.

What's different? And is it CPU burst free for long running programs? (well distributed load over time, manual complete GC command can be called for each tick)

3

There are 3 answers

4
Alp Mestanogullari On BEST ANSWER

You may want to look at the thread initiated by Luke Palmer here : http://www.haskell.org/pipermail/haskell-cafe/2010-February/thread.html#73881

2
J D On

You may be interested in this blog post by Simon Marlow about moving GHC from stop-the-world collection to something more concurrent with pause times more suitable for soft real-time applications such as games.

I haven't benchmarked GHCs latency profile myself but, as I understand it, those 0.0007ms pause times may seem small but they are proportional to the heap size which is tiny for that toy tic-tac-toe program so real heaps and pause times will be orders of magnitude larger.

0
Don Stewart On

You might be interested in the commercial Haskell game, Nikki and the Robots, released in 2011 by Joyride Labs.

enter image description here

They don't seem to be having any trouble with having a garbage collector.