Jump to content

April 2017 »

23 24 2526272829
- - - - -

Self-hosting the Epoch Compiler: Day Four

Epoch language design
4: Adsense

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.]

Dec 14 2013 01:40 PM

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!

Note: GameDev.net moderates comments.