2 ms·
If you squint enough, JS is a lisp.. Define a goddamn language, syntax is not enough to define one! What are the semantics? Without that you are just talking a
by gf000 3mo ago
If you squint enough, JS is a lisp..
Define a goddamn language, syntax is not enough to define one! What are the semantics? Without that you are just talking about syntax trees like they would mean anything
- dosisking 3mo agoJS is Self, which is a dialect of Smalltalk. So not really Lisp imo
- throwaway81523 3mo ago> If you squint enough, JS is a lisp.. Yes, that is true. I'm not big on the idea that Lisp is defined by parentheses. The implementation strategies are another way to look at it. That doesn't capture it either, but it's an angle to try.
- gf000 3mo agoSo then what it is? Because otherwise it's a magical nothing-term to which everything lisp people like applies, but no criticism can ever reach it because "that's not really lisp, see it's different in this other implementation"
- Pay08 3mo agoIn my mind, it's 2 distinct criteria: interactivity and the manipulation of symbols (whether those are implemented as symbols or identifiers doesn't really matter). I don't know about Erlang, but from the admittedly little JS I've written, I believe it achieves both criteria, even if it's worse at them than a "proper" Lisp.
- pjmlp 3mo agoIt isn't, Dylan and Julia are two Lisps with Algol like syntax. Indeed there was a proposal to add Algol like syntax to Lisp, https://en.wikipedia.org/wiki/LISP_2 https://en.wikipedia.org/wiki/LISP_2
- bsaul 3mo agonever understood why people say that: the syntax for defining code seems quite different from the syntax defining data structure. There's no homoiconicity in javascript..
- gf000 3mo agoAnd that's just syntax, it doesn't give you a programming language at all. JS is a dynamically typed language with prototypical inheritance objects that work like universal key-value maps for the most part. It is also mutable. Clojure is a dynamically typed language with key-value maps. It is also immutable. You can surely see where I'm going , the underlying semantic model is the meaningful part. Homoiconicity doesn't give you anything special if your language can parse itself and can eval code. It just makes these completely abstract implementations simpler.
- zelphirkalt 3mo ago> Homoiconicity doesn't give you anything special if your language can parse itself and can eval code. It just makes these completely abstract implementations simpler. Well, in a way it does give you something: By making expression of things like macros simpler, it makes them sometimes worthwhile, and makes it a reasonable request to have this kind of meta programming in your language at all. Without homoiconicity such things become even more difficult endeavors and often unjustifiable for the language design and its implementation.
- gf000 3mo agoI mentioned in other comment that homoiconicity doesn't necessarily make writing macros simpler. It makes writing trivial toy examples simpler. But let's compare it to a modern macro system like rust's or scala's, where you get a typed object representation of the AST, and for anything non-trivial you are better off with this latter. Also, arguably the best is to have certain features in the language itself, that can be used to build proper abstractions - so you don't have to resolve to using macros in its place.