Sunday, December 15, 2019

What functional language is most suited to create games with?



I have had my eye on functional programming languages for a while, but am hesitating to actually get into them. But I think it's about time I at least starting glancing that direction to make sure I'm ready for anything.


I've seen talk of Haskell, F#, Scala, and so on. But I have no clue the differences between the languages and their communities, nor do I particularly care; except in the context of game development.


So, from a game development standpoint, which functional programming language has the most features suited for game programming? For example, are there any functional game development libraries/engines/frameworks or graphics engines for functional languages? Is there a language that handles certain data structures which are commonly used in game development better?


Bottom line: what functional programming language is best for functional game programming, and why?



I believe/hope this question will declare a clear best language therefore I haven't marked it CW despite its subjective tendency.



Answer



F# being part of Microsofts .net family has access to XNA, which is a fantastic base for building games. A bit of googling turns up some tutorials, videos and articles. The great XNA docs should help as well.


There has been some movement in games for Haskell as well, see here. You'll probably be using openGL bindings.


Since Scala plays in Java land, it integrates with all the available Java engines/bindings, see this SO post.


I think it comes down to preference, while I've only played with Haskell, I'd imagine each functional language has it's own idiosyncrasies. It may be worth whipping up a small test game in each and seeing which one feels better to you.


Like I said I only have minimal Haskell experience, so I can't comment on the best, but these resources should get you started hopefully.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...