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."
Some body misplaced a calendar?
Aprils Fools is in two months time.
Read more about the reasoning and decisionprocess here:
http://treitter.livejournal.com/14871.html
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).
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).
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...
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
Python has also made some good advances for those criteria, esp if you couple it with something like wxPython.
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
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.
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.
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.
Because then people would be bitching endlessly about The Whitespace Thing, whereas JS has the curly braces that God and Dennis Ritchie intended.
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.
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.
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.
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.
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.
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?"
Personally, I prefer Chun Li.
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 ?
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.
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
Don't worry: the rope is automatically freed when you are terminated.
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)