2 ms·
Javascript is an a weird place where some people denigrate it beyond reason and others elevate it beyond reason. It does have some warts due to early design mi
by goto11 4y ago
Javascript is an a weird place where some people denigrate it beyond reason and others elevate it beyond reason.
It does have some warts due to early design mistakes, mostly related to type coercion and semicolon insertion. A linter can protect against that.
Among its supporters, much is made of the fact that Eich initially wanted to do scheme in the browser. But JavaScript does not have code-as-data which to me is the defining quality of Lisp/Scheme. It does have lexical scope and closures, but any mainstream language has this these days. It has prototypal inheritance which is mostly notable because it is different from the more common class based inheritance, not because it is particular good in its own right.
- somewhereoutth 4y ago> code-as-data which I consider to be the defining problem of Lisp/Scheme. It becomes impossible to reason about code if it gets used too much or indeed at all. Note that the lambda calculus has no such feature (though of course you could build an LC interpreter in LC)
- lispm 4y agoBut then Lisp is a family of general purpose programming languages and lambda calculus is not.
- somewhereoutth 4y agoLisp is also proffered as being foundational in some sense. I would argue that the LC is a better foundation.
- mncharity 4y ago> [Javascript] has prototypal inheritance which is mostly notable because it is different from the more common class based inheritance, not because it is particular good in its own right. With a caveat that browsers implemented a rather crippled version of it. Much goodness of prototypical inheritance comes from most everything being an object - as with smalltalk. Regrettably browser implementations chose to half-ass this. How many types does browser js have? A few primitives, and Objects, ... and great many implementation types poorly pretending to be Objects, backed with code which accepts only the implementation type and chokes on real objects. They repeatedly implemented a fast path and stopped there, ignoring the general case. Imagine how poorly smalltalk would work if similarly compromised. Browsers have gotten less bad in this respect in recent years, but far too late for the community to learn prototype style programming from js.
- BrendanEich 4y agoLexical scope and closures were uncommon in 1995 industry/"blue collar" languages, no fair comparing to languages "these days". Code as data (homoiconicity) was ruled out by the "Make it look like Java" order from Sun and Netscape management. Sorry.