News for hackers. Stuff that matters.
Re:ECMAScript 2016 Approved by ZenPsycho on Friday June 17, 2016 @12:55AM (#11920757)
Javascript doesn't need and shouldn't have a "Standard Library". Javascript isn't python or c. It's more like Lua: It's meant to be embedded inside an application, and the application provides all the interfaces you need.

If you start trying to include things like file i/o in the base language, you're never going to satisfy all the very different requirements of code running in a browser vs. running on a server. If file I/O had been standardised years ago, with API designed by server programmers the browser would be saddled with lousy synchronous stuff that hangs the browser UI, opens up a thousand security issues, and bloats the language with stuff that's pointless for purposes that aren't web browsers or servers.

If you think the web platform lacks something what you do is take it up with the W3C or WhatWG who are in charge of deciding what APIs the application exposes. if you want node to match the browser or vice versa, write a library.

Finally the biggest and best reason to not do this is that, once you put something in javascript (or a web browser for that matter), you can never ever take it out no matter how badly designed it is, without breaking something. At least with an external library abstraction you can switch to a better designed library.

Javascript and the web is an open platform. not a closed platform. The web browser itself provides a MASSIVE standard library that includes everything from a UI and text layout engine, to a standard graphics drawing library, a standard file io library, and plenty of other stuff you'd have to build from scratch in python or ruby. Don't undersell that.

Re:ECMAScript 2016 Approved by rkwz on Friday June 17, 2016 @01:53AM (#11920906)
(Please don't downvote parent if you disagree with parent's opinion, downvote only if it doesn't contribute to the discussion)

@ZenPsycho: A standard library doesn't always have to mean file io or sockets etc. It could be better String/Array/Object manipulation apis, better utility functions (kinda like what underscore/loadsh provide) etc

These are universal helpers that are very much needed whether you're writing code that runs in browser/server/mobile/iot etc.

> If file I/O had been standardised years ago, with API designed by server programmers the browser would be saddled with lousy synchronous stuff that hangs the browser UI

Maybe a bad example, but wouldn't sync file io be a problem in server as well?

Re:ECMAScript 2016 Approved by Kiro on Friday June 17, 2016 @03:49AM (#11921188)
> Please don't downvote parent if you disagree with parent's opinion, downvote only if it doesn't contribute to the discussion

You are wrong. It's absolutely fine to downvote on disagreement. See the following comment from pg himself:

http://news.ycombinator.com/item?id=117171

Re:ECMAScript 2016 Approved by norswap on Friday June 17, 2016 @06:10AM (#11921704)
The irony of your post getting downvoted is delightful. (I myself agree with you.)
Re:ECMAScript 2016 Approved by ZenPsycho on Friday June 17, 2016 @09:49PM (#11926614)
also ironic: it's my highest scored comment ever.
Re:ECMAScript 2016 Approved by tragic on Friday June 17, 2016 @06:54AM (#11921873)
It's also fine not to, which means (in my view) it's fine to ask others not to, if you disagree with pg and think it's unhelpful.
Re:ECMAScript 2016 Approved by LionessLover on Saturday June 18, 2016 @07:37AM (#11928053)
Which is wrong. As is the use of "absolutely" - to show that you have the universe-opinion. What hubris. And it does not matter that some guy "himself" posted some opinion either. Right were you link to there are different opinions from other people that show more thought was put into them. The "pg" comment actually is the only one for your argument, all others are against!
Re:ECMAScript 2016 Approved by LionessLover on Friday June 17, 2016 @04:45AM (#11921357)
Which is wrong. As is the use of "absolutely" - to show that you have the universe-opinion. What hubris. And it does not matter that some guy "himself" posted some opinion either. Right were you link to there are different opinions from other people that show more thought was put into them. The "pg" comment actually is the only one for your argument, all others are against!
Re:ECMAScript 2016 Approved by jholman on Friday June 17, 2016 @08:31AM (#11922215)
pg wrote the site, pg is one of the owners of the site, pg was the only admin at the time that that comment was written. Admins/maintainers (dang) since then haven't disagreed. That makes it site policy, doesn't it?

When you come to a new site, it's usually considered civil to learn the rules of that site, although of course I cannot force you to do so. For example, assuming that reddit rules apply on HN is kinda silly. Relatedly, you might be interested to note that there are dozens of HN old-timers that will automatically downvote (nearly) any comment that contains a "downvote me if you want" or a "don't just downvote me if you disagree" or "these downvotes are BS" or something.

You're right, though, that not all users agree. And hopefully you learn from this comment that it's okay, on HN, to downvote me if you disagree, even if you think I contributed to the conversation.

PS: welcome to HN.

Re:ECMAScript 2016 Approved by LionessLover on Friday June 17, 2016 @09:43AM (#11922572)
> pg wrote the site

What does ownership have to do with it?

That does not make him more right than any other human being.

Ownership means one can impose ones will, it does not mean you are omniscient.

Re:ECMAScript 2016 Approved by coldtea on Friday June 17, 2016 @04:01PM (#11925204)
>That does not make him more right than any other human being.

No, just the only relevant person to say what is welcome and allowed in HIS social bookmarking forum and what's not.

>Ownership means one can impose ones will, it does not mean you are omniscient.

"House rules" are not meant to be perfect or agreeable to all -- they are just meant to be whatever those running and owing the house decide.

Re:ECMAScript 2016 Approved by LionessLover on Saturday June 18, 2016 @07:37AM (#11928052)
> pg wrote the site

What does ownership have to do with it, you fucking moron?

That does not make him more right than any other human being. Ownership means one can impose ones will, it does not mean you are omniscient.

Re:ECMAScript 2016 Approved by coldtea on Saturday June 18, 2016 @09:10AM (#11928441)
>What does ownership have to do with it, you fucking moron?

I'd say "you fucking moron" besides rude, is grounds for killing your account.

As to the question, rules on any property, including a website, are usually imposed by the owner.

That's what "ownership" has to do with it.

There are moderators, and comment and submission rules in places. Maybe you conflated HN with some kind of self-governing collective?

>That does not make him more right than any other human being. Ownership means one can impose ones will, it does not mean you are omniscient.

You wrote that again and I already answered. Nobody cares about PG being omniscient. He can impose ANY arbitrary will (right or wrong), because it's his site. He can even close it if he gets bored with it. Whether you or I find any particular rule "right" is inconsequential, as we're guests here, not even customers.

Re:ECMAScript 2016 Approved by Karunamon on Friday June 17, 2016 @08:34AM (#11922228)
Well given that it's PG's site, I'd say his opinion is the only one that matters.

Besides, votes are used for agreement more than for any other purpose, and given that there's no way to force people to not do this, let's just dispense with the fiction that they can ever mean anything else. "Please no downvote" is just noise.

Re:ECMAScript 2016 Approved by astazangasta on Friday June 17, 2016 @10:46AM (#11922921)
Horsehit - mass opinion obviously matters a lot more on this subject, since there is no way to enforce our arbitrary kowtowing to Paul Graham's wisdom. What is he going to do, yell at us for down voting incorrectly?

This is our website. Maybe pg 'made' it, but we use it. If most of us disagree that is what will (and should in my opinion) happen.

Re:ECMAScript 2016 Approved by tlrobinson on Friday June 17, 2016 @10:56AM (#11922982)
Hacker News has remained a relatively civil place for far longer than most online forums largely because of the policies pg and other admins have put in place.
Re:ECMAScript 2016 Approved by astazangasta on Friday June 17, 2016 @11:15AM (#11923105)
And the self-policing of its users is the force that makes that happen, not the opinion of the admins.
Re:ECMAScript 2016 Approved by coldtea on Friday June 17, 2016 @03:58PM (#11925181)
>What is he going to do, yell at us for down voting incorrectly

He can always close down the side.

Besides, it's not about "what is he going to do" -- it's about what people coming here should respect.

Re:ECMAScript 2016 Approved by astazangasta on Friday June 17, 2016 @04:16PM (#11925278)
He could, but it's unlikely he will close the site over improper downvoting behavior (which is rampant, but unimportant). And what I think people here should (and do) respect is the general spirit of civility; we respect Paul Graham's wishes because he asked for civility, not vice-versa. If Paul Graham asked us to be pointlessly cruel, we would not respect that (or we would be congregating elsewhere).

Therefore, what matters most in practice is the mass opinion of users of the site - what do we think is most useful and respectful in daily usage (following Paul Graham's lead to be respectful because we can all agree that this is a good idea).

Re:ECMAScript 2016 Approved by rictic on Friday June 17, 2016 @04:27AM (#11921288)
Manipulation and utility functions like Object.keys, Object.values, Object.entries, Array.isArray, Array.prototype.includes, Sets, Maps, and many more? Because those and more are actual accepted additions to Javascript over the past several years.
Re:ECMAScript 2016 Approved by BinaryIdiot on Friday June 17, 2016 @01:11AM (#11920802)
> Javascript isn't python or c. It's more like Lua: It's meant to be embedded inside an application, and the application provides all the interfaces you need.

I couldn't disagree more. JavaScript started out that way but today (really the past 6+ years) it's used in identical use cases as Python in addition to being embedded into web browsers.

> If you start trying to include things like file i/o in the base language, you're never going to satisfy all the very different requirements of code running in a browser vs. running on a server.

You don't need to. Provide the basic capabilities that all languages provide, restrict what isn't possible when it's embedded into an environment. Keep it simple.

> If file I/O had been standardised years ago, with API designed by server programmers the browser would be saddled with lousy synchronous stuff that hangs the browser UI, opens up a thousand security issues, and bloats the language with stuff that's pointless for purposes that aren't web browsers or servers.

This is very unfair. What's "years ago"? The asynchronous patterns used in JavaScript date back to well over a decade ago and JavaScript wasn't really used elsewhere until node.js. I'm not sure I would consider any standard APIs as "bloat" either. This just looks like a baseless attack.

> Finally the biggest and best reason to not do this is that, once you put something in javascript (or a web browser for that matter), you can never ever take it out no matter how badly designed it is, without breaking something.

Same goes for all programming languages and their standard libraries. This is why you target specific versions. This is a solved problem.

> Javascript and the web is an open platform. not a closed platform.

So is Python. C++. C#. etc.

Re:ECMAScript 2016 Approved by patates on Friday June 17, 2016 @05:18AM (#11921521)
> You don't need to. Provide the basic capabilities that all languages provide, restrict what isn't possible when it's embedded into an environment. Keep it simple.

Well, that makes sense but wouldn't it make more sense that the environments supply what's meaningful on top of a very light base? Like window.document.querySelectorAll in browser and require("fs") in node.js?

I, although, also think that stuff like what underscore/lodash provides could very well be in that light base, before we start discussing a standard for observables.

Re:ECMAScript 2016 Approved by BinaryIdiot on Friday June 17, 2016 @09:00AM (#11922348)
> wouldn't it make more sense that the environments supply what's meaningful on top of a very light base

I certainly don't think so. JavaScript is a language that works in more places now; commonized libraries would be a huge benefit. As an example you wouldn't use Python with different io libraries depending on the operating system it's running on and yet this is what node is evolving into.

> Like window.document.querySelectorAll in browser and require("fs") in node.js?

querySelector / querySelectorAll are specific to a browser platform but a way to conduct io could be pretty universal, in my opinion.

Re:ECMAScript 2016 Approved by RobertKerans on Friday June 17, 2016 @01:13PM (#11923905)
That would seem sensible: just a native `range` function would be nice, and more declarative methods available natively would be great (zip would be very useful). Having primitives to build upon is pretty important though: I don't know of the Observable proposal is the best to pick on, given its general usefulness for UI
Re:ECMAScript 2016 Approved by oceanswave on Friday June 17, 2016 @06:37AM (#11921811)
You're confusing a language with a platform. The language specs of the languages you mentioned do not have file system semantics included
Re:ECMAScript 2016 Approved by BinaryIdiot on Friday June 17, 2016 @08:29AM (#11922206)
I'm not confusing anything here. Unless a language has a platform specific API it typically gets bundled into the language specifications itself to ensure consistent interfaces and to force implementations to match a set standard.

C++'s STL is part of its specification. Python has a library reference outlining the interfaces their standard libraries must include.

You're still thinking in browser world. In a browser world a browser is a platform and has to provide APIs to allow JavaScript to interact with its elements. Today this isn't always true. Today you have node.js and several other execution engines that allow JavaScript to run anywhere much like other languages. It's time the standard reflects that new reality, in my opinion.

Re:ECMAScript 2016 Approved by elliotec on Friday June 17, 2016 @01:38AM (#11920868)
JavaScript doesn't just run in the web browser anymore. A standard library seems like an odd and annoying oversight at this point. Relevant blog post from Thomas Fuchs: https://medium.com/@thomasfuchs/what-if-we-had-a-great-stand...