3 ms·
Classes are fine! Inheritance isn't. You can mostly avoid using it, though. JS lacks homoiconicity and thus can't have a lot of nice things a Lisp dialect woul
by nine_k 7y ago
Classes are fine! Inheritance isn't. You can mostly avoid using it, though.
JS lacks homoiconicity and thus can't have a lot of nice things a Lisp dialect would, notably macros.
With what we've got, I have more hope on JS eventually migrating towards a (more) statically typed language with ML influence; typescript sort of leans towards it, slowly.
- sli 7y agoYou're right about Lisp features, but CLJS macros are kind of bad at the moment. I have a fairly simple macro that works just fine in Clojure but does not compile in ClojureScript and I can't figure out why. It's probably a side-effect of how macros are handled in CLJS (they're part of a different compilation stage and must be written in CLJ or CLJC, hence :require-macros instead of just :require). If you're looking for an ML, check out ReasonML. It's really quite good, its output is quite good (and hotfix friendly), and its type system is far better than TypeScript's will ever be. Mostly because TS wants to stay close to JS. Too close, in my opinion.