[erlang-questions] Theoretically Stuck
Jay Nelson
jay@REDACTED
Wed Sep 6 08:46:34 CEST 2006
Richard O'Keefe wrote:
> And in Self an object may acquire new slots at any time without
changing its identity.
Coming from Lisp, I always wondered why C and C++ required a storage
location (variable) to have a type but the data or object had no sense
of self. The old joke was "Why, if I take my laptop to the library,
does it become a book?"
It seemed natural to me that data have immutable identity and storage
locations be just that: empty addresses that are references to where
something (anything) is stored. Why is it hard to ask an object what
type it is, and why should its type identity change just because someone
moves it to a different location?
I used to want to create an object system where objects are as Richard
describes in self. They would have identity and that's it. There would
be "bundles" of related functionality that could be added or removed
from individual objects at any point of the execution or depending on
who was accessing the object, so that things like security or
concurrency would be trivial -- just take away all the write access
bundles. I even toyed with creating Aspect-Oriented Erlang which was
process per object with meta-messages to add and remove bundles
(aspects). Bundles implemented methods as message handlers. (The
biggest trick to a new OO paradigm is to avoid the existing terminology
so that people don't get confused with the new twist on a term that they
already have ingrained as a particular implementation and meaning.)
Fortunately, I came to my senses and started thinking in the erlang way
again. I have already done my stint in the OO world and solved the
problems there, but found the code tedious and verbose. I am now back
to functional (which I like more than any other type of code for most
problems) and am trying to come up with succinct solutions to problems
that previously seemed to be too complicated to solve clearly.
I do believe that erlang would make a good platform for experimenting
with implementations of other languages and for doing simulations, but I
haven't ventured into any problems in those spaces.
jay
More information about the erlang-questions
mailing list