19 hours ago

[SAOC 2025] Improving D Error Messages Weekly Update #4

Development of ErrorSinkJSON

  • Modified the new error sink class ErrorSinkJSON derived from ErrorSink.
  • Designed to output compiler diagnostics (errors, warnings, deprecations) in JSON format.
  • Created printJSONObject() method to print diagnostic in JSON format directly to stdout.
  • Work under progress for the unittests for errorsinkjson.d

Challenges Encountered

  • Resolving @safe vs @system issues when using vfprintf/vsnprintf.
  • Handling null filenames safely in JSON output.
  • Ensuring proper import paths to resolve dmd.errorsink without creating cycles.

Work in : https://github.com/Iskaban10/dmd/tree/lsp