Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning instead of error for effect violations (nosideeffect, gcsafe, raise mismatches) #790

Open
timotheecour opened this issue Jul 30, 2021 · 0 comments

Comments

@timotheecour
Copy link
Owner

timotheecour commented Jul 30, 2021

effect violations (raises, gcsafe, side-effects etc) should give warnRaiseMismatch, warnGcsafeMismatch, warnSideEffectMismatch instead of error, rationale:

  • you can't overload by effect anyways (which is a good thing)
  • you can still get errors exactly as before, by using warningAsError, but it gives you more control when needed
  • it removes a lot of friction caused by the viral-ness of effects; oftentimes the violation is only theoretical (eg if a RT condition which would trigger can be assumed by user not to happen) and user can decide whether they're ok with this violation, on a granular basis

this would significantly reduce impact of breaking changes for correctness bugfixes, eg if we discover that in some situation, a raise OsError can happen (eg getcwd can raise in rare conditions and a call now needs getcwd which adds a raise[OsError]), it wouldn't cause a CT error but instead a warnining (which can be turned into a CT error depending on warnaserror); it basically makes code evolution easier, and smooths the upgrade process of a new version of compiler/library.

Viral errors = bad; viral warnings = bearable

links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant