Stack Based Epoch, part deux

Published August 23, 2008
Advertisement
I decided to take a few spare minutes and get back into working on Epoch, particularly on making things purely stack-based.

So far, so good; almost all of the arithmetic operations and other built-ins have been removed, awaiting reimplementation in stack-aware forms; but other than that, everything remains intact and functional.

The following Epoch program demonstrates the working stack:
entrypoint : () -> (){	integer(test, 2)	testfunction(test, 40, "Output, this is a test")}testfunction : (integer(foo), integer(bar), string(baz)) -> (){	debugwritestring(baz)	debugwritestring(cast(string, add(foo, bar)))}


You may note that lexicalcast is gone, in favor of the more succinct and flexible cast operation. This operation will be the basis for all type conversions in the language, at least so far as I can foresee at the moment. With a small amount of work, real/integer and real/string conversions will be possible as well as string/integer conversions.


One of the trickier bits I had to wrap my head around was splitting the type checking into load-time rather than run-time. This is basically a crude bit of static analysis, done to ensure things maintain correct types; the stack itself contains no type annotations, just data, so it is mandatory that we are statically aware of what kind of data resides at each slot in the stack.

That seems to have been conquered, though, and leaves me with just a handful of minor reimplementation tasks before everything is back up to Release 2 levels of functionality. Woohoo!


As I think I've stated before, my next big project is a Scribble application, where you can draw neat little squigglies on a blank white window using the mouse. This will be a full test of several features, most notably structures, since structure support is required for communicating to most of the Win32 API.

At the moment, I have no idea how I'm going to implement structures, so I might content myself with making a tidy-up pass on the Fugue code and putting out a Release 3 to demo the stack-based changes.


So Epoch continues to progress. I'm not sure if I'll hit my goal of having a workable prototype language ready for GDC '09, but I should get pretty darn close. At the very least I'll have enough to prove that Epoch can be a viable real-world production language, given enough patience and grunt work - and that's all I really want to accomplish anyways.

Taking over the world is just a bonus.
0 likes 2 comments

Comments

Telastyn
How are you going to implement virtual dispatch if there's no type tokens with the data? (not challenging that it's wrong/impossible, just curious due to lack of formal training)
August 24, 2008 12:11 AM
ApochPiQ
There will be type information for all UDTs; it's just the built-in types that don't need it. ... At least, I don't think they'll need it [grin] If it ends up being otherwise, it should be an easy enough fix.

I haven't quite decided on how the UDT system will work; if I will differentiate between POD structures and "classes" (which will just be globs that you can send messages to) or whatnot. Lots of thinking yet to be done on that front.
August 24, 2008 12:40 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement