RingoJS hits 0.9
Ringo is a CommonJS-based JavaScript runtime written in Java and based on the Mozilla Rhino JavaScript engine. It takes a pragmatical and non-dogmatic stance on things like I/O paradigms. Blocking and asynchronous I/O both have their strengths and weaknesses in different areas.
Its aim is to provide an off-browser JavaScript platform that has the right mix of features and simplicity to be pleasant to work with and easy to deploy. The primary goal is to build a stable, high-performance runtime for server-side use. The following code is all you need to create a simple web app:
exports.app = function(req) {
return {
status: 200,
headers: {"Content-Type": "text/plain"},
body: ["Hello World!"]
};
};
if (require.main == module)
require("ringo/httpserver").main(module.id);
Simply save the code above as "server.js" and run it by executing ringo server.js. Like most Ringo apps, this app will automatically reload, picking up any changes you make without requiring a restart.
But Ringo lets you do more than write web applications. It allows you to seamlessly use any Java class or library simply by dropping it into the classpath. This makes it easy to integrate Ringo into existing Java environments and reusing existing Java code works without lots of effort or porting issues.
Get the RingoJS 0.9 release here: ringojs.org/download
Get Started or the documentation page to learn more about Ringo.
Changelog for RingoJS 0.9
Release date: 2 January 2013
New features and major changes
- new ringo/worker module; a Worker API based on W3C Web Workers
- http://hns.github.com/2011/11/16/workers.html
- worker examples in /examples/ directory of ringo release
- new net module; provides support for networking using TCP and UDP sockets.
- shutdown hooks in
ringo/engine - new layout and design for JsDoc tool
ringo-doc - split ringo.jar into ringo-core.jar (java classes) and ringo-modules.jar (js modules)
- ringo/httpclient now based on java.net.URL (ringo/httpclient API unchanged but
Clientconstructor removed) - pluggable module loaders; more info: https://github.com/ringo/ringojs/commit/20eee6739da7c69bf93c19d544abc2896df6b7a5
- Java and JavaScript EventAdapters
Other changes and bugfixes
- system module is no longer preloaded
- remove obsolete and/or obscure global functions: doctest, loadClass, readFile, readUrl, runCommand, toint32, trycatch, enterAsyncTask, exitAsyncTask
setTimeout()/setInterval()are now global; ringo/scheduler removedSemaphoremoved into new moduleringo/concurrent- return absolute path in
module.resolve()if resource is a file ringo/promisecallbacks return a promises chain (as they're supposed to)- renamed
ringo/promiseexportsdefertoDeferredandpromisestoPromiseList ringo_configproperty renamed toappin JSGI requestfs.touch()now creates an empty file if no directory or file at the given path existsfs.listDirectoryTree(),fs.listTree(),fs.Path.listPaths()return sorted results- force String return values for
fs.owner()andfs.group() - avoid unwanted reconfiguration in
ringo/logger globalworks now with sealed globals- updated mustache.js to support dot notation
- ringo-admin could not remove downloaded files on Windows
- -m/--modules option accepts multiple paths seperated with path.seperator
Contributors
- Andreas Bolka
- Jim Cook
- Robert Gaggl
- Philipp Naderer
- Simon Oberhammer
- Tim Schaub
- Hannes Wallnöfer