If I'm understanding what you're calling first-class scope, then Lua's environments would count as a well-developed language with first class scope. Sandboxing Lua (outside of Luajit) is trivial, for example, because you just bind a given environment to a given function. [0]
Scope in my scripting language is also similar - you can definently touch it. That's how "set!" allows you to create a variable, for example. Assignment isn't special. set! is reaching into the scope above itself to place the variable, otherwise it wouldn't be accessible after the set! call. But it is just a function call. (And there's a couple other things like scopedepth to help you index a given scope).
Thank you for the pointer to Lua! Will have a look.
Yes, "scope" is in the end the evaluation environment of some funktion. Usually it's not a first-class object in a particular language, and only available implicitly.
Having it first-class would mean being able to directly manipulate and pass function environments.
Like I said, I'm not sure this makes sense at all. But maybe it could open up some possibilities.
(I came up with the general idea when thinking about what the "implicit scope" in Scala is, or could be seen as).
Scope in my scripting language is also similar - you can definently touch it. That's how "set!" allows you to create a variable, for example. Assignment isn't special. set! is reaching into the scope above itself to place the variable, otherwise it wouldn't be accessible after the set! call. But it is just a function call. (And there's a couple other things like scopedepth to help you index a given scope).
[0] https://www.lua.org/pil/14.html