Re: mutter tiling



On 17.03.2011 13:31, Jasper St. Pierre wrote:

  Me personally, I'm not in favor of writing writing it
in Javascript because of the dynamic typing (will be painfull to find
problems caused by changed Mutter bindings).
Why do you think that?

Standard problem of dynamically typed languages. Checking if variables have the right type is delayed until runtime. Example (pseudocode):

windows = global.get_windows()
mutter_window = windows[0]
meta_window = mutter_window.get_meta_window()
meta_window.move(100,100,200,200)

This code assumes that the object global has a method
    MutterWindow[] get_windows()
that the class MutterWindow has a method
    MetaWindow* get_meta_window()
and that the class MetaWindow has a method
    void move(int x,int y,int w,int h)

If you change then to a new version of gnome-shell or mutter where anything from this interface is changed, in javascript you get an runtime error only when a statement using it is actually executed. This means for every update of the framework, to be reasonably sure that your plugin still works you have to test it completely (with 100% code coverage). This is big fun, as we are talking about GUI stuff here, so you can't even run it automatically.

In Vala you get a compiler error as soon as you try to compile your plugin. Which do you think is better? :)

There's no support for running various C code from an extension right
now, either compiled through Vala or not.

Too bad. Another statically typed language maybe?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]