4 ms·
It is a poor functional language. List comprehensions (from Haskell) are nice, but the rest is garbage. Crippled lambdas, no currying, "match" is a clumsy stat
by nbelaf 3y ago
It is a poor functional language. List comprehensions (from Haskell) are nice, but the rest is garbage.
Crippled lambdas, no currying, "match" is a clumsy statement, weird name spaces and a rigid whitespace syntax. No real immutability.
- dekhn 3y agofunctools.partial is currying, right?
- vore 3y agoNo, it’s partial application. Currying is when a 1-arity function either returns another 1-arity function or the result.
- dekhn 3y agohmm... that just sounds like a specific case of recursive application of partial functions? At least that's how I interepret the wikipedia explanation: "As such, curry is more suitably defined as an operation which, in many theoretical cases, is often applied recursively, but which is theoretically indistinguishable (when considered as an operation) from a partial application." (while I see partial as having value, I'm struggling to see if currying would really be a useful addition to a scripting language)
- bloaf 3y agoI use the toolz package for currying and a few other conveniences. That plus named tuples and a little discipline gets me 80+% of the benefits of pure functional. The biggest thing to me wasn't in your list: lack of tail call optimization means you have to be a bit careful about where you use recursion. I personally think long anonymous functions are an anti-pattern, naming your functionality is great for readability. I learned this from Wolfram language which makes heavy use of anonymous functions, I would often find myself returning from lunch to find my code which was perfectly clear that morning had become unintelligible. Today I try to limit anonymous functions to re-ordering arguments or "picking" functions that pull simple values out of more complicated data structures.
- yakshaving_jgt 3y agoIIRC, Haskell’s list comprehensions are lifted from Erlang.
- pedrow 3y agoI believe they were based on Miranda[0] (1985) but they have a longer history than that, maybe under a different name. [0]:https://en.wikipedia.org/wiki/Miranda_(programming_language)#Overview https://en.wikipedia.org/wiki/Miranda_(programming_language)...