News for hackers. Stuff that matters.
Re:Let’s Replace JavaScript with Something Better by wvenable on Thursday April 12, 2018 @06:17PM (#16825435)
> JavaScript always was a bad idea, for the simple fact that automatically executing untrusted code from untrusted and unknown sources is a bad idea.

The premise here is completely wrong. A modern web browser is a sandboxed application delivery platform. The entire purpose is to execute untrusted code and it does so remarkably well. Take this away and you just have a document viewer -- a sophisticated one for sure -- but one always limited to its original purpose.

This proposed solution would eliminate many of the applications that web users use every single day and many more that haven't even been invented yet. HTML5 games would be impossible. Forget Google Maps. It's not even worth entertaining.

> In the company of the two declarative languages HTML and CSS, the imperative, all-purpose JavaScript always seemed the odd one out.

Declarative languages are extremely limiting and the trend has been to move away from them. For example, the introduction of Service Workers to replace manifest files.

Much of the success of the web has been in defiance of the declarative nature of the formats rather than in support of them. We're building complex applications in a declarative format designed for documents and that's only possible because we can imperatively manipulate those documents with code.

Re:Let’s Replace JavaScript with Something Better by bassman9000 on Thursday April 12, 2018 @07:36PM (#16825882)
This proposed solution would eliminate many of the applications that web users use every single day and many more that haven't even been invented yet.

No big deal. When Apple introduced the App store, a maybe-not-new-but-finally-practical way of shipping applications to end-user devices was born. And they weren't webapps. No JS at first, mostly Objective-C and plists. And was still revolutionary in its reach, and consequences. Then Android came. Still no JS, but XML and Java.

So, no, you don't need HTML+JS to deliver rich content application to users.

Re:Let’s Replace JavaScript with Something Better by wvenable on Thursday April 12, 2018 @08:12PM (#16826065)
You need HTML+JS if you want to deliver one single application to iOS, Android, MacOS, Android, Linux, BSD, Solaris, Chrome OS, Tizen, and OSes that don't even exist yet and not be held to a single proprietary platform owned and managed by a single entity.

You could argue that it's not necessary but that's what it is.

The site you're posting to now probably wouldn't even exist if it required installing a different proprietary application for every platform.

Re:Let’s Replace JavaScript with Something Better by bassman9000 on Thursday April 12, 2018 @09:07PM (#16826326)
You could argue that it's not necessary but that's what it is.

Yeah, that's the whole point I'm trying to make. That it's not necessary. That JS it no more special than any other language, and that there are recent, real, practical examples of absolute disruption (Apple/Android app stores) which broke what we thought it was required to deliver content to users.

As per the one single application, that's a gross oversimplification.

Re:Let’s Replace JavaScript with Something Better by wvenable on Thursday April 12, 2018 @09:25PM (#16826423)
Nobody said JS is special but the point of the article is that code execution (of any kind) is unnecessary.

The ironic part is that app store you're arguing for wouldn't even exist without the web. The web is what made Mac OS X viable for users to switch to it (and MS Office). The platform network affects that made Windows a monopoly have been drastically cut down by the web.

> As per the one single application, that's a gross oversimplification.

Says another person posting on a web application that runs on every platform out there.

Re:Let’s Replace JavaScript with Something Better by leadingthenet on Thursday April 12, 2018 @07:44PM (#16825934)
Everything you listed as a con is exactly what I’d like the web to be.
Re:Let’s Replace JavaScript with Something Better by wvenable on Thursday April 12, 2018 @08:05PM (#16826038)
Says the person posting to a web application. Where exactly do you want to draw the line?
Re:Let’s Replace JavaScript with Something Better by localcdn on Friday April 13, 2018 @01:34AM (#16827344)
Hacker News has no need for JavaScript
Re:Let’s Replace JavaScript with Something Better by wvenable on Friday April 13, 2018 @10:17AM (#16830197)
JavaScript makes the upvote/downvote buttons work in a way that users expect them to work. Given that is almost 50% of the end-user functionality of this site, I'd say that's pretty important.
Re:Let’s Replace JavaScript with Something Better by leadingthenet on Saturday April 14, 2018 @07:32AM (#16836896)
This website is the perfect example that a web app can be extremely functional without requiring Javascript, especially not for doing CSS and markup.
Re:Let’s Replace JavaScript with Something Better by marssaxman on Thursday April 12, 2018 @07:20PM (#16825826)
That all sounds like a pretty good idea to me. I was happy with the distributed document viewer system and never actually wanted the complex application platform. I still don't want it, but I'm forced to put up with it if I want access to the document viewer system, because the two wildly different projects have been smashed awkwardly together.

Since the web as a document viewer system appears to be dying, leaving only the distributed application system I don't really want to use anyway, perhaps in a few more years I'll be able to abandon the web thing and do something else.

Re:Let’s Replace JavaScript with Something Better by krapp on Thursday April 12, 2018 @08:06PM (#16826045)
>Since the web as a document viewer system appears to be dying, leaving only the distributed application system I don't really want to use anyway, perhaps in a few more years I'll be able to abandon the web thing and do something else.

How many real "distributed applications" do you see on the web, though, versus documents with dynamic content?

Is Medium, which is primarily intended to serve text, but which depends on javascript, an app or a document? What about Facebook, which despite its complexity still looks and acts more or less like a document, albeit with interactivity and asynchronous loading. Is it a matter of static versus dynamic content? Memory usage and computation? Features like AJAX and session storage?

If documents are only static, non-scripted HTML pages, then do they become applications if there is server-side logic involved?

I don't think there is an objective description of "web app" versus "document", I don't think the web is as cleanly cut along those lines and many might like to believe.

Re:Let’s Replace JavaScript with Something Better by marssaxman on Thursday April 12, 2018 @08:19PM (#16826101)
There's a simple heuristic that works pretty well for me: does it still make sense in Reader View? If so, it's a document, and it shouldn't have needed Javascript. If not, then it's probably a web app.

I am less concerned about server-side logic than the expectation that I'm just going to be happy to run arbitrary code provided by other people on my machine.

Re:Let’s Replace JavaScript with Something Better by wvenable on Thursday April 12, 2018 @08:26PM (#16826145)
Doesn't the mere existence of reader view make your point moot?

The web browser is your software -- I have mine customized with plenty of plugins, blockers, and reader view. You can take content, remix it, and display it however you like. I can render this site as green text on a black background if I wanted to.

I can write my own web browser if none of the existing ones do what I want.