Jump to content

  • Log In with Google      Sign In   
  • Create Account





Homing in on Epoch Release 12

Posted by ApochPiQ, 14 April 2012 · 912 views

Epoch Release 12
The task list for Epoch Release 12 continues to shrink!

Right now there are basically six major things that definitely need to be done before I'd even consider shipping the release:
  • Operator precedence reimplementation (basically just need to do a quick Shunting Yard implementation in the new compiler)
  • Fix up code generation of parenthetical expressions (right now it doesn't really do anything)
  • Implement constructors again
  • Implement anonymous temporaries again
  • Take care of getting pattern matching somewhat working, at least back to its former level of functionality
  • Fix a bug in the library mechanism that prevents overloaded library functions from resolving correctly

I've been sinking a lot of time recently into getting semantic error generation working nicely, and outputting at least rudimentary error messages instead of just mysteriously crashing. Syntax errors are still just mystery failures, though, so I'm torn on whether to put any time into getting syntax error reporting working for R12. It'd be nice to do, but it's also a major bit of work, and R12 is already taking a very long time, so it's a tough call.

I have a feeling I'll end up doing at least basic parse failure messages for common syntax errors, and then leave it at that; but we'll see.

I'm still extremely happy with the overall progress that R12 represents, though. It's basically a rewrite of the compiler and a substantial overhaul of code generation, not to mention the ability to use LLVM for native code emission now (at least in very limited contexts). I'd still like to take out the majority of the VM execution path eventually and replace it with native code, but that gets really complicated when I want to reintroduce things like garbage collection. So it bears some serious consideration before making any hasty decisions.

One cool thing about this new compiler (among many others!) is that it's really easy to flag semantic errors now. There are code expansion passes (which do some magic I won't get into here for the sake of brevity), type inference passes, and then final sanity checking passes; any of them can flag an error at the most appropriate moment, when the maximum amount of context is available. This helps make errors a bit more precise in how they communicate the exact nature of the problem.

What I'm going for is error quality on par with Clang for instance - if not better. No more "type mismatch" crap - you'll see precisely what type(s) you're providing and a list of expected types, so you know immediately what's up. Of course that's not fully wired into the R12 compiler yet, but it could be.


I think it's been observed before that the hardest part of writing a programming language is recovering from programmer errors. This is absolutely without question the truth, in my experience. All that native code generation magic, all the parser optimizations, all the other myriad bits and pieces of arcane trickery that go into Epoch... they've got nothing on error reporting.

At least it's fun!




December 2014 »

S M T W T F S
 123456
78910111213
14151617181920
21222324252627
28 293031   

Recent Entries

Recent Comments

PARTNERS