Archived

This forum has been archived. Please start a new discussion on GitHub.

Javascript support - ICE ideal platform / node.js

Dear ZeroC team,

I was wondering what your opinion is on Javascript support in ZeroC. With the increasing adoption rate of Javascript on the server, I see JS as the ideal language to make ICE a true internet communication platform.

With the new HTML5 websocket feature becoming widely available in IE, Chrome and Firefox, ICE could play a critical role in creating and powering next generation internet applications:

By supporting JS on top of websocket, ZeroC could support the following architectures:

- HTML5 client (JS and websocket) talking to any ICE server. JS code would be generated based on Slice definition.

- ICE server implemented in JS on top of node.js. By supporting JS on the server, ICE servers could easily and quickly be written in JS. The ubiquitousness of JS would help the market penetration of ZeroC.

Any feedback would be appreciated
Best
Frank

Comments

  • God I would love this. As it sits now, I'll probably have to write a simple web service in Ruby or Python, but if we could get ZeroC Ice working in Node.js, it would save me so much time. Keep up the good work, guys.
  • kwaclaw
    kwaclaw Oshawa, Canada
    Seconded
    flangel wrote: »
    Dear ZeroC team,

    I was wondering what your opinion is on Javascript support in ZeroC. With the increasing adoption rate of Javascript on the server, I see JS as the ideal language to make ICE a true internet communication platform.

    With the new HTML5 websocket feature becoming widely available in IE, Chrome and Firefox, ICE could play a critical role in creating and powering next generation internet applications:

    By supporting JS on top of websocket, ZeroC could support the following architectures:

    - HTML5 client (JS and websocket) talking to any ICE server. JS code would be generated based on Slice definition.

    - ICE server implemented in JS on top of node.js. By supporting JS on the server, ICE servers could easily and quickly be written in JS. The ubiquitousness of JS would help the market penetration of ZeroC.

    Any feedback would be appreciated
    Best
    Frank

    Although I am not a JavaScript fan (especially not on the server), I agree that ICE for client side JS could be a rather significant market for ZeroC, especially since Microsoft now also puts some emphasis on HTML5/JS clients. This would make more sense than supporting ActionScript.

    Karl
  • Work in Progress – Hail

    Along these lines, I've started hail, a transport layer implementing the Ice protocol for Node.js applications. It's not npm'd yet, and it's not complete, but as of today (12th June 2012) it parses simple Slice files, dispatches interface methods taking simple types as arguments (including built-in types and sequences of built-in types), and returns void or integers. The Printer example in the ice documentation works with a ZeroC-implemented client.
    var ice = require('hail');
    
    // Adapters do not need names in Hail.
    var adapter = new ice.adapter(4001, 'localhost');
    
    // Create a servant, and publish it via the adapter
    ice.create_object_factory('printer.ice', function(error, defs) {
        var printer_x = defs.Demo.Printer();
        adapter.publish_object('SimplePrinter', printer_x);
    
        // Implement the printString() method. All invocations are asynchronous.
        printer_x.on('printString', function(response, s) {
            console.log(s);
            response.send();
        })
    });
    
    adapter.activate(function() {
        console.log('Started listening!');
    });
    

    Hail is a from-the-ground-up implementation of the Ice protocol using Node.js primitives, thus preserving the event-loop properties you would expect from a Node.js library.

    I will probably continue developing this to parse structures and throw runtime exceptions as appropriate. Contributions are welcome, as are task lists; I'm willing to continue this library for you, other Ice users, if you tell me what you need. :)
  • kwaclaw
    kwaclaw Oshawa, Canada
    Tack wrote: »
    Along these lines, I've started hail, a transport layer implementing the Ice protocol for Node.js applications.

    What about Javascript clients?
  • kwaclaw wrote: »
    What about Javascript clients?

    Definitely possible, and definitely valuable, but I haven't done any deep thinking on this. Actually, for my original goal (easier load tests), this is very useful.

    Congratulations, we have hail github issue #1. :) Pull requests or suggestions on a good idiomatic Node interface would be very welcome. I may give it a shot after my vacation just now.