News for hackers. Stuff that matters.
Re:Introducing "Functional JavaScript" by k3n on Wednesday March 20, 2013 @10:42AM (#5407516)
That would highly depend on if you're writing performance-sensitive code, and I doubt most JS would be greatly affected by these paradigms.
Re:Introducing "Functional JavaScript" by MBlume on Wednesday March 20, 2013 @11:24AM (#5407791)
lack of TCO doesn't mean it's a little slow, lack of TCO means that naive use of classic functional patterns blows the stack for big lists/structures/arguments.
Re:Introducing "Functional JavaScript" by fogus on Wednesday March 20, 2013 @11:59AM (#5408065)
By "classic functional patterns" you mean recursion. There are other ways to implement functions that are "classically functional" using techniques other than recursion, that do not blow the stack. I'll talk about each and their tradeoffs.
Re:Introducing "Functional JavaScript" by gngeal on Wednesday March 20, 2013 @01:28PM (#5408746)
It's not just recursion, it's calls in general, I guess. (There are other ways of being space-inefficient in functional programs, see the odd versus even streams issue in Scheme.) Are you going to mention tail calls in ES6 in your book, BTW?
Re:Introducing "Functional JavaScript" by fogus on Thursday March 21, 2013 @08:07AM (#5414463)
Sorry for the late response. I will not cover ES6 tail calls very much at all except to mention the possibility for inclusion.
Re:Introducing "Functional JavaScript" by MBlume on Wednesday March 20, 2013 @12:57PM (#5408502)
I did also say "naive use" =) Looking forward to the book.
Re:Introducing "Functional JavaScript" by k3n on Wednesday March 20, 2013 @12:14PM (#5408166)
Right, but is this a concern for most JS?

I realize that JS is becoming more popular for various tasks -- not always relating to the web -- but still, I kind of doubt that 99% of the JS out there is going to run up against these types of problems. Perhaps something like Uglify.js or similar might, but then again, if you're implementing a parser (or any other static code analyzer/tool) then you're probably going to avoid most libs to start with.