[erlang-questions] write the ant simulation in Erlang?

Brian Zhou <>
Wed Oct 8 23:56:34 CEST 2008


Recently I watched clojure concurrency video, very impressive talk.

    http://blip.tv/file/812787

In the talk, lot of time was spent on walking thru the ant simulation code.

Like many of you here, I was not convinced by the STM approach.
Especially seeing the "Santa Claus" solution in Haskell and Erlang
side-by-side.

But I'm having some difficulty thinking about how to use Erlang for
this ant simulation problem.

It was suggested to me in IRC to have a manager process for the world
state, with interface like world:is_food(loc). But how to make sure
certain calls are in a a transaction? e.g. world:is_food(loc) and
world:take_food(loc)? Maybe move what needs to be in a transaction
into world:single_function() ?

Thanks in advance for any idea,

-Brian



More information about the erlang-questions mailing list