I am pleased to announce SilkJS, a V8 based Swiss Army Knife (and HTTP server).

SilkJS currently compiles for Linux and Mac OSX, but should port trivially to any flavor of Unix. It was originally written for Ubuntu Linux and ported to OSX (a FreeBSD flavored Unix) in under 2 hours.

So what is it?

SilkJS is a C++ program that links with the Google V8 JavaScript engine and several other libraries. It provides as simple and direct as it can, methods that make calling operating system and those other libraries' functions from JavaScript context.

Running SilkJS is as simple as:
path_to/SilkJS some_javascript_file.js
SilkJS simply loads the specified JavaScript file, compiles it, runs it, then calls a main() function provided by the script. Any additional arguments on the command line are passed to the main() function.

SilkJS is not NodeJS. It merely provides the "glue" to the operating system and other library functions to make them callable from your JavaScript program.

I wrote an HTTP server almost entirely in JavaScript using SilkJS that's included with SilkJS. The HTTP server is a pre-fork model server, and it's very fast. I was able to run ab (apache benchmark) against it with 20,000 concurrent requests and it served a 13.3K file 50,000 times in under 3 seconds with no errors. It is several times faster than NodeJS at serving NodeJS' sample "hello, world" demo on the nodejs.org home page. It is 30x or more faster than Apache and PHP 5.3 at running real world server-side business logic.

I also wrote a console program in JavaScript using ncurses that technically minded webmasters will find quite useful. It refreshes the screen once per second, displaying in real-time the CPU usage, memory usage, disk activity, and virtual memory. With this program, you can tell if a busy WWW server is CPU, memory, and/or disk bound. Or if it's swapping heavily.

SilkJS comes with a number of library interfaces built-in. These include console I/O, file system I/O, the gd2 graphics library, MySQL, ncurses, networking, and process management (fork, wait, etc.).

nodejs.org is served by ngnix, not by nodejs. SilkJS can be viewed at http://silkjs.org/ and it is entirely served by SilkJS itself.

SilkJS may be downloaded and used freely from github at http://github.com/mschwartz/SilkJS.

Please see the Wiki http://github.com/mschwartz/SilkJS/wiki, it contains more details about building SilkJS, benchmarks, example programs, etc. Of particular interest to us ExtJS developers is the ORM, which fully supports ExtJS DataStore.

I've started a Google Group for supporting SilkJS at http://groups.google.com/group/silkjs

Check it out!