Slashdot videos: Now with more Slashdot!

View

Discuss

Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).

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."

Uhh, what? You're not making any sense. It's debatable whether Javascript is an ideal language for this kind of usage (personally, I'm quite liking Qt Quick/QML), but if your browser has a hole that allows an attacker to run arbitrary commands on your desktop you're screwed, no matter what language your desktop is written with.

JavaScript, as TFS said, has some nice features. It's a pure object-oriented language with first-class closures, prototype-based inheritance and introspection. It's very flexible and really great for rapid prototyping and scripting. The problem is not that JavaScript sucks, it's that JavaScript sucks as an application development language. It has no concept of modularity: everything lives in the global namespace and must be parsed and executed as a linear sequence (modulo web workers). It has no declarative structure: your program imperatively builds the run-time structures. It has weak support for arithmetic: double-precision floating point values are the only numeric type.

Writing complex applications in JavaScript is possible, but so is writing complex applications in assembly. That doesn't make it a good idea.

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.

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??

This kind of false reporting seems to be occurring more frequently around here. Either the editors really are as incompetent as their grammar typically suggests, or they are deliberately misleading us in order to generate traffic.

Hmmm... javascript is pretty much the exact opposite of lock in. It is the closest a language has really come to being "write once run anywhere". Even most node.js stuff runs in the browser and vis versa with ease.

Javascript is fine, it just give you enough rope to hang yourself. (and a little extra, as it turns out)
The language itself has some patterns that allow for terrible patterns, and ambiguity, but all in all, I don't think it's bad.
Waiting for someone to disagree...

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).

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).

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.

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.

I am not sure I completely agree at this point. The cases where you get significantly better performance out of other languages are very task specific. Sometimes thing like manual control over memory allocation can make a huge difference, but most of the time it comes out pretty even.. and no language really escapes big O, which when your sets get large enough, the differences between languages can quickly become trivial.

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.

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).

Python is a better language than Javascript. Why did they choose Javascript over Python?

I learned C when it was two years old and have touched the mimeograph Bell Labs C manual with dmr's penciled in notes (yes, I'm bragging). I did computer languages at Waterloo and have written a few at least one of which is still in use today. So I make a point of trying all these new languages that come out and I've tried them all from Snobol to Erlang. They're all fucking retarded.

JavaScript rawks. Utterly. Among my friends I've noticed they've all quietly moved to js and node.js independently, as I have.

The Gnome folks don't have a deaf ear, it seems, since they proactively acknowledge JS isn't a lot of developers' cup of tea... And the anti-JS vitriol is something that doesn't make sense to me, but whatever (note: I don't use it in app work, but that's only because I found another language I know).

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.

It's very popular on the mobile side, and it's a tribute to Javascript's power, ease of use, and flexibility that people use it despite usually being required to use it in a sandbox where all user interaction has to be written in HTML and accessed via the DOM, two of the most ugly technologies ever designed.

Python... heh. COBOL meets perl, they have a baby, BOOM, Python. Awesome. You were joking right? Isn't the selling point of Python that it has so many libraries and so much stuff in them you don't eve

It's popular on the mobile side because it's cross-platform. That's it. JavaScript isn't easy to use, it's a mess of a language that has been hacked into something vaguely usable because it's the only option there.

And yeah, who wants to actually write relevant code? Let's spend all our time re-implementing the wheel, because that's effective. Python has excellent design behind it, and it's perfect for this kind of thing. Small to medium sized applications that need to be made fast, while remaining maintaina

Saying JS is an awesome language isn't a good enough reason to switch. Next year are they going to switch to Python coz like thats awesome too? Or Dart?

They didn't say JS is an awesome language, exactly. They said a lot of new developers coming to gnome already know JS. In addition gnome-shell and a number of components are written in JS. Therefore it makes sense to write some tutorials and recommend to new developers to build on what they already know from their work with other operating systems, which is -- JS.

They are not telling existing developers to change to JS. They are not telling new developers not to develop in something else. They are only sayi

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...

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

You mean for documentation purposes? Since most, if not all of those are already supported for development?

Anyway, I'm just glad they're no longer pushing Mono/C#! Gnome has enough overhead by itself without adding in a huge, mandatory VM; especially one with the sort of dubious connections that Mono has. (Not that Java's VM has much better connections these days.) I guess they really have finally broken with Miguel.

You know, Javascript is an excellent language, both for its power and its familiarity, but I have to say part of me wishes, after reading this thread and seeing how "not picking Python" has really riled up half of Slashdot, they'd picked PHP instead, just to really piss everyone off.

I went from using KDE exclusively to using Gnome exclusively back to using KDE exclusively.

The latest Gnome 3x sucks and is worse than the 2x series. The KDE 4x series is far superior to the flawed 3x series. KDE is on the right track with 5x while Gnome continues to stay on the wrong track doing things it's userbase isn't wanting it to do, taking features away which users love, "improving" the interface by making it harder to use or reducing flexibility.

Whoever is designing the Gnome interface sucks and this decision to choose Javascript over a language like Python, Ruby, or C#? Wtf are they thinking?

Unfortunately, as much as it sucks... there will remain a healthy supply of GNOME-based distributions, for whatever reason. And as long as people continue to put out shitty GNOME distributions, they will inevitably have users and GNOME will continue to have an audience. The environment is still garbage even now, yet there continue to be GNOME-based distributions released.

Gnome has always been on the wrong track from day 1. It was a political response [linuxtoday.com] to KDE's use of Qt (which was QPL [wikipedia.org] 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 [sourceforge.net] because it's insanely fast and powerful), but at least KDE has had a solid vision from the get-go, if sometimes flawed.

There are plenty of 4th generation languages that are highly capable of the job, and do so in an elegant, and more importantly maintainable way. JavaScript is a monkey's language born from the intentions of enabling lay-users. A noble goal but detrimental to professional development work.

You can write desktop and mobile in plenty of languages already, yet most people still uses whathever is native for the platform. Be it ObjC for iOS, Java for Android, or C/C++ for desktop.
The reason? Maybe JS is easier to write for unexperimenced developers (do you really want that anyway? are they that desperate for more developers?), but truth is, when you have a layer of abstraction there is always some functionality missing and the only way to access it is via bindings to native anyway. When you writ

I know choosing a language is usually subjective, but most Linux fanboys like Python (or even Ruby or PHP). Why not these? IMO, these are better languages and more suited for Apps and scripting. JavaScript's either original intention or main intention from history has been for client-side Web Browser scripting. Most tutorials, questions, and hacks will be for the Web Browser when searching for JavaScript in a search engine. I really don't get why people are pushing JS. Spend a day each coding in Ruby,

From the article: "Gnome, the graphical desktop environment for Linux, may not be as influential as it once was."Add to it, "use of JavaScript in WinRT, Chrome Apps, and FirefoxOS apps" and you probably get a lot of the reason for the decision.

Pity they didn't use the Hackfest to design something innovative to energize their base and make working with Gnome cutting edge. Instead it appears that they settling into comfortable middle age.

I can see there reasoning for selecting javascript. But I would never call JS elegant. It lacks so many basic language constructs, that you everyone has to be intimately familiar with a mess of boiler plate code to make it object oriented or make your code easily reusable.

It's somewhat like programming in ASM because that's what every processor requires, even though it is tedious and redundant.

Similarly, with the pervasiveness of javascript, we will probably so TypeScript or something similar become the d

Javascript is fine, once you divorce it from all of the browser peculiarities, but it's an untyped language and untyped languages suck for refactoring. They should never be used for complex apps requiring maintainability. And yes, that goes for python too.

Yeah, I know they said "apps," but even most apps quickly grow beyond the comfort zone of a script.

Comparing Python to Javascript and saying they are both the same is just wrong - for one, Python is strongly typed, but dynamic, not weakly typed like JavaScript.

While I agree static typing makes maintaining complex applications easier, Python does a lot to reduce the issue. The language and culture are built around code being readable and maintainable, it's strongly typed, it follows the idea that nothing should ever fail silently, which greatly reduces the chance of issues cropping up. This makes Python completely usable for a wide range of applications. Yes, in some cases, a statically typed language will be easier to manage, but that's not the case in 'anything beyond the comfort zone of a script'.

JavaScript, on the other hand, is full of awkward stuff that makes it hard to program in. Things fail and return random values, stuff like that. Add to that a poor syntax for readability and JavaScript is pretty hard to maintain.

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.

Even if there are some gnome specific JS bindings, your basic code logic and flow should be easily portable to other new platforms all supporting JS as well. There are a ton of applications out there now, and while JS may have been supported before; this announcement will hopefully get some existing developers for other platforms to port their JS apps to gnome. Also anxious to see how jQuery will tie itself into this.

Because nobody has ever used it, and hardly anyone has ever heard of it.

Javascript is the most ubiquitous scripting language on the planet. There are implementations for virtually every platform. It's fast, modern, and it uses curly braces. And virtually anyone who's ever done any programming outside of Excel macrowriting has encountered it. It's the number one language used for cross platform mobile apps. It's a first class language for Windows 8 deve

I can't say I like Javascript as a language but at least its ubquitous and more modern, lightweight and flexible than some other candidates. It's also far better than something heavy like Java or god forbid Mono which bring a lot of baggage in terms of runtime size and potential lawsuits.

I think that more organizations switching to JavaScript is reflective of what the internet is and the market space that organizations have to live and compete within. While JS isn't a great language, robust, elegant, or [insert your adjective here], what it is is accessible. Anyone can start programming in JS today, with no special tools and little to no knowledge. It means that anyone can participate in the conversation (which is both good and bad). It's like Democracy, everyone can have their say whether or not their opinion is informed or not. Similarly, people who might not have a ton of programming experience or might not know the "right" language can and will be able to take their ideas to market more readily than before. Even if their idea doesn't succeed, it may end up spurring more seasoned programmers to do something similar or improving the idea or even helping newcomers build up their products and abilities. I think this is much more important than the theoretical purity of a language or the right or wrong way to program something. It's about conversations and it's about bringing people into the fold versus excluding them. It's about equality versus the typical snobbishness that can occur as the "elite" developers look down their nose at you because of the choice of languages versus the value of the idea you are attempting to promote.

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

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.

Well, the first metric I saw when when a web server written in node was faster than Apache.

I know there's a lot of variables there, but still, when an interpreted language beats C for something like this, that's impressive.

TO be sure, you can do the kind of I/O js does in C, but it's a real pain and usually platform dependant in some way, even the difference between linux and bsd can start the ifdefs popping up, but js brings asynchronous I/O to the 10 GOTO 10 crowd. That, and the fact the js x86 emulator not only works but runs linux under which you can edit, compile a real program no slower than unix used to be on an 11/45 and you're doing this in a browser tab.

That's the metric I use for me to consider it fast. Obviously this is a contentious and complex topic, but as a rough approximation, I think it's fast.

Or at least it CAN be. The loops FB makes it jump through are insane and they manage to kill any js interpreter they throw at it and even the mighty V8 is now starting to strain so something will have to change there. But if they knew what they were doing it'd be as slick as it was performance wise 3 years ago, this isn't the fault of js, just bad (or no) performance profiling and tuning in Palo Alto.

So, while this may not mean any code you write will be fast, if you're used to real-time programming you'll love the language and the stuff you can do now with css3/html5 (gradients, css-masks) may not have the underpinnings of the next Pixar like NeXt did, there's still enough there to, say, keep the molbio crowd happy for the next decade with very fast real time renderings of molecules they can play with to cite one example.

I agree the success of is tied to the web, but so what, that's like saying the success of C was only because of Unix.

I'm one of the first C programmers and I've switched to js and node.js. it's better and faster than C.

Then you're doing it wrong. And if you had half as much experience as you claim to have in this and your other post, you would understand that.

Just because you've written some C, doesn't mean you know what you're doing. I've worked with plenty of 'programmers' who have been 'doing it all their life' or better yet, 'longer than you've been alive' (refering to me) and those statements universally come from people who suck and are too stupid to realize it.

You go on to further my point about you not really knowing what you're talking about when in other posts you talk about the x86 emulator written JavaScript as if thats supposed to be something to show how awesome it is. When you make that awesome emulator there out run my copy of QEMU without kmod, then perhaps I'll give you a listen, but you've got to be absolutely retarded to actually think JavaScript as a language has a technical reason for it to be faster than compiled C in reality, you being unable to write quality C withstanding.

Yes, decent Javascript can out run really really shitty C, but only if you stack the deck so that C doesn't have a chance first. Just because you've seen a porn, doesn't mean you know how to be a parent.

Really? JavaScript has too many fatal flaws, as much as libraries try to hide them, even with something like CoffeeScript patching the holes, it's still missing a ton of stuff that makes Python so powerful and effective.

Like languages (pick one) with strong typing so you know at compile time of trivial bugs that you'll never discover with JavaScript until you have exercised every path of execution that can reach your function.

JS is pretty fast for an interpreted language. Several companies, especially Google, have been putting a lot of work into improving the interpreter. I'm not sure it's caught up to lua, but I suspect it's well ahead of perl/python/ruby at this point. Note that you can still use any of those if you want, or even C or C++. I think there's even bindings for GNU Ada. I doubt the Mono bindings have disappeared either, but I'm really glad they're no longer pushing Mono, even though that can technically be conside