On Thursday, 1 September 2016 at 08:04:00 UTC, Bienlein wrote:
D has a lot to offer with regard to functional programming. It has pure functions and true immutable classes (true = also sub objects become immutable), which Scala all doesn't have (because of restrictions of the JVM). Does D have tail call recursion optimization? I don't know, actually. If D had that and pattern matching, it would beat Scala with all it's hype by a big leap.

D does not guarantee tail calls, but the compiler might sometimes decide to do it. Functional programmer usually want to guarantee, so they don't have to write a loop. The downside of TCO is that the stack trace is missing frames, which can be very confusing.

D has no syntax for pattern matching, but some library support:
https://p0nce.github.io/d-idioms/#Recursive-Sum-Type-with-matching

Reply via email to