5 ms·
C/C++ have not fallen to the wayside but most major programming languages have now inherited quite a few functional paradigms. I haven't kept up to date, but do
by short_sells_poo 6y ago
C/C++ have not fallen to the wayside but most major programming languages have now inherited quite a few functional paradigms. I haven't kept up to date, but don't both C++ and Java have lambdas now? Don't they also feature currying? C++ is of course not Haskell, but that's not the point. Functional programming has become commonplace by procedural languages adopting the simpler/most-useful aspects.
- cies 6y agoIf it's not null-safe I will avoid it for new projects. Lambda's: great! But real null-safety, strong type safety, proper sum types, pattern matching/ type destructuring, are now my requirements. I'd say Kotlin is the language with the most adoption that ticks the boxes. And it is (not surprisingly) an OO lang.
- dunefox 6y ago> I'd say Kotlin is the language with the most adoption that ticks the boxes. How? Kotlin is decisively an object oriented language.
- sk5t 6y agoKotlin pattern matching and destructuring/unapply support are pretty weak, no?
- gher-shyu3i 6y agoYes, Java's pattern matching is much more fully fledged than Kotlin's. You can destructure nested types. Also, at some point in the (near) future, you should be able to do things like: Object o = new int[]{1, 2}; if (o instanceof int[] {var a, var b}) { // a == 1, b == 2 }
- gher-shyu3i 6y agoIncidentally, pattern matching that Java is getting is superior and more fully fledged to the one that exists in Kotlin. You can also have null safety in Java by means of annotations. You can also check out C# since it fits your requirements. It has pattern matching, but sum types are still in the works.
- cies 6y agoI've grown a strong dislike for annotations. One here or there is not the problem, but they will be used (I'm looking at you Spring) to add magic to my programs. I want to know what goes on; annotation hide what goes on. Debugging problems with annotations is a real pain. I like that in Kotlin the community seems to fight overuse of annotations (also they fight overuse of Exceptions which I really like: Exceptions are not a way to do multiple return values, sumtypes are).
- cies 6y agoOn sum types in C#: https://www.reddit.com/r/csharp/comments/7b8mvn/have_sum_types_ever_been_considered_by_the_c/ https://www.reddit.com/r/csharp/comments/7b8mvn/have_sum_typ...
- Zababa 6y agoI don't know about the currying, but Java has already lambda and optionals, and is getting immutable records, sealed class (product and sum types), pattern matching and type inference in Project Amber [1]. They all are features usually found in functional languages (Standard ML for example). [1]: http://openjdk.java.net/projects/amber/ http://openjdk.java.net/projects/amber/