News for hackers. Stuff that matters.
Re:Principles of Rich Web Applications by mrbrowning on Wednesday November 05, 2014 @01:31AM (#8560736)
Immutability-by-default is a necessary, if not sufficient component of the semantics of Scheme that is lacking in JavaScript, and it's that same lack that leads me to think that any comparison between the two languages is basically spurious.
Re:Principles of Rich Web Applications by nostrademons on Wednesday November 05, 2014 @02:44AM (#8560872)
Scheme certainly has mutability, through set!, set-car!, set-cdr!, and procedures based upon them. It's not the default - you always know when you're mutating something - but then, there's a pretty direct syntactic translation into Javascript, where = without a var always means you're mutating something.

Why is this important for students, anyway? Shouldn't they be exposed to mutability fairly early on?

Re:Principles of Rich Web Applications by mrbrowning on Wednesday November 05, 2014 @04:43AM (#8561103)
It's not important for students, I just dispute the notion that JavaScript has any special affinity with Scheme beyond that of any other language with first-class functions. Anyway, the major advantage of immutability by default is that it enables under-the-hood optimizations like structural sharing that make FP the paradigm of least resistance. To the extent that JavaScript doesn't do that, it doesn't really deserve to be called a functional language any more than e.g. Ruby.