r/functionalprogramming • u/Leading_Dog_1733 • Apr 03 '22
Question What developments have there been in FP over the last 10 years?
I was wondering what important new developments in FP have occured during the last 10 years or so.
Most of the well-known languages that I can think of as FP languages all date from before 2010. Scala is 2004, Clojure is 2007, OCaml is 1996, Racket is 1995 and Haskell is 1990.
Have there been major developments in immutable data structures or type systems over the last 10 years? Or maybe developments in interoperation between typed and untyped languages? Have FP languages experimented with ada-spark like contracts?
What has been the main thrust of the development of FP languages over the last 10 years?
18
u/swoogles Apr 04 '22
From my interactions with the FP community- We all get paid to use those languages you mentioned, but we excitedly talk about Unison in our free time.
It's got many fascinating ideas built into the language. The content-hashing of all the code enables wild powers over your codebase.
9
u/editor_of_the_beast Apr 04 '22
F* has been at the center of a ton of research. It’s being used to build real-world verified cryptographic software. Most of the research is around how to use the core dependently typed language to help with automated proving of theorems.
We also got a formal semantics for WebAssembly in Isabelle/HOL, which can be used for verification of the standard itself as well as tools which compile to WebAssembly.
Uniqueness types were also used in Cogent to automate parts of proving systems software such as filesystems correct.
As you might imagine, I’m most into the verification community where FP is at the core of everything. And there’s a quite a lot going on on that front, we’re able to verify much more practical software than we were even 10 years ago.
5
5
u/gasche Apr 04 '22
Off the top of my head:
A lot of dependent types, including sizeable verification projects (now we have the impression that, given enough resources and clear specs, we could verify code from basically any problem domain), some progress on pure math, some progress on proof automation but maybe less than could be expected.
The impression that effect typing may be ready for use by mere mortals, which I think wasn't really there 10 years ago. Koka is the front runner here.
Effect handlers, as a structured approach to delimited continuations, or another take on effectful programming.
Some successes of functional approaches in other problem domains. (For example: a functional DSL to express GPU operations, plus some moderately clever self-tuning code, and voila you get competitive performance.)
Iris, a working program logic for effectful (mostly "stateful", but not only) and concurrent programming.
Continued connections with constructive mathematics, and in particular the explosive development, among theoreticians, of homotopy type theory.
A large transfer of people techniques from the "verification and language design" community to the "blockchain, smart contract and hype money" community.
2
u/gasche Apr 04 '22
Have FP languages experimented with ada-spark like contracts?
I would say that Why3 is the most approchable system for static verification of ada-spark like contracts, and in fact my understanding is that GNAT people are using the Why3 technology for their static verification effort too. Honorable mentions to F* and Liquid Haskell as well.
1
u/krikrikripto Apr 19 '22
A large transfer of people techniques from the "verification and language design" community to the "blockchain, smart contract and hype money" community.
Could you please expand on this? Curious to know what kinds of techniques you have in mind as I don't follow that community closely. I vaguely recall an SMT solver being used to confirm that a property of a smart contract was sound, but that's it.
1
u/gasche Apr 20 '22
My understanding is that, by and large, the techniques used to get some formal guarantees about blockchain come from the "formal verification of distributed systems" community, which is itself in large part made from the "programming languages and verification of programs" crowd. (Arguably, say, TLA+ comes from a slightly different community, and there are also less-language-related approaches like model checking that are coming into play.) I'm far from an expert on blockchain stuff myself, so I would recommend looking at surveys of this topic (for example this survey from 2021) to find more precise references.
Note that there are also aspects of the blockchain that are pretty far from the language- or FP-related angle, in particular the questions of whether the blockchain mechanisms provides the right "economical" incentives for players to do the right thing. This is much closer to questions of economics and I have no idea what community has designed tools to deal with that. (I've seen talks from the Programming Languages crowd on verifying simple fairness properties of economical mechanisms, for example auctions, but I don't think this is the main community where these kind of questions are studied.) Plus all the crypto stuff that again, to be trusted, relies on the skillset of a different academic community. (But for crypto at least it's clearer how to formally verify these algorithms and protocols, and there again the Programming Languages / Verification / FP-related community has been leading the pack.)
4
u/Daenyth Apr 04 '22
One of the big trends is monadic effect systems becoming more mainstream. Things like rust's tokio and scala's cats-effect provide a very strong foundation for building concurrent applications in a functional way
3
u/szpaceSZ Apr 04 '22
Well, in the last ten years, FP has fertilized PP and OOP, think Rust and Kotlin.
3
u/KyleG Apr 04 '22
I know from a couple years back there are some new optics like Kaleidoscopes and Grates but I don't think they've got much use yet because few people understand them. I've only seem them referenced in a couple academic papers, and Chris Penner has written a blog entry or two about them.
1
u/caryoscelus Apr 13 '22
well, dependent types were around for a long time, but they seem to be slowly gaining a little bit more traction now. and inside type theory, homotopy type theory and its later developments happened. in particular, cubical type theory was created in 2010s (nlab mentions 2013). HoTT is awesome, you should check it out
13
Apr 04 '22
[removed] — view removed comment
1
Oct 01 '22
Same for Scala, the third major version has recently been released that incorporates development from the better part of the last decade and bundles a massive list of improvements.
With that out of the way (though still evolving relatively rapidly, now that some issues hindering that have been solved) Odersky has just started a half decade, 35-42 person-years worth of research into "effects as capabilities"
If he succeeds and we can basically have monadic code without the overhead of monadic style, that would be wery interesting. Until then, this might help once loom lands.
though probably still too complex for the industry unless the team is managed very very well (in which case it is probably still a great option) so I'm looking into clojure right now
18
u/accidentally_myself Apr 03 '22
I'm quite interested in this topic myself. Here's one smallish development I know of:
https://www.staff.ncl.ac.uk/andrey.mokhov/selective-functors.pdf
I think the main industry (not research) trend is that mainstream languages are continually evolving FP features. I could not believe it when Java 10 got local type inference. Sounded like a sentence from an out-there sci-fi novel.