Hey there! Another Skookum JS release is out and about! It’s 0.4.0 this time, slowly making progress.
This time around the release focus was on getting the module system mode Common JS compliant and similar to Node’s. This also brought __filename and __dirname, which simplified a few tests.
There are also some improvements like simple tab completion for the CLI and some new modules, check the full changelog for details.
When I started sjs I had this idea about a JS interpreter with a more “traditional” look, rather than the inherent async model Node provides. Just for the sake of exploring. Well, live and learn, I had no idea Common JS defined more stuff than modules! Somewhat randomly I also ran into Ringo JS, which looks pretty much like what I wanted to do, but built on the JVM. So I’ve decided to follow some of the Common JS specs (open issue here), and let’s see how deep the rabbit hole goes.
Roughly three weeks after the last release, today I’m happy to announce Skookum JS 0.3.0!
What is Sookum JS?
This new release contains a few new modules: random, system (now non-builtin), process, pwd and uuid.
I’m specially happy about two of those modules: random and process, so let’s explore them a bit:
The random module implements a PRNG based on the well known Mersenne Twister PRNG. It also implements a CSPRNG by reading from the best random source available on the system: getrandom on Linux and arc4random_buf on OSX, falling back to reading from /dev/urandom.
If you are an expert in this field and have some comments about the implementation, please reach out!
The process module is by far what took the longest to complete for this release. It implements just two functions: daemonize and spawn, to daemonize the current process and to spawn new child processes respectively.
There are tons of other additions abd bugfixes, check the full changelog for details and the documentation for all APIs.
Last, I found some inspiration and made a new logo, what do you think?
The initial release was a couple of weeks ago, but there are improvement all across the board:
- Better CLI experience and ability to toggle strict mode
- Multiple fixes to the build system (I’m still learning CMake)
- Fix building proper strack traces
- New modules: os and refactored io
- Buffer support for i/o operations
These are just the tip of the iceberg, check the changelog for all details.
For those wondering why sjs is so skookum, see the initial anoouncement and the design documentation.
In the next release I’ll be primarily focusing on child process support and maybe experimenting with multi-threading too. Stay tuned!
The runtime model is quite different from Node: there is no builtin event-driven execution, all APIs are (for the most part) object oriented versions of POSIX APIs. Let’s see how to write a socket client which connects to a server, sends ‘hello’, waits for a reply and closes the connection:
I started this project to have some fun (for certain definitions of fun) and learn some more stuff along the way. Even if the project is being open sourced now, the commit history shows its evolution, including all the mistakes and brainfarts, have fun going through it!
My idea is to have a large standard library, including the kitchen sink. Or at least that’s how I feel like today. This initial release contains the basics to get the project off the ground, expect to see improvements.
Curious? Bored by Node because it just works? Head over to GitHub for the code, and here for the documentation.