seax icon indicating copy to clipboard operation
seax copied to clipboard

Improve Scheme compiler error messages

Open hawkw opened this issue 10 years ago • 2 comments

It would be really nice if the compile error messages carried over source position information.

This would require modifications to the AST to allow AST nodes to be annotated with position information from the parser. This wouldn't be particularly difficult, but it would take some work, so I'm moving this to the Scheme v2.0 milestone as I'd rather focus on higher-priority issues (i.e. #15 and #14 ).

Also, carrying this extra data around might make the compiler slightly slower. In scenarios where a binary is being compiled, this isn't a significant problem, but if the Scheme compiler is running as a line-by-line interpreter, every nanosecond counts. Therefore, it would be nice if this could be done conditionally.

hawkw avatar Apr 08 '15 16:04 hawkw

I made a dev branch for this and started messing with it. Not sure when I'll actually get around to finishing it.

hawkw avatar Apr 10 '15 20:04 hawkw

Other compiler error message improvements:

  • consider making the CompileResult type's error component carry a list of error messages rather than a single one.
  • give AST nodes the ability to reconstruct the lines of source code they were built from (since Lisp code is Basically Just Its' Own AST anyway)

hawkw avatar Apr 16 '15 18:04 hawkw