[HN Gopher] E.W.Dijkstra Archive: On the foolishness of "natural... ___________________________________________________________________ E.W.Dijkstra Archive: On the foolishness of "natural language programming" Author : lelf Score : 35 points Date : 2020-09-19 19:39 UTC (3 hours ago) (HTM) web link (www.cs.utexas.edu) (TXT) w3m dump (www.cs.utexas.edu) | [deleted] | pdfernhout wrote: | Natural language is adapted for many tens of thousands of years | to be used by groups of hunter/gatherers working together on a | common task -- which also includes arguing about related things | like assumptions and priorities. In that context, physically | pointing or showing things is important ("put it _there_ "). As | is also non-verbal feedback from expressions on people's faces or | by where their eyes are looking. Also, people in the group can | ask clarifying questions, like "What did you mean by X?" or "Can | you be more specific?". Or the speaker can ask, "Did you | understand what I said?" When people try to explain how to do a | task without getting immediate feedback on how the receiver is | understanding the communication, one can expect that natural | language instructions will be missing critical information -- or | may also specify unneeded extra information. Ever since I worked | in the IBM Speech Research Group circa 2000, I have felt natural | speech could be useful in programming -- but it will take a | different perspective on how to use natural language as | conversation and related creative experimentation to provide a | different experience compared to what people are used to doing | with conventional programming languages. It might be more akin to | some aspects of pair programming perhaps. | | That said, a big feature of HyperTalk (used by HyperCard) was | that is is closer to natural language than most programming | languages. HyperTalk supported various alternate phrasings and | also the use of the word "it". And the physical "card" metaphor | provided an approachable metaphor for instructions about | manipulating stacks. It is sad that Apple essentially killed off | HyperCard for most users with various marketing decisions as it | was an amazing platform that made programming approachable for | many non-programmers. https://en.wikipedia.org/wiki/HyperTalk | | And Inform7 as mentioned by someone else here is another example. | Although Inform7 feels more about being read as natural language | (when you write is within strict limits) than about being written | flexibly as natural language. | k__ wrote: | _" Natural language is adapted for many tens of thousands of | years to be used by groups of hunter/gatherers working together | on a common task "_ | | Is this the case? | | I don't know much about languages, but I can't even recognise | earlier version of my native language from a few centuries ago. | pdfernhout wrote: | Thanks for the question (and indirectly an example of my main | point on natural language as dialog). Sorry for not being | clearer. I did not mean the words themselves. I mean the | neural circuitry in humans for language. | | Also related: "Researcher Responds to Arguments Over His | Theory of Arguing" | https://artsbeat.blogs.nytimes.com/2011/06/15/researcher- | res... "The main idea of the "argumentative theory of | reasoning," put forward by Dan Sperber and myself is that the | function of human reasoning -- why it evolved -- is to | improve communication by allowing people to debate with each | other: to produce and evaluate arguments during a discussion. | This contrasts with the standard view of reasoning -- | apparently shared by quite a few of the readers -- that | reasoning evolved in order to further individual reasoning: | to make better decisions, to plan ahead, to get better | beliefs, etc. ... We do not claim that reasoning has nothing | to do with the truth. We claim that reasoning did not evolve | to allow the lone reasoner to find the truth. We think it | evolved to argue. But arguing is not only about trying to | convince other people; it's also about listening to their | arguments. So reasoning is two-sided. On the one hand, it is | used to produce arguments. Here its goal is to convince | people. Accordingly, it displays a strong confirmation bias | -- what people see as the "rhetoric" side of reasoning. On | the other hand, reasoning is also used to evaluate arguments. | Here its goal is to tease out good arguments from bad ones so | as to accept warranted conclusions and, if things go well, | get better beliefs and make better decisions in the end." | mhh__ wrote: | In the same sense that the data structures are generally more | important than the code, I think the "quality"-axis is around | some combination strictness, semantics, and safety rather than | the syntax. | | I may be outspoken in saying this, but I try to avoid Python | wherever possible because - although I like the syntax - I am | quite worried about having to trust other humans to enforce | semantics rather than a compiler. If something ill-formed is in | my program, I want to know about it before it starts running | rather than 5 hours into execution. I have the same opinion of C, | too. | | In an ideal world where we could all sit around and plan our | programs from scratch, I would love to program in a pure | functional style - but this isn't really possible half the time: | I try to minimize as much global (or even local) mutable state as | possible, especially now that progress in execution speed is | incremental and the growth is probably going to be in our ability | to use concurrent execution. | | Python is supposed to faster to get going, and maybe it is | compared to C++, but even then C++ can express things that can | only be done with writing tests in Python (for free). There is a | trade-off in that I've spent years honing my skills now, but is | it that hard (It's quite hard to be holistic when teaching | programming, I'm slightly glad I figured most of it out myself) | amelius wrote: | Maybe natural language should become more like programming | languages instead of the other way around. I suppose this could | be especially useful in e.g. legal circles, where ambiguities are | problematic. | exdsq wrote: | Lojban is a good example of this. | Animats wrote: | Ah, that's Dijkstra - programming is hard and programmers should | _suffer_. | | He's right, though. Natural language is for communicating, not | describing. When we really need to describe something detailed, | we need either visuals or formalism. | jimbob45 wrote: | Ironically, natural language makes finding documentation | extremely difficult. If you're SQL problem revolves around the | keywords "USING", "HAVING", or "WHERE", Bing is going to really | struggle to find you results. If, instead, you're looking for | strcpy, nearly every result will be relevant with little effort. | drunkpotato wrote: | I just went to bing.com and typed `sql using` into the search | box. The results were relevant. I tried again with google and | duckduckgo. Same. I wonder if perhaps you are overestimating | the difficulty here. | jimbob45 wrote: | Easy searches like that will work but you never need help on | the easy queries. It's in the complex queries with keywords | modifying keywords where the issue arises. | jasperry wrote: | I feel Dijkstra kind of undermines himself with the curmudgeonly | "kids these days" remark at the end. Still, he makes a very | strong historical argument for a broader point than the title | suggests--for not being in such a hurry to get rid of formal | notation. For some of us, that's preaching to the choir, but I | feel like it could be well aimed today at those who think "IT" | has no need for "Computer Science". | coldtea wrote: | > _I feel Dijkstra kind of undermines himself with the | curmudgeonly "kids these days" remark at the end_ | | Not necessarily. The idea that "kids" across generations are | always either the same or improving across times and cultural | changes is an even bigger cliche than "kids these days". | | Dijkstra in this, as is made clear from the context, case | doesn't even talk about kids (people) in general, but about a | specific subset: educated people. | | So, while more people get an education than ever, and you could | find total illiterates in greater masses in e.g. 1900 than when | Dijkstra wrote this, there's also a decline in many aspects | between a university graduate of 1950 and a graduate of say | 2020. Part of this is because in the 1950 university degrees | where rarer, and thus more demanding and elite. | | But it can be true even for graduates from colleges that remain | highly selective (Yale/Harvard 1950 vs Yale/Harvard 2020). | | One example might be a CS degree with C/Assembly or Lisp and | SICP vs one with some Java "market-driven" introductions to | programming... One makes computer scientists, the other is a | glorified job training program... | rowanG077 wrote: | I wouldn't be so sure that that 1950 university degrees where | more demanding. More rare and elite, definitely. But it | wasn't really intelligence or drive that made sure you could | go to university. It was whether your social standing allowed | it. | [deleted] | astrowar wrote: | inform 7 is an example of programming in natural language. It | specializes in solving a single problem and being more of a set | of statements than a place to write algorithms. Even so, | ambiguity problems in writing are complex and require constant | consultations with the documentation to know which sentence is | valid for which situation. | Jtsummers wrote: | Inform 7 is a natural language DSL for a rather narrow domain | (interactive fiction). Dijkstra's discussion in this letter is | probably from the general (at the time and recurring) | discussion of general purpose natural language programming. | That is an important distinction to keep in mind. | zokier wrote: | I really like this quote: | | > _some still seem to equate "the ease of programming" with the | ease of making undetected mistakes_ | | Conversely you could say that ease of programming is equal (or at | least correlated) with ease of getting confidence of your | programs correctness. | | On the wider subject of the essay, I do note that languages like | APL that really embraced symbolics for expression do not seem to | have gained much ground, and on the other hand languages that are | light on syntax and use more verbiage like for example Python | have been massively popular. | | Overall I think the essay also relates to the common idea that | naming things is difficult. The names we give our elements of | code imbue the "all sorts of nonsense that, when we use our | native tongues, are almost impossible to avoid". And how many | bugs stem from people making assumptions about things based on | their names because the sort of linguistic ambiguity etc that | Dijkstra is talking about here? | sigsergv wrote: | Natural language is so opaque term. You need to establish context | (vocabulary, relations, rules) if you want to pass some | information to another person. The same phrase could have | different meanings in different context. And from this point | programming language is just another context. ___________________________________________________________________ (page generated 2020-09-19 23:00 UTC)