BT

Phobos: Will we have JavaScript on the Server-side again?

| by Rob Thornton Follow 0 Followers on Nov 15, 2006. Estimated reading time: 1 minute |

A recent editorial on Ajaxian asks what it would be like to write JavaScript on the client and server. Phobos, a Java.net project, is doing just that. The goal of Phobos, a lightweight web application environment, is to show that Java can be a successful platform for server-side scripting. Server-side JavaScript would allow code-sharing between the client and server and only one language required for web development.

Several recent toolkits (GWT, Ruby on Rails helpers) have focused on allowing developers to write in one language and generate JavaScript code. Instead of this trend, Dion asks:

...maybe we will end up developing end to end in JavaScript? Wouldn't it be nice to be in one language (that is very flexible, and allows you to code functionally, procedurally, OO-ally, etc)?

Michael Mahemoff agrees that server-side JavaScript has a lot of potential, though it was written off after failing in the 1990s in products such as Netscape Enterprise Server. JavaScript has come a long way in the last decade and is now prevalent in most organizations, though usually not the language of choice.  Phobos, announced in May, is a web application environment running on the Java platform that is composed of a set of JSR-223 compliant scripting engines, AJAX and Java libraries (Dojo, JDom, etc), and some scripting libraries.  Currently they're focused on JavaScript, using Mozilla Rhino as the engine, with some modifications such as the ability to subclass Java classes and support for the JavaScript language extensions for XML.

A Manageaility post asks if we know how we want to develop web applications:

It's quite a paradox, Javascript doesn't have the consistency, modularity and static checking that Java has so someone builds a compiler. Java's type checking system is not quick and dirty enough so someone builds a framework based on Javascript. Can't we ever make up our minds our are we doomed to repeatedly re-invent the way we do things?

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss
BT