Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

Self-hosting the Epoch Compiler: Day Four

Posted by , 13 December 2013 · 579 views

Epoch language design
Mostly hammering away on a variety of miscompiles and other tiny bugs tonight; I've squished a ton of problems but they all blur together and I can't clearly remember what all they were.

Almost everything at this stage manifests as the JIT engine vomiting when trying to turn the compiled Epoch program into LLVM bitcode (for eventual translation to machine code). Sadly, this means it takes a disproportionate amount of digging around in various bits of code to pin down the exact reason for a miscompile.

Something that's scaring me a lot is that many of the bugs I find in the compiled program are not reproducible in smaller test cases. That tends to suggest a nasty problem in the compiler itself, since it should theoretically always be possible to recreate a miscompile in a controlled experiment.

Without small test cases to validate that compiler bugs are really fixed, it's extremely hard to know if I'm actually making progress or just pushing the bugs around into different areas. Since it takes a couple of minutes to produce a compiler binary, there's a lot of downtime and context switching.

My brain is pretty tired today and I'm honestly not sure how much dedication I have tonight.

Some of the bugs are just so bizarre that I'm deciding to punt on them when possible; there'll be plenty of time in the future to hunt them down and hopefully get regression tests into the test suite. I'm pretty much only fixing things that reflect large-scale issues or would affect too much code to work around them.

Unfortunately, it looks like one of my attempted fixes has actually had me going in circles, because it introduced a different bug that broke in a totally different way. Trying to fix the new bug led to undoing the fix, which in turn created the old bug again. Argh!

[Ed. Note: I fell asleep shortly after this.]

This is pretty much my least-favourite part of software development. The endless chasing around in circles after bugs that only reproduce in the running system... Good luck!

August 2016 »

2829 30 31