All programming languages have globally defined symbols. While best practices invariably abjure their use as mutable entities the philosophy of what is mutable and what is not mutable is highly context dependent. Technologies like JIT compilation and type inference generate code on the fly based on the context in which symbols are dynamically referenced.
This makes me wonder exactly how far can this be taken. Have languages been researched that are oriented around embracing global references?
For an example of what I'm thinking of, in Perl there is a "local" command that allows you to save the value of a symbol that is global to the current dynamic scope, modify the symbol as though global within that scope, and automatically restore its prior global value upon return. This differs from ordinary concepts of local variables in that the nested dynamic scopes inherit the binding. It also means that all code references, as well as data references, would be potentially dynamic.
I'm sure features other than a Perl-like "local" would be necessary to make it more wieldy (or less unwieldy for programming in the large, as the case may be). An example of a more powerful dynamic scoping feature would be Javascript's "with" statement which allows unqualified references (without the object reference itself being repeatedly specified) to the properties of an object within the "with"'s dynamic scope.
The point here is that there are different ways of attacking the problem of programming in the large and some may be more conceptually clean than others in the sense of Ockham's Razor in that there is no escaping global symbols so we may as well make the best of them.
In more abstract terms, Quine suggested a similarly radical approach, at least in spirit, to applying Ockham's Razor in formal logic's use of the "name":
“Chief among the omitted frills is the name. This again is a mere convenience and is strictly redundant, for the following reasons. Think of ‘a’ as a name, and think of ‘F(a)’ as any sentence containing it. But clearly ‘F(a)’ is equivalent to ‘(∃x)( a = x & F(x))’. We see from this that ‘a’ need never occur except in the context ‘a =’. But we can as well render ‘a =’ always as a simple predicate ‘A’, thus abandoning the name ‘a’. ‘F(a)’ gives way thus to ‘(∃x)(A(x) & F(x))’, where the predicate ‘A’ is true solely of the object ‘a’.
“It may be objected that this paraphrase deprives us of an assurance of uniqueness that the name has afforded. It is understood that the name applies to only one object, whereas the predicate ‘A’ supposes no such condition. However, we lose nothing by this, since we can always stipulate by further sentences, when we wish, that ‘A’ is true of one and only one thing:
(∃x)A(x) & ~ (∃x,y)(A(x) & A(y) & ~(x=y) )”
“(This identity sign “=” here would either count as one of the simple predicates of the language or be paraphrased in terms of them.)”
PS: Part of the reason I ask this question is that I did a multitasking/multiuser OS on the 8088 back in the mid '80s that had a "push and set" macro that I used extensively to create very compact code that, it seemed to me, ran quite fast. This was a small system -- under 25,000 lines of code -- but it did work well in it specialized function as a 24 user instant messaging/bbs system.