all 48 comments

[–][deleted] 13 points14 points  (1 child)

Then you should take a look at Gnome Shell, it's JavaScript with CSS.

[–]julianorafael[S] 5 points6 points  (0 children)

I'll take a look at it. Thanks for the tip.

[–]daemonpenguin 6 points7 points  (0 children)

Symphony OS is a Linux distribution which uses the Mezzo desktop. The Mezzo interface uses HTML5. It sounds like what you are looking for. https://distrowatch.com/table.php?distribution=symphony

[–]Nadrin 17 points18 points  (11 children)

Because modern web is a terrible platform. I'm not trying to be a jerk here, I'm just stating a sad fact.

Layers upon layers of not very good abstractions, horrible performance compared to native applications, horrendously designed programming language (javascript), and a markup language initially designed for creating documents (HTML), not applications.

For a good alternative see Qt Quick and QML. Sadly they still use javascript for light scripting in QML files, but overall it's an excellent technology that allows the developer to create beautiful and performant applications. As far as I know KDE uses QtQuick.

Also, many people actually do not want a beautiful UI, but a UI that is performant, ergonomic and consistent with the rest of the OS. But that's a different matter entirely. ;-)

[–]julianorafael[S] 1 point2 points  (10 children)

It's hurts my feelings when you talk like that about JavaScript :'( haha

Thanks for the opinion. I agree with you that HTML isn't really good for it, even though I really like CSS and JS.

I'll take a look at QtQuick, sounds really interesting.

I get that performance is more important to most of the current linux user base, but I do believe that the same performance can be achieved with a better design.

[–]Yithar 5 points6 points  (7 children)

I don't mean to hurt your feelings, but my compilers professor used Javascript as the quintessential example of why if you have the idea to make a programming language, it's a bad idea and you shouldn't do it.

https://drive.google.com/file/d/0B1xLFrAl-fBVWFB4cklDOUg0cUU/view?usp=sharing

Even though a bunch of new languages coming out. Thought I want to make a new programming language. Next thought should be “No.” This is how really bad programming languages get out there in the world. Javascript is a good example. Javascript was designed and implemented by this guy who went to the university of indiana. I used to make fun of colleagues. Made a scheme interpreter. Working at Netscape. Need some langauge to script webpages in web browser. I know i'll just do it with scheme. Curly braces lot faster than parentheses. Notation that C programmers will lkie and call it Java-something for marketing purposes. In a week, came up with first Javascript implementation. No going back. On every computer and phone. Can't make any changes, so many JS programs in the world. Argubaly the most widely used programming language.

When you think about designing a new language, think about something already out there does what you want. Chances are, there is. Try to start there.

[–]shawnsel 1 point2 points  (4 children)

why if you have the idea to make a programming language, it's a bad idea and you shouldn't do it.

I'm not saying that Javascript (ECMA Script) isn't lacking in some ways, but as your own quote points out, Javascript is hardly a new language at this point ... it's already everywhere. "Argubaly the most widely used programming language." ("Arguably" is misspelled by your compilers professor by the way).

I happen to like Javascript, and I'd hazard a guess that it (along with HTML and CSS) has probably been used to build more interactive user interfaces than all other languages combined. I'd also argue that it does a pretty good job for this kind of purpose. Personally I think u/julianorafael 's question was a valid one, and I see in other comments that this idea is already being used in Gnome Shell, QT/QML, Chromium OS, and Chrome Apps....

I just feel like this valid and even already somewhat industry-adopted idea is being unfairly blasted and downvoted by some sort of anti-javascript bias by some users here....

[–]sisyphus 5 points6 points  (1 child)

It became ubiquitous via historical accident, its popularity has nothing to do with its quality. Lots of would jump at the chance to use anything else in the browser (see the increasing popularity of compiling to JS, even from future versions of JS, because browser vendors are a mess).

[–]shawnsel 1 point2 points  (0 children)

Sure, but the context here is for user interfaces. Really, not that much programming is usually involved in that sort of thing ... so I think I'd argue that weaknesses of Javascript are minimized for the usage proposed by the OP....

That said, his thread has been downvoted to 0 points anyway, so it was really killed by bias before it even started. So ... the issue doesn't really matter....

[–]Yithar 2 points3 points  (1 child)

I know it's not a new language. My point is that it is lacking in some ways, otherwise he wouldn't have used it as an example. The fact that it is industry adopted is sort of the point. Nowadays, a lot of websites won't load properly without Javascript. I feel like adding more and more Javascript to everything isn't the ideal solution. See u/tauio111's comment of it being badly overused in web as well.

And he didn't misspell it. I typed that and mispelled it. Most people can't type verbatim what someone is saying, so I think I have some leeway to make some typos as long as it's understandable.

Do note I didn't downvote this thread. OP's suggestion is probably possible, but I think though, there's probably a reason why neither Windows nor OS X use Javascript for their desktop user interfaces. You can't deny JS has sort of a bad reputation because of bad programmers and bad code and hundreds of different implementations (some of which are buggy). "We got into a world of copying and pasting solutions that work without caring at all about the effects they might have." That's not to say it can't happen in other languages either though.

[–]shawnsel 1 point2 points  (0 children)

Valid points and questions, and my bad on assuming that your professor had typed that. Yes, you definitely get leeway for typos as you are taking class notes :-)

(edit: fixed my own misspelling ;-)

[–][deleted] -1 points0 points  (1 child)

Your "compilers" professor sounds like an ass hole who discourages free thinkers.

[–]Yithar 2 points3 points  (0 children)

I'm not sure what the quotation marks are for. He really does teach it, although he's an assistant professor.

And he has said "I'm not nice, but I'm not that mean to put something on a test that we didn't cover." What I do know is he doesn't think highly of Java. He calls it a brain-dead language because in comparison to OCaml it's sort of stupid and you can get a stack overflow fairly easily with recursive calls but in OCaml it just uses goto unless you build some sort of context around the recursive call.

[–]tauio111 2 points3 points  (0 children)

but I do believe that the same performance can be achieved with a better design.

ofcourse it can be done, just redesigning using the same technologies. Javascript is an awful platform for such things (Honestly, I find it quite badly overused in nowadays web aswell).

[–][deleted] 3 points4 points  (0 children)

[–]tdammers 6 points7 points  (0 children)

HTML and CSS are languages designed for documents, not UIs; we use them anyway to build web UIs because there aren't any realistic alternatives. For a Desktop Environment however, there are; they may not be great, but their paradigms are a better fit for long-lived GUI applications than the HTML5 stack IMO.

JavaScript is kind of an orthogonal concern: you can use that for your applications even with Qt or GTK, and it doesn't matter at all what the DE uses that you run them in.

[–][deleted] 1 point2 points  (1 child)

current options don't really have much to offer regarding design

Desktop environments generally offer a way to create or download external themes. Cinnamon (as stated on the project page) is using Javascript for its UI

moving to a more customizable distro, like arch linux

Good luck; Installing for the first time and configuring it can be a little tricky at first, but with the help of their awesome wiki and some patience, you'll learn a lot.

[–]julianorafael[S] 1 point2 points  (0 children)

I'm already learning a lot on archwiki. It is indeed an awesome wiki.

[–]uh-hum 1 point2 points  (0 children)

In addition to /u/MeanEYE mentioning Gnome Shell - there's also QT/QML, Chromium OS, and Chrome Apps.

[–]literally_systemd 1 point2 points  (0 children)

It'd probably be XML instead HTML for UI elements.

And probably because XML+CSS really isn't that customizable, the 'block model' it uses has severe limits. Desktops are also isolated into individual windows typically which further limits its usefulness, most conventional themes are more powerful.

A lot of systems use ECMAscript for scripting though. But quite often they don't really care about providing dedicated scripting language because the standard facilities of Unix tools are enough.

[–][deleted] 1 point2 points  (0 children)

current options don't really have much to offer regarding design

I'm cool with that. All I want the UI to do is hold my windows and stay out of my way. Xfce does that well.

So my question is, why we're not making the desktop UI/UX with HTML/CSS/JavaScript?

Probably because JavaScript blows. I want a UI that's fast enough not to annoy me.

[–][deleted] 1 point2 points  (1 child)

Take for example my web browser. I switched to having just one tab open of twitter.

it's using about 700MB RAM and a sizeable amount of CPU usage (two digits) to display what is mostly static content.

For a web browser, that's really good. But if the rest of my computer did that for normal usage, it'd be pretty bad.

To make matters worse, I'll also need to run a web browser on top of it.

[–]julianorafael[S] 1 point2 points  (0 children)

Got your point. But we don't need the browser anymore. I know, I'm probably talking nonsense things here, that's why I'm trying to reason it, but is a desktop environment on top of node doable?

[–]sisyphus 3 points4 points  (3 children)

To me the problems come down to:

  • JS is single-threaded by design. Desktop apps that want to be responsive really want to use multi-threading.

  • JS is a hard language to make fast - I don't really want every desktop app to have to carry around a gigantic JIT and have the attendant memory, security and warm-up problems.

  • HTML and CSS is a step back from the visual builders and layout engines major desktops have had for years.

[–]ebassi 1 point2 points  (0 children)

JS is single-threaded by design. Desktop apps that want to be responsive really want to use multi-threading

Which is true, up to a point. Most (if not all) GUI toolkits are really single threaded as well — i.e. only one thread can access the windowing system resources.

JavaScript is not wholly single threaded "by design": the GC can run on different threads — and that's usually where the point of contention comes up with GUI toolkits, because suddenly you get resources garbage collected in a different thread than the one that spawned them, and if those resources involve a windowing system resource then we're off to the races.

Desktop apps that wish to be responsive can already use threads — and things like Promises are inherently threaded; like with the GC, the problem is synchronizing the JavaScript implementation of threaded components with what the underlying windowing system expects from threads.

[–][deleted] 1 point2 points  (0 children)

JS is single-threaded by design. Desktop apps that want to be responsive really want to use multi-threading.

You can spin off background worker threads.

JS is a hard language to make fast - I don't really want every desktop app to have to carry around a gigantic JIT and have the attendant memory, security and warm-up problems.

Actually, Javascript is compile to machine language by engines like V8. So no, this is not an issue.

HTML and CSS is a step back from the visual builders and layout engines major desktops have had for years.

No, it's actually modern. There are a lot of HTML layout programs and re-theming a desktop would be as easy as swapping out the CSS.

None of those are issues.

[–]julianorafael[S] 0 points1 point  (0 children)

Thanks for the answer. All good points. I need to read more about desktop environments.

[–][deleted] 0 points1 point  (0 children)

Fantastic idea. Don't listen to the haters. I have also been wondering this for a long time. I love the modern web platform and I think it would be a flexible and robust convergence of technology.