I assume most Clojure experts have seen Rich Hickey's ants demo ( http://gist.github.com/1093917 and http://blip.tv/clojure/clojure-concurrency-819147). If one were to try to make a distributed version of the same app, but browser-based where each browser controlled one ant, is there anything from Clojure/ClojureScript that would aid in the transactional nature of the behave
function (assuming behave
was run on the client)? Or are Clojure/ClojureScript's STM features really not intended for distributed use?
i.e., if on the client I'm at (3,2) and want to move to (3,3), and in my client (browser)'s world (which could be slightly stale, the same way in Rich's original version that the Thread was slightly stale) that square is empty, but then I send the request to the server and in the server's world that square is full, is there any kind of distributed STM in ClojureScript that can tell me—nope that square was full and you have to revert that move so your next move will have to start from (3,2) again. In Rich's original presentation that was all automatic, built into Clojure's STM functionality. But distributed, will that have to be more explicit, or is there existing functionality built in to do this?
If that kind of thing is not built into Clojure/ClojureScript, are there other platforms that might be more suitable?