|
|
|
|
|
by gordonguthrie
4536 days ago
|
|
No. The client and the server are such different environments. In the server you want 10s of 1,000s of processes, with long lifes (years, months) and hot code loading and supervision/restart. None of this is needed/available in the browser. So the key goal is low-impedance - the developer has a mental model where this is say a server-side process and the business rule is 'send the user a message' so they write code like: call_user("gordon@vixo.com", modal, {"Did you brush your teeth?", {"yes", "no"}})
and the 'modal' process in my browser gets some message like: {msg, {"Did you brush your teeth?", {"yes", "no"})
It pops a yes/no dialog box and send "yes" back to the calling process on the server. |
|
Supervision and restart are not only useful if a application is long running, if you implement a game, a user might to spend many hours on a page. They might leave it open in a different tab for a long time and expect it to work when they get back.
I know more about CSP and not Actors but there you use many of the same tricks (I think). And I really don't see why one would constrain the browser side.
See for example this project: http://www.infoq.com/presentations/pedestal-clojure