Skip to content
dann toliver edited this page Feb 27, 2014 · 2 revisions

This week: Local state!

  • slow recap intro

  • Mεταβάλλον

  • "We saw how primitive procedures and primitive data are combined to construct compound entities" -- how?

  • "abstraction is vital in helping us to cope with the complexity of large systems" -- 1.1 language guide, locke quote, what abstractions have we seen so far?

  • "Effective program synthesis also requires organizational principles" -- why? haven't we already seen modular designs like data-driven programming?

  • "modeling physical systems, is to base the structure of our programs on the structure of the system being modeled." -- read paragraph. seems so simple -- what could possibly go wrong?

  • oh, wait... we can look at the same physical system in multiple ways. oops. two opposing world views: objects and streams. read the paragraph. amazing.

  • "The difficulties of dealing with objects, change, and identity are a fundamental consequence of the need to grapple with time in our computational models. These difficulties become even greater when we allow the possibility of concurrent execution of programs." -- incredible. it's like they're inside my MIND.

  • "The stream approach can be most fully exploited when we decouple simulated time in our model from the order of the events that take place in the computer during evaluation." -- wat.

AMAZING.

  • "In a simple banking system, we could characterize the state of an account by a current balance rather than by remembering the entire history of account transactions." -- event logging / CQRS / datomic /

  • "If we choose to model the flow of time in the system by the elapsed time in the computer" -- as opposed to...?

  • " In particular, if we wish to model state variables by ordinary symbolic names in the programming language" -- what other way is there?

  • "A call to a procedure computed the value of the function applied to the given arguments, and two calls to the same procedure with the same arguments always produced the same result.1" -- pure functions, random/put-get

  • set! -- video (Leo)

  • begin

  • new-withdraw: it returns a lambda... which somehow eats the argument? this seems somehow strange. what are the implications for our evaluation strategy? (a b c) -- if a return a lambda when evaluated and b returns a lambda when evaluated does b eat c or does a eat b and c? i mean a eats b and c but you don't know that until runtime? racket throws an error on arity-mismatch... but it's an exclusively runtime error, because you don't know arity until you evaluate that instance and if A returns a lambda taking one arg and eats B and then that lambda returns a lambda that eats one arg would it eat C??? so it really should be ((new-withdraw) 10) but that doesn't work. sugar?

  • 300.4: hiding principle... a way to formally enforce abstraction boundaries?

  • oddly, make-withdraw makes a lot more sense: it's just a closure

  • lightening talk on Kolomogorov complexity?

  • 309: "The general phenomenon illustrated by the Monte Carlo example is this: From the point of view of one part of a complex process, the other parts appear to change with time. They have hidden time-varying local state." -- read both paragraphs, good stuff!

  • referential transparency (“equals can be substituted for equals”)

  • 'Thus, we cannot determine “change” without some a priori notion of “sameness,” and we cannot determine sameness without observing the effects of change.' -- whoa. car driving down street on different days... inherent temporality. huh.

  • aliasing and side-effects...

  • identity vs value: "This complication is a consequence, not of our program- ming language, but of our perception of a bank account as an object. We do not, for example, ordinarily regard a rational number as a change- able object with identity, such that we could change the numerator and still have “the same” rational number."

  • functional programming means "programming with pure functions", imperative means "programming with assignment" -- is that generally accepted?

  • recursion allows us to program without assignment!! less surface area for bugs. exciting!

Clone this wiki locally