The results of this aren't really easy to show, obviously, but there is one advance - the acceptmsg() function can now be passed a reusable response map which dictates how a task will respond to receiving certain messages from other code.
I also did some tweaking to the grammar so that whitespace is a bit more relaxed. The combination of these two things yields the following update to the task demo program:
//// TASKS.EPOCH//// Demonstration of the multiprocessing capabilities of Epoch//entrypoint : () -> (){ task(asyncjob1) { pi_task() } task(asyncjob2) { pi_task() } task(complexjob) { acceptmsg ( compute(integer(a), integer(b), integer(c), string(d)) => { message(sender(), completed(add(multiply(a, b), c), d)) } ) } message(asyncjob1, calculate("ignored")) message(asyncjob1, ignoredmessage("foo", "bar", 42)) message(asyncjob1, calculate(10000.0)) message(asyncjob2, calculate(50000.0)) message(complexjob, compute(5, 4, 2, "Filler")) debugwritestring("Please wait, async tasks running...") integer(baz, 42) debugwritestring(concat("Main task: ", cast(string, baz))) responsemap(resulthandler) { result(real(foo)) => { debugwritestring(concat("Pi result: ", cast(string, foo))) } completed(integer(a), string(b)) => { debugwritestring(concat(b, cast(string, a))) } } acceptmsg(resulthandler) acceptmsg(resulthandler) acceptmsg(resulthandler)}pi_task : () -> (){ acceptmsg(calculate(real(limit)) => { message(sender(), result(pi(limit))) } )}pi : (real(denominator_limit)) -> (real(retval, 0.0)){ real(denominator, 1.0) boolean(isplus, true) do { real(div, 0.0) assign(div, divide(4.0, denominator)) if(equal(isplus, true)) { assign(retval, add(retval, div)) assign(isplus, false) } else { assign(retval, subtract(retval, div)) assign(isplus, true) } assign(denominator, add(denominator, 2.0)) } while(less(denominator, denominator_limit))}
Unfortunately, somewhere in my mucking about in the parser, I've introduced several memory leaks. So my priority for now is getting those issues squished. From there I've got a few minor improvements to make, and then the Big One: lockless message passing. I'm hoping to get that done in short order so I can take some time before GDC to clean up and polish the code a bit more.
This week is going to be very long, and not nearly long enough.