scala / scala-dev

Scala 2 team issues. Not for user-facing bugs or directly actionable user-facing improvements. For build/test/infra and for longer-term planning and idea tracking. Our bug tracker is at https://github.com/scala/bug/issues
Apache License 2.0
130 stars 15 forks source link

Plugins need to own first-class options #825

Closed som-snytt closed 1 year ago

som-snytt commented 1 year ago

With the dawn of "toolkit composition", where it's easy for scala-cli to create a compiler with required dependencies, including plugins, third party plugins need first-class access to the compiler option namespace.

In particular, plugins that generate warnings deserve to own -W switches.

Today's example is the zero waste plugin, the last blocker for production use of Scala 3.

I'll volunteer to take a first swing at whether it is feasible for competing plugins to declare which options they support.

The second-class -P mechanism, which is great for people who love colons, and who does not love colons, does not inspire confidence.

Maybe -V can profit from the mechanism.

SethTisue commented 1 year ago

I'm lightly skeptical... -P seems fine to me 🤷 , and I'm not sure it's a good idea to blur the distinction in user's minds between what the compiler provides and what a plugin provides

som-snytt commented 1 year ago

The goal is for compiler to do less providing. It may turn out to be untenable.

som-snytt commented 1 year ago

This idea is more interesting if the compiler generates no warnings and all -W output is 3rd-party. Same for lints, which are just a class of warnings.