-
Notifications
You must be signed in to change notification settings - Fork 20
Description
We commonly include a Breaking Changes section in release notes. What does the terminology actually mean?
I used to think it is similar to breakages in binary backward compatibility in C++ or Java. However, we don't have a binary release form of a library.
If it means breakage at the source level backward compatibility, it could be too sensitive, and we might have missed many breaking changes.
For example, we used to assume changing a function from the defaults capabilities to pure capability is a backward compatible change. However the assumption is not true if we take the type checker into account:
Given a library including the following function:
function method1(): void {
}When changing it to
function method1()[]: void {
}The following user code, which could type check originally, will be failed to type check any more:
function method2(): void {
}
function infer<T>(
(function()[T]: void) $_,
): (function ((function()[T]: void)):void) {
return $_ ==> {};
}
function broken(): void {
$f = infer(method1<>);
// Typing[4403] Invalid argumentHack(4403)
// Expected a function that requires the capability set {}
// But got a function that requires the capability set {AccessGlobals, IO, ImplicitPolicyLocal, RxLocal, System, WriteProperty}
$f(method2<>);
}Similarly, changing the return type of a function into a more specific type is also backward incompatible at source level, even though similar changes are usually considered binary backward compatible in other languages.
Key takeaways
- We might want to change the structure of our release notes.
- I think currently it is not a big deal because any way we don't promise backward compatibility. However, if we want to create a stable language in the future, we will have to define a stable ABI for distributing libraries, not just the source code. Essentially, any statically typed languages that have the ability of type inference, would need a stable ABI in order to create reusable libraries that would not arbitrarily break the library users.