I wonder how the author translated actor heavy code to clojure - I guess the closest available concept would be agents.
I wonder how the author translated actor heavy code to clojure - I guess the closest available concept would be agents.
We used actors to create a pool of workers in order to run some slow processes in parallel. The simplest equivalent in Clojure was to run the processes via pmap. Cheap, quick and very effective. We didn't have as much control over the parallelism but it didn't really matter for our use case.
We had about 1,000 lines of Scala that we'd developed as we learned Scala. Today we have more experience in Clojure than we did in Scala back then. Writing 260 lines of Clojure with the Scala code as a guide took a couple of days, including writing a new set of unit tests.
Learning enough about Akka to migrate to it would have taken us some time - and would still have left us with three languages in the mix. By replacing this Scala code with Clojure, we only had two languages in the mix, which was also a win.
It sounds to me like you got a large code reduction because in Scala you used a heavyweight concurrency solution to a lightweight parallelism problem.
(And parallel collections came in 2.9, not 2.8 - we'd already migrated, painfully, from 2.7 to 2.8)
I wonder how 15 hours in the post become a couple of days here on HN. But of course, the post was written as an anecdote and should be taken as that.
Could you elaborate what makes Akka "a language" for you? I did assume Akka actors are for all practical reasons a drop in replacement for scala actors.
More people should btw. read "Anecdotal Evidence and Other Fairy Tales" in Hacknots book:
Akka is _not_ a language - I'm not sure where you got that impression? (please explain so I can respond to it - no judgement). Based on the Akka documentation (pre-1.0), it did not seem to be completely a "drop in replacement for scala actors" but I hope it's moving that way (and I'm very pleased that Scala is adopting Akka as the default implementation!).
Heh, yes, anecdotes are meant to be just that....
Average work day being ~8 hours, 15 hours == a couple of days :)