3 ms·
I think it's interesting to see a snapshot of how people were thinking in 01988 (or 01968), even if there were important things they didn't know about, so they
by kragen 6y ago
I think it's interesting to see a snapshot of how people were thinking in 01988 (or 01968), even if there were important things they didn't know about, so they weren't really at the forefront of their field. I hadn't realized Berkeley RISC[-I] was a register-window design like SPARC, for example, which adds new meaning to the fact that [Berkeley] RISC-V, led by some of the same people and explicitly named after it, isn't.
There are things for which dynamic scope is more suitable—that's why Common Lisp has special variables, after all. In TeX and PostScript it's common to change the current line width, the current font, the current color, the current clipping path, etc., and then restore it at the end of a scope with a grestore. Dynamic scope is the wrong default for local variables, of course.
I normally think of register-window architectures as being a specific optimization for lexical scoping—they save you from having to index each local variable off a frame pointer, or save and restore some register you've allocated to it—although they don't help a lot with closures. So, after reading your comment, I thought it would be interesting to see how they squared that circle. I was looking forward to the intellectual puzzle-solving tidbits!
Imagine my surprise to discover that they don't discuss the issues of lexical and dynamic scoping at all! There are fascinating and subtle tradeoffs involving both usability and performance here, but they simply don't touch on them. As far as they're concerned, it seems, Lisp functions have access to their parameters and temporaries, nothing else.
- rjsw 6y agoBerkeley RISC[-I,-II, -III (SOAR), -IV (SPUR)] all used register windows, and SPUR was specifically designed to run Common Lisp. There is a paper [1] on the design of SPUR Common Lisp. [1] https://www2.eecs.berkeley.edu/Pubs/TechRpts/1987/CSD-87-373.pdf https://www2.eecs.berkeley.edu/Pubs/TechRpts/1987/CSD-87-373...
- kragen 6y agoThank you!