Live data from Hacker News

JavaScript Conquered the Web, Now It’s Taking Over the Desktop

wired.com

141–150 of 270 posts

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#141
post #37
post #29

Earlier quoted context omitted.

Python would like a word with you about point 1)

Well I have yet to see Python make a decent cross platform application on all of those platforms especially iOS and Android. I love Python but people over state its benefits and effectiveness.

Python is wonderful for business logic and scientific computations. HTML/JavaScript is wonderful to make beautiful interactive user interfaces.

So at the moment, I am using PyQt/PySide and load my HTML/JavaScript/ReactJS GUI in a webview with a simple bridge object between my Python code and the JavaScript code.

As soon as I need native interactions with the file system, etc., I am using Python, which is robust and proven (and I am used to it). For example, if I need a dialog to save a file, I just use QFileDialog.

At the end, because of a clear separation between the GUI and the computation/system interactions with the bridge object, I just need a different bridge object to have everything running fully online.

One point is of course that I am not developing for phones and tablets, I package everything with pyinstaller for the good old desktop users.

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#142
post #94
post #54

Earlier quoted context omitted.

> HTML/CSS/JS is considered 'hackable' because it's widely understood by today's semi-power-user audience I think that's related to the high fault-tolerance in Javascript. A good developer is good in any language, so she can work with Javascript. A beginner or even a bad developer can make things happen in Javascript, when that is not always possible in other languages. So the entry point level is so low that a lot o…

I can assure you that a bad developer can make things happen in any language. And it will look and behave like shit in all of them. There is no language that makes a developer write good code by magic.

There are languages where non-developers can make SOMETHING happen (like make the monkey dance[1]). There are languages where non-programmers can't -- you have to be SOME kind of programmer, good or bad, to make C do something other than look at you unkindly.

1) http://programmers.stackexchange.com/questions/221615/why-do...

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#143
post #73
post #7

Earlier quoted context omitted.

WebAssembly will hopefully end JavaScript's stranglehold on the web. The justification for using JavaScript for server/desktop/mobile applications seems to essentially be that a certain large group of programmers only know JavaScript.

I guess you tend to reuse the technologies you're familiar with, especially when they are very well proven for solving a very complicated problem that requires a lot of expertise (I'm talking about fancy UIs, of course). Which is also why I think the emphasis on JS is wrong: the main selling point of these technologies is NOT javascript, is HTML5/ CSS. Javascript is just a (very handy indeed) scripting language like…

So where are the masses of serious C#/ Java/ developers using transpilers to write the logic of their web applications?

I think it is catching on with C++ game developers, who want to be able to run the same codebase natively or in the web browser. The Unity 3D game engine has built-in support for this using WebGL, for example.

I don't know if CLR or JVM languages have been successfully transpiled to the browser using asm.js / WebAssembly (it wouldn't be very efficient at all, so I doubt that will ever be popular).

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#144

> It turns out it’s useful to have a lingua franca for the web. No, I don't think so. Most people do not use JavaScript since it is useful. They use it since it is the only option available on the browser. There is a BIG difference. > Creating desktop apps in JavaScript lets developers choose from a vast range of freely available code libraries and frameworks, which takes much of the grunt work out of coding Lots of…

I can't believe this is the top comment. Let's go point by point: 1) JavaScript has its warts and its gotchas like anything else (okay, maybe a few more). So what? Spend 50 hours building anything substantial with JavaScript and you'll get a good handle on them, and you'll be good to go for the next 10,000 hours. Same goes for just about any other language. Focusing on the weird edge cases might make for a nice blog…

>> Spend 50 hours building anything substantial with JavaScript and you'll get a good handle on...

I don't mind MY JavaScript. It's everyone else's that drives me bonkers. Tracking down things in JS is a timesuck of epic proportions. Much of the time, it just isnt't any fun.

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#145

Earlier quoted context omitted.

> How can anyone in their right mind trust a language that requires such dirty implementation tricks to achieve decent performance? Isn't this a rather broad brush with which to paint all JIT language implementations, including Java, C#, and, say, PyPy?

Could you name a JIT compiler that doesn't do this kind of thing, yet offers performance comparable to AOT-compiled languages? (FWIW, I'm not saying it's impossible. It's perfectly possible, but you'd need a source language that offers much better static guarantees than the typical language that a JIT compiler is written for.) --- Sorry, can't reply to you directly, because “I'm submitting too fast”. So my reply goes…

> that _doesn't_ do this kind of thing

Why does that matter to anyone?

> you'd need a source language that offers much better static guarantees than the typical language that a JIT compiler is written for

Java and C# are both statically, strongly typed languages where JITs are the dominant implementation.

Almost by definition, it's impossible to write a JIT compiler that outperforms AOT compilation without looking at runtime data, because AOT compilers have a lot more time to look for difficult static optimizations. The reason JITs can keep up is because they have access to information that an AOT compiler does not.

> And there's no need to use statistics to optimize anything at runtime when your ahead-of-time compilation step already emits optimal target machine code.

This is simply untrue. For example, it's not possible to statically determine whether a function should be inlined or not. However, a JIT can see that it's used in a hot loop and dynamically inline.

For any language, no matter the type system, runtime information will always be a superset of compile-time information. There will always exist optimizations in a JIT that aren't possible in an AOT compiler.

> Java is as dynamically typed as it gets: `instanceof`, downcasts and reflection, all conspire to reduce the usefulness of static type information to zero.

Idiomatic Java code doesn't use these features heavily. Just because it's possible to wipe out type information doesn't mean that the vast majority of code that an AOT or JIT compiler sees won't be strongly typed.

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#146
post #95

Earlier quoted context omitted.

And it is extremely successful because it's not a bad language. Sure, there's lots of "wat", but a non-professional programmer is going to say "wat" about every strange error they get from another programming language that js would have just passed silently with a weird result. Then they will replace whatever construct isn't working with one that does, and get on with their life, unlike people who seem to have a lot…

> And it is extremely successful because it's not a bad language. Perhaps not a bad language, but I do think it falls into the same category as PHP - just good enough. It's just good enough to do what we want it to do, and given the lack of choice, we're willing and ready to pile abstraction upon abstraction upon it to try and reduce the pain involved with getting work done. And like masochists, we look at the result…

I don't think you know what you're talking about. PHP, up to version 4 at least, was hardly even a language. More like a collection of macros.

Javascript, despite a few ugly gotchas, is an elegant language with a few simple rules that allow for an impressive degree of freedom and flexibility.

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#147
No. Javascript frameworks/tools change every few months, by the time you finish a project, everything you used has been superseded by something new. Last year's expert is today's luddite. Change at that pace is unsustainable for long term support of applications.

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#148
My biggest issue with these apps is the inability to share memory. If I have Viber, Slack, Atom and regular Chromium open at the same time, they all consume copious amounts of memory which I assume is due to the constant overhead layout/JS engines need to keep resident per app.

If I'd somehow opened all these as tabs on Chromium, they would plug into Chromium's already-allocated shared data structures and the memory consumed would be quite lower. I can have Facebook Messenger, Deezer and Gmail open alongside 10+ other tabs at all times, but once I start Slack and Viber alongside Chromium (or Skype for Linux Alpha, or Visual Studio Code, or Black Screen, or any of these trendy hybrid-web-desktop apps), Linux starts screaming and swapping things around; as a result, everything becomes sluggish.

Also, the apps themselves feel a bit laggy even when they have all the memory they need. I know the comparison is not fair, but using, say, Code::Blocks or QtCreator (which are full-blown IDEs) with Atom, I can feel input response differences for some reason.

I have a low amount of RAM on my home PC and I plan on upgrading it, so you can say that my hardware is the problem, but clogging up memory like that is always a waste.

As a test, I just opened Popcorn Time. Right after startup, it uses 200MB of resident memory. The whole GNOME shell + the Xorg process consume around 280MB combined on my PC. That's insane. Yes, it looks beautiful, but it's nothing you can't do with Qt these days. It also supports JavaScript. QML is not hard to learn. It's available for Windows, Linux, OS X, and even mobile. Ditto for GTK+ 3: Vala is beautiful, practically C#, and good enough for at least the UI layer of your app, if not for the whole thing. Qt and GTK+ are both open source and LGPL, which means you can freely link to them even if you develop proprietary software.

I just don't see such a need to make today's apps so bloated (and I don't consider "people have enough memory nowadays" a valid argument). If it's an one-off app made by a small team, or for fun, the trade-offs may be worth it. But for Slack, or Skype for Linux, or VS Code, wouldn't it make sense to put more developer time on it and have a much more performance-conscious application?

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#149

Earlier quoted context omitted.

I was under the impression modern JS interpreters JIT to machine code and are fast. Kind of like how Java was slow in 1995 but today is kind of amazingly fast. Which I guess implies that there are two ways a language can become fast: one is by being designed for speed, and another is by becoming extremely popular/useful and having tons of millions of hours of thought and work put into making it faster.

JS engines have improved by about 2 orders of magnitude in speed for actual use over the last 10 or so years. They've outpaced Moores law.

Probably because the head guy working on V8 had lots of experience with virtual machines going back to Self in the 80s. But it's kind of silly to say that JS VMs have outpaced Moore's law, given that interpreted JS was very slow to begin with. It's not the same as a compiled languge improving by that much in the same time.

Basically, JS wasn't leveraging much of the computer's power until V8 came along.

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#150
post #95

Earlier quoted context omitted.

And it is extremely successful because it's not a bad language. Sure, there's lots of "wat", but a non-professional programmer is going to say "wat" about every strange error they get from another programming language that js would have just passed silently with a weird result. Then they will replace whatever construct isn't working with one that does, and get on with their life, unlike people who seem to have a lot…

When I first started learning JavaScript, I wondered how people became proficient at the langue with all these weird quirks[0] that don't raise errors. Turns out that there are a bevy of things to help combat these quirks. Two of them are strict mode[1] (which can be scoped[2] in instances were libraries/frameworks would fail running in strict mode) and linters. Strict mode and linters do not fix everything. This is…

> I wondered how people became proficient at the langue with all these weird quirks[0] (links the usual loose equality table)

Why don't you all just use === instead of ==?

Tell me, how long does it take to learn it?

Post reply on HN