Jump to content

  • Log In with Google      Sign In   
  • Create Account






Self-hosting the Epoch Compiler: Day Six

Posted by ApochPiQ, 15 December 2013 · 639 views

Epoch language design
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!




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

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.

Very impressive; gratz, and kudos!

This is awesome, congratulations!

+1 awesome dev cred :)

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.

August 2014 »

S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627 28 2930
31      
PARTNERS