
Chris T. answered 02/11/22
Senior Software Engineer at Google, BS in Computer Science
In my experience, closure has a more formal definition in programming languages with first-class functions. In this case, a closure is a structure that stores the function as well as its environment. Its environment consists of the variables used within the function but are defined in some enclosing scope.
In C++, this can be seen with lambdas, where you can explicitly list the environment you capture:
In Rust, closures are called, well, closures :) and capture implicitly: https://doc.rust-lang.org/book/ch13-01-closures.html
There are many other languages with closures.
Blocks are used to define lexical scopes in a language. The behaviors of a block are defined by the language in question and can change or have exceptions based on name resolution, masking, and hoisting rules of the language. Note that blocks are not strictly associated with functions nor do they require environment capture.