Re:Linguistics and Programming Languages
by didibus on Monday July 17, 2017 @01:13PM
(#14790488)
Love this, and agree. Though I would love to see a computer system which can resolve ambiguity in natural languages and formalize it for us. It would get it wrong often, but if it is good at it, no more so then a programmer gets the requirements wrong.
[ Parent
| on HN ]
We may not be able to do this automatically, but you can use a kind of refinement calculus to accomplish this.
Start off with vague requirements from your client:
We need a machine which can wash clothes at various
temperatures and speeds. The user should have options
to control the temperature and speed since they'll have
different types of materials. Maybe we can give them
some preset options?
Conversation: What are the temperature options?
Hot, warm and cold; but it's in two cycles and each can
have a different temperature.
How long should it wash the clothes for?
That depends on the material and how dirty it is.
What if it's really dirty?
They should be able to do an extra rinse cycle.
How fast should it spin?
That depends on the material and how dirty it is.
Refined (control panel only): Dial presenting options for:
Sanitary
Normal
Sensitive
Bulky
Buttons allowing further refinement:
Water: Hot/Cold, Warm/Warm, Warm/Cold, Cold/Cold
Extra Rinse: (yes or no)
"Dirtiness": light, normal, heavy (impacts wash duration)
If you use a proper requirements management tool, you can trace every one of those final system requirements back to some (slightly editorialized) conversation or initial (ambiguous, plain language) requirement description. Of course, this will, in reality, be an iterative process as you discover ambiguities in the specification and code and go back to the client for feedback and clarification.
Re:Linguistics and Programming Languages
by another-dave on Monday July 17, 2017 @02:05PM
(#14790925)
You could potentially have a compiler that would infer meaning & only fail compilation if the fuzzy natural language terms were ambiguous in context — just like languages like Scala currently infer types when unambiguous.
Also, feels like Inform7 should be mentioned in any discussion on NLP and programming: http://inform7.com
First thing to mind based on the article's premise and hits a lot of the article's desired points already.
Interesting. This feels like a great way to prototype functional requirements. Express the full process as an interactive fiction novel, and let people play it. Get feedback, iterate on the novel, until they are satisfied, then implement.
Re:Linguistics and Programming Languages
by slaymaker1907 on Monday July 17, 2017 @07:21PM
(#14793131)
One thing that would be interesting is if you could write a compiler front end that was interactive so that it could give you better error messages.