Without the specs, there is no way to tell if tac is behaving as developers intended it
Without the specs, there is no way to tell if tac is behaving as developers intended it
You want 'evidence' tsc is not working as it should, by writting a duplicated less specifying specification that would sometimes conflict with the typescript one.
It make me remember the people that wanted to specify everything and generate implementation from it: that called a programming language.
Specification is meant for compiler author. Writing one of them is easier than otht
In fact, while poorly named, what we call testing is actually specification. A test suite specifies for software authors what a program is intended to do and how it is intended to be used. Of course, as a nice side bonus, because the specification is delivered in code the documentation can be validated for truthfulness against an implementation by machine.
It's not doing what I expect. Oh? Change the code
How is that different from now?
1.It's not doing what I expect.
2.Is it intentional behavior or a bug?
3. Let's ask on github/reddit etc
With Special:
1. It is not doing what I expect
2. Is this a spec issue or code issue?
3. Let's check spec.
4a. "Working as specified". Shit. Hope spec improves in future versions
4b. It is not working as spec says. Let's file a bug on tsc.
And that is the difference.
Also, when done well a spec is a great way to learn & understand the language too. http://golang.org/ref/spec is so much more usable than Typescript's docs.
A spec resolves such discrepancies. Indeed, the spec may be where the problem is, but once the spec is corrected then implementations know what they must do. Absent of a spec, who knows?
1) a reference implementation,
2) written in natural language, or
3) written as formal semantics
#1 is the same as the current situation. With #2, you might get a bit closer but natural language has many ambiguities and idiosyncrasies that can render it useless in various situations.
You can try to define formal semantics, but that is not only hard to create, it's also hard to translate into an implementation, adding significant overhead in both parts of the process. And there can still be bugs, and there can still be edge cases with undefined behavior.