Re: mutter tiling



On Thu, Mar 17, 2011 at 8:58 AM, Oliver Mangold <o mangold googlemail com> wrote:
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?


I've been wondering about the possibility of the leveraging the GWT compiler to write gnome-shell extensions (any js code, really) in Java. I haven't really looked into it yet (and I don't know much about gnome-shell's APIs), but I think it would be a great way to write code for the desktop. The Java interfaces to mutter could be generated automatically, giving you type safety against the mutter API, and you'd have a nice, strongly typed development language for extensions :).

I'm sure it would take quite a bit of work, so it's not really a solution for the tiling question. But, just a thought...

Jesse


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