Ask HN: What Would Programming Look Like If Machines Programmed
This just came to me earlier but I thought it worthy of a post here. What would programming look like done by machines instead of humans? Would oop even exist or would functional take all?
9 comments
[ 3.1 ms ] story [ 30.7 ms ] threadAssuming we are talking full real hard AI, when machines can effectively program, they don't need english (or human) language constructs. The resulting programs probably won't even be introspectable by humans.
What programming language is your consciousness written in?
As far as OOP vs. functional programming goes, OOP is a construct to help tiny human brains can try and chunk away complexity at lower layers so stuff "just works." Done well, it simplifies mental models. Done poorly, you end up with factoryfactoryfactories. Functional programming seems the more sane choice since a machine won't care about added syntactic burdens of passing state around everywhere.
Any more speculation on this topic veers off into unsubstantiatable science fiction territory.
http://gcc.gnu.org/onlinedocs/gccint/GIMPLE.html#GIMPLE
All sorts of compilers write machine code based on intermediate languages or human readable source.
If you want to know what paradigms they follow, you would have to look at the internal data structures of each tool. Usually, a machine figuring out how to 'go fetch a beer' is only going to use the tools and techniques that its builder designed it to.
Even if you have built a powerful optimization system, its optimizations will probably be over-optimized to the point where no single identifiable paradigm for solving a large number of problems emerges. Programming languages and paradigms used by people are practical trade-offs that meet the majority of problems in a good, but not the best way.
That's why it sometimes is dumb to pursue languages or paradigms that fit a particular problem extremely well or to explore esoteric and meaningless language constructs except in the hopes that it will lead to some practical and general usefulness later. Mathematics historically has always had people diving into the most esoteric depths, not because it was useful, but because it was a conspicuous display of wealth of time and effort.
A nice example of how 'alien' the results can be is experiments that have been done designing hardware circuits with this type of approach. Results have included designs that were difficult to comprehend at first glance, including features that were not connected to other parts of the circuitry but upon removal caused the rest the the chip to not work correctly. (It was figured out but explanation is beyond the scope of a discussion here).
I don't have time to dig right now but you might want to have a look here; http://www.cogs.susx.ac.uk/users/adrianth/ade.html
I know he's had some interesting results. Here's a good write-up I found with a bit more searching; http://www.damninteresting.com/on-the-origin-of-circuits/