Helma / RingoJS – Vienna.js Minitalk
Upcoming SlideShare
Loading in...5
×
 

Helma / RingoJS – Vienna.js Minitalk

on

  • 796 views

 

Statistics

Views

Total Views
796
Views on SlideShare
796
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Helma / RingoJS – Vienna.js Minitalk Helma / RingoJS – Vienna.js Minitalk Presentation Transcript

    • Helma / RingoJS Philipp Naderer / @botic
    • Helma / RingoJS• JavaScript on the JVM• Both based on Mozilla Rhino• Helma is EOF, 1998 – 2008• RingoJS is the successor of Helma
    • Features• CommonJS modules & packages• Full access to Java libraries• ECMAScript 5 and JS 1.8 support• Lots of „ringo/“ modules • dates, http, concurrency, logging, subprocesses, jsgi, command line, ...
    • Debugger
    • Multithreaded JS?• Ringo‘s concept: Workers• You can still use an EventLoop• No shared global object*• Singletons instead of shared data
    • Ringo Workers• Look like Web Workers in Browsers• No JSON serialization needed = faster!• Send a message with postMessage(e)• React on message with onMessage(e)• Return the result to the caller with postMessage(e)
    • fibobuster.js1. var {Worker} = require("ringo/worker");2.3. // Create 50 Workers = 50 Threads4. for (var i = 50; i < 100; i++) {5. var w = new Worker(module.resolve("./fibonacci"));6.7. // Callback for the output8. w.onmessage = function(returnObj) {9. console.log("Result: " + returnObj.data.result);10. }11.12. // Start with the calculation13. w.postMessage(i);14. }
    • fibonacci.jsfunction onmessage(message) { var limit = message.data; console.log("Fibonacci #" + limit); /* Calculate the fibonacci number */ var a = ..., b = ..., c = ...; for (...) { ... } message.source.postMessage({ result: c });}
    • webserver.jsvar response = require("ringo/jsgi/response");var {Application} = require("stick");var app = exports.app = new Application();// Configure stick middlewaresapp.configure("notfound", "route");app.get("/", function(request) { return response.html("<h1>I‘m a todo app!</h1>");});if (require.main == module) { require("ringo/httpserver").main(module.id);}
    • webserver.js serving 10.000 HTTP requests
    • More infos• ringojs.org – basic information• github.com/ringojs – source + examples• @ringojs – official account• IRC: irc.freenode.net #ringojs