Kevin Dangoor asks what Server Side JavaScript needs and launches more talk about a standard library for Javascript on the server-side.
Having a unified API for libraries in different environments would in my opinion be nice especially because it would allow higher level modules to be shared between different server-side javascript environments. One problem that has slowed this from happening in the past has been that in Java-based environments like Helma , Sling and Xjs , Rhino makes the direct scripting of Java packages so easy, that some stakeholders don't believe the added burden of maintaining an additional API layer in javascript is reasonable for the benefit they would get from it.
Some pointers to current server-side javascript library projects in the realm of the Helma project and to other efforts for a standard library for JS:
The current Helma 1 versions come with two libraries containing several modules. The HelmaLib provides modules for core functionality such as Database, File, Ftp, Http, Smtp and SSH, some that extend built-in prototypes, and a few others. The Jala library adds further modules such as DNS, MP3 and XML-RPC and utility modules such as i18n, image manipulation, captcha, HtmlDocument, RemoteContent, Podcast, Rss and other XML related modules.
Modules are included either via a configuration file or at runtime via a method call. A module is only loaded once, even if included multiple times. In the context of Helma 1, modules are loaded into the global scope and they need to be nice and restrict themselves to a save namespace.
For Helma NG , the way modules are included is changed to eliminate any possible namespace conflicts. Each module in Helma NG lives in its own scope and can selectively import other modules or portions thereof into its scope. Here again, when modules are imported in different scopes, each module is only actually loaded once.
There has been some discussion with the goal of a unified library/ modules architecture between different projects over in the Helma NG group. One of the major goals in Peter Michaux's xjs project is to provide a standard library and a shared module loading mechanism.
29.1.2009, 19:58