Server side JavaScript on Mac OS X?

P

Peter Michaux

Is anyone doing server side JavaScript on Mac OS X?

What tools work well for this?

I'm doing server-side JavaScript on OS X right now :)

Here is a list of some alive and dead projects:

http://en.wikipedia.org/wiki/Server-side_JavaScript

I've investigated the options related to the Mozilla JavaScript
implementations. There are also Microsoft .NET things you can do, I
believe.

Spidermonkey is Mozilla JavaScript implementation in C. There are
projects like Whitebeam, wxJavaScript, jsext, and several mod_js
projects.

Rhino is the Mozilla JavaScript implementation in Java. Helma is the
leading JavaScript web framework based on Rhino. There is now also
Phobos to consider.

I've decided to mess around with Rhino and Jetty which are the basis
for Helma. Using Rhino and all of Java seems like a huge jumpstart
compared to "loosing" time messing with C libraries. I'd rather use a
C implementation but that is a huge uphill battle to get to a really
complete dev environment comparable to Perl/Python/Ruby.

There is no doubt that JavaScript on the server-side is gaining some
momentum since it allows code sharing with the client. This is more
beneficial as client programs become heavier.

The opposite approach is like GWT and haXe which compile source code
down to JavaScript to send to the client.

Peter
 
G

gh

I'm doing server-side JavaScript on OS X right now :)

Thanks, Peter - you're looking at the same things I am, for similar
reasons.

Unless I'm mistaken, there doesn't seem to be a clear answer as to
what is the best SSJS implementation for the Mac.

Have you gotten Rhino to respond to a CGI request?
 
P

Peter Michaux

Thanks, Peter - you're looking at the same things I am, for similar
reasons.

Unless I'm mistaken, there doesn't seem to be a clear answer as to
what is the best SSJS implementation for the Mac.

There is not a clear "best" but if Rhino is the engine Helma and
Phobos are the ones to consider.

The "for the Mac" part is not so important as Mac is not a common
deployment platform. "for Unix" would be better if you don't care
about sharing with developers using Windows.

Have you gotten Rhino to respond to a CGI request?

Here is a link to the first hacking attempt I made to use Rhino, the
Jetty server, and MySQL together. This is not really a good example. I
posted it hoping it would get others started doing something better.

<URL: http://peter.michaux.ca/article/3019>

Now I'm taking some of the ideas of this example and trying to make a
"real" framework that I could use in production. It's slow going.
Certainly not as fast as downloading Rails and buying a book on it.

Peter
 
G

gh

I'm making good progress. After following Peter's recipe for Rhino
(thanks!), the following program runs just fine from the command line:

#!/usr/bin/java org.mozilla.javascript.tools.shell.Main
print("Hello World");

(I saved it as HelloWorld.js. It's the shabang that makes it a
JavaScript program, not the .js)

However, if I start it from Safari, I get the following message in the
log:
Exception in thread "main" java.lang.NoClassDefFoundError: org/mozilla/
javascript/tools/shell/Main

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top