History of T (2001)
Being an extremely young programmer (I&#x27;m 35), I had never quite understood what &quot;dynamic scoping&quot; is - the whole idea that scoping can somehow be done differently than &quot;like in all the languages&quot; was foreign to me until a few minutes ago. If you&#x27;re an ignorant youth like me, here&#x27;s some clarification.<p>Wikipedia&#x27;s description is horrid, but C2&#x27;s[0] is a gem:<p>&quot;In <i>dynamic</i> scoping, by contrast, you search in the local function first, then you search in the function that <i>called</i> the local function, then you search in the function that called <i>that</i> function, and so on, up the call stack. &quot;Dynamic&quot; refers to <i>change</i>, in that the call stack can be different every time a given function is called, and so the function might hit different variables depending on where it is called from.&quot;<p>Sounds totally insane to me and I wonder how people made working software at all in the &#x27;80s. That said, I get happy when I remember that people often complain about how horrible it is that $OBSCURE_AWESOME_TECHNOLOGY never made it and how $TRENDY_FAD solves the same problem so much less elegantly. I mean, apparently an $AWESOME_TECHONOLOGY sometimes does win, against all odds - in this case lexical scoping. Yay Guy Steele!<p><a href="http:&#x2F;&#x2F;wiki.c2.com&#x2F;?DynamicScoping" rel="nofollow">http:&#x2F;&#x2F;wiki.c2.com&#x2F;?DynamicScoping</a><p>EDIT: I just realized that shells copying all environment variables into child processes is basically a present-day example of dynamic scoping (although, fortunately, without mutation - we&#x27;d have entire data centers <i>on fire</i> if you could mutate parent process envs). It gives me a slightly better idea how this stuff could be used to make working software.