Stream: t-compiler/help

Topic: Is rustc_interface a rustc interface?


George Fraser (May 02 2020 at 21:00, on Zulip):

This started as a discord discussion (https://internals.rust-lang.org/t/using-the-rustc-interface-crate/11982/22) with @bjorn3 and @mark-i-m and then evolved into a github issue (https://github.com/rust-lang/rust/issues/71770) discussion with @simulacrum . The original motivation was "I would like to be able to read the stream of diagnostics without having to buffer and parse JSON", but it seems this is an instance of a larger question: is rustc_interface intended to be a high-level interface for rustc?

George Fraser (May 02 2020 at 21:02, on Zulip):

rustc_interface seems to be missing many of the components you typically see in a compiler API like the Java Compiler API, or F# compiler service, or many others. Such as, documentation of how to do basic tasks like parsing and getting a pointer to a range, or the present example of a typed API for diagnostics. I am happy to help work on these things, but based on @simulacrum response in the github issue, I am now wondering whether rustc_interface is in fact intended to be a compiler-API in the tradition of these other compiler APIs I have mentioned.

simulacrum (May 02 2020 at 21:03, on Zulip):

No, I don't think it is, or at least not today

simulacrum (May 02 2020 at 21:03, on Zulip):

it's intended perhaps for internal consumption (e.g. clippy would also use it, I believe)

George Fraser (May 02 2020 at 21:03, on Zulip):

@Zoxc FYI

simulacrum (May 02 2020 at 21:03, on Zulip):

but not really for public consumption

Last update: Sep 27 2020 at 14:45UTC