💾 Archived View for gemini.lostleonardo.xyz › sicp › lecture-6A.gmi captured on 2022-07-16 at 13:29:46. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
"The implications of introducing assigment and state into the language are absolutely frightening. The substitution model of evaluation breaks down and we have to introduce the environment model".
A variable is not just a value, but a place that holds a value, and the value that is in that place can change. Or an expression might contain a side-effect.
A pair is no longer just its CAR and its CDR, it has identity, it is an object.
"All of these things enter as soon as we introduce assignment. This is a far cry from where we were with substitution".
This model is technically harder because we have to think mechanistically, we can't just think about it as mathematics. It is philosophically harder because what does it mean for something to change or for two or more things to share state.
There are also new kinds of bugs related sequencing and aliasing that just do not exist in a language where we do not worry about objects.
The reason we got into this mess is because we were looking to build modular systems. We wanted to build systems that fall apart into chunks that seem natural. For instance, we wanted to take a random number generator and package up the state of that random number generator inside of it, so that we could separate the idea of picking random numbers from the general Monte Carlo method of estimating something.
We would like to build in the computer, systems that model our view of reality.
Modularity is a key idea.
A different way of decomposing systems that is more like a signal processing view of the world rather than the idea of objects sending messages.
Conventional interfaces allow up to glue things together.
Map -> Filter -> Accumulate
A very general way of composing programs.