Self-hosting the Epoch Compiler: Day Six

Published December 15, 2013
Advertisement
Tackling problems with a fresh mind makes a world of difference.

The first thing I needed to solve this morning was a miscompile involving constructors. Deeper investigation showed that sum-typed members were to blame. Thankfully, this bug had an easy repro, so I built out a test case and set out to fix it.

A couple of false starts later, things were looking solid.


At 11:51AM PST, the self-hosted compiler passed its first test in the compiler test suite.


It's now time to run the full battery of tests on the shiny new compiler, and see if it passes enough of them to warrant attempting a second-order self-host.


At 12:02PM PST, the self-hosted compiler finished its first complete run of the test suite. There are a few failures, mostly dealing with pattern matching, which has always been the most fragile bit of the language implementation. Some of the failures I'm going to ignore because none of the compiler implementations can pass those tests yet, so it isn't really concerning that the self-hosted one can't either.

I'm not quite ready to proclaim self-hosting a success. The test failures are worrisome, and I haven't done a second-order self-host test yet (where I feed the compiler into the self-hosted version of itself... is this getting confusing yet?).

However, this is a huge milestone. To make sure the implications are clear, this is what happened:

  • I wrote a compiler, in C++, which compiles the Epoch language
  • I wrote a compiler, in Epoch, which does the same thing, using the C++ version to boot-strap it
  • The Epoch implementation of the compiler can compile itself
  • This "self-hosted" version of the compiler is almost completely accurate and stable

I still have just over two weeks of padding time before my self-imposed deadline for finishing this project. That should hopefully be plenty of room to solve the last few bugs and get this thing completely done.


For now, though, it is time to celebrate!
9 likes 6 comments

Comments

swiftcoder

Congrats! That is a very major milestone, and an incredibly heartening achievement to keep up the spirits for the bug fixing ahead.

December 15, 2013 08:33 PM
ApochPiQ
At roughly 8:12PM PST, the compiler successfully passed a second-order self hosting test. That is to say:

1. Start with C++ compiler
2. Build Epoch compiler
3. Build Epoch compiler using itself
4. Build another copy of the Epoch compiler using the results of step 3
5. Results of steps 3 and 4 are binary identical


I'm exhausted but really pumped about this. Hopefully sometime soon I can start working on the performance issues.
December 16, 2013 04:20 AM
Servant of the Lord

Very impressive; gratz, and kudos!

December 16, 2013 06:52 AM
dmatter

This is awesome, congratulations!

December 16, 2013 03:34 PM
NetGnome

+1 awesome dev cred :)

December 16, 2013 09:41 PM
Squared'D
I thought your project was interesting so I decided to check out your old blog post. I found this one.

http://www.gamedev.net/blog/355/entry-1811315-the-epoch-manifesto/

This seems like a good language. I wish I had more time to look at it. I'll check it out after I finish my current project, but write now I'm a little to busy. I'll look at some of your other older post to see more of its features.
December 17, 2013 01:57 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement