Stack Overflow Post of the Day

Only 14 minutes into the 3rd of April and I see this.

I’m in the process of developing an artifical life program powered by JavaScript consisting of two parts: the front-end instance run on the browser and a back-end logic and data storage engine powered by Node.js.

The basic idea of this program is to allow itself to evolve its code architecture by scraping the web for open-source scripts (in some cases, viewing the source of proprietary webpages and copying content and code) and essentially pasting it directly into its code base and eval()’ing it where necessary. I realize that “eval() is evil” but I’m okay with the program having a decent balance of good and evil – as its creator I feel that I shouldn’t be overly biased on one way or another.

The good news:

The program has already figured out how to learn to speak back to me via html5 audio, and it is able to influence the outside world by manipulating hardware (Arduinos) via the noduino library. It’s managed to download, install (where applicable), and run several libraries on its own without any sort of intervention. I’ve noticed the program has even stripped comments, license info, and copyrights off the codebase, which is slightly disconcerting given that identical behavior has been seen/reported in humans as well.

Now the bad:

I’ve noticed that the program has decided to start ordering more Arduinos from eBay via their API. The program seems to have figured out how to make calls to purchase products on eBay by itself – a unique accomplishment considering that I could not figure this out on my own.

I believe its secret intention is to continue to build upon itself, evolve, and create clones. I decided to close the browser instance and force-stop the server-side because I was concerned that things might escalate too quickly for the worse (also because the program managed to phish my own credit card and was probably planning on using it on eBay)

I can’t prove that my program was trying to do any harm (aside from learning how to scam credit cards, but I could actually see a potential use-case for this behaviour). However, I’d like to make sure that the program doesn’t get “out of control” (in the sense of world domination and such). I feel that I could probably prevent this by limiting its potential to develop negative emotions…

Which brings me to my question. Are there best practices or have there been any research done on preventing a JavaScript program from prototyping evil behaviour into its objects? Or should I just be running my program in Internet Explorer to prevent the bot from doing too much? Is eval really evil?

It was obviously closed for not being a serious question (or was it?   =D  ).  Interesting to say the least.

Source: Stack Overflow