Hacker News new | past | comments | ask | show | jobs | submit login
Language and Structure in Non-Programmers Solutions to Programming Problems [pdf] (ucr.edu)
71 points by charlieegan3 on Apr 17, 2016 | hide | past | web | favorite | 17 comments



Perhaps the coolest thing about natural language is just how completely unstructured it is compared to programming languages (which are of course 100% structured). No one ever declares variables up front, tells you what state to record, or really gives you any specifics at all. Natural language is additive, an immensely powerful feature to have and one I've never seen in a programming language. People use natural language to build up contexts, with various details, which I presume the brain then must infer structure from in order to 'execute' the idea being discussed.

For me this is why new languages such as Rust, Go and so on don't really interest me; sure they fix a lot of problems with some new structures, but the real power is a language which can infer structure from your inputs. I believe in the future we would write software like researchers currently write thesis'; separating out functionality into separate document sub sections, and then using natural language to build the idea up over the course of a number of pages.


> People use natural language to build up contexts, with various details, which the brain then must infer structure from in order to 'execute' the idea being discussed.

Most of that simplicity comes from the years of built up information and context you have. You can just say "want to go to the movies?" And be understood because that person knows of your dropped "do you" in "do you want", that "to the" very likely means "via motorized transport in either an independent or shared manner" and that "the movies" refers to a physical theatre, with a to-be determined showing.

NLP is a huge field and even the big names in the industry (Google, for example) are far off from anything resembling basic communication, beyond preset responses/dialogue trees.

The fact of the matter is, you're probably not getting anything resembling intelligent human communication, til we have AI. Something that can think for itself and create true context.


The amount of context required here is crazy. There is communication context (am I saying that to somebody in the room, in the neighbourhood, or somebody I am going to visit next week in a different town), as well as knowledge of locality (there are 4 cinemas within easy walking distance of me, so motorised transport won't figure high on my list), and of historic relations (do we actually usually go to different showings and compare notes afterwards, will we share a movie and then head home, is there a bar next door to the cinema we usually end up in, do we usually turn up at the cinema find nothing worth watching and go bowling instead).

For the minute I think NLP systems are best off politely declining and staying home to troll Twitter


Context is king. "Kill the man with the knife!" Who? The guy holding a knife? How? With this knife I have right here? We can't say anything at all, unambiguously, without immense context.


This reminds me of old style text adventures, that frequently have to deal with this kind of ambiguity, and only manage it to a limited degree. For example:

> kill the man

Which man?

> the one with the knife

I don't see that here.

> kill the man with the knife

You don't have the knife.

and so on...


> preset responses/dialogue trees

What you refer to as preset is not strictly hand written, is it?


No. It's something like.

ambigious phrase or phrase token -> multiple possibilities the parser can handle -> multiple possibilities from the requester -> repeat until you've dialed down to a single possibility.

It's a big part of what the Machine Learning guys and the NLP guys are doing. But, as mentioned, there's very little context for a computer to work with...so everything is very specific. "google, find me movie theatres in the area" vs "i wonder what movies are around. do you have any ideas google?".


> Natural language is additive, an immensely powerful feature to have and one I've never seen in a programming language.

You might want to take a look at behavioral programming[1]. It is the brainchild of David Harel, who since the eighties has worked on designing programming paradigms that allow specifying very complex systems in a natural way. One of his older ideas -- hierarchical state machines -- is nearly ubiquitous today in languages for fully verifiable, safety-critical real-time reactive systems.

[1]: http://www.wisdom.weizmann.ac.il/~bprogram/more.html


I agree, you may want to look at my work on Natural Langauge Interface to scenario based programming, language and short chunks of stories are very useful for describing required behavior, aka, programming. It may require some diambiguation initially, but it is a natural interface. References: http://www.wisdom.weizmann.ac.il/~harel/papers/NLToLSCs_Cicl... Also a comparative study here: http://www.wisdom.weizmann.ac.il/~harel/papers/Evaluating%20...


In some languages, "5" creates an anonymous constant object of type Number. Some languages will quietly coerce larger structures to any object it resembles with late binding (?) and lazy evaluation.

Natural Language is only as unstructured as their speakers. Going by that measure, a lot of programs are unstructured, although the languages they are written in are not.

A more interesting notion, that I don't really understand either, is that language is necessarily underspecified.


The problem is with computers we have to build incredibly complex systems out of very basic axioms (the features of von Neumann machines). The closest similarly complex systems built out of natural language are philosophy and law, and both are rife with ambiguity.


> we have to build incredibly complex systems out of very basic axioms

Yes and this is because our programming languages aren't as advanced as natural languages, not yet.

> philosophy

Did you just compare computer systems as being as complex as figuring out the meaning of life and the universe?

> law

Law is written in a way that is unambiguous as possible. Additionally it's a lot more complicated then simply running the same logic over and over when you are dealing with real peoples lives.



An interesting point - a lot of people explain their solutions using "when ...", but very few languages use 'when' as a keyword (coffeescript being one of the few popular ones).


How should it work? Should it work like "if," define an event handler? The word itself is very natural but assigning it a definite meaning isn't as natural.


Date of publication?

Ah, 2001. Thanks for posting this, I hadn't come across this.


Is there a more updated article that people can recommend? This article is from 2001, with most references from the 80's




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: