News for hackers. Stuff that matters.
Re:JavaScript Conquered the Web, Now It’s Taking Over the De... by scrollaway on Monday September 12, 2016 @02:15PM (#12482202)
> Most people do not use JavaScript since it is useful. They use it since it is the only option available on the browser.

You're not contradicting what you are replying to. People are using Javascript because it's the only option, but it is useful to have a lingua franca.

I just wish that lingua franca wasn't Javascript.

Re:JavaScript Conquered the Web, Now It’s Taking Over the De... by tracker1 on Monday September 12, 2016 @03:46PM (#12483022)
It's very far from the only option server-side (node), but a lot of people are using it there... and on the desktop (various native tooling options, electron, etc), and in mobile apps (react native, nativescript, cordova).

I know someone who's wished for "one language to rule them all" for a long time and wants/wanted that to be Visual Basic... It's a matter of perspective as much as anything else.

JS can be a very beautiful/expressive language... and mocking some of the corner cases of coercion doesn't really help the argument. JS started as a language for input validation first... it works in a way that input validation passes/fails very cleanly. It makes it a great transport/middle-man language actually.

Re:JavaScript Conquered the Web, Now It’s Taking Over the De... by inputcoffee on Monday September 12, 2016 @02:26PM (#12482297)
I agree with the first part.

The issues of: "utility of lingua franca" and "ubiquity of Javascript" are orthogonal issues.

It seems everyone agrees that Javascript would not have been the first choice of language. There is no short argument there, you have to go out and try at least one other language and compare them.

However, on the second question, I don't see why it is useful to have a lingua franca.

Multiple languages arise out of multiple needs. You want a superfast language for your OS, you want a quick high level language for quickly examining data, you want a language that describes visuals and so forth.

What are the benefits of a lingua franca for the internet, or any other domain? They still get to exchange data in an agreed upon format.

Re:JavaScript Conquered the Web, Now It’s Taking Over the De... by pcwalton on Monday September 12, 2016 @02:29PM (#12482335)
Because all of the languages supported by the browser have to interact with the DOM. DOM memory management is incredibly tricky: it will not do to just have "an agreed upon format" to exchange data between such languages. You need all the languages to participate in a single garbage collection regime and to have semantics for interoperability at the object level between all of them, which is a very difficult problem.

Even getting interoperability between JS and C++—what the browsers do to implement the DOM—has been exceptionally difficult, with innumerable security vulnerabilities resulting from this.

Re:JavaScript Conquered the Web, Now It’s Taking Over the De... by inputcoffee on Monday September 12, 2016 @02:43PM (#12482479)
When I said "agreed upon format" I was thinking of something like JSON to talking to the server. I didn't think of various tabs on a browser having to interact.

You probably know more about how the browser works than I do, but I think I see what you're saying.

Suppose we implemented a browser that can allows front ends coded in RUST. In my mind, the browser just gives the RUST app its own tab, with its own memory and so forth.

I am not proposing mixing up languages for the a given front end, or for components within an application or anything. Not because I think that would be wrong, but because I haven't thought it through.

Re:JavaScript Conquered the Web, Now It’s Taking Over the De... by 0xmohit on Monday September 12, 2016 @03:16PM (#12482763)
> I just wish that lingua franca wasn't Javascript.

Why?

Just because undefined is not a function [0]?

[0] https://twitter.com/vikasgorur/status/744204277745254400

Re:JavaScript Conquered the Web, Now It’s Taking Over the De... by anoplus on Monday September 12, 2016 @02:39PM (#12482436)
Also, when it comes to languages. I rather have one language to be agreed upon, and to have small, gradual improvements to that language while keeping the world standard and simple. In case of JavaScript the improvement is strong typing.
Re:JavaScript Conquered the Web, Now It’s Taking Over the De... by tracker1 on Monday September 12, 2016 @03:48PM (#12483039)
If you want strong(er) typing, just create with TypeScript or flow... I don't see nearly the value in it that you seem to.