> First-class functions, lambdas, and closures are mostly unheard of in the top 20 programming languages. Aside from JS, you're pretty much out of luck.
This was true at one point, but most popular languages have them now, don't they? Even C++ and Java have them now (and have for a while).
Java has a terrible hack where it is technically creating a singleton class and attaching a function to that class that is then applied behind the scenes. The Functional interface is a horrible, unergonomic hack.
Likewise, C++ basically has function pointers (though I'd hardly put C/C++ in the same category). True closures aren't really possible without garbage collection or manually specifying the closure, but at that point, the closure is just a glorified struct and loses all its ergonomic advantages.
> Java has a terrible hack where it is technically creating a singleton class and attaching a function to that class that is then applied behind the scenes.
I'm not sure why that's a terrible hack. Scheme is just creating a struct behind the scenes anyway.
I actually find Java's approach to be quite ergonomic, because you can use lambdas anywhere you need a type that has exactly one virtual method. Of course, checked exceptions destroy the ergonomics anyway.
> True closures aren't really possible without garbage collection or manually specifying the closure
Rust's closures are not as ergonomic as e.g. Scheme's, but they're not bad.
Lambdas require a SAM functional interface to be defined for the thing they are going to be used for which is hardly easy to use or ergonomic compared to something like StandardML, Lisp, or even Javascript.
Also on this topic, but all things "closed" over must be `final`. Any attempt to change the variables closed over by a class will immediately fail.
The fact that Scheme is doing all these things behind the scenes is the point. The programmer isn't responsible for creating new structs/classes, adding all the things, and sending them around to the correct functions. In languages that require all this extra work, closures are seldom used because the extra code and cognitive overhead is almost always bigger than the advantages gained.
This was true at one point, but most popular languages have them now, don't they? Even C++ and Java have them now (and have for a while).