4 ms·
The C-influenced nomenclature is not needed here. By the nature of what you're referring to, it is not a library. "In the standard" will do.
by pwdisswordfish8 5y ago
The C-influenced nomenclature is not needed here. By the nature of what you're referring to, it is not a library. "In the standard" will do.
- bqa65 5y agoEr, C did not invent libraries by any measure whatsoever, and is completely appropriate to call a function available to code without imports “in the standard library”. It is a library function. You did not write it. Simple as that. This is one of the more unnecessary pedantries I’ve ever seen, and that’s saying something on HN.
- skrtskrt 5y agoI always assumed just from how people used the terms that available without imports = “core language” and available via import without installing external packages = “standard library”
- throwanem 5y agoThat may indeed be a more useful distinction to draw here. In it, Node could be said to provide a "standard library" (although not actually standardized, and I'm not sure how much it overlaps with eg Deno), while padStart and such would be core language features inasmuch as a compliant JS implementation is guaranteed to include them. edit: It is not, however, an accurate distinction. https://news.ycombinator.com/item?id=28021135 https://news.ycombinator.com/item?id=28021135
- pcthrowaway 5y agoEven if you call the node built-in libraries 'the standard library' (for node), from context I think it was clear that GGP was referring to the ECMAScript standard library
- throwanem 5y agoPretty sure GGP in your usage here was also me. I was so referring, but had been unaware that ECMA-262 actually defines "standard library" in a way with which my intuitive usage happened to correspond.
- wk_end 5y agoFWIW my intuition is that any functions, classes, constants, whatever - things that I could write myself if I had to - are “standard library”. “Core language” refers to syntactic or semantic features of the language that would require modifying the compiler or interpreter to introduce.
- deleted 5y ago[deleted]
- mbrubeck 5y agoOkay, let's see what “the standard” has to say… “Clauses 18 through 28 define the ECMAScript standard library.” —ECMA-262, 12th edition, June 2021, ECMAScript® 2021 Language Specification, §4.5
- pwdisswordfish8 5y ago... so? The current incarnation of TC-39 has produced something that's a mess in more ways than one. The spec somehow managed to make it all the way to 5.1 and with that term nowhere to be found. With all the people who've got their hands in the spec nowadays, that someone playing it fast and loose with language also used the wrong terminology is not particularly surprising, nor does it make it any less grating to hear. (Does the standard provide for a way not to run with the "standard library"? To opt for a different library of your choosing, for example, or no library at all? No? So it's a set of built-ins that are just an inescapable part of the language, then.)