Live data from Hacker News

How AI based programming could work

bjenik.com

1–10 of 61 posts

Re: How AI based programming could work

#2
Suppose you have an AI that generated some code for you, but it doesn't do exactly what you want. Now try to debug it...

what if programming wouldn't involve defining exact steps, but instead just roughly defining what we have and what we want and maybe giving a few hints, and having the computer generally do the right thing - wouldn't that be awesome?

I experience enough frustration with things like debugging generated code, ostensibly "smart" devices which seem to "have a mind of their own" (maybe that's the point, but it's not doing what I want), and getting Google's search engine to find exactly what I want with its pseudo-AI machine-learning algorithms doing completely inexplicable things with my queries, that I think "generally do the right thing" is not a good idea. Edge cases matter a lot.

Re: How AI based programming could work

#4
>what if programming wouldn't involve defining exact steps, but instead just roughly defining what we have and what we want and maybe giving a few hints, and having the computer generally do the right thing - wouldn't that be awesome?

So, Prolog?

Re: How AI based programming could work

#5
post #4

>what if programming wouldn't involve defining exact steps, but instead just roughly defining what we have and what we want and maybe giving a few hints, and having the computer generally do the right thing - wouldn't that be awesome? So, Prolog?

Why Prolog? I have never noticed that Prolog was any better than other computer languages at reading one's mind!

Re: How AI based programming could work

#6

Suppose you have an AI that generated some code for you, but it doesn't do exactly what you want. Now try to debug it... what if programming wouldn't involve defining exact steps, but instead just roughly defining what we have and what we want and maybe giving a few hints, and having the computer generally do the right thing - wouldn't that be awesome? I experience enough frustration with things like debugging genera…

Yeah, I think this article is talking about something that isn't programming at all. There will always be programmers (unless we're talking about a real robot uprising situation) and if we enter a world where people can tell AIs to perform programming tasks effectively, that won't just be the provenance of programmers; it will reshape society in general.

Re: How AI based programming could work

#7
In a sense we already do this. For example, every time you create a website in HTML/CSS and javascript, you use high level instructions and a lot of declarative stuff. It is already very far away from the actual hardware. If you use some framework with builtin templates, all you need is the actual content and some plumbing. Everything else is handled by the lower layers and it is much more declarative than you realize. It also means that you do not specify thousands of things/little details and you trust the lower layers to do the right thing. It is already happening and it will only get better.

People freak out every time when this idea appears and the recurring argument is that "the AI will not do the right thing, it is too stupid". They forget that our frameworks/libraries and complicated software stacks already work as dumb AIs. They follow hardcoded rules and try to please us and most of the time it actually works otherwise we would not use libraries. Using a neural network may not be the right choice for this problem but the general idea is correct. A good library should hide the "how" as much as it can and only require the user to specify the "end goal".

Re: How AI based programming could work

#8

The whole point of programming is to get exact results by solving all edge cases. Machine learning/Neural nets are only good at guessing results, and cannot solve all edge cases without specific direction.

Sure,

A program that looks at a pattern, emulates it and then enumerates the various edge-cases, looking for further patterns from the programmer's answer.

It would still require effort but it could be a lot easier than present approaches and it might even find edge-cases a human would miss.

Re: How AI based programming could work

#9
I suspect we'll see supervised seq2seq generated code first.

Like:

---

Programmer inputs on left:

compute std dev of x please

AI on right proposes edit to code:

+ import numpy as np

...

+ stddev_x = np.std(x)

---

Not super complicated to start with, but you can see where it will go from there.

Re: How AI based programming could work

#10

Suppose you have an AI that generated some code for you, but it doesn't do exactly what you want. Now try to debug it... what if programming wouldn't involve defining exact steps, but instead just roughly defining what we have and what we want and maybe giving a few hints, and having the computer generally do the right thing - wouldn't that be awesome? I experience enough frustration with things like debugging genera…

Don't we already have a similar situation today with the compiler and application stacks? I'm not writing my business logic in assembler -- I'm writing it in Java, maybe pulling in some third party libraries, using Spring, and then running on the JVM. All kinds of opportunities for things not to work as I expect and then I have to figure out why.
Post reply on HN