[ANN] Grace 0.2.0 πŸ’…, fancy diagnostics library for compilers

I’m excited to announce the release of grace 0.2.0, an OCaml library for building, reporting and rendering beautiful compiler diagnostics :camel: :paintbrush:. Now available on opam-repository.

The three main features of this release include:

  • :books: UTF8 support: Source files can now contain Unicode characters, including emojis :zap: :rainbow: :rocket:, with proper rendering of ASCII art for errors.

  • :1234: Error Codes: Diagnostics can now include short, searchable error codes. Allowing compilers to integrate a Rust-like error code index.

  • :pinching_hand: Compact ANSI Errors: Grace_ansi_renderer now supports a pp_compact_diagnostic for concise error messages, displaying only the file location and the error message.

Tap into the power of Grace for your error reporting! Happy hacking :man_technologist:

CHANGES:

  • fix(renderer): remove uncessary underlines when printing a unique β€˜multi-line Top marker’ (#31)
  • fix(renderer): replace unicode chars with ASCII in Config.ascii (#27)
  • feat(renderer): add NO_COLOR and TERM support to Config (#8)
  • feat(core,renderer): add support for error codes (#30)
  • feat(renderer): add support for UTF8 encoding (#25)
  • feat(renderer): re-introduce support for compact diagnostic rendering (#28)
  • refactor(renderer)!: move grace.renderer library to grace.ansi_renderer (#29)

BREAKING CHANGE

  • Grace_rendering has been removed. Use Grace_ansi_renderer instead.
14 Likes

This looks very promising, and very frustrating at the same time because I can’t compile it on windows yet :frowning: (not the library itself, but I can’t get the dependencies yet).

I’ve seen you are planning to provide LSP integration? This would be fantastic to have a single library for managing all the error reports!

Just makes me wish I could have Unicode characters in OCaml source files for identifiers & operators in OCaml :worried: