Here's an example of what I mean, a Promises/A+ implementation in less than 100 LOC - just for the fun of it: https://github.com/djfm/promesse/blob/master/lib/promise.js
I think it kinda feels like Haskell, yet browsers understand it :)
Here's an example of what I mean, a Promises/A+ implementation in less than 100 LOC - just for the fun of it: https://github.com/djfm/promesse/blob/master/lib/promise.js
I think it kinda feels like Haskell, yet browsers understand it :)
I feel the same way. And since you can write a cruddy jQuery mess that fetches data and spits out to backend-as-a-service providers, Javascript is hands down the easiest way to go from nothing -> project others can use.
The ecosystem is in a bunch of growing pains right now, but if you don't care about maintainability and scaling up to a large project, just throw up an HTML page with some styling and javascript that makes it interactive.
My #1 pain point with functional JS though, is that using a persistent data structure library like ImmutableJS or Mori removes the ability to use some of the awesome new syntactic sugar introduced in ES6 like the spread operator, destructuring, etc, for making code less verbose. So you have to make that tradeoff between being able to use a succinct syntax for common operations vs having the optimal performance in terms of memory efficiency and garbage collection pressure.
I'd really love to see native persistent data structures as a first class citizen in JS so they can make use of all new language features. Until then, I'll probably continue to choose ClojureScript for my own projects.
That said, if you want something more ML-like in your JS, Flow is an increasingly-viable option: https://flowtype.org/
What does this mysterious assertion mean?