October 2019

When starting a thread under local scope, the thread's variables will eventually need to get bound. In a language with GC this happens without the user doing anything, since the local scope remains accessible to the thread. But it comes at the cost of having GC in the language, to free the local scope when the thread finishes.

How can a language start a thread under local scope without GC? In the same way it can have lexical scoping without binding free variables: by generating the thread's source code at runtime with backquote and calling eval. This binds copies of the free variables of the local scope (and higher scopes) and still lets the thread access the global environment.

I should admit I wasn't aware when I started that lexical scoping without binding free variables, and as a result multi-threading without GC, are two more things a function can't do that a macro can.