10

With the arrival of the new GNOME Developer Center I stumbled across JavaScript bindings for the gobject libraries. Now I would love to read a comment from an expert if he (or she) would recommend / consider using those for a desktop application. That involves consideration of aspects like

  • API simplicity and usability
  • developer documentation
  • stability
  • scalability
  • gjs or Seed?

At once: Are those APIs ready for usage or would it be better to wait a little until it is more established? Can you develop a whole application in JS or would you restrict usage to scripting purposes?

f4lco
  • 3,728
  • 5
  • 28
  • 53
  • 1
    I believe the majority of gnome-shell ui (the new window manager for gnome3) is written in javascript. Check out https://github.com/philn/gnome-shell-extensions for some examples. But from what I can see it's just a way of hooking functionality into the window manager, not a full app. – lucas1000001 Apr 11 '11 at 08:40
  • If your project is open source, I believe using JavaScript has one major advantage: more developer contribution. A project written in JS will have a much larger developer audience that is willing to contribute. Most in technology know JavaScript at some level. I personally haven't contributed much to open source desktop software even though I'd like to, mainly because I don't have much C/C++ or Python knowledge. Further, people who know C/C++ and are willing to contribute to OSS are mostly already involved in something; those assets are stretched thin. JS knowledge isn't. – Dan Apr 13 '11 at 16:19

1 Answers1

9

Through GObject Instrospection you have access to the same API provided by the libraries written in C (with the lingo for JavaScript).

The documentation needs to be improved. However, you can always use C documentation as fallback. Nevertheless, you can help with the documentation for JavaScript as you learn ;-)

gnome-shell is written in JavaScript and C, therefore JavaScript is a first class citizen in GNOME 3. It should not have performance penalties (if so, it should be improved).

There is a discussion about the future of JavaScript in GNOME (whether to use gjs or seed), you can read the thread here: https://mail.gnome.org/archives/desktop-devel-list/2011-April/msg00147.html

As I said previously, with GObject instrospection you can write a whole application in JavaScript. For instance, you can take a look to "The Board", a new application written in JavaScript https://live.gnome.org/TheBoardProject

gpoo
  • 8,408
  • 3
  • 38
  • 53
  • Actually gnome-shell is not written just in javascript, it is written in C, as well as javascript. I do agree you can write a application solely in javascript, or more accurately gjs or seed, making full use of introspection to access things like Gtk, Clutter, Rest, etc. I also agree about the documentation – James Hurford Aug 10 '11 at 04:44
  • 1
    @JamesHurford Indeed, gnome-shell is written in both, C and Javascript. I fixed it. Thanks! – gpoo Oct 16 '11 at 01:55