🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

*Yawn*

Published May 21, 2009
Advertisement
I've spent the few rare free moments I have working on Epoch lately; there's a healthy set of things getting checked off the R7 work list (see previous entry) and progress is definitely being made.

There's still a few kinks to work out, but infix operators are now working more or less perfectly. Along with a few other tweaks, this changes the code from something nasty and littered with function calls, to this:

//// 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(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("Main task: " . cast(string, baz))	responsemap(resulthandler)	{		result(real(foo)) => { debugwritestring("Pi result: " . cast(string, foo)) }		completed(integer(a), string(b)) => { debugwritestring(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, 4.0 / denominator)		if(isplus == true)		{			retval = retval + div		}		else		{			retval = retval - div		}		isplus = not(isplus)		denominator = denominator + 2.0	} while(denominator < denominator_limit)}


Since the lack of good infix operators was pretty much the number one complaint about the language, I trust that this will boost your enthusiasm accordingly [wink]
Previous Entry Syntax improvement FTW
Next Entry R7 Status Update
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement