Off On an Erlang Adventure
I have decided for some reason that it would be fun to play with massively scalable systems. In particular, I thought it would be a hilarious waste of time to work on an MMO engine. I’m not sure why this seems like a good idea, given that I have more than enough on my plate as it is, but I justified it by saying that time that I might’ve spent playing a game will now be spent creating a game. We’ll see how it goes.
For scalability, and for an excuse to learn something new, I thought I’d play with Erlang. Erlang is a functional programming language that is completely geared toward concurrency. It’s not so fast with the number-crunching we’d expect to do with a game for physics and collision detection, but it is really well-suited for having zillions of semi-independent entities wandering around. Hopefully we can figure out a way to offload hard core number crunching to C via an FFI interface of some kind, but we’ll cross that bridge when we get to it. For now, I’m just trying to learn how to build a real-life application in Erlang.
Most of the documentation on Erlang seems to revolve around learning functional programming. I feel pretty good about FP already, due to having taken 6.001 back in the day. Tutorials about implementing the factorial function in Erlang aren’t really what I’m looking for. I’ve ordered Programming Erlang from Amazon and it’s due to arrive on Friday, so hopefully that’ll get me going. Stay tuned and maybe this will all be useful to you, too.
February 8th, 2008 at 8:37 pm
Let me know what you think about the book. I\’m divided over it since a lot of what Joe talks about is available for free online in various PDF books. I think it\’s annoying when he decides to pose non-trivial questions and then leaves the answers up to the reader to figure out. For a lot of topics he tells you to go read the Erlang man pages. For $36 am I wrong to expect the author to provide complete information and thorough treatment of all the mentioned topics? It\’d almost be better if he didn\’t mention the subjects at all, rather than leave the reader feeling left out in the cold.
I\’d be interested to know what you come up with as far as the physics go. I too am looking into Erlang as a platform for a generic game server (MMO and otherwise). I\’m especially worried about scripting and the problems that immutable data present when dealing with large sets of data. Maybe another port to an external lua or python instance that more traditional developers can write scripts against?