7 ms·
Can you be more specific about how LiveScript is nothing like Haskell? Granted that LiveScript isn't Haskell, how are the syntactic features that are derived f
by jaekwon 14y ago
Can you be more specific about how LiveScript is nothing like Haskell?
Granted that LiveScript isn't Haskell, how are the syntactic features that are derived from Haskell not at all like Haskell?
- tikhonj 14y agoWhich parts of the syntax are like Haskell? As far as I can tell, the syntax for calling functions is similar to Haskell, but that's about it. Maybe some of the operators are vaguely like Haskell's, except they're baked into the language instead of being definable by the user. The vast majority of the syntax seems based on CoffeeScript.
- GeZe 14y agoLiveScript has many features over CoffeeScript that may not exactly be as in Haskell, but are inspired by it. You can define curried functions, use partially applied operators (addTwo = (+ 2)), use operators as functions (sum = fold1 (+)), use infix functions, ("hi" `startsWith` 'h'), compose functions (h = f . g), have proper list comprehensions, and its standard library, prelude.ls, is based off of Haskell's Prelude module (inclusion is optional though if you want to use underscore.js or something else). For more information check out http://gkz.github.com/LiveScript/blog/functional-programming-in-javascript-using-livescript-and-prelude-ls.html http://gkz.github.com/LiveScript/blog/functional-programming...
- spacemanaki 14y agoLiveScript is really only like Haskell in some syntax and naming of some functions. The defining characteristics of Haskell (to me, bear in mind I'm a Haskell noob) are strong, static, inferred types, and an emphasis on pure or near-pure functional programming (limiting side effects as much as possible). The defining characteristics are not a standard library function named "fold" or "takeWhile". LiveScript has JavaScript semantics, like CoffeeScript. These semantics differ from Haskell in deep and fundamental ways. Yes, it might also encourage functional programming, but so does Scheme and Clojure, both of which are really nothing like Haskell either. I don't think this is controversial.
- yoklov 14y agoIt's far enough away in terms of semantics that it's not particularly relavent. I'm haven't written much Haskell, but from what I can tell, Haskell is really all about the types. And the laziness. And the purity (which is all about the types). It's missing most of the the things that make Haskell Haskell, and not another functional language. It borrowed some syntax, but from what I can tell, it's much closer semantically to Scheme.