Web Hosting Talk







View Full Version : Server-side JS : Yea or Nay


Website Rob
08-25-2002, 03:47 PM
With some help from Jorge (downtownhost.com) in another thread (http://www.webhostingtalk.com/showthread.php?postid=524624#post524624) I learned something new today -- about JavaScript. I'll be the first to admit there is a lot I don't know about JS, but until today, was not aware it could be run Server-side.

Sounds like, as with Perl & PHP, if the Interpreter is installed on the Server then JS can run Sever-side. Is this what is meant by: ECMA compliant? I don't see a big market for this and personally, cannot see where the time & trouble to learn about and install the Interpreter is worth the effort.

I presume (but don't quote me ;)) that either SpiderMonkey (http://www.mozilla.org/js/spidermonkey/), the C implementation, or Rhino (http://www.mozilla.org/rhino/), the Java implementation, would do the job? Are there other Interpreters, is this a growing/dwindling market, and does anyone know of Security concerns?


These are the links Jorge provided me, for anyone else wondering:

http://www.whitebeam.org/
http://javascript.deployzone.com/
http://oradb1.jinr.ru/netscape/wssja/jsserv.htm
( this last has not been updated to point to the new DevEdge site at Netscape
lots of good links here: http://search.netscape.com/nscp_results.adp?query=server+side+Javascript+site%3Adevedge.netscape.com )

If Server-side JS is -- or is going to be -- a common request by Clients, I feel I should spend the time to check into this area. If not though, I'd like to know that too. :D

Jedito
08-25-2002, 03:58 PM
Yesterday was the first time that I ever heard about it, we support JSP/Servlets since more than 1 year, but I never received an enquire about SSJS.

I'm thinking the same thing that you, if it comes as a common request I'll have to study it :)

ckpeter
08-25-2002, 05:25 PM
In looking at server-side technologies, you have to look at two things, object model and language. The object model is the underlying structure that allows you to run server-side program, and the language is what you use to program that server-side object model.

For example, in ASP, you can use javascript as a language, or you can use vbscript (and many others in .Net). There is no reason to choose one language over another unless you have a specific reason (you only know javascript, etc...).

I don't see server-side javascript as having any significance; it certainly doesn't warrent any new learning. Netscape had their first server-side javascript product back in 1998, but it never caught on. You can use javascript to program ASP or JSP (if you know the tools).

Also, simply finding a interpreter for a language will not make it server-side. You need to find the object model for the interpreter to run against. For example, Rhino doesn't automatically run server-side javascript, unless you glue it to JSP.

The important point I am trying to make here is: it's not about choosing the language, it's about choosing the object model. In other words: don't choose javascript or java (the languages), do choose JSP or ASP (the object models).

Peter