4 ms·
(1) keeps cropping up but these new languages are hardly "FP" or even using "FP" features. I think we give FP research way too much credit. Pure functions? No,
by thu2111 6y ago
(1) keeps cropping up but these new languages are hardly "FP" or even using "FP" features. I think we give FP research way too much credit.
Pure functions? No, none of those languages can even express the concept except maybe C++ with the const keyword (which is as old as Haskell itself).
Immutable data structures? Even very modern languages like Kotlin don't really have them. You can define a data structure where the fields are immutable after construction but it's not transitive. There are read only collections but not immutable collections, without doing extra work. Maybe immutable collections will turn up at some point, there's a proposal to add them, but it'll just be a library not a language feature.
Type inference? New languages don't use full blown Hindley-Milner TI, they do much more limited TI that's designed to strike a balance between readable error messages, documented APIs, IDE performance and so on. Meanwhile the concept of TI is obvious and required no inspiration from anywhere - anyone who ever looked at source code will be struck by the repetition required.
Generics? C++ templates started being discussed in 1985, and it's again a pretty obvious concept that would occur to anyone who wanted to offer type safe collections.
I honestly can't see the huge impact FP supposedly had on mainstream programming. All the ideas its advocates try to claim for their own are either not used, or are obvious but usually not implemented the same way. My guess is if Haskell had never existed modern languages would look exactly the same.
- fulafel 6y agoMany FP languages also lack these. Try these: closures, first class functions, garbage collection, anonymous functions.
- thu2111 6y agoAll except first class functions are found in Java. I don't think many people would claim Java is an FP language.
- fulafel 6y agoI think the discussion is in danger of going the way of a Möbius strip... Language features originating in FP have been adopted by GP languages, which was the point :)
- thu2111 6y agoBut those features were found in Java 1.0 so the influence can't be that strong, given it was heavily advertised as an object oriented language at the time.
- fulafel 6y agoFrom the list, only GC was in early Java. GC was popularized by Lisp (was added in the 60s?) and other FP languages like ML (had gc from the start in 1973) decades before.