<p>Does anyone see server-side JavaScript taking off? There are a couple of implementations out there, but it all seems to be a bit of a stretch (as in, "doing it BECAUSE WE CAN" type of attitude). </p>

<p>I'm curious to know if anyone actually writes JavaScript for the server-side and what their experiences with it have been to date.</p>

<p>Also, which implementation is generally seen as the most stable?</p>

[{'answer_id': 17437, 'author': 'Cristian', 'author_id': 680, 'author_profile': 'https://Stackoverflow.com/users/680', 'pm_score': -1, 'selected': False, 'text': "<p>I can't see most developers getting over their distaste for client-side JavaScript programming. I'd rather go to Java for server-side stuff before choosing JavaScript.</p>\n"}, {'answer_id': 17438, 'author': 'Adam', 'author_id': 1366, 'author_profile': 'https://Stackoverflow.com/users/1366', 'pm_score': 1, 'selected': False, 'text': "<p>I've never even heard of this, but it strikes me as using the wrong tool for the job. Since programming languages are just tools designed to help us solve some problem.</p>\n\n<p>Why would you want to process something in Javascript when you can process it in PHP or ASP.NET which are designed specifically for this task?</p>\n\n<p>Sure you can pound a nail in with a screw driver, but a hammer works much better because it was actually designed for it...</p>\n\n<p>So no, I don't see it taking off.</p>\n"}, {'answer_id': 17450, 'author': 'Björn', 'author_id': 1814, 'author_profile': 'https://Stackoverflow.com/users/1814', 'pm_score': 1, 'selected': False, 'text': "<p>Well, plain ol' ASP supported JavaScript server-side years ago and everyone onad their dog used VBShiate instead. But I have to agree with the others: JS does not seem to be the right tool here - and I love to do client-side JS :)</p>\n"}, {'answer_id': 17456, 'author': 'Frank Krueger', 'author_id': 338, 'author_profile': 'https://Stackoverflow.com/users/338', 'pm_score': 1, 'selected': False, 'text': '<p>I personally did a whole site in server side JavaScript using ASP. I found it quite enjoyable because I was able to have some good code reuse. This included:</p>\n\n<ul>\n<li>validation of parameters</li>\n<li>object modeling</li>\n<li>object transport</li>\n</ul>\n\n<p>Coupled with a higher-level modeling tool and code gen, I had fun with that project.</p>\n\n<p>I have no numbers on perf unfortunately, since it is used only on an intranet. However, I have to assume performance is on par with VBScript backed ASP sites.</p>\n'}, {'answer_id': 17511, 'author': 'Hanno Fietz', 'author_id': 2077, 'author_profile': 'https://Stackoverflow.com/users/2077', 'pm_score': 4, 'selected': False, 'text': '<p>I like to read Googler Steve Yegge\'s blog, and recently I came across <a href="http://steve-yegge.blogspot.com/2008/06/rhinos-and-tigers.html" rel="nofollow noreferrer" title="Rhinos and Tigers">this article of his</a> where he argues that <a href="http://www.mozilla.org/rhino" rel="nofollow noreferrer" title="Mozilla Rhino">Mozilla Rhino</a> is a good solution for server-side JS. It\'s a somewhat sloppy transcript, you might prefer to watch the <a href="http://sites.google.com/site/io/server-side-javascript-on-the-java-virtual-machine" rel="nofollow noreferrer" title="Google IO Talk">video of the talk</a>. It also offers a little bit of insight on why he thinks server-side JS is a good idea in the first place (or rather, why he thinks that it\'s a good idea to use a dynamic language to script Java). I thought the points he makes were convincing, so you might want to check it out.</p>\n\n<p>A while earlier, he also posted <a href="http://steve-yegge.blogspot.com/2008/05/dynamic-languages-strike-back.html" rel="nofollow noreferrer" title="Dynamic Languages Strike Back">something about dynamic languages in general</a> (he\'s a big fan of them), just in case you were wondering why to use JS at all.</p>\n'}, {'answer_id': 17562, 'author': 'John Topley', 'author_id': 1450, 'author_profile': 'https://Stackoverflow.com/users/1450', 'pm_score': 3, 'selected': False, 'text': '<blockquote>\n  <p>Why would you want to process\n  something in Javascript when you can\n  process it in PHP or ASP.NET which are\n  designed specifically for this task?</p>\n</blockquote>\n\n<p>Perhaps because JavaScript is a more powerful programming language than those two? For example, it has functions as first-class data types and support for closures.</p>\n\n<p>Steve Yegge has blogged about porting Ruby on Rails to server-side JavaScript as an internal project within Google ("Rhino on Rails"). He did it because he likes Rails but using Ruby isn\'t allowed within Google.</p>\n'}, {'answer_id': 17703, 'author': 'Marcus Downing', 'author_id': 1000, 'author_profile': 'https://Stackoverflow.com/users/1000', 'pm_score': 0, 'selected': False, 'text': "<p>Server-side programming has been around for a lot longer than client side, and has <em>lots</em> of good solutions already.</p>\n\n<p>JavaScript has survived and become popular purely because developers have very little choice in the matter - it's the only language that can interact with a DOM. Its only competition on the client side is from things like Flash and Silverlight which have a very different model.</p>\n\n<p>This is also why JavaScript has received so much effort to smart it up and add modern features. If it were possible for the whole browser market to drop JavaScript and replace it with something designed properly for the task, I'm sure they would. As it stands Javascript has strange prototype-based objects, a few neat functional programming features, limited and quirky collections and very few libraries.</p>\n\n<p>For small scripts it's fine, but it's a horrible language for writing large complicated systems. That things like Firefox and Gmail are (partly) written in it is a heroic accomplishment on their part, not a sign that the language is ready for real application development.</p>\n"}, {'answer_id': 17713, 'author': 'Brian Warshaw', 'author_id': 1344, 'author_profile': 'https://Stackoverflow.com/users/1344', 'pm_score': 1, 'selected': False, 'text': '<p>It seems like most of you are put off by this idea because of how unpleasant the various client-side implementations of Javascript have been. I would check out existing solutions before passing judgment, though, because remember that no particular SS/JS solution is tied to the JS implementations currently being used in browsers. Javascript is based on ECMAScript, remember, a spec that is currently in a fairly mature state. I suspect that a SS/JS solution that supports more recent ECMA specs would be no more cumbersome than using other scripting languages for the task. Remember, Ruby wasn\'t written to be a "web language" originally, either.</p>\n'}, {'answer_id': 17736, 'author': 'bootload', 'author_id': 2092, 'author_profile': 'https://Stackoverflow.com/users/2092', 'pm_score': 1, 'selected': False, 'text': '<blockquote>\n  <p>Does anyone see Server-side Javascript\n  taking off?</p>\n</blockquote>\n\n<p>Try looking at <a href="http://www.appjet.com" rel="nofollow noreferrer">http://www.appjet.com</a> a startup doing hosted JavaScript applications to get a feel for what you can do. I especially like the learning process which gently nudges the user to build things with a minimal overhead ~ <a href="http://appjet.com/learn-to-program/lessons/intro" rel="nofollow noreferrer">http://appjet.com/learn-to-program/lessons/intro</a>  </p>\n\n<p>Now it might seem a weird idea at the moment to use JavaScript but think back when PC\'s started coming out. Every nerd I knew of was typing away at their new <em>Trash-80</em>\'s, <em>Commodore64</em>\'s, <em>Apple ][</em>\'s typing in games or simple apps in BASIC. </p>\n\n<p>Where is todays basic for the younger hacker? </p>\n\n<p>It is just possible that JavaScript could do for Web based server side apps as BASIC did for the PC. </p>\n'}, {'answer_id': 17942, 'author': 'pottedmeat', 'author_id': 2120, 'author_profile': 'https://Stackoverflow.com/users/2120', 'pm_score': 2, 'selected': False, 'text': '<p>Before it was acquired by Google, <a href="http://www.jot.com/" rel="nofollow noreferrer">JotSpot</a> used server-side JavaScript to let you query their database and display your pages. They used <a href="http://www.mozilla.org/rhino" rel="nofollow noreferrer">Rhino</a> to do it. CouchDB uses server-side JavaScript to create <a href="http://wiki.apache.org/couchdb/Views" rel="nofollow noreferrer">views</a> of their database.</p>\n\n<p>As you can see from these examples, a great way to use JavaScript on the server is for plugins. One of the reasons it\'s used is that you can create a very isolated sandbox for people to run their code in. Also, because of the way that JavaScript as a language works, you can provide a user tooling specifically honed to the tasks your users need to complete. If you do this right, users don\'t need to learn a new language to complete their tasks, a quick glance at your API and examples is enough to get them on their way. Compare this to many of the other languages and you can see why using server-side JavaScript to provide a plugin architecture is so enticing.</p>\n\n<p>A secondary popular solution, one which can be seen through a project like <a href="http://www.aptana.com/jaxer" rel="nofollow noreferrer">Jaxer</a>, is that a common problem of web applications that do client-side validation is that, since JavaScript is easily bypassed in the browser, validation has to be run once again on the server. A system like Jaxer allows you to write some validation functionality that is reusable between both server and client.</p>\n'}, {'answer_id': 227562, 'author': 'Herms', 'author_id': 1409, 'author_profile': 'https://Stackoverflow.com/users/1409', 'pm_score': 0, 'selected': False, 'text': '<p>Flash Media Server is scripted by using Server Side Action Script, which is really just javascript (ECMAScript).  So, I do it a lot.  In fact, most of my day was dealing with SSAS.</p>\n\n<p>And I hate it.  Though to be fair, a bunch of that is more related to the (not so great) codebase I inherited than the actual language.</p>\n'}, {'answer_id': 546511, 'author': 'oberhamsi', 'author_id': 42900, 'author_profile': 'https://Stackoverflow.com/users/42900', 'pm_score': 2, 'selected': False, 'text': '<p>Support for JS on the server has been getting stronger and the number of frameworks is getting bigger even faster.</p>\n\n<p>Just recently the <a href="https://wiki.mozilla.org/ServerJS/Introduction" rel="nofollow noreferrer">serversideJS</a> group was founded. They have a lot of smart people that have been working on serverside JS for years (some of them more then 10).</p>\n\n<blockquote>\n  <p>The goal for this project is to create\n  a standard library that will\n  ultimately allow web developers to\n  choose among any number of web\n  frameworks and tools and run that code\n  on the platform that makes the most\n  sense for their application.</p>\n</blockquote>\n\n<hr>\n\n<p>to the people who say "why would you choose JS over java or any other language?" - you should read this <a href="http://javascript.crockford.com/javascript.html" rel="nofollow noreferrer">Re-Introduction</a> by Crockford and <a href="http://video.yahoo.com/watch/111582/992708" rel="nofollow noreferrer">forget about the DOM</a> - the DOM is superugly, but that\'s not JS fault and JS is not the DOM.</p>\n'}, {'answer_id': 1175563, 'author': 'temoto', 'author_id': 73957, 'author_profile': 'https://Stackoverflow.com/users/73957', 'pm_score': 1, 'selected': False, 'text': '<ul>\n<li>XChat can run Javascript plugins.</li>\n<li>I\'ve some accounting software completely written in Javascript.</li>\n<li>There\'s this interesting IO library for V8: <a href="http://tinyclouds.org/node/" rel="nofollow noreferrer">http://tinyclouds.org/node/</a></li>\n<li>CouchDB is a document database with \'queries\' written in Javascript (TraceMonkey).</li>\n</ul>\n\n<p>Considering this, i believe, server-side Javascript <em>did</em> take off.</p>\n'}, {'answer_id': 1175580, 'author': 'Unknown', 'author_id': 57757, 'author_profile': 'https://Stackoverflow.com/users/57757', 'pm_score': 0, 'selected': False, 'text': "<p>I think server-side Javascript is guarenteed to take off. Its only a matter of time.</p>\n\n<p>Mozilla, Google, and Adobe have so much vested interest for Javascript that it would take a miracle to dislodge it from the browser world. The next logical step is to move this into the server-side.</p>\n\n<p>This is a step towards moving away from the hodge podge of Internet technology that usually includes all of these</p>\n\n<ul>\n<li>HTML</li>\n<li>CSS</li>\n<li>Javascript</li>\n<li>Serverside Language J2EE/ASP/Ruby/Python/PHP</li>\n<li>SQL</li>\n</ul>\n\n<p>I haven't heard much about the current state of Javascript Server frameworks, except that they are mostly incomplete.</p>\n"}, {'answer_id': 1321913, 'author': 'Aaron Qian', 'author_id': 86288, 'author_profile': 'https://Stackoverflow.com/users/86288', 'pm_score': 0, 'selected': False, 'text': '<p>I see server-side js will offer considerable advantages in future applications. Why? Web apps that can go offline, client-side db store, google gears, etc...</p>\n\n<p>Following this trend, more and more logic are moving into the client-side. Use an ORM that works for client-side, and use another on server-side (be it PHP / Ruby / whatever), write your synchronization logic twice in two different languages, write your business logic twice in two different languages?</p>\n\n<p>How about use js on the client AND the server side and write the code once?</p>\n\n<p>Convincing?</p>\n'}, {'answer_id': 2433206, 'author': 'Carlos', 'author_id': 292331, 'author_profile': 'https://Stackoverflow.com/users/292331', 'pm_score': 0, 'selected': False, 'text': '<p>Personaly i\'ve been developing and using my own JavaScript framework for about 4 years\nnow.</p>\n\n<p>The good thing about JS on serverside is that implemented in ASP Classic you don\'t need\nany other plugin or software installed, besides i\'m also using my javascript (client)\nframework on my server, that allows me to enjoy of the same functionality and proven\nperformance of my functions at both environments client and serverside.</p>\n\n<p>Not only for data validation, but also lets say HTML or CSS dynamic constructions\ncan be done client or serverside, at least with my framework.</p>\n\n<p>So far it works fast, i have nothing to complain or regret except its great usability\nand scalability that i have been enjoying during this past 4 years, until the point\nthat i\'m changing my ASP Classic code to javascript code.</p>\n\n<p>You can see it in pratice at <a href="http://www.laferia.com.do" rel="nofollow noreferrer">http://www.laferia.com.do</a></p>\n'}, {'answer_id': 12553832, 'author': 'Shamoon', 'author_id': 239879, 'author_profile': 'https://Stackoverflow.com/users/239879', 'pm_score': 0, 'selected': False, 'text': '<p>Node.js has taken off and proven that server-side JavaScript is here to stay =)</p>\n'}]
['https://Stackoverflow.com/questions/17435', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1693/']