SBCL "user-guided optimization" notice
github.com
github.com
A (possibly stupid) question: is it possible to generalize this pattern and will it bring any kind of improvements? I'm thinking that for functions shaped like (LAMBDA () X), where X is a literal object or a lexical variable, COMPILE can keep a hash-table with the X being its weak keys and the respective compiled functions being their values. Whenever a form like (LAMBDA () X) is encountered as an argument to COMPILE, it can "intern" the function in the table (if necessary) and return it.
I have no idea if it would bring any or a lot of gains besides the cases for NIL (and maybe T) because of CONSTANTLY and closures, but it's a thought that came to my mind upon first reading this commit.
Thinking of the queen of languages relegated to "a relatively niche language" really made me sad.
They're just a global enum, almost all languages have enums.
You could say that it's a global (per package) weak hash table, from my understanding.