[Haskell-cafe] H98, OOHaskell - getting started with objects in Haskell

caseyh at istar.ca caseyh at istar.ca
Mon Jan 17 00:15:01 CET 2011


If you want to use an OO approach: try thinking of a sparse array of  
objects (previous and current generations) where each object "knows"  
its coordinates by being linked into a sparse array data structure.


Quoting gutti <philipp.guttenberg at gmx.net>:

>
> On Fri, 14 Jan 2011 12:36:22 -0800 (PST)
> "Wolfgang Jeltsch-2 [via Haskell]"
> <ml-node+3341886-976283800-146367 at n5.nabble.com> wrote:
>
>> Is this really ideal for OO? I thought that in a cellular automaton,
>> all cells have to change synchronously. In addition, cells have to
>> access the old states of their neighbours to compute their new
>> states. So you would have to heavily synchronize the objects.
>>
>> In this light, I?d say that the distributed OO approach isn?t very
>> practical. A global control of the whole system might be better.
>>
>> Note that I?m by no way an expert in cellular automata. I?m just
>> thinking of the game of life. :-)
>>
>> Best wishes,
>> Wolfgang
>
> Hi Wolfgang,
>
> I don't yet have experience with cellular automata either. What u say
> seems plausible, but then the life game might have been coded that way,
> because most OO language don't offer concurrent objects and the
> distributed OO approach (seems to be a very recent concept).
>
> Looking at life u probably could save time, if u only would evaluate
> code on cells, where the neighbors have changed status. So rather than
> triggering them all centrally and each checks its neighbours, we could
> use the concept:
>
> - let the active ones trigger the neighbours & so pass on activity
>






More information about the Haskell-Cafe mailing list