from Hacker News

Programming with natural language is going to work (2010)

by mrleinad on 5/22/23, 9:11 AM with 233 comments

  • by armchairhacker on 5/24/23, 2:29 AM

    Remember the phrase "developers spend 10% of the time writing code and 90% of the time debugging?"

    Even if it isn't 90%, most developers like writing code more than debugging, so most would prefer to automate the latter.

    AI translating natural language into code probably isn't as important as AI generating bug-free code and/or debugging its code. Even GPT-4 struggles with this: sometimes you point out a bug and it works, but sometimes it just can't find the issue and starts hallucinating even more as it gets confused.

    Everyone's trying to train GPT models to write code, but maybe we should be training them how to use a debugger. Though its a lot harder to map text generation to debugging...

    Also, it's a bit ironic how one way to prevent bugs is using stronger type systems and formal methods. But, AI is particularly bad at formal methods. But maybe with a system like MCTS combined with much faster generation...

  • by lcuff on 5/24/23, 12:41 AM

    I suspect as things evolve with the Large Language Models, there will be integration with existing computer languages and frameworks. That the ability to say "Create a web site using language X with framework Y" will become a reality. This ability to get Hello World done in 5 minutes instead of 1/2 a day to walk through a intro book/tutorial, well, that's a win.

    Then, down the road, each AI might have a preferred/default language, technology and framework. Quite possibly newly created. This has a parallel to intermediate representations (the earliest of which I'm aware of is p-code in UCSD Pascal). But it is also analogous to compiling C to assembler, and then machine code. Similarly with Java. Wolfram is correct when he talks about needing it to be a representation that the creator can inspect and verify. Not necessarily the least bit easy with a complex project. It will be an engineering journey, but it does spark in me the hope that English (or anyone's native language) becomes the high level language of choice for guiding machines in tasks. Mathematica? Humph. Stephen Wolfram is very pleased with things he's thought of or perhaps synthesized, but I'm gonna say, I think Mathematica is not the generic solution we will want.

  • by dboreham on 5/24/23, 2:28 AM

    We've been doing this for 200+ years. All the programming languages we use, and mathematical notation, are based in some way upon natural language concepts (yes even FP languages). So really we're talking about a continuum. And also worth noting that human languages evolve over time. So both programming languages will evolve to be more natural, and natural language will evolve to be more machine-parsable.
  • by dusted on 5/24/23, 9:08 AM

    One way to view a programming language, that differs from the traditional math-oriented perspective, is that a programming language is a subset of a natural language which has become sufficiently unambiguous.

    Ambiguity is in my opinion the biggest reason why "plain {insert natural language} programming won't be a thing".. The major challenge in normal commercial software development is not writing working code, it's aligning expectations and identifying assumptions and eliminating ambiguities.. At that point, the coding part is more or less mapping the description to whatever particular words the implementation language is using.

  • by omginternets on 5/23/23, 11:24 PM

    Sure, if the natural language we're talking about is formalized to the point of basically being math. Let's not confuse that with "everyone will be able to program", though.
  • by dang on 5/24/23, 9:40 AM

    Discussed at the time:

    Generating code from natural language is closer than you think - https://news.ycombinator.com/item?id=1912530 - Nov 2010 (80 comments)

  • by heikkilevanto on 5/24/23, 9:33 AM

    Long time ago they tried to develop a system where the users could explain things in "plain" English instead of the difficult codes used so far. It was called cobol.

    As has already been pointed out, 90% of time is spent on debugging and modifying existing code, not writing new stuff. And of the 10% of coding, 20% is writing the happy path, and 80% is spent in handling errors, corner cases, input validation, and inconsistent domain rules.

    Maybe we can have AI tools to help with all this, but there is still a long way to go. And when we get there, it will still take professional developers to use those tools, and to understand all the special cases.

  • by pyrale on 5/24/23, 8:40 AM

    It seems like this article is an advertising for Wolfram Alpha's then-new feature. It brings few elements to support the headline thesis, aside from showing these features.
  • by makz on 5/24/23, 1:48 PM

    This is not new. There is something called rethorical algebra.

    Rhetorical Algebra

    It was developed by ancient Babylonians where the equation was written in the form of words that remained up to the 16th century.

    Example: x + 5 = 8, is written as " The thing plus five equal to eight".