Modeling Process
Rich Hickey
Modeling Process Rich Hickey Which are more fundamental? - - PowerPoint PPT Presentation
Modeling Process Rich Hickey Which are more fundamental? Messages, classes, encapsulation, inheritance, dispatch... Time, value, identity, state, persistence, transience, place, perception, visibility, memory, process... Coming to
Rich Hickey
Value
magnitude, quantity, number... or immutable composite thereof
Identity
associate with a series of causally related values (states) over time
State
moment in time
Time
results happen in new places
Not this!
Memory Perception Reality Logic
past
use computer memory, we’d be ill
memories
don’t replace the old
brain memory
like places
but not necessarily the same memory
time as a dimension
past
without cooperation
(pure functions*)
Observers/perception/memory
States (immutable values)
Identity (succession of states)
process functions supplied from multiple threads of control (multiple participants)
v2 Fn + args v3
23
perception
F v2 F v3 F v4 vN+1 vNs vN
AtomicReference
(swap! an-atom f args) (f vN args) becomes vN+1
24
perception
( s e n d a r e f f a r g s )
returns immediately queue enforces serialization
( f v N a r g s ) becomes vN+1
happens asynchronously in thread pool thread
F vN+1 vNs vN F F F F F
F v1 v2 v3 v4 v1 v2 v3 v4 v1 v2 v3 v4 v1 v2 v3 v4 F F F F F F F F F F F
Transactions
25
million steps?
function invocation is a waste
transitory”
v2 Proc + args v3
aTransient
P r
+ a r g s
aTransient aTransient
Make Transient (in new memory) can be O(1) Make Persistent (immutable) can be O(1)
coding again?
effected by it
leak
and transient->value functions and become ‘pure’
Pure Function Proc V->T T->V value value
threads
constructs in terms of these fundamental issues
http://clojure.org