9. July, 2007
9. July, 2007
in by Michael Neumann

So I finished work on RubyJS for now. It's mostly complete. Further changes are done on demand. Today I prototyped a first GWT port and thought about API issues. I'm not yet sure whether I want to port it. I'm more into taking a good idea as a basis and then do the stuff myself.

For example what in GWT is:

Button b = new Button("Hello", new ClickListener() {
  public void onClick(Widget sender) {
    Window.alert("...");
  }
});

becomes in RubyJS:

b = Button.new("Hello")
b.on_click do
  Window.alert("...")
end

Or:

b = Button.new("Hello").on_click do
  Window.alert("...")
end

I think there is much room for improvements.

The Javascript code for the core library is currently at ~9 KB. Compare this with the Prototype library which is at ~70 KB. And those 9 KB are without (space) optimizations turned on. So there is still much room left.