Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browserless JavaScript

Tags:

javascript

I talked to the Team Lead at Snap-On Tools once, and she told they used an "implementation of JavaScript" for their server-side coding. It's been a while, but I was thinking, WTF is she talking about? Are there interpreters for JavaScript besides those implemented in browsers?

How can you create a program or code, especially server-side, using JavaScript that doesn't execute in the context of a browser? What the hell is server-side about JavaScript if it's not generating content after the browser has loaded it? Can "server-side" JavaScript generate content before the HTTP response is deliver—and if so, how does that work/is set up?

I have many issues with JavaScript, but first-class functions are so sexy. And JavaScript Object Notation is so pure; I couldn't imagine an easier way to define data structures. Plus, you can hack out some code pretty quickly with dynamic typing if you're not writing something that's mission critical.

As a side question, given the last paragraph, have any suggestions about a good language to learn (comments will suffice)?

like image 796
core Avatar asked Jan 25 '09 07:01

core


1 Answers

JavaScript does not have to be run in a browser if you use an ECMAScript engine. Actually, both SpiderMonkey and Rhino are ECMAScript engines.

Flash's ActionScript is another ECMAScript derived language that doesn't have to run in a browser.

Edit - Wow, a lot has changed in three years. For your server-side needs, I now recommend node.js.

like image 144
DavGarcia Avatar answered Oct 04 '22 22:10

DavGarcia