

Ants: locks vs stm - silkodyssey
http://groups.google.com/group/comp.lang.lisp/msg/a86c91091ae16970

======
gruseom
I don't know anything about this and the flame/troll aspect of the thread
makes me not want to. I was kind of hoping that a new Lisp on a new platform
might have a chance at a fresh start clear of all that stuff.

I did notice one thing, though. Assuming that what Rich Hickey's saying is
true, it would be better to point to something visible that the demo does that
the knockoff can't do. If it's possible to appear to reproduce a demo without
doing the hard parts, then maybe the demo wasn't actually _demonstrating_ the
hard parts. In that case a better demo would be a good idea. Such things can
be hard to come by, though, as demos tend to be relatively simple and thus
knockoffable.

~~~
arohner
This locks vs. STM debate is a lot like the old malloc vs. GC debates. "Look
at my fancy new Java code. I just do foo = new Foo(); and everything is taken
care of" and then a C++ guy responds with "so? I can do foo = new Foo();
delete foo; That's only one more line than your fancy GC system. My version is
also faster because it doesn't _waste_ time on GC".

Locks vs. STM will play out about the same way. It's hard to demonstrate all
the things you _don't_ have to care about with GC. Making a _good_ demo that
shows you don't need to worry about memory leaks, double freeing, memory
corruption, etc is hard. The same is true of making a good demo for STM that
illustrates all of the problems you don't have to worry about compared to
locks.

I think the ants demo is a good idea technically. Now it just needs a set of
"rules", similar to what Rich just posted.

~~~
chwahoo
The similiarities between GC and STMs extend beyond this particular debate as
Dan Grossman describes in his 2007 OOPSLA paper:
[http://www.cs.washington.edu/homes/djg/papers/analogy_oopsla...](http://www.cs.washington.edu/homes/djg/papers/analogy_oopsla07.pdf)

------
utx00
talk about loop abuse:

    
    
         (flet ((make-random-move (rankf)
                         (loop for place in places
                               for rank = (funcall rankf place)
                               collect (cons place rank) into ranks
                               sum rank into ranks-total
                               finally (loop with r = (if (zerop ranks-total) -1
                                                        (random ranks-total))
                                             for (place . rank) in (shuffle ranks)
                                             sum rank into current-ranks-total
                                             when (< r current-ranks-total)
                                             do (cond ((and (eq place ahead) (move ant)))
                                                      ((eq place ahead-left)
                                                       (turn ant -1))
                                                      ((eq place ahead-right)
                                                       (turn ant +1)))))))
                  (if (ant-food ant)

~~~
sbt
Yeah, this piece illustrates why Python is such a success and Lisp is not.
Lambda may be the ultimate imperative, but certainly not the most convenient
in many cases.

~~~
tc
You're not serious? The loop macro is the most Pythonic aspect of CL (c.f.
list comprehensions). Your trouble handling that loop has nothing to do with
lambdas.

~~~
utx00
right, but i'm guessing his (and mine) trouble handling that loop has more to
do with loop that it does with us - at least that's what i tell myself so
please be gentle

------
diN0bot
full thread is somewhat more interesting than one guy's bitchy smackdown.
[http://groups.google.com/group/comp.lang.lisp/browse_thread/...](http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/1d014c846acaadc8/a86c91091ae16970)

~~~
rbancroft
um, no it isn't. And that one guy happens to be the guy who invented clojure.
Rich Hickey does often seem a bit testy at times, but I think it's because he
is a bit of a visionary and it is tiring always having to drag along people
that don't quite get it.

~~~
icey
If you follow CLL, Rich and Pascal have had a back and forth on the newsgroup
on more than this occasion.

~~~
slpsys
That actually makes a lot of sense, in context; I was wondering why/how Rich
had enough time to pore over some random guy's implementation of ants, not
knowing much about Pascal (until this HN thread). I think if people ignorant
to his own accomplishments, it's because many F/OSS project mailing lists or
IRC channels see messages from someone new to the project claiming a more
naïve version of Pascal's email every few months (or weeks).

------
itistoday
I haven't seen a smackdown like that in a while... but that was just too easy,
the OP had no clue what he was dealing with.

Had he watched the Clojure concurrency video in which Rich extensively
discusses the ant colony simulation and its purpose, he might not have made
that mistake:

<http://blip.tv/file/812787>

~~~
tc
Pascal Costanza (the OP) is a smart guy. He's behind the ContextL and AspectL
frameworks, and he just published an interesting paper on implementing
hygienic macros within an unhygienic macro system [1]. But in this instance,
it seems he clearly missed the point of the Ants exercise.

[1] <http://p-cos.net/documents/hygiene.pdf>

