Unfortunately I can't afford to let this sit around for a few days collecting ideas, since I have such time pressure to get it all implemented and running. However, if some good suggestions arise, I'll definitely do what I can to change the syntax. For now, though, this is what message passing will look like:
entrypoint : () -> (){ task(async) { integer(my_foo, 0) dispatch initialize : integer(foo)) => { assign(my_foo, foo) } wait(initialize) message(master, result(add(my_foo, 42))) } dispatch result : (integer(foo)) => { debugwritestring(cast(string, foo)) } message(async, initialize(4)) wait(result)}
2100 Hours
Erugh. The more I look at that code, the worse it sucks.
The first thing that came out of my twisted head looks like this:
entrypoint : () -> (){ task(async) { integer(my_foo, 0) onmessage(initialize(integer(foo))) { assign(my_foo, foo); } wait(initialize) message(master, result(add(my_foo, 42))) } message(async, initialize(4)) onmessage(result(integer(foo))) { debugwritestring(cast(string, foo)) } wait(result)}
Slightly more readable but still disgusting.
It looks like I may have to violate my own principles and include some new symbols, because this function-style mess is getting ridiculous for complex tasks.
Will post further updates as I come up with (hopefully) better alternatives.
Ten minutes later...
Here's another attempt:
message sendint :( integer(foo))entrypoint : () -> (){ task(async) { integer(my_foo, 0) onmsg(sendint) { assign(my_foo, foo) } wait() master(sendint, my_foo) } async(sendint, 4) onmsg(sendint) { debugwritestring(cast(string, result)) } wait()}
On the plus side, I find it nice and compact and pretty readable. On the down side, it's still kind of hard to see how the flow of messages and data works. Also, having to pre-declare messages kind of sucks.
2125 Hours
Another alternative, mainly just a slight tweaking to get the syntax more "Epoch-like":
entrypoint : () -> (){ task(async) { integer(my_foo, 0) onmsg sendint : (integer(foo)) { assign(my_foo, foo) } wait() mastertask(sendint(add(my_foo, 42))) } async(sendint(99)) onmsg sendint : (integer(foo)) { debugwritestring(cast(string, result)) } wait()}
Still not really happy with it, but it's better than the other options, at least IMHO.