Epoch self-hosting progress

Published August 25, 2013
Advertisement
So the Epoch compiler is now written end-to-end in Epoch. There is no C++ left in the bootstrapping process aside from the runtime environment which does garbage collection and such.

Sadly this doesn't mean that we're quite to self-hosting just yet. Only about a third of the compiler test suite is passing, and a lot of the remaining work centers around getting the parser finished and rigging up the code generation to the AST traversal logic.

As you may or may not recall from previous updates, the code generator is already done and capable of generating the full Epoch compiler given a properly formatted AST; so what's remaining here is just glue between parsing and the code generation system to get it to where all the tests pass again and we can try the evil experiment of feeding the complete compiler into itself.


There are a number of parser features left to complete before this can happen:

  • Parenthetical expression support
  • Literal function parameters (used for pattern matching)
  • Higher order functions
  • References
  • Entities (flow control, etc.)
  • Function tagging
  • Sum type definitions
  • Templates
  • Some literal cleanup (floating point support being the biggest one for now)
After that, some general features still need to be wired into the compiler. These are things that need nontrivial logic to exist between the parser and the code generation layer:

  • Overload resolution
  • Type inference for assignments and parenthetical expressions
  • Chained assignments
  • Function pointer members in structures
  • Pattern matching on values
  • Pattern matching on types
  • Template support
  • Some built-in operators and functions
  • Type demotion (e.g. integer -> 16-bit integer where appropriate)
  • Standalone code blocks
  • Batch test framework
  • Executable binary generation
I also have a couple of known bugs to clean up before it's all said and done, but they're rather boring for the most part.


On the one hand, this amounts to a whole lot of work; on the other hand, it's a measurable checklist and I still have until the end of the year to hit my personal deadline for the project.

It's actually kind of a relief to see a finite list of things left to knock out. "Write a self hosting compiler" is kind of a tall order, and to finally be in a place where the end is clearly in sight is a great feeling.


There are also some other reasons for me to be excited about the future of Epoch, but I can't really go into detail just yet. Stay tuned, life's about to get interesting.
6 likes 1 comments

Comments

3Ddreamer

Work hard you do and results you get.

I am happy for you.

August 27, 2013 04:01 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement