- CoffeeScript + Underscore: I’ve seen some examples using CoffeScript + Underscore which seem appealing. For example: http://autotelicum.github.com/Smooth-CoffeeScript/SmoothCoffeeScript.html#toc-Chapter-7
- Livescript: Derived from Coco (which itself was derived from CoffeScript), it has the more appealing syntax to me (it even has my beloved pipeline ‘|>’ operator from F#). The pros are that it is the most functional like approach. The cons would be that it isn’t very spread (I made a search in SO and there’s really NOTHING regarding it) and all that implies (not much community, support, tutorials, etc).
Thanks a lot!
I’m probably a bit biased (I am the creator of LiveScript), but you should try LiveScript! I’m currently working on a standard library for it that will integrate better than underscore. As you say, there aren’t that many people using it yet, but a community has to start somewhere! As you’ve pointed out, it seems like the best option all other things being equal – so take a dive and try it!
You basically have two options:
- Use a JS-derived language like CoffeeScript
- Use a functional language to JS compiler
For option 1, well, it’s probably your best option for interoperability with other JS code. It’s also your best option if you actually want to work with other JS developers who may not be familiar with
<insert functional language>.
If you aren’t actually very familiar with JS, I would suggest option 1. It may be tricky to understand how things work especially if you run into bugs in the language/tool of your choice if you don’t understand the JS underpinnings.
Option 2 can be more interesting to use as you would probably get the benefits of your favorite language into JS. In addition to the Pit project you mention, there are some attempts at making Haskell compile into JS which could also be an option.
Option 2’s downsides are probably the fact the projects aren’t (afaik) very advanced to this day yet and that it may compile into not very efficient JS code.
Lastly, there was some Haskell-style language which was based on JS, similar to CoffeeScript, but I seem to have forgotten its name. It might be worth a shot, if someone can figure out what it was called 😀
And what about just a library of “”FUNCTIONAL”” functions , + coffeescript + underscore 😉 !