Slashdot Mirror


The State of Natural Language Programming

gManZboy writes "Brad Meyers (and co) of the Human Computer Interaction Institute at Carnegie Mellon have written an interesting paper about the state of natural language programming. They point out that well understood HCI principles aren't finding their way into relatively new languages like Java and C#."

66 of 387 comments (clear)

  1. Proposal by Anonymous Coward · · Score: 5, Funny

    If
    Natural Language is not making its way into Programming
    Then
    Programming should make its way into Natural Language
    Else
    Continue

  2. Doesn't seem to say much. by BigZaphod · · Score: 2, Funny

    The article seems like some kind of summary. Unless I missed something important, like, a second page or something. But basically, it seems to suggest that, even after all these years, we still aren't any closer to having a natural way to program. Huh.

    1. Re:Doesn't seem to say much. by Camel+Pilot · · Score: 2, Interesting

      That was assessment also.

      However i did visit alice.org. I clicked on gallery and found no way to navigate back!

      Seems kinda of odd that a site dedicated to "natural programming" concepts would not take the time to employ "natural navigation". Hmmmmm.

  3. Programming in english sucks anyway by Qzukk · · Score: 4, Insightful

    Inevitably you end up with an artificially rigid language structure that sounds like something that nobody would EVER say. Perfectly easy to read, after all, who wouldn't understand what "ADD VAR1 TO VAR2 GIVING VARX", but who the hell would use the word "giving" in such a way. It's a nightmare to learn or write, at least for English-speaking people who would have to constantly fight years of learning to speak real English to make up for the fake english in the language.

    --
    If I have been able to see further than others, it is because I bought a pair of binoculars.
    1. Re:Programming in english sucks anyway by Anonymous Coward · · Score: 4, Insightful

      Witness--why everyone hates legalese in EULA's. Achieving unambiguous precision with English is HARD.

    2. Re:Programming in english sucks anyway by rewt66 · · Score: 2, Insightful

      You mean like Cobol?

    3. Re:Programming in english sucks anyway by ensignyu · · Score: 2, Interesting

      It might be a little rigid, but not necessarily that bad. HyperTalk goes:
      put the sum of var1 and var2 into varX

      or:
      set varX to the sum of var1 and var2

      or:
      add var1 and var2
      put the result into varX

    4. Re:Programming in english sucks anyway by Pxtl · · Score: 4, Insightful

      imho, natural language programming languages are awful because they add a tiny bit of verbal legibility in exchange for a) losing nice obvious visual cues like { and } and b) missing something painfully obvious:

      We learn math pretty friggin' soon after learning to spell. And at that point, you never write "one plus one equals two" ever again, if you ever did.

      The fact is that comptur language has a closer relationship mentally to math than to english. So why not use mathematical language? Its even better, as its not tied to a single human language (who wants to translate "plus" into Swahili?)

      IMHO, modern commercial languages do suck for not learning from their more academic peers (Java, I'm looking in your direction - inner classes rock, but they're no excuse for all the missing stuff).

      But for "englishoid" languages, I learned VB first and then Java, and I have to say the first thing I loved about Java was the unambiguous { and } blocking.

      I'm all for using natural english in the parts of programming where it belongs - like flow control, function calls, class definitions, etc. But having unambigous "this is a block" characters helps mental consistency, and using mathematical syntax helps people understand the more mathematical concepts (although the C = as assignment thing is an abomination - := pwns it).

    5. Re:Programming in english sucks anyway by truthsearch · · Score: 3, Insightful

      "Real" natural language processing means the computer can interpret what you're trying to say no matter how you say it. As long as grammer is correct, there can be a variety of ways of saying things. NLP tries to be smart at figuring out sentances it's never seen before by learning from past conversations. Of course with the complexity of natural language this is difficult and doesn't always work, but we've learned enough about how to do it that we should already have ways for computers to "understand" more natural instructions.

    6. Re:Programming in english sucks anyway by Blakey+Rat · · Score: 2, Interesting

      I'd love to see a Hypertalk-like language come back from the deadly. Applescript is *close*, but not quite there, and Hypertalk seems to be a very obvious no-brainer choice for visual programming.

      Is it slow? Yeah, it's slow... no doubt. What you'd do is put the power in the methods of the objects, and just let Hypertalk tie the objects together. (For instance, Hypertalk might be too slow to negotiate a fast FTP download, but it's certainly fast enough to contain a statement like "if startDownload is true then tell ftpSocket to start download and place the result at global downloadLocation"

    7. Re:Programming in english sucks anyway by squidfood · · Score: 2, Insightful
      And at that point, you never write "one plus one equals two" ever again, if you ever did.

      This is true for primatives.

      But for even slightly more complex tasks ("Find all the people who live in New York, and add their votes."), natural language is about as good. As the tasks get more complex, natural language ("Look for your friend in this picture, then see who's standing next to him.") quickly describes things that are formal language headaches.

    8. Re:Programming in english sucks anyway by wmshub · · Score: 5, Informative

      Did you two (the parent & grandparent of this) really read the article? It's not about programming in English, it's not about syntax, it's about structure.

      For example, they pointed out that people think about tasks in an event-driven way, their example is "when pac-man is out of lives, the game is over". But they must program by finding where in the program the number of lives goes down, and inserting the code there. An event driven language would simplify.

      Their other example was that most languages make people think in loops, when they really want to operate on a group. Saying "for (i = 0; i len; ++i) { x[i] += 10; }" it a really clumsy way to express what people thought, which was "add 10 to everything in x".

      Anyway, I agree that parts of the article don't sound too helpful, but they aren't talking about writing in English; they're talking about changing the structure of languages to more closely match what people think.

  4. Is it any wonder? by Tackhead · · Score: 5, Funny
    > They point out that well understood HCI principles aren't finding their way into relatively new languages like Java and C#."

    Well, duh! That's because if, according to the article...

    > The goal is to make it possible for people to express their ideas in the same way they think about them.

    ...most ideas just don't work that way.

    #include // Do What I Mean

    thingy main (thingy list) { Sort thingy
    No, like this
    With the guy's name on the right
    No, I guess the middle initial deserves its own column. No, I didn't think of that.
    But don't print the middle initial.
    No, not like that.
    Eew, that font sucks.
    Yeah, like that.
    No, like it was before.
    Yeah, no--wait. I gotta talk to my boss.
    He said to do it like this. // wave hands
    But he didnt like it.
    Fuck this, I'll pay some guy in India to do it.
    }

  5. Not gonna work by JohnGrahamCumming · · Score: 5, Funny

    Given the state of natural language on /. this isn't going to work :-)

    John.

  6. Closest I've found to Natural Language... by PortHaven · · Score: 2, Insightful

    Is Macromedia's ColdFusion syntax. As it continues to become less tied to HTML it will be interesting to see where this goes.

    But natural language requires more typing than say C syntax.

    A EQUALS B
    A = B

    But does the thought process get speeded up. If so one needs to know how the gains and loss affect overall development.

  7. I don't buy it. by vontrotsky · · Score: 5, Insightful

    I disagree with the article's assumption that interesting programming errors are due to people being unable to express themselves "naturally" in code. Rather, I find that almost all errors worthy of debugging come not understanding the problem domain correctly.

    jeff

    1. Re:I don't buy it. by Bastian · · Score: 4, Interesting

      One thing that I have noticed about any debate about what programming facilities will most help programmers to write more bug-free code or spend less time debugging is that the debate is based entirely around anecdote.

      I would love to see some numbers on the frequency and nature of bugs in software, and I want to see these numbers broken up by language as well as by appliction domain. I suspect that a comprehensive collection of such statistics doesn't exist, since I haven't seen any empirical data enter into the various debates to which they would apply.

      Until someone spends some more time researching this information, I doubt that the development of programmign technology will advance in a fashion any more directed or smooth than science and technology did back in the fourteenth century.

  8. HCL, HCl, or HCi? by tepples · · Score: 2, Informative

    HCL (Hilbert Class Library) has little if anything to do with HCi (Human Computer Interaction) or HCl (hydrochloric acid). The article is about HCi.

  9. Hmmmm by Profane+MuthaFucka · · Score: 3, Insightful
    The article wasn't really that clear on exactly what NLP is, but they pointed at something called Alice.

    On that site, there's http://www.alice.org/whatIsAlice.htm which says
    Rather than having to correctly type commands according to obscure rules of syntax, students drag-and-drop words in a direct manipulation interface. This user interface ensures that programs are always well-formed. In addition, Alice reifies object-based programming by providing animated, on-screen 3D virtual objects.

    So, this is just like Visual Basic. I know that can't be true, or else Microsoft would be marketing VB as NLP. So what am I missing?
    --
    Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
  10. Oh NO! Not Again! by kaalamaadan · · Score: 3, Insightful

    Cobol, anyone?

    Multiply x by y to get something or the other ...

    1. Re:Oh NO! Not Again! by Tablizer · · Score: 2, Insightful

      Cobol, anyone?

      (Or SQL for that matter. We managed to finally obsolete COBOL more or less, but SQL is still with us.)

      Anyhow, the idea behind the COBOL Natural Language push was to rid the need for programmers or at least greatly reduce their training. However, it was found that somebody with some training could translate business logic into something that the computer could understand better than amatures. In other words, with some training productivity was so much higher than some manager trying to be precise enough.

      Further, regular human speach is vague. To learn not to be vague takes a some training itself. And, many have discovered that English is not geared well to being precise. Rather than bend English to be precise, it appears better to toss English with something meant for precision. In other words, there is a bigger payback in efficiency to bend the human to be more like the computer (or at least use better language structure) than the other way around.

      Further, non-programmers often have a horrible time with "normalization". They tend to duplicate stuff in ways that comes back to haunt the design down the road. In the real world making copies of papers is the norm, for example. If you do this in the computer, then you have to remember to change all the copies and know where they are.

      Thus, if the training effort involves issues not just related to language to do it right, then it is worth it to integrate a more precise language into the training rather than futz with english.

      Otherwise, it is like putting training wheels on motorcycles. It pays to get the prerequisites right first.

      Maybe on a small scale, natural language will be okay. However, scaling this to production systems would probably be a mess. Even with languages more precise than English, we still make some ugly bugs. The problems would probably jump an order or two of magnitude if a hacky amature system based on the naturally vague English language is applied.

  11. Natural language programming. by Adhemar · · Score: 5, Insightful
    The virtue of formal texts is that their manipulations, in order to be legitimate, need to satisfy only a few simple rules; they are, when you come to think of it, an amazingly effective tool for ruling out all sorts of nonsense that, when we use our native tongues, are almost impossible to avoid.
    - Edsger Wybe Dijkstra, "On the foolishness of natural language programming".
    An interesting read.
    1. Re:Natural language programming. by Moofie · · Score: 2, Funny

      I don't think that anybody who spells their name like that gets to talk about "natural language".

      (it's a joke, people!)

      --
      Why yes, I AM a rocket scientist!
  12. Write a Natural Language Compiler by TheUnFounded · · Score: 5, Interesting

    Write a Natural Language Compiler and you'll find that programmers can't write in a Natural Language. Can you imagine what would happen when you have to understand, not the flow of the code, not the overall process of the application(s), but HOW the writer was THINKING when they wrote the code? I've worked on a couple interesting projects where the programmers originally were involved in the physical business process, and eventually ended up coding (don't ask). When I had to edit their code, there was NO way of understanding it unless you actually talked to them and realized how they were thinking about the problem. It's not that the code was so poor, but they wrote code based on how they'd seen the business operate, and that just didn't translate nicely into straightforward code.

    Personally, I don't see how creating a language that encourages this behaviour can be a good thing. Isn't this the point of learned programmers? The ability to translate real world situations into easy to understand processes? Then again, I'm no language development guru. :)

  13. People think in their languages. by Mr.Spaz · · Score: 3, Insightful

    One of the big problems this approach will have to overcome (in my opinion) is that people generally tend to order their thoughts in a manner specific to their native language. A development environment that seems intuitive and easy to use to a native English speaker might be backwards or obtuse to a person who natively speaks another language. To clarify; I'm not speaking strictly of grammatical structure of language, but of a seemingly inherent difference in the way people learn things based on what language is used in the teaching. For this reason it has always seemed better to me for programmers to learn a new, common language (that of the higher-level compiler they are interested in) so that when they work with others, everyone is on the same page (similar to scientists and doctors using Latin nomenclature).

    I'd imagine that a "natural language" system could be developed with different approaches based on the native tongue of the programmer, but I would think this would damage the benefits of commonality that other languages now enjoy.

    1. Re:People think in their languages. by brpr · · Score: 2, Insightful

      English speakers (at least the grammatical ones) are familiar with a handful of verb inflections -- singular vs. plural; present or past tense -- but Old English actually inflected the nouns of a sentence as well, to indicate the subject and the predicate. You could say either "Dick hit Jane" or "Jane hit Dick" and the noun inflection, not the word order, determined who actually got hit. I'm no linguist, but I believe there are contemporary languages with similar features.

      Well yes, of course there are contemporary languages with similar features.

      That's a vast conceptual shift, that a person's name can be said differently according to whether he's the subject or the object of an action.

      No it isn't. What you're missing here is that the underlying argument structure of natural languages is pretty universal: inflection and word order are just two different ways of encoding the same agent-patient-theme hierachy. A parser could extract the same semantic information from two languages which on the face of it appear to be quite different. The hypothetical natural language programming system would interpret sentences based on their argument structure rather than their syntax per se.

      There are no natural ways of thinking; thought patterns are learned and largely cultural.

      Says who? Certainly not modern cognitive science, or indeed modern linguistics. What is a "thought pattern", anyway? If it's any technique for thinking which is learned, then, by definition, anyone who isn't already familiar with it can...learn it. Problem solved.

      For "natural programming" to really work, the system would have to be tailored to each native language and culture it would serve.

      Obviously the system would have to be tailored to each language, but this would just be a matter of rewriting the parser and vocabulary (and in fact it should be possible to share a lot of the parsing infrastructure between languages). There's no reason to expect any "cultural" issues would extend further than this.

      As a linguist, I'm very sceptical of the general utlity of NLP. While it's perfectly possible to parse natural language, it's an impossible problem to reliably extract meaning from it. This is because most meaning in a natural language sentence is not encoded -- it is infered by the hearer based on assumptions about the attitudes, knowledge and intentions of the speaker. Clearly, for a computer to do this it would require a massive encyclopaedic knowledge, and (more or less) a fully functioning human-like mind. I doubt we'll be seeing this any time soon.

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
  14. I didn't RTFA... by GillBates0 · · Score: 3, Insightful
    The goal is to make it possible for people to express their ideas in the same way they think about them.

    That's about as far as I got. I guess he didn't really express his ideas in the same way that I wanted to think about them.

    Which nicely illustrates the point that there's always a "semantic gap" associated with natural languages, which builds up because people have different ways of thinking. The semantic gap is even wider when one of the entities being communicated to happens to be a machine. There's a reason why traditional programming languages are precise and exact...it's so that the gap is reduced - the machine will do exactly what you tell it to do...even then we have a disconnect between what the programmer's thinking, and the code that he's writing.

    --
    An Indian-American Hindu committed to non-violent thought/speech/action alarmed by the global explosion of radical Islam
  15. Natural Language isn't for Serious Programming by I_Love_Pocky! · · Score: 3, Insightful

    Natural language isn't precise enough for serious programming. I personally wouldn't enjoy typing so much for no added benefit. It seems like this sort of thing only has value amongst people who are learning to programming. Why would a mainstream language like Java or C# cater to this bunch?

  16. Ah, I see the problem... by Nijika · · Score: 2

    "The goal is to make it possible for people to express their ideas in the same way they think about them." There's your problem right there :) I think they're probably not being adopted because in the world of programming convention is the key to interoperability. Human thought and language aren't so strictly tied to convention.

    --
    Luck favors the prepared, darling.
  17. Remember Apple Script by brw215 · · Score: 2

    It seems to me that the steps in the Natural Programming approach are not at all novel and certainly not as useful as they appear. The authors seemed to have forgotten the train wreck that was AppleScript. The authors state that syntax in program languages are too complex. I would argue that the syntax of a programming language needs to be more complex then the syntax of a natural language. The sad fact is that English (and other natural languages) were not designed with enough precision for things like programming languages. For example: If in some natural programming someone were to state "if x or y do z" Does this statement mean that x and y need different values or can they both be true? One can't tell from looking at the statement.

    1. Re:Remember Apple Script by Anonymous Coward · · Score: 2, Insightful

      > The authors state that syntax in program languages are too complex. I would argue that the syntax of a programming language needs to be more complex then the syntax of a natural language.

      I think you really mean the opposite of what you said. The syntax of natural language is bogglingly complex. You can express the syntax of even perl with a few kilobytes of EBNF. Noam Chomsky tried to come with formal syntax rules for spoken languages and utterly failed (though his work is what led to BNF and company)

    2. Re:Remember Apple Script by philge · · Score: 3, Informative

      Applescript is alive and well an dearns me a decent living. One of the main benefits of applescripts syntax is that is it alot easier to read then it is to write because of its english like language. So when you come to look at it six month later its is a lot easier to figure out what it does.

    3. Re:Remember Apple Script by javaxman · · Score: 2, Interesting
      Dude, I have news for you, AppleScript is still a bit of a train wreck.

      Not that it's not powerful and fairly easy to use ( you can do a *lot* of fairly amazing stuff with AppleScript that can't really be done otherwise ), but it is _not_ as straightforward as it should be... doing something relatively simple, like string manipulation, just isn't easy. How do you take a path name and add a few characters to it? It's kinda hard to figure out.

      Of course, you could blame some of AppleScripts' difficulty-of-use on the unstructured, somewhat here-and-there nature of Apple's documentation of AppleScript, such as the ton of useful, important stuff that appears only in an "AppleScript Additions" PDF ( unlike *any* other AppleScript documentation ).

      Something that really jumped out at me from the article is the notion that what's "natural" is defined very specifically by the problem area. Which makes sense... but doesn't lend itself well to general-purpose programming environments. Like some other poster said, oh god, COBOL... general purpose programming environments are going to require constructs and data structures which are well, general, flexible, and thus maybe not "natural" for some problems.

      Big deal. If you have a specific problem area, what do you do as a programmer? You write a set of APIs that are specific to that problem area, then use them again and again. You write those APIs in your general purpose programming language and go from there. These folks are trying to solve a problem that isn't as helpful to solve as they think, IMHO. Learning one language and several libraries of APIs is more useful to me than learning several different languages.

  18. Good point! by goldspider · · Score: 4, Insightful

    One thing that programming languages force upon you (the programmer) is the ability to get what you want using the least possible resources.

    Natural language, while easier for beginners, would make for horribly inefficient code and would be undesirable for any sizeable application.

    --
    "Ask not what your country can do for you." --John F. Kennedy
  19. What is the PURPOSE of natural language? by Anonymous Coward · · Score: 3, Insightful

    IMO it's nothing more than a better way to introduce *newbies* into programming.

    Would would any programming want to code in english? To me this:

    myvar++

    makes more sense than:

    increase the variable myvar by one please

    Do we really want people who can't understand something as simple as "myvar++" to be programming in the first place? Seems to me we NEED a barrier to entry. There're enough lousy programmers out there already.

  20. The problem is by Anonymous Coward · · Score: 2, Insightful

    It isn't that there aren't any languages that follow these principles coming out; lots of them are. It's just that the only languages that have become popular ignore these principles.

    The fact is that people don't care what's academically sound, or what people have "proven" is the best way to do things. In fact, the things people do care about are directly contradictory with what's academically "best". It isn't some kind of head-slapping coincidence that the new popular languages ignore "natural programming". It's the market speaking, and it's saying "we don't want natural programming languages".

  21. Re:How about this? by mmkkbb · · Score: 2, Interesting

    How about an answer from someone more well-acquainted with basic human desires?

    --
    -mkb
  22. on a bumper sticker by devphil · · Score: 5, Funny


    YOU FORTH LOVE IF HONK THEN

    And here's some filler text to compensate for /.'s sucktacular lameness filter. Blah blah blah. "It won't be any more frightening than the time I climbed up an elevator shaft with my teeth," said Sunny.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    1. Re:on a bumper sticker by the+quick+brown+fox · · Score: 2
      honk if you.love ruby

      ;)

  23. Wow. by cbiffle · · Score: 4, Insightful

    Well, I'm not sure if it's that nobody read the article, or if nobody actually understood it, but.

    We've had a lot of posts about "OH NO! COBOL!" Yes, yes, I agree with you -- pretending to be English usually results in awkward and unnatural syntaxes. One of the advantages of a formal syntax like most programming languages is that it clicks the brain into a different mode. (How many of you can read sigs like 2b||~2b? I thought so.)

    But that's not really the paper's main aim. It makes a couple of notes that all of us, particularly those of us in language design, could benefit from.

    1. People tend to deal with collections in the aggregate far more often than they step through them an item at a time. The example given was "set the nectar of all the flowers to 0." Look past the syntax for a moment and look at how simple that is.

    2. Debugging the traditional way sucks. Did anyone actually read that bit at the end about the 'Why?' questions, and look at the screenshots? Holy crap. That's really impressive.

    Of course, I may be biased, because the points made in the article are basically the same that underlie a language I'm currently designing. :-) (And no, I'm not using Englishy COBOL syntax.)

  24. Deterministic vs. nondeterministic by Just+Some+Guy · · Score: 2, Insightful
    The current crop of computers is based on series of logical operations, and there is little in common between discrete logic and the Real World. Most programming languages bear a strong resemblance to mathematical notation, and that's not just coincidental.

    The real problem is a lack of strong domain models for most real world situations. That is, if you're starting a project to emulate something happening outside of a computer, then there's a very large likelihood that you're going to have to build your own object model to describe the situation to the desired level of accuracy. Once you have that model, it's easy enough to say "do this until that happens", but there's a world of difference between that point and staring at a blank screen at the beginning of a project.

    There's been some progress (depending on who you ask) to make this easier for those who aren't full-time programmers, such as UML and related design tools, but even these are mainly limited to building a high-level template of the final result so that a human can manually implement all of the details.

    This may or may not be avoidable. Vernon Vinge (author and CompSci professor) refers to the "Age of Failed Dreams" where humans eventually concede that some things just aren't possible. Expecting a current deterministic Turing device to be programmable at the level where people interact with each other may very likely be one of those areas.

    --
    Dewey, what part of this looks like authorities should be involved?
  25. Is this a good idea? by hugesmile · · Score: 4, Insightful
    It seems that the effort here is to allow end users to state their "problem" in natural language, and then a program gets generated to solve their problem.

    Right now that happens - only the program gets generated by programmers (sometimes outsourced to India!)

    Unfortunately, what the user says they want, and what they really want are usually very different things. Natural Language Programming really doesn't solve that problem.

    The critical piece is the Designer, who sits between the end user and the programmer, and asks the tough questions: "Do you really want that? Let me explain the implications of what you just asked for." "How critical is that piece of functionality that you just added on a whim, but it just added 3 years to the project plan?" "You're asking for the data to be selected this way, but really there's no use for that - have you considered selecting the data this other way?" etc.

    1. Re:Is this a good idea? by Taladar · · Score: 5, Insightful

      The difficult thing with programming isn't usually the syntax but the fact that most people can't cope with the computer doing exactly what they tell it to do.

    2. Re:Is this a good idea? by Erik+Hollensbe · · Score: 3, Insightful

      AppleScript is a pretty decent example of how this works well - it's close enough, in fact a little to far for my taste... often finding the "right words" becomes a chore.

      example:

      set bDmg to true
      display dialog "Compress DMG?" buttons {"Yes", "No"} default button 2

      if the button returned of the result is "Yes" then
      set sDmgFormat to " -format UDZO "
      else
      set sDmgFormat to " -format UDRW "
      end if

      From a script I use to build .dmg files.

  26. English and Computer Language dont Mix Well. by jellomizer · · Score: 3, Interesting

    It Would be nice to send out the specs for the program and run it threw the parser and get the program you want but the truth is that normal Human Language wasn't designed for problemsolving espectilly in some of the details that programming requires. Things like nested Lists. (1,2,3,(2,4,3,2),5,2,(2,3,5,6)) Which are easy to learn to program and install are much harder with natural language.

    Make a List with the values 1, 2, 3, then this is a list of 2,4,3,2, now we are back in the first list with some more values of 5 then 2, now we get an other list inside this list as 2,3,5,6 Now we finish both list.

    As you see in english this is clumzy I am sure someone with a better master of english may be able to make it a little more percise but still just giving up and using the () makes it a lot easier to see and understand then using a bunch of words.

    Most human languages were made Thousands of years ago. And came from languages 10s of thousands of years old if not Millions of years old. They were not designed for micro processing of infromation. They were required for more common sience reasioning. Which we as humans often fail a lot at and imagin how poor a computer would be a common sience.

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
  27. What is natural language? by drgonzo59 · · Score: 2, Insightful

    It is a matter of habit and training. I am used to think in terms of objects so any object oriented language is "natural language" for me. When I solve a problem I think of objects, methods, properties and how they work together. I don't have to translate from some abstract "natural" concepts to OO concepts. I am sure someone who is using lisp will see lists and functions in the same problem that I see objects and methods.
    I understand that the goal is to have the user just tell the computer what to do in English. The problem is that English is not precise and is too ambiguous. I don't know if I would want to fly on an airpline if I knew the computer on board was programmed in English.

  28. standard flaw in research like this by egomaniac · · Score: 2, Insightful

    Why does all research like this seem to revolve around "toy" problems? They study non-programmers or, when they include real programmers, focus only on small tasks that can be completed in an hour or so.

    Great, I accept that a new language can make toy problems easier.

    However, I think the situation is very different when you have a real programmer working on a real program. Writing a real application, like a word processor or a web browser, is difficult no matter what language you do it in -- and I would argue that the difficulty doesn't vary much between languages. In fact, I would further argue that many of these research languages, while making toy problems easier, would actually make "real" programming substiantally harder, because the semantics of the language are not as formalized and thus more difficult to remember and deal with.

    I'm certainly not opposed to advances in language theory and design -- our modern-day large applications would be essentially impossible to write if all we had to work with was machine language. But to be a major advance, a new language should focus on making real problems easier for real programmers, not making toy problems easier for non-programmers.

    --
    ZFS: because love is never having to say fsck
  29. Some 17 years ago ... by KlaymenDK · · Score: 4, Informative
    ... Dan Winkler created HyperCard together with Bill Atkinson.
    Granted, it was by no means a fast runner, but you could write more or less plain English to it:
    go to the last card of stack "Home"
    go to black with visual effect fade to black
    go to the previous card with visual effect venetian blinds
    get the third word of line 2 of field "Slashdot"
    put it into the messagebox
    Who could possible be confied by this code?
    Notice the brilliant little keyword called "it", that you could use with "put" and "get". Neat, simple, easy!

    eulogy
  30. Re:AppleScript, anyone? by philge · · Score: 3, Insightful

    There are two main features of applescript. 1) The english like syntax 2) the ability to control other applications Of the two the second is by far the most important. But to gether they create a new programming experience. Because most of the complexity is sequestered in the applications you are comtrolling the applescript code tends to be very short. On average I would say my applescripts are about 30 lines with only 5 - 10 lines of working code the rest is error catching and handleing. Because of the syntax it is very easy to read the code moths or years later. Also the having short code helps. BUT the most important thisis tha becasue the code is sort YOU CAN START AGAIN. How much code is kludged because no one wants to rip out and recode 1000 or more lines of code? There is a real benefit in short code that you can read

  31. Tourette's: the natural language of programmers by BrakesForElves · · Score: 2, Funny

    Programmers sit serenely, silently coding for hours at a stretch.

    Then they execute the code for the first time, see the results, and scream out SHEEEIIIIT, GODDAMN IT!!!

    Hence, to an outside observer, the natural language of programmers is indistinguishable from a case of Tourette's Syndrome.

    --
    About the word "if": If bullfrogs had wings, they wouldn't bounce around on their little green butts.
  32. Re:Applescript by MoneyT · · Score: 4, Interesting
    Probably because it's too obvious. I ran into that problem a few months ago. Version 6 of matlab for OS X had a unique problem in that one needed to start X11 and then start Matlab before it could be run, there wasn't a single command to do both. Of course, this lead to confusion on the part of our users, and so the simple and obvious solution would be to write an apple script to do it. That was the easy part:
    tell Finder to open application X11
    tell Finder to open application MatLab
    The problem was, in the way that Matlab was setup, the helper app used to launch MatLab in the X11 environment never truely opens (it bounces in the dock for a while and then goes away having begun the true MatLab startup. The end result of this was that since Apple Script was not being notified that the application had finished opening, it was recieving an error that startup had failed and kept retrying the start. This resulted in an infinate loop of MatLab window creation.

    The solution of course was to tell Apple Script that regardless of what hapens, just issue the open application command and stop caring. I spent a good hour or so digging through documentation until I finaly found how to do this, and the answer is so blaringly obvious that it makes one feel stupid when they realize they should have known it all along:
    ignoring all errors
    tell Finder to open application MatLab
    That's it.
    --
    T Money
    World Domination with a plastic spoon since 1984
  33. Oh, you mean COBOL! by jd · · Score: 2, Informative
    I certainly believe that people drift towards computer languages that closest match the method of their thought processes, but I do not agree that you should (or even could) write a programming language that mirrors natural languages or pure thought.


    Down that path lies madness. Or Adam and the Ants.


    Fourth Generation languages expressed things in terms of the requirements, rather than the actual mechanisms involved. Such languages have been around for a while, but have largely failed in the "real world". Pushing the complexity into the compiler turns out not to reduce the errors and can actually severely impact both performance and stability.


    Fifth Generation languages tried to solve the problems generated in Fourth Generation languages by assuming that the compiler wasn't complex enough. By adding a degree of "intelligence" to the compiler, it was believed that you could increase the abstraction further (thus allowing the compiler greater freedom to choose an optimal solution) and use learning to correct mistakes in methods. Fifth Generation languages were first introduced in the mid 1980s, but nobody could figure out how to get them to work as designed.


    Fifth Generation languages forked, at some point, and the only really active area of research is in Genetic Algorithms. GA's are intriguing, but not practical outside of herustics.


    Today, the only languages used in practice are Second Generation (assembly) and Third Generation (the C family). Object Oriented programming has allowed Third Generation languages to encompass problems that would otherwise be impractical below a Fourth Generation language. This has proved a far more fruitful line of research and development. Far more "real" programs exist in Java than exist in APL or Prolog, for example.


    (There are plenty of Operating Systems written in C and C++. Could you even begin to imagine writing one in APL??)


    Parallel Programming has gone a similar path. Complex compilers, such as "Parallel C" and "Parlog", and Parallel Languages, such as "Occam" and "SISAL", were intended to replace the complexity of hand-coding parallel functions in conventional serial languages.


    Such methods died a death, as threading and event-based programming proved perfectly adequate for most purposes. Of the above, Occam is the only one I ever regarded as being particularly effective, but it's rare to see anyone still use it.


    The "advanced compiler" approach being tried these days is OpenMP, but when you look at the relative amount of time and effort invested in solutions, far more people are working on code using PVM or MPI, maybe throwing a clustering system such as Beowulf or Mosix on top, than they are using OpenMP.


    The experience of time appears to show that Third Generation languages are the optimal balance between compiler/language complexity and code complexity. As such, I expect it to be more productive to improve whole-code optimization and auditing tools for such languages. These don't require the compiler to be any more complex, as they can parse the input and/or output, in traditional Unix daisy-chaining style.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  34. but _WHICH_ natural language? by museumpeace · · Score: 2, Insightful

    a language that leaves all the verbs for the end of the sentence? A language that likes the modifiers to follow rather than precede their nouns?...my point is , you have one translation problem in going from high level language to machine language and another going from "natural" language to high level language. But a third problem is finding a culture-neutral natural language OR solving the natural language translation problem...and you have seen how atrocious babelfish results can be...we just aren't there yet folks! The ambiguity that must be dodged in going from normal human speech to a computer program hides in different places depending on the language, especially on which words have multiple meanings. And inflection? What are you going to do? program with emoticons?
    I know that natural language is creeping into UI's in specialized search engines. If you know where to look, you will find natural language search features on Fidelity.com and perhaps other financial websites. These are much more carefullly bounded problems than the broad challenge of allowing a user to express a solution or algorithm for an arbitrary problem a computer could be programmed to do in, say C, but using ordinary speech. The article sited is interesting and it might make life better for us programmers but I am not getting my hopes up that more than incremental change to computer languages is around the corner.

    --
    SLASHDOT: news for people who can't concentrate on work or have no life at all and got tired of yelling back at the TV.
  35. You say it by Anonymous Coward · · Score: 2, Informative

    Actually you're much closer to truth that you think.

    People here in /. automatically assume that a natural language is a change to code syntax making it closer to English while keeping the semantics identical to C or Java. But it's the whole way around, folks.

    A natural language as stated in the article would be closer to the programmer's mental model (and no, the mind of a programmer is still not equal to a Von Neuman machine). For the very least, such a programming environment would provide incremental changes and retractions to previous decisions, as those listed in parent's joke.

  36. Specialsied languages are not just for programming by EmbeddedJanitor · · Score: 5, Insightful
    Natural languages are often not the best way to express problems/concepts concisely. The use of specialised languages is not something that is specific to programming. We (humans) have special languages for all branches of mathematics, chemistry (H2O...), physics (E=Mc2), music, drawing house plans.... These specialised languages came about because natural languages do not provide an effective means for communicating these ideas. For an example, consider some music written in a natural language: "Big drum beat followed by a bit of silence then a soft ....." Imagine trying to read and play that.

    Programming is also something that is easier to express in a specialised language. Sure we can make some things more human readable but does that make it easier to understand? The hard part of programming isn't reading/writing the code so much as knowing what structures and concepts to use. Making programming more natural language like will not really make programming easier, you still need skill and practice. Using the music analogy again: I don't play music and can't read music score (the language of music). If Beethoven's fifth (if he ever had a fifth) was rewritten in a natural language it would not make it easier for me to play; I'd still need a whole lot of practice with a piano or whatever to play effectively. Relative to aquiring the piano skills, I expect learning to read sheet music would be relatively simple.

    Where natural languaages might help is in system design and requirement capture. Still, however, I think that most often things go wrong because when people are expressing their thoughts in a natural language they use very woolly thinking and use vague terms.

    --
    Engineering is the art of compromise.
  37. Natural Programming != Progrm. in Natural Language by TuringTest · · Score: 2, Informative

    Sadly true. Will somebody actually RTFA and realize that 99% of the other posts are offtopic? The article isn't describing a new way to program the computer using natural language; we already have COBOL for that, and we all know how that approach works.

    The article is talking about new programming paradigms, which deprecate the old Von Neumann architecture programming model and allow for a more flexible mindset while programming. Last generation scripting languages (Python, Ruby...) would be a step in that direction. The article is proposing to explore that domain scientifically.

    --
    Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
  38. Perl version by Black+Perl · · Score: 3, Funny
    $_ =
    q[ for ( @_ ) { push @_, sort grep /\w+/, @_ } print unpack 'A*', pack 'B*', join '',
    reverse map
    { length ( $_ ) >> 1 }
    split /\S+/
    ];eval
    --
    bp
    1. Re:Perl version by Nurgled · · Score: 2, Insightful

      Of course, what this is really doing is:

      if (love->you(perl)) { honk(); }

      So unless there's a you method in package love, this will cause a runtime error. The following would be a little more consistant with the other examples, but less like English:

      honk if $you->loves(perl);

      ...and if you want this to run with the strict pragma in effect, you'll have to quote the string "perl", or use a scalar variable $perl.

  39. Re:Is this a good idea? i.e. apples vs grapes by faragon · · Score: 3, Interesting

    To compare the natural language (Noam Chomsky tells that it is universal for every human language) with any programming language it is quite non-sense: programming languages tends to unambiguation, to be context free and deterministic. It's quite similar to compare an image versus a verbal description of it: the image it is finite and unambiguous, while the verbal description only can be arbitrary.

    I understand that the point of this thread is to find a way to remove or to light some "translation" between the "human idea" and the "human computerized/programmed solution". For me, as the years go by, C/C++ is another language built-in myself. I can convert problems into solvable ones via computing, quite on the fly (still planning and designing the solution, but the implementation itself comes in a natural way, like the water that falls down a river).

  40. Flowcharts by Doc+Ruby · · Score: 3, Insightful

    Where's my compilable flowchart? They're more universally understandable across human languages/cultures, including geek/wonk/artist/customer/PHB, than text. They can be intermediate-compiled to text procedures for lexical parsing techniques. And they're much easier to design, program, debug, maintain and document, especially for parallel/distributed/networked applications. They're natural language without speech. Where's my gcc flowchart preprocessor?

    --

    --
    make install -not war

    1. Re:Flowcharts by owlstead · · Score: 2, Informative

      In my robotics invention system 2.0 from LEGO :)

  41. Natural language does not... by Jagasian · · Score: 2, Insightful

    ... make a good programming programming language. Mathematics has "been there and done that" with natural language versus a formal language. Why reinvent the mistakes of the past?

  42. Re:Applescript by ampathee · · Score: 2, Funny

    God that reminds me of the old "guess the command" puzzles in old text-adventures.

    One of the wall panels sounds hollow.
    > PUSH PANEL
    You can't do that.
    > TAP PANEL
    You can't do that.
    > PRESS PANEL
    Nothing happens
    . ..(much typing, and thesaurusing) ..
    > CARESS PANEL
    The panel slides open.

    I hope NL Programming wouldn't be bringing back that sort of thing..

  43. Natural language compilers?are they kidding??? by master_p · · Score: 2, Insightful

    It is very difficult to write a context-free programming language, let alone a natural one! when we speak, everything is meant relative to the current context. There is no way that a mathematical abstraction can be made out of that, unless really powerful computers can try every production possible in the same time (thinking about quantum computers).

    We humans don't even talk logically at times (logically in the mathematical sense). We say one thing, we mean another one. One of the most difficult things for new students is to get used to the strictly mathematical nature of computer languages. Computer thinking requires every bit to have its special meaning in the universe. Most people choke on that. The most capable programmers are those that can hold a mental model of the application, its various parts and as a whole. These types of people can translate requirements to code very efficiently, because they can reason about a program's state better since they remember the whole program and they can immediately recognize the consequences of any programming decision.

    And when one becomes familiar enough with the way the computer works, then the verbosity really gets in the way.

    What we need is a development environment that can reason about the state of the program. That's the root of all problems. Embedding state information in a program is something I haven't seen in any language. Most languages, if not all, work in the assumption that anything can happen anytime, and they don't have state constraints, thus allowing the programmer to make mistakes that could be cought in compile time.

  44. It's hard enough to find a programming job... by phyruxus · · Score: 2, Insightful
    Most programming work involves maintaining what's there. I expect that if NLP hit today, tomorrow there'd be 10^9 lines of code which don't quite do what they were intended to do. Or work at all for that matter :)

    The world will always need people who understand that asking for the last digit of Pi isn't a worthwhile request.

    "Computer, sort this list of names, then beat me at chess without moving your queen, then formulate a method of reversing entropy." "Computer, tell me a joke."

    If natural language aims at letting users tell the computer what to do in the terms they think about their tasks, the computer needs to be aware/intelligent to understand the requests. Otherwise there's always going to be a manual describing what you can and can't ask and how/how not to ask it. And people won't read manuals, they'll write programs that don't work.

    And then, you and I will *finally* get programming jobs. :)

    --
    "A witty saying proves nothing." ~Voltaire
    "d'Oh!" ~Homer
  45. Re:Specialsied languages are not just for programm by Nurgled · · Score: 2, Insightful

    In a way, the languages of mathematics and music are natural languages. Someone didn't sit down one day and enumerate all of the rules for mathematical expressions, it evolved to suit the needs of mathematicians and has retained the flexibility that results from such evolution, much like "social" languages.

    It's hard for programming languages to "evolve" in the same sense since they aren't "for humans, by humans", but we do try new language designs and find that some work better than others.

    Some of the more "dynamic" languages go some way to enabling this kind of evolution. If I try to use an unusual construct in a mathematical expression, I'd probably follow it with a statement in English or mathematics explaining the meaning. If it was a useful construct, others will adopt it and slowly the explanation will become unnecessary. Likewise, in some languages we can define new constructs (within certain boundaries, of course) and tell the compiler what is meant by them in simpler terms, usually by writing some kind of function. Over time, popular constructs will be adopted as core features in newer languages. One example that springs to mind is the foreach construct, which does vary from language to language but arose because it was very common to want to visit each element in a list in turn and perform some operation on it. Modern languages have become a lot more expressive so this kind of evolution will probably become more common.