2011-07-30

references for security and speed

7.9: adda/oop/references for security and speed:
. notice how oop would rather
create a new object and modify a pointer
than modify the value of a current object .
. I call this the "(pervasive pointers).

. from an encapsulation view there is no diff',
since only the owning type
can do these mod's .
. what it does seem to uniquely do though,
is encourage the sharing of objects;
ie, if you can modify your value
then I have no interest in sharing its object
because it's no longer synonymous with
the intended value at some past time .
--
. oop is doing for every value
what c does only for arrays .
7.10:
. it does promote strong
capability-based security;
because if everything is through reference,
and ref's are encryptable,
then that is a much stronger encapsulation
unless the system is already protected
by allowing only system-compiled code .
7.11:
. another interesting property of
pervasive pointers
is that by comparing pointers,
one can tell quickly whether
even huge structures are identical;
though if the pointers aren't equal,
they might still represent equal values .
. python has a speed hack where the
first 100 ints have reserved pointers
so in the many loops controlled by small ints,
pointer compares are decisive .