-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Error -> Defect for defects #13908
Error -> Defect for defects #13908
Conversation
Gah, the older names were more readable though. Maybe we can find some other solution? |
my feeling as well. What if instead of these renamings we did the following (syntaxwise, identical to --hint flags)
which is more flexible for users who care about maximizing performance but still want to allow one specific type of defect to be catchable, depending on their applicatin. exampleFor eg, a numerical application may want to allow |
@timotheecour Switches like these mean that we effectively have different language dialects. IMHO we should simply not track Defects in the type system. Even if your proc doesn't do any arithmetic and no allocation whatsoever (not sure I've ever written such a proc btw!) the call itself could fail due to a StackOverflow. |
who cares, you should never actually see them, right? :)
you have, and lots of it - an api for I agree that switches are bad - in addition to dialects, they also tend to not be implementable in user code, meaning that we can't build "system-like" types ie the new |
so.. y/n? if y, I'll go ahead and fix those silly tests |
not really, different language dialects is when you need to re-compile nim; what I'm suggesting is just an extension of an existing compilation flag (eg
IMO the sane behavior is assume any defect can be raised, unless specified otherwise by proc signature (and this should be rare, ie only in hotspots) or inferred by static analysis. Furthermore, mismatch in tracked defects shouldn't result in sigmatch incompatibilities.
on that note,
one cost to consider is a bunch of deprecation messages, and incompatibilities bw nim 1.0 or 1.2 and nim devel for users that want to supress warnings by changing those types to new names. But I'm really thinking |
What a bizzare definition of language dialect, so GCC doesn't support multiple versions/dialects of C then because I don't have to recompile GCC itself in order to get them? Indeed, --threads:on is a minor language dialect, which is why there is an RFC to turn it on always. Same for |
they're rarely raised and should never be caught - this is just to get a more reasonable error message when compiling, so that risks can be identified more quickly in software - knowing that a function can defect is critical.
favourite example: |
The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
f98630d
to
85ee99b
Compare
c4151bb
to
b8e91c4
Compare
1.2? |
New features/breaking changes don't go to 1.2. |
this can't work; see nim-lang/RFCs#214 |
this is a matter of definition - this could just as well be considered a bugfix and part of the original |
There is nothing like that going on here. What's really going on here is that you take "semver is good" as an axiom and whenever it's demonstrated to be actually a poorly thought out concept which doesn't match a reality where bugfixes cause regressions you need to patch your definitions in a quite silly way. So now the old name "FIeldError" which we used for a decade always was a "bug", come on. |
the nice thing about having a CI that now runs in stable branches + important_packages is we can test things out and see what breaks in practice on a not-so-small sample size instead of FUD-ing about what could potentially break. Semver, like all good rules, should be broken when reasonable. Breakages are no fun and should be minimzed to high degree but can't be eliminated, even if you stick to bug fixes. Other factors can matter more than 0% breakage: what packages are available for an old version; how much work is needed to support old versions, etc. If you want 0% breakage, you might as well not upgrade anything. |
* Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
The distinction between Error and Defect is subjective,
context-dependent and somewhat arbitrary, so when looking at an
exception, it's hard to guess what it is - this happens often when
looking at a
raises
list without opening the correspondingdefinition and digging through layers of inheritance.
With the help of a little consistency in naming, it's at least possible
to start disentangling the two error types and the standard lib can set
a good example here.