Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Mod_js: Server-side JavaScript (modjs.org)
34 points by mcxx on April 17, 2008 | hide | past | favorite | 7 comments


i'm working on a similar project using rhino 1.7 on the jvm.

i've added a pretty seamless package management and script loading system on top of rhino (you can say 'package('foo.bar.baz')' and it does what you expect), and done a servlet that will invoke scripts written in it.

on top of the basic language and servlet infrastructure i've written a little glue to allow seaside-style continuation stuff, except that the continuations can be serialized and consumed inside another process so it can be clustered. i'm deeply indebted to attila szegadi for many of the techniques used to do this.

it's very cool (and quite fast/scalable) and js 1.7 is actually a very modern and powerful dynamic language (lexical scoping, comprehensions, generators, etc.). my company is in the process of open-sourcing it but if anyone wants a sneak peek let me know and i'll ship out a tarball.

oh and libraries aren't an issue, i've gotten everything i've needed by calling into the standard java library. we've written real applications with this thing.


I'd be interested in checking it out.

I've been using Rhino a lot recently, and I must say it's pretty awesome. You get all the functionality of pretty much any Java library out there for free, without all the cruft of Java.

However, I did a quick benchmark of Rhino, Spidermonkey, and JavaScriptCore (WebKit's engine) and jscore beats the crap out of Spidermonkey and especially Rhino. I don't remember the exact numbers, but it was something like this:

    JavaScriptCore: 0.5 seconds
    Spidermonkey: 3 seconds
    Rhino: 6 seconds
To be fair, the benchmark was very specific to the project I'm working on and involved a lot of regex and string manipulation. Rhino's regex implementation is known to be pretty slow.


the regex implementation is extremely slow, but in general it's quite reasonable. i wouldn't use it for number crunching, but for all the things that we've been using perl/ruby for it seems much faster (and it has jvm concurrency, which means we can thread really nicely which helps too).

i'm going to be at web 2.0 next week but when i get back i'll put together a tarball that has some examples and stuff in it and send it along. the project is called 'jetstream' by the way. please send me an email to remind me.

cheers, ben


So, is the next big web framework going to be ECMAScript?

Obligatory: http://steve-yegge.blogspot.com/2007/02/next-big-language.ht...


Aptana has been marketing their GPLed Jaxer server ("the Ajax server") which includes things like database access from javascript:

http://aptana.com/jaxer


Anyone know what JavaScript engine they use?


    AC_MSG_CHECKING(for --with-js)
    AC_ARG_WITH(js, [--with-js=PATH Path to spidermonkey source tree],




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: