Toulouse.js

Toulouse.js

Yesterday, I was to a javascript developers conference in Toulouse and I saw a presentation of Ember.js and Backbone.js. Two frameworks I don't know a lot about, and I can compare with Yoshioka. And all that I listened reinforced the fact that the choices I made for the architecture of my framework were not so stupid.

Toulouse.js

Ember.js

Ember.js is the new name of Sproutcore 2.0. I didn't know and it is very interesting because Sproutcore was the seed in my mind that helped me build Yoshioka. Here's the story.

In 2010, a new real MVC framework is announced, from Apple! Sproutcore. I jumped on it to discover the Grail I was waiting for. Sproutcore was made with a ruby server which live build project files to javascripts loaded on your browser. It provides a MVC pattern and a sort of ORM to communicate with the server. But the bad side was it was very very inspired from Objective-C Cocoa framework from Apple which is very difficult to comprehend. So I gave up quickly, but keeping in mind to retry it quickly.

Then, some months later, YUI3 published some MVC modules in experimental state. This modules was very easiest to use when you have habbit to work with YUI, so I started to work with it immediately. And then, I decided to apply all the great ideas I learn from Sproutcore into YUI3 MVC : live compilation, separation of template files, localizations, fixtures, etc.

Bad sides

The bad sides of this framework is the Cocoa approach and the very closed framework. It is very difficult not to walk into the path. That was the feeling I had 3 years ago and it was the same thing that told Raphaël Rougeron who was talking about Ember.js. With Yoshioka and YUI, you are free and invited to rewrite the wheel every time you need it. I love rewriting the wheel because the wheels never fit perfectly for what I want.

Another bad point is a memory leak. I used to have similar issues on Yoshioka with dynamical locales. Ember comes with a cool feature wich is able to update a variable into a template without full re-render it. It's the same behavior I chose for locales : an element (a span for Yoshioka) with an ID, and an observer which update the value of the node when the attribute of the model change. The problem is this node and observers are very difficult to clean and they are never free to be removed by garbage collector. With a workaround in the way Yoshioka locales are updated, I gain some hundred MBits of RAM. Overblog was able to occupy 600MB of RAM with a eavy use of the app. Now, it rarely jumps over 150MB. Raphaël talked about 2Go of memory on their apps.

Toulouse.js

Backbone.js

Then, Jean-Christophe Queval talk about Backbone.js. I have not a lot to say about it because Barebones is the inspiration of YUI3 MVC modules. So it must be cool :)

But as he said, Backbone is more a toolbox than a framework. YUI3 will give the same design pattern with all the foundations of their framework and all the free available modules. It would be very easier to quickly create a web app compatible with suckin'browsers.

Socket.io

Finally, Cyrille Bogaert showed us a demo of a web video game using web socket to make multi players sync their positions in a game. This demo gave me an idea for trying improving performances on Overblog. I hope I will have some time to experiment the replacement of Ajax JSON-RPC by a theorically very quicker web socket between client and server wich will directly communicate with internal API by using Thrift.