- What is your evaluation of the proposal?
+1.
Even if it doesn't provide all the flexibility that other more advanced solutions might provide, it is a very welcome addition to large codebases that today are forced to disable -warnings-as-errors
in a per-module basis because there's is no other way to do be specific about which warning-as-error needs to be disabled today.
I am not sure about the complete suppression of warnings, but I understand that it is part of the proposal as a parallel to the already existing --suppress-warnings
, which has a dubious value.
I will love to see a later SE proposal augmenting this to allow fine grained disabling of warnings-as-errors in code, but I understand that keeping the scope of this SE limited is to provide a workable solution to experiment with and get more information about how such feature can be implemented in the future.
- Is the problem being addressed significant enough to warrant a change to Swift?
Yes.
With every compiler version we find new warnings. Some of them are easily handled and can be done quickly, but others require more thinking, studying the alternatives and deciding for one. The only option today for an iterative approach of fixing those warnings-as-errors is to completely disable warnings-as-errors and have the affected module less "protected" for a time.
With every new SDK the deprecation warnings creep in and, in large enough codebases, forces the disabling of warnings-as-errors in order to allow the code to compile, and let the groups that work with the actual code fix it as best as they can on their own timeline, without blocking the adoption of the new SDK for the rest of the application(s).
Finally, during the beta releases, it is necessary to maintain compatibility with two compiler versions and two SDK versions, which makes the above even more complicated. Allowing reducing the severity of warnings-as-errors in the newer compiler and ignoring the unknown group warning in the older compiler will allow keep using both in the safest way.
- Does this proposal fit well with the feel and direction of Swift?
I think it should be the new direction of Swift.
For the longest time the policy has been that there's not way of disabling one warning and that Swift did not want dialects. For the longest time proposals of changing this have been rejected on those grounds, sometimes without a lot more discussion that using the "no dialects" reasoning. This might have been a good decision in the past, but in the real world adopting newer compiler versions and SDKs has need to disable warnings-as-errors for the smallest reasons.
I honestly don't think a "dialect" is created by the user wanting to have the safest experience (warnings-as-errors), but voluntarily selecting to delay treating some of those warnings-as-errors. When not using warnings-as-errors those are warnings, and let the user keep working. There will not be a "dialect" created. The language is the same. We allow the user to decide what is important for them.
- If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
The usage of warnings-as-errors in our codebase is encouraged, but in some cases we need to opt-in some modules into -no-warnings-as-errors
to avoid some specific warning-as-error and sadly missing on the safety net of the rest of warnings in the process.
In comparison, for Clang, we can use the command line arguments or the pragmas to selectively disable some warnings-as-errors while keeping the rest of the errors/warnings enabled.
- How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
I reviewed the SE carefully and skimmed over the implementation. I was looking for the possibility of ignoring unknown warning groups, which is not pointed out in the SE, but it is part of the implementation. This is a very welcomed forward-looking addition.