Slashdot Mirror


Gnome Goes JavaScript

mikejuk writes "Much to most programmers' shock and dismay Gnome has made JavaScript its main language for apps. It will still support other languages and it still supports C for libraries, but for apps it is JavaScript that rules. JavaScript seems to be a good choice for Gnome 3, as the shell UI is written in the language. It is also consistent with the use of JavaScript in WinRT, Chrome Apps, and FirefoxOS apps, and generally the rise of web apps. As you might expect, the initial reactions are of horror at the idea that JavaScript has been selected rather than the favorite language of the commenter. There is a great deal of ignorance about (and prejudice against) JavaScript, which is often regarded as an incomplete toy language rather than the elegant and sparse language that it actually is."

27 of 387 comments (clear)

  1. Aprils Fools? by Anonymous Coward · · Score: 5, Funny

    Some body misplaced a calendar?
    Aprils Fools is in two months time.

  2. Read more facts here by Anonymous Coward · · Score: 5, Informative

    Read more about the reasoning and decisionprocess here:

    http://treitter.livejournal.com/14871.html

    1. Re:Read more facts here by MrEricSir · · Score: 5, Informative

      What the summary seems to be leaving out is this: Javascript will be the language they suggest n00bs who want to learn Gnome programming start with.

      That's really the only change being made here. They're not re-writing apps in Javascript, they're not removing existing language support. This is purely an advisory statement for first-time Gnome programmers.

      --
      There's no -1 for "I don't get it."
    2. Re:Read more facts here by Anonymous Coward · · Score: 5, Funny

      Its clear that x86 asm is the predfered language for noobs to write proper Gnome Apps.

    3. Re:Read more facts here by Ceriel+Nosforit · · Score: 4, Funny

      Why is this funny? Assembler was the first programming language I really understood because it's so simple to see what's going on in it. What I struggled with was object orientation because I thought objects were redundant with classes. It seemed philosophical compared to how concrete a stack and an arithmetic unit is. I knew what the circuits of the latter looked like and even knew about electrons and holes.

      Unless you've been living under a rock the past decade you know the Internet runs on Javascript because it is non-blocking. I don't expect most of the Slashdot crowd to know what that means anymore, nor why halting is a problem. I'll appeal to authority instead and tell you that it is what Google uses and Google cares about the responsiveness of the UI. Slashdot's favorite mobile phone, the N9, uses QML and Javascript for the UI and wow have you been happy with it until now!

      People complain about how it's easy it is to screw things up in Javascript. It's pretty easy to write a recursive loop in C and mess up the exit too. Javascript has frameworks, and if you use the Chrome Inspector you can actually see the variables update at a high FPS and then drop to a crawl when the tab loses focus. You don't need to compile anything. With just CSS and jQuery you can start doing useful things in your daily environment.

      IMO an example of a truly monstrous language is Java. It just seems idiotic that that by writing the same thing in three slightly different ways you'll somehow come up with more robust code. It's like a language that was never meant for humans to write, but for some reason we were supposed to read it. Yet it's ECMAscript that's considered harmful??

      --
      All rites reversed 2010
  3. Re:Enough rope by SQLGuru · · Score: 5, Insightful

    TypeScript (http://www.typescriptlang.org/) adds some rigor on top of JavaScript that helps keep you from shooting your foot as often. It "compiles" down to JavaScript, so it shouldn't limit what you can do, but it makes it feel a little more like a real language.

    But I'm fine with JavaScript. I think that it's a decent first language since the bare minimum tools you need are on all of the devices you can buy today (you just need a text editor and a browser to get started).

  4. Re:Enough rope by Austerity+Empowers · · Score: 5, Interesting

    You could argue C gives you all the rope you need as well.

    I keep asking myself "what language should I learn that's accepted everywhere, doesn't have to be compiled for a particular processor, and has a truly cross platform UI". Javascript is it, with C coming in a heavily qualified second, Java most 3rd except for that fruit company (and I know Java, but hate it passionately).

  5. There shall be only one? by mike.mondy · · Score: 5, Informative

    From the TFA and the blog linked from the TFA:

    During the GNOME Developer Experience Hackfest this week, one of the major goals we identified was the need to pick a *single* language to give a simple answer to "how do I write a GNOME app?". [emphasis added]

    Why only one?

    * It allows us to focus when we write developer documentation, fixing bugs in the development environment and the development of tools. This reduces our maintanence costs and enables us to be vastly more efficient.
    * It enables code and knowledge sharing to occur, so that people can easily copy and paste code from existing applications, or find information about common problems and challenges.
    * It provide a coherent and easy-to-follow path for new developers.
    * It allows us to include the full GNOME framework within the language itself.

    But also:

    We will continue to write documentation for other languages, but we will also prioritize JavaScript when deciding what to work on.

    I wonder how much harder it would be to support LUA, python, tcl, and some of the other common languages. Or whatever comes next...

  6. Javascript == annoying by sanosuke001 · · Score: 5, Interesting

    loosely typed language without declaration requirements for methods/variables makes it such a huge pain in the ass to debug/understand/update source that I want to have nothing to do with it.

    --
    -SaNo
  7. Re:Enough rope by jythie · · Score: 4, Informative

    Python has also made some good advances for those criteria, esp if you couple it with something like wxPython.

  8. Elegant? by Tridus · · Score: 4, Insightful

    Javascript is about as elegant as an oil tanker. Considerable effort has gone into tools and libraries to make working in it suck less, but it's hard to wipe away the problems inherent in the design.

    --
    -- "So they told me that using the download page to download something was not something they anticipated." - Bill Gates
  9. Re:Enough rope by serviscope_minor · · Score: 5, Funny

    You could argue C gives you all the rope you need as well.

    C gives you all the rope you could ever want, wraps it wround your neck and encourages you to run very fast across a long, wobbly plank.

    Oh, and don't forget to free() the rope when you're done with it.

    --
    SJW n. One who posts facts.
  10. Use the Farce, Gnome... by Remus+Shepherd · · Score: 4, Funny

    JavaScript is the programming language of a Gnome programmer; an elegant language for a more civilized age.

    But hokey nonstandard libraries and ancient browser syntaxes are no match for a good object class at your side, kid.

    --
    Genocide Man -- Life is funny. Death is funnier. Mass murder can be hilarious.
  11. Re:Enough rope by gstoddart · · Score: 5, Insightful

    C gives you all the rope you could ever want, wraps it wround your neck and encourages you to run very fast across a long, wobbly plank.

    I always like to think of it as being more that C leaves ropes, cliffs, pointy objects, and a few angry bears wandering around -- and it's up to the user to to look out for themselves.

    If you know how to navigate it, and keep your wits about you, you'll mostly be fine. But if you're running around with your eyes closed or don't have adult supervision, you could really get hurt.

    It doesn't actively come after you, but there's no safety nets either.

    --
    Lost at C:>. Found at C.
  12. Re:Enough rope by Anonymous Coward · · Score: 5, Funny

    Because then people would be bitching endlessly about The Whitespace Thing, whereas JS has the curly braces that God and Dennis Ritchie intended.

  13. Re:Enough rope by Anonymous Coward · · Score: 4, Insightful

    C gives you all the rope you could ever want, wraps it wround your neck and encourages you to run very fast across a long, wobbly plank.

    I'd rather take the OP's version.

    You could argue C gives you all the rope you need as well.

    with the qualifier that far too many people do not know how to handle that much rope, so in the process they get it knotted and accidentally wrapped around various things, neck included. But otherwise C does not actively wrap rope around necks, it just doesn't have anti-neck-wrapping safeties for ropes.

  14. Re:They should have gone with Python by squiggleslash · · Score: 4, Insightful

    If only they'd picked ${my favorite language} instead of ${language I don't like} - all of Slashdot.

    --
    You are not alone. This is not normal. None of this is normal.
  15. Re:Enough rope by Dcnjoe60 · · Score: 4, Informative

    Python has also made some good advances for those criteria, esp if you couple it with something like wxPython.

    The developers talked about python quite a bit, but what caused them to go javascript as the recommendation for n00b gnome developers is that is (javascript) is so pervasive in other systems that it is likely they will already be exposed to it and can build upon that. If you are doing web, iOS or Android programming, chances are you are or have used javascript. That plus all of the gnome-shell stuff being done in it makes it kind of a no-brainer as that is what a lot of new developers are interested in extending.

    The gnome developers went out of their way to explain that python, c and are all still fully supported and that javascript is just what they are steering new developers to when asked the question about what language.

  16. Re:They should have gone with Python by Dcnjoe60 · · Score: 5, Informative

    Python is a language which makes app writing very easy. It's very easy to write, read, debug. It's also very fast when used right or modified.

    This decision in my opinion is one of the boneheaded decisions which will be Gnomes final nail on the coffin. They had a chance to rule the Linux desktop with Ubuntu and since Gnome 3.0 have threw it all away. Everything that made Gnome great with the 2x series seems to have been lost at 3x and their release schedule is so slow that we are probably going to be stuck on 3x for 10 years. Goodbye Gnome and welcome back KDE.

    You are welcome to your opinion, but since gnome-shell is written in JS and most new developers want to work on things that tie into gnome-shell, it seems to make a lot of sense to steer them to JS. If you took the time to actually read what the gnome developers are putting forward, you would find that they are officially recommending JS for new developers who are looking how to quickly become productive in developing for gnome. They are still fully supporting c (libraries still are in c) python, vala and any other language that has bindings to the gnome libraries.

    Obviously, if you are a C programmer, you will probably continue to program in C, even in gnome. That is, unless you want to write extensions for gnome-shell, in which case, you will program in JS as that is the language gnome-shell is written in. The same is true for C++, python or any other language.

    Once people get past the knee-jerk reaction to the work "javascript" and look at what gnome developers are proposing, it makes a lot of sense. Basically, they realize the entry bar to developing in gnome is quite high, so since so much of gnome already uses JS they are going to make tutorials for beginning developers on how to use JS to develop for gnome and recommend new developers use JS to develop for gnome. Experienced developers, or any developer for that matter, are still free to use any language they want.

  17. Do not forget about XFCE by houghi · · Score: 4, Interesting

    XFCE is the new Gnome. I hate both KDE and GNOME. Luckily there is XFCE (and LXDE).

    --
    Don't fight for your country, if your country does not fight for you.
  18. Jeez, Louise... by Chris+Mattern · · Score: 5, Funny

    At this point, I can only envision somebody at the head of Gnome saying, "Dammit, people are still using Gnome! Well, what else can we do to kill this thing?"

  19. Re:why not guile? by Chris+Mattern · · Score: 4, Funny

    So why not Guile?

    Personally, I prefer Chun Li.

  20. Re:Enough rope by rs79 · · Score: 4, Informative

    If you're unclear why, watch the 8 hours of doug crockford's videos about and and you'll get it. there's a lot more academic rigor in js than most people have any idea about. it's good stuff.

    --
    Need Mercedes parts ?
  21. Re:Enough rope by jythie · · Score: 4, Informative

    Yeah, that produces a bit of a barrier. Once one has a good feel for what works everywhere and what does not it can make a good tool (I develop wxPython apps for Linux/Windows/OSX) but the 'oh wait, that doesn't work here' traps can be discouraging. Their documentation has improved significantly in that regard though.

  22. Re:Gnome is officially dead. KDE has won. by oGMo · · Score: 5, Interesting

    Gnome has always been on the wrong track from day 1. It was a political response to KDE's use of Qt (which was QPL back then) and always a mishmash of libraries and utility applications rather than a fundamentally solid desktop environment. That it might have been usable at some point is more luck than anything.

    I don't use KDE (or GNOME, I prefer RiscOS On X because it's insanely fast and powerful), but at least KDE has had a solid vision from the get-go, if sometimes flawed.

    --

    Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

  23. Re:Enough rope by Chemisor · · Score: 4, Funny

    Don't worry: the rope is automatically freed when you are terminated.

  24. Re:Untyped Languages Are Ill-Suited for This by lattyware · · Score: 4, Informative

    It's mainly a product of the weak typing - doing [] + {} gives you an object, while {} + [] gives you 0. That's not useful when you have a problem you are trying to debug. Python follows the idea that things should fail loudly so that bugs are made clear. The indentation thing is overstated - text editors are not that terrible, and if they are, use a different one. It makes the code far nicer to work with and read.

    Firstly, don't blame the language for the programmer - anyone can be a rubbish programmer in any language. As to your examples, I find it funny you manage to pick an incredibly hard thing to do in Python - if you open a file and iterate over it, the default method (without any special work from the programmer) is to do so lazily, so there is not a massive file read into memory. The whole Python core library is built around the iterator interface, which means most data is processed lazily without having to even think about it.

    As to your last comment, Really? PHP has a host of problems - mainly due to the way they update the language without removing old stuff, and add features haphazardly. This leaves you with twenty different ways to access a database, etc..., etc... Python, on the other hand, has specifically avoided this. 3.x has gone back and fixed core language problems where they existed, and made the experience much more consistent. This is a sign the language is being curated and nurtured, not hacked on like JavaScript or PHP.

    --
    -- Lattyware (www.lattyware.co.uk)