3 ms·
"I believe it is very nearly within our reach to stop writing software and start specifying software instead. Write the specification, press a button and have a
by philwelch 17y ago
"I believe it is very nearly within our reach to stop writing software and start specifying software instead. Write the specification, press a button and have a full implementation that is mathematically guaranteed to implement your specification."
Well, we'd have to write that specification in some sort of consistent formal language. What kind of computer program converts a program specified in formal language into an executable program? Oh, right--a compiler.
The most generous I can get here is to suppose he's advocating a declarative high-level programming language. But that wouldn't be nearly as interesting to write an essay about, so let's pretend that your declarative, high-level "specification" language means "no more writing code". Either that, or he honestly believes you can write a compiler for English. But given how most specs are written, I would be even more fearful of the output of an English compiler. So you have to use a formally specified language--oh wait, that's coding again.
- krakensden 17y agoThe worst part is that he seems to think this is a novel idea.
- gdp 17y agoWho said anything about novelty? Referring to tools that do most of what is described seems to negate any claims of novelty.
- gdp 17y agoSure, the distinction between writing specification and writing code is pretty artificial. A specification may be incomplete or ambiguous. Through stepwise refinement, multiple (formal) steps are taken towards a more concrete implementation, which eventually might result in an efficient implementation capable of being executed. None of this is really new, and I think the differences between a "program" and a "specification" are reasonably well understood in most contexts. Tools already exist to do these sorts of things, they are just restricted to certain problem domains where the expense and overhead are justifiable for the extra safety guarantees. Also, I think you're jumping way back into coder-world by talking about declarative high level languages. Sure, that might be one way of achieving the stated goals (and indeed, many have gone down that path!) however specifications can come in many shapes and sizes. The idea is to reduce the number of abstractions which the programmer must hold in his or her head in order to write programs. The ability to construct ambiguous, incomplete specifications that can be interacted with or validated before anything resembling an executable specification comes about is beneficial in many circumstances, particularly when you are talking about concurrent or distributed systems. Basically what I'm saying is that a specification provides only some of the information required to construct an executable program, and may abstract away specific behavioural information until much later into some refinement process. A "program", as such, does not, and by its nature contains a description of exactly all the behaviour that can be exhibited by execution of said program.
- philwelch 17y ago"Also, I think you're jumping way back into coder-world by talking about declarative high level languages." Not really--"specifications" are usually understood to be expressed in declarative English, and any sort of "specification" that can be programatically translated into a program would simply be high level source code. I'm not against writing specs, I'm simply saying "a spec that can be compiled is code".
- gdp 17y agoBut a specification could be ambiguous, with the need for human intervention to resolve ambiguity through the 'compilation' process. And I'm not sure that I'm aware of any production-grade systems that use declarative English as a specification mechanism. Most of the systems that I am familiar with use ASCII-friendly logic notation or mathematical notation in the style of LaTeX or similar. I'm not necessarily suggesting that this is how software should be developed, rather I'm just pointing out that your experience and knowledge of what might pass as a specification is different to mine.
- philwelch 17y agoHere's my point. "You should be able to compile spec" is a useless argument, because anything we can compile would either be English (which we shouldn't compile) or a formal language (and a formal language that can be compiled is a programming language). Useful things to say include "here's a good high-level language that makes it easier to program" or "here's a language and a compiler for it that allows the compiler to ask intelligent questions about ambiguity in the code". "I want to be able to push a button and turn a specification into a program" is too vague to be useful--interpreted literally it already describes the compilers we have today, and interpreted liberally it could mean anything from "languages aren't high level enough" to "programming is too hard" to "I want to express programs with pretty pictures and by answering questionnaires" to "I want to compile English". Now, if we rule out "I want to compile English" as a very bad and stupid idea, we're left with things that, quite frankly, we've been researching the whole time (with the possible exception of compilers that question ambiguous expressions). Forcing us to ultimately conclude, first that the author doesn't know what he's talking about, and second that he isn't asking for anything more than what computer scientists are already working on.
- extension 17y agoOn somewhat of a tangent, consider a specification such as "sort a list of numbers". After adding a few minor details, this could be an entirely formal and unambiguous specification, yet implementation would require (disregarding prior art) an informal creative process involving significant leaps of intuition. It seems to me that a formal spec need only provide a method of verification and is therefor distinct from the solution, though it's no surprise that the distinction goes unnoticed in our industry, given the dearth of both specs and difficult algorithmic problems.
- philwelch 17y agoBut we can already turn "sort a list of numbers" into a program, although instead of "sort a list of numbers", it's called sort() and takes a list of numbers as an argument. By this standard, most programs are closer to specs than they are to solutions--a testament to the abstractions we already have.
- extension 17y agoI had gotten word that the sorting problem has been solved, hence the "disregarding prior art" part. My point, which you don't seem to be contradicting, is that a formal specification of a problem is not the same as a solution. They just seem the same because real world programming problems tend to have obvious solutions, or at least solutions that don't feel much like programming.