🎉 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!

The Daily Epoch Running Update

Published August 02, 2008
Advertisement
Today's little slice of work on Epoch consisted of something rather different: serialization to a binary format on disk.

Currently, the parser loads raw text code and converts it to lists of "operations" within memory; each operation is an atomic action (from the language's point of view) and includes things like assigning values into variables, invoking function calls, and so on.

Up until now, that binary data has existed purely in memory. As the language - and, specifically, the grammar - becomes more complex, it takes increasingly long to parse that raw code into binary form. To get past this, I'm working on caching the binary data into a separate file for faster loading and execution.

There's another motivation for this engineering decision as well: I will be converting the VM from a standalone EXE to a standalone DLL. You feed the DLL a binary Epoch file, and it executes it. The VM DLL will be totally self-contained, aside from the interface to A) get the version and make sure it is compatible with the binary code, and B) fire off the execution of the program itself.

Therefore, the new Epoch toolchain will look something like this:
  • Text editor for the coding phase (will eventually be an IDE, possibly integrated into Visual Studio)

  • Binary conversion pre-pass tool (outputs binary code)

  • Code optimization and static verification pass (refines binary code)

  • Execution stub (a simple platform-specific executable that invokes the VM

  • VM DLL which actually executes the binary code


This introduces the pseudo-code compiler tool, which will take the results of the binary conversion pass (and, someday, the results of the optimization pass) and bury it inside an EXE (or whatever local platform-dependent packaging). The EXE will be a simple stub that reads the pseudo-code data from disk and passes it into the VM DLL for execution.


Ten bonus points to anyone who knows where I got that idea [wink]



There are a couple of major advantages to doing this. First and most significantly, it allows the distribution of binary-format (as in .EXE) Epoch programs, and will be available very soon in the development cycle. Coders will be able to write Epoch software and have it run on any machine. Secondly, by splitting the VM into a DLL, all Epoch programs on a local system can use the same VM code, without having to have a copy of the VM itself embedded in each program. This is basically how most real-world VMs operate anyways.


One concern with the binary format is that it is actually easily converted back directly to raw source code, since it stores variable and function identifiers as raw strings. I might look into making an obfuscation pass for "release mode" binaries that don't need debug information like variable names. That should be fairly straightforward.



A couple of hurdles remain before Epoch is ready for prime-time usage in writing Win32 apps. First, we have no support for structures, so most of the Win32 API is inaccessible. Getting this into place will be a major bit of work, since basically the entire object and type system will need to be implemented in order for structures to be supported in a first-class way.

The second big hurdle is adoption. Someone (preferably besides me) needs to take the time to actually write a nontrivial program in Epoch, and take note of any deficiencies in the language's features. These will then be made the priorities for further work on the language itself. In this way, I can keep development rolling smoothly while ensuring that the "real-world" pragmatic edge of the language stays sharp.

So far, I have to say the adoption rate thus far looks pretty disappointing. I can only really blame one thing for that: there's no damn reason to use Epoch to write Win32 software if you already know C. Or C++. Or any of the .Net languages. Or any language, really.

I need a selling point that makes the language superior to existing alternatives. I'm especially competing with .Net and (eurgh) Java on that front. Of course in the long run the main thing that will make Epoch attractive will be its support for multiple processing paradigms, but that has to come after the foundations are fully laid.

So this looks to be a bit of a chicken/egg problem. Bootstrapping the language itself has been fairly easy, but getting it to a point where it is not only a viable but a preferable option will be difficult I suspect.


Oh well. I didn't start this damn project because I thought it'd be easy [grin]
0 likes 4 comments

Comments

johnhattan
Adobe AIR would be my guess. Java should've worked that way, but Sun was never that quick on the uptake and recommended that you make a batch file.
August 02, 2008 07:56 PM
Telastyn
Quote:
Someone (preferably besides me) needs to take the time to actually write a nontrivial program in Epoch, and take note of any deficiencies in the language's features.


You can have 'em just as soon as I'm through with them. But yeah... guinea pigs are hard to come by.
August 02, 2008 11:47 PM
Daerax
Seems like I would be a good candidate. Except C++ is like the only language I dont have installed. Ive got three Haskell compilers, ocaml, C# 2 & 3, Spec#, Nemerle, F# , R, Python, Coq , scala and java but not C++. Nor do I intend to install it so I wont be able to compile your source.

As well, operators seem minor but are a fair deal. It can get unwieldy if (a < 3 && a * b + (c/ q). A bit contrived but would be too noisy as is. Syntax is important.

To both of you since you have user definable operators one thing that would be nice is to be able to set operator precedence.

@Taletsyn - just read and your reasons agaisnt make sense.

I do not agree with your hatred of tuples. I make heavy use of them and are easier to reason about as function parameters than curried functions.

downloading now...
August 03, 2008 12:36 AM
ApochPiQ
I'll be including a binary distribution in the next release; it'll have the VM DLL plus a shell program for running Epoch sources. That should alleviate the build problems for those who don't want to start from raw source.
August 03, 2008 07:05 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement