-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Deliver OCaml Compiler Errors in JSON format (or Sexp) #7123
Description
Original bug ID: 7123
Reporter: jordojw
Status: acknowledged (set by @shindere on 2017-02-24T15:59:11Z)
Resolution: open
Priority: normal
Severity: feature
Category: compiler driver
Monitored by: @Drup @gasche @diml @hcarty
Bug description
It would be much easier to build tooling for the OCaml compiler if OCaml type errors (or any error for that matter), was delivered in a format such as JSON or sexp. Ideally, errors would be serialized into something loosely typed so that as new versions of the OCaml compiler don't break the compilation of build tooling. The serialized errors can include rich information such as the nature of the error, specific line numbers that are relevant, inferred/mismatched types - all encoded into an error structure that developer tooling can use to provide very nicely formatted/integrated feedback to developers.
Right now, the only other thing that can be done is to create giant banks of regexes that extract out very complicated structures of type errors. That approach could be crowd-sourced, but it will inevitably be fragile so I am requesting official compiler support for serializing rich information about errors.