Good resources for using functional programming in game development?

I am new to this functional programming paradigm, but for now I like it. Since I participate in game development, I want to try writing some games in a purely functional programming style. I am not against the language - be it Erlang, Haskell, Lisp or even Ruby (I found out that it supports functional programming functions).

Well, it’s obvious that for learning functional programming (in fact, anything), the best advice would be to simply learn a functional language and program a lot in it. But I'm looking for some resources on the use of functional programming in games and game engines (2D or 3D).

So, do you know about any functional programming articles / books / blogs / regardless of their use in real games or about developing simple game engines with functional programming languages ​​and about the interaction between the game engine and the game engine in this functional environment

Please do not suggest something like "just start programming simple things in a functional way and gradually it will come to you." As I said earlier, this is obvious, but what I am asking here is some resources on this subject, if any. Thank!

+44
erlang functional-programming lisp haskell
Jul 30 '09 at 20:20
source share
9 answers

Well, you could do worse than studying the code for some of these haskell games .

Some of them use FRP (functional reactive programming), which some people work as a high-level clean technique for games and other things. But most of them are a typical mixture of spectacular and clean functional code.

Relevant bloggers include James The Hague .

Pay attention to FunGEn at the first link - although it is not actively supported, it is a 2D game engine with working examples.

There is also a clean language with it a game library and beautiful screenshots .

+23
Jul 30 '09 at 20:38
source share

Well, I'm basically a Haskell programmer, so I can only suggest trying out Haskell libraries like Gtk2hs. This is mainly for 2D applications and user interfaces, but it is good to get started. An even simpler library is HGL, but its a bit of listening and obsolescence. If you want to try messier (but cooler!), Then go to the Haskell OpenGL library, which can be found here . I have never tried working with Haskell and OpenGL, but if you look at the answer provided by Simon Michael, there are examples of games in the Hackage Game Section that use OpenGL.

Sorry to not link all the libraries, but I am a new user and I am not allowed to use more than one hyperlink. If you google them, they should come up easily, though.

+7
Jul 31 '09 at 9:56
source share

If you are interested in the network side of games, Joel Reymont wrote about his experiences encoding an online online poker server . I think he made at least three different implementations (Lisp, Erlang, Haskell). Unfortunately, his material is scattered all over the Internet. Here are two pointers you might find useful:

EDIT:

Below are some pointers and links from the above documents.

EDIT II:

Joel has obviously sold his poker code since then, so it is no longer available as open source .

+7
Jul 31 '09 at 17:13
source share

A bit outdated, but this is the first in a series of posts on how to use F # with an XNA game development card. You can also find on the F # blog for game development there is useful material.

+4
Jul 30 '09 at 10:20
source share

Frag is a 3D first-person game written in Haskell by Moon Hong Chong. It is licensed under the GPL. The design and implementation of Frag is described in the Moon test, functional programming, and 3D games.

+3
Jul 31 '09 at 17:38
source share

Wings3D is an Erlang package that is used to draw wireframe shapes. I think it is used in games, but this is not my bag ...

+2
Jul 30 '09 at 20:25
source share

Try this Casting SPEL

+2
Jul 31 '09 at 5:20
source share

Well, I'm not sure how much this helps, and you probably already heard about it, but it seems like an obvious start: here's an article about Jack and Duckster.

+1
Jul 30 '09 at 20:26
source share

As Nathan Sanders (from my own googling on "haskell games gc") claims above, there was a time when Haskell had (?) Some pretty serious problems with GC ... this old article (I know, 6 years), also see this question . Since Frag exists, I assume that they should have captured at least some things in later versions of GHC.

+1
Apr 25 2018-11-11T00:
source share



All Articles