Hacker News new | ask | show | jobs
by patates 3661 days ago
> 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.

2 comments

> 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.

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