Jump to content
  • Advertisement
  • entries
  • comments
  • views

Variable syntax is finally sane

Sign in to follow this  


At long last, the Epoch syntax for defining and initializing variables has gotten some love.

Here's how R12 Epoch looks:

add : integer a, integer b -> integer c = a + b

entrypoint :
integer forty = 40
integer two = 2
integer the_answer = add(forty, two)
debugwritestring(cast(string, the_answer))

I plan to kill debugwritestring forever in an upcoming checkin, so be prepared to start writing "print" instead. It will also feature overloads for printing integers, reals, and booleans directly, so you don't have to manually cast them all over the place.

From there, it's just a matter of rebuilding a lot of compiler polish-work so that things like sensible error generation become possible. I'll also need to do some hefty work on the compiler test suite to make sure that all the syntactic and semantic corner cases are covered and well-tested, which should help alleviate some of those stupid situations where I ship a release with half the examples busted.

In other news, it's difficult to restrain myself from heading off on a rabbit trail and starting to work on native code generation via LLVM. In fact, screw it, I might just start working on that in parallel with the compiler rewrite, and push back R12 a bit. I dunno.

Maybe this nice bottle of scotch will tell me what I should do...
Sign in to follow this  

1 Comment

Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!