5 ms·
I don't think there's any one knock-down criterion, but there are several small things that add up: -Scala was intended to have strong FP and OO support from d
by SatvikBeri 9y ago
I don't think there's any one knock-down criterion, but there are several small things that add up:
-Scala was intended to have strong FP and OO support from day 1
-Scala has very strong support for immutable values and
persistent data structures. It's hard to do FP efficiently without these
-Similarly, Scala has built in support for laziness to a significantly greater extent than most languages. This is arguably important because it supports immutability, there are some important mutable algorithms that have no efficient immutable equivalent without laziness
-Strong lambdas (unlike, e.g., Python)
-Many of the major Scala libraries are either written in a heavily functional style or support highly functional APIs, while libraries in most languages do not
- charlysl 9y agoInteresting points well put, thank you.
- mateo411 9y agoWhat is a strong lambda?
- SatvikBeri 9y agoNot a standard term – I'm just referring to the ability to do anything in a lambda that you can do in the body of a function, such as defining intermediate values, which is not possible in Python.
- zjarek_s 9y agoI think this is nitpicking. In python you can do everything you want in inner functions, they just have to be named. Additionaly there is simple syntax for single expressions, that don't need names. Lack of TCO is a lot bigger obstacle to using more functional style