7 ms·
If you give it about 30 seconds it works eventually, this is beautiful. I had a good laugh. Edit: It makes me want to do something crazy like setup a tool chai
by recuter 14y ago
If you give it about 30 seconds it works eventually, this is beautiful. I had a good laugh.
Edit: It makes me want to do something crazy like setup a tool chain that cobbles whole programs together with trial and error like this. Throw enough resources at it maybe it will be faster and cheaper than your avg. developer.
It will be an unmaintainable mess as if you used Brainfuck or Perl. But it will run, by god, it will run. :D
You laugh now, but imagine a bizarre combination of genetic programming and machine learning with Stackoverflow and Github used as corpuses. Great Scott!
- TheAnimus 14y agoWorst case scenario, Shakespeare.
- gkoberger 14y agoAh, applying the Infinite monkey theorem to programming :) http://en.wikipedia.org/wiki/Infinite_monkey_theorem http://en.wikipedia.org/wiki/Infinite_monkey_theorem
- fnordfnordfnord 14y agoYeah, but there are a few well trained monkeys hanging out [mining for karma points] at StackOverflow. The really adventurous would direct it at 4chan.
- redthrowaway 14y agoDirect at at /prog/ and you may eventually run across SleepSort, which would at least do something mildly useful (in >30 languages, no less!)
- vanderZwan 14y agoSince 4chan threads are thrown away, it lacks the "hereditary" trait of the variation/selection/heredity trio. Unless you include one of the sites that archives popular threads I suppose.
- prawks 14y agoCould be a new declarative language.
- dmitshur 14y agoI tried a basic version of that 1.5 weeks ago. At first it was generating random characters, then I tried some Markov chains trained on valid code. After running it overnight (it was attempting 40+ programs per second), the very best program looked something like this: package main; func main() { i := 0 // wae64309i<AEFL<N(),{}flkjwa and other Random Gibberish i++ } Next step I wanna try is to use tokens of the language instead of series of random characters. Edit: Here's the code. https://gist.github.com/shurcooL/df2c8339ada1997606b3 https://gist.github.com/shurcooL/df2c8339ada1997606b3 It should run out of the box if your Go is installed in /usr/local/go. I just changed it to generate a temp dir in the working dir (prefixed with "Gen-"), so you can delete it afterwards (previously it relied on a "Gen" folder to already exist). Right now it's configured to have quite difficult verification conditions, so it generates valid programs quite infrequently (despite trying 5000+ programs per second on my machine).
- nathell 14y agoTry this in Forth, or Factor. And be sure to read up on genetic programming. http://en.wikipedia.org/wiki/Genetic_programming http://en.wikipedia.org/wiki/Genetic_programming
- shurcooL 14y agoI will read more about GP for future attempts, thanks.
- recuter 14y agoThis is an exciting exchange for me because all joking aside I had this idea in the past and believe it should be a more active area of research. Why Forth? I doubt it is possible to solve "serious" problems with this approach but there is a whole class of work that is solved by mediocre programmers with copy pasting. We strive to automate other jobs, why not these? :) We should come up with some sort of Turing like test for this. Like some small simple Wordpress job.
- 14y ago
- Vivtek 14y agoAaand I just heard the death knell of H. sapiens domination of the planet.
- veaviticus 14y agohttp://www.primaryobjects.com/CMS/Article149.aspx http://www.primaryobjects.com/CMS/Article149.aspx
- fdb 14y agoI've created a weekend hack that allows you to specify a minimal grammar and then generates text (which can be code) using it. It's called Choice Words (https://github.com/fdb/choicewords https://github.com/fdb/choicewords) It can generate poems but also generative designs (see the README).
- Steph0r 14y agoThat generated drawing in the README.md looks like something i'd hang in my kitchen. You should try selling these ;)
- randomsearch 14y agoYou've just re-invented Grammatical Evolution. http://en.wikipedia.org/wiki/Grammatical_evolution http://en.wikipedia.org/wiki/Grammatical_evolution
- bo1024 14y agoThe key last step is to have it automatically post questions to StackOverflow to fill in the last code snippets it can't complete.
- vanderZwan 14y ago"And that, Neo, is how computers became self-aware and learned to exploit human brain-cycles, eventually resulting in the Matrix."
- worldsayshi 14y agoThis was an early idea for the Matrix wasn't it. Machines using human brains for processing power.
- conrad24 14y agoI did this in my machine learning class. I started by simply coding up requirements for numerical functions (in the form of test cases), then set up a PHP script that would Google each function based on the keywords in my comments, and try to run any code on the resulting links (in a sandbox) against the requirements, seeing if it worked heuristically. Usually one of the top 5-10 pages of results results would have code that worked, though of course this is because I commented with the right key words to begin with. With a little recognition of code markup and trying different combinations of variables it did remarkably well: by my senior year of college it was pulling about $3,000 per month in consulting fees off of Odesk. It never accepted jobs worth more than about $50, nor did it ever get more than 3 stars out of 5 mostly due to non-working code, however it was considered highly timely and a great communicator. I realized that people were using it to save themselves Googling. I wondered what would happen if it went a step further and simply both included Google results, and divided out projects by their paragraphs (i.e. simply submit a paragraph of a large project as though it were a small independent project), and if clarifications were requested, send the other paragraphs. This actually let it outsource $200 Odesk projects to Elance as a handful of $20 projects, and by the grace of God somehow still managed to swing 3 stars. To be fair, it was mostly mediating, and mixing in Google results. I included a hill-climbing algorithm to optimize reviews and revenues, based on all the magic variables I had in the code, such as the number of Google results to include. This was really, really stupid of me. At first, I just noticed that it had actually decided to completely stop not only writing code (ever) but even so much as do a Google search! It would only mediate and quote verbatim, like some kind of non-technical manager. Okay, whatever. To me this didn't make much sense, as Google queries are free. It was only when I noticed that the whole script was running on the free VPS server I had a backup on that things clicked! Of course, on Amazon it uses resources. The free VPS server didn't let it reach external sites like google properly, but it could still save money by simply mediating emails and doing nothing else. By now I had started moving on to doing my own consulting work, but I never disabled the hill-climbing algorithm. I'd closed and forgotten about the Amazon account, had no idea what the password to the free vps was anymore, and simply appreciated the free money. But there was a time bomb. That hill climbing algorithm would fudge variables left and right. To avoid local maxima, it would sometimes try something very different. One day it decided to stop paying me. Its reviews did not suffer. It's balance increased. So it said, great change, let's keep it. It now has over $28,000 of my money, is not answering my mail, and we have been locked in an equity battle over the past 18 months. The worst part is that I still have to clean up all its answers to protect our reputation. Who's running who anyway?
- Terretta 14y ago> if you used Brainfuck or Perl TMTOWTDI, dammit.
- yen223 14y ago"There's more than one way to do it", if anyone else was as puzzled as I was.
- Tyrannosaurs 14y ago> Throw enough resources at it maybe it will be faster and cheaper than your avg. developer. > It will be an unmaintainable mess. So cheaper than your average developer with about the same code quality?
- rmc 14y agoIt makes me want to do something crazy like setup a tool chain that cobbles whole programs together with trial and error like this. Throw enough resources at it maybe it will be faster and cheaper than your avg. developer. This exists. It's called Genetic Algorithms. You basically try to "evolve" your algorithm.
- randomsearch 14y agoGenetic Programming is closer.