3 ms·
A language designed for modifying programs while they run. Common Lisp and Smalltalk are languages designed to support modifying programs while they run. It's
by mikelevins 8y ago
A language designed for modifying programs while they run.
Common Lisp and Smalltalk are languages designed to support modifying programs while they run. It's the standard way to develop a program in old-fashioned Lisp and Smalltalk systems: you start up your language runtime and then teach it, incrementally and interactively, to be the application you want.
Interactive repls are pretty common nowadays, but a repl is not the same as being designed to support programming-as-teaching.
Consider the Common Lisp generic function UPDATE-INSTANCE-FOR-REDEFINED-CLASS. It's in the language standard. It provides an extensible mechanism that the runtime uses to update existing instances of a class when the class is redefined.
Why would you ever want such a function at all, much less want it to be part of the language standard?
Because the authors of the Common Lisp language standard were experienced Lisp hackers. They took for granted that the way you write a program is you start your Lisp and then interactively teach it how to be the application.
You don't want to have to stop the program and rebuild it just because you redefined a class. That's silly. The runtime should know how to update any existing instances to reflect the new definition, because telling the Lisp new definitions as it runs is the standard way that you normally work.
Old-fashioned Lisp and Smalltalk systems are full of features that make this assumption--that you build an application by interactively teaching a running program how to be the application. As far as I know, they're the only development systems designed with that assumption (although, if Racket has such features and I overlooked them, I'd be glad to know it!).
If you're not familiar with that style of programming (and I think most programmers are not), or if you don't prefer it, then something like UPDATE-INSTANCE-FOR-REDEFINED-CLASS makes no sense. On the other hand, if you prefer that way of working, as I do, then the absence of features like UPDATE-INSTANCE-FOR-REDEFINED-CLASS is as uncomfortable as a missing tooth.