Re:John Carmack on Mutable Variables
by SoftTalker on Friday October 31, 2025 @02:52PM
(#45775382)
JS is much more of a functional language than it was given credit for a long time. It had first-class functions and closures from day one if I'm not mistaken.
Re:John Carmack on Mutable Variables
by inopinatus on Friday October 31, 2025 @04:01PM
(#45776085)
I’m fond of saying “JS is a Lisp”. It’s not a hill I’d bother dying on, however.
Re:John Carmack on Mutable Variables
by DemocracyFTW2 on Saturday November 01, 2025 @06:39AM
(#45780631)
I'm really afraid that the weak point of the argument is really Scheme having a Lisp syntax. One might say syntax is the most superficial thing about a language but as a matter of fact it's the mud pool in front of the property where everybody's wheels get stuck and they feel their only option is to go into reverse and maybe try another day, or never. The same happens with APL; sure it's a genius who invented it and tic-tac-toe in a single short line of code is cool—doesn't mean many people get over the syntax.
FWIW I believe that JS for one would greatly benefit from much better support for immutable data, including time- and space-efficient ways to produce modified copies of structured data (like you don't think twice when you do `string.replace(...)` where you do in fact produce a copy; `list.push(...)` could conceivable operate similarly).
Re:John Carmack on Mutable Variables
by zelphirkalt on Saturday November 01, 2025 @05:29PM
(#45785576)
Doesn't even have to be true copies. Structural sharing is a thing, that enables many or most functional data structures and avoids excessive memory usage. I agree with your point, and it would put JS higher in my liked languages list.
Re:John Carmack on Mutable Variables
by waynesonfire on Saturday November 01, 2025 @08:10PM
(#45786721)
Python is like a mutation wet-dream. The language is so broken in modern times.
I think it's simply the difference between the curious mind, who explores stuff like Clojure off the job (or is very lucky to get a Clojure job) and the 9 to 5 worker, who doesn't know any better and has never experienced writing a FP codebase.