[cap-talk] Capabilities and Freedom vs. Safety
James A. Donald
jamesd at echeque.com
Sat Jul 28 06:26:23 EDT 2007
James Donald:
>> Similarly, if Microsoft was an object cap programming
>> environment, all the capabilities objects would be
>> initialized at startup to the extent that this was
>> possible, and stuffed into the "theApp" object, where
>> all their capabilities would be ambient to all the
>> code, with the result that all the advantages of
>> writing programs in a purely object capability
>> language would be eliminated.
David Wagner wrote:
> It's possible I misunderstood what you are describing,
> but I don't think that true objcap languages actually
> let you do that. That's just not expressible in
> objcap languages, as far as I know.
E has classes. You can put a big pile of stuff in a
class. Classes have methods. Declare a great big class
CtheApp, which contains a great big bunch of methods
(most of your application, including all the default
methods generated by Microsoft's IDE), and a great big
bunch of objects (all the default objects that any
routine Microsoft project uses). Hey presto, all the
many objects that you have stuffed into this great big
object "theApp" are global to all its methods, defeating
locality of data - thus making all capabilities ambient.
Most of your other classes have a reference to your
theApp object, and therefore all the objects are also
global to all their methods - not that it matters, as
the vast majority of your code consists of methods of
the object "theApp"
That is the code that the Microsoft IDE generates by
default for most cases.
If you have classes and objects, you cannot a single
class from swallowing up most of the application, and by
default, 99% of the code in a typical Microsoft program
are methods of single big object, or methods of classes
that contain a reference to this single big object which
is by default called "theApp"
Further, E is worse than C++ in this regard, because
method arguments are as durable as their object - it has
*less* locality of data than C++, and the locality that
C++ has can easily be defeated by making your
application into a single honking big object - which is
what the Microsoft IDE does by default.
More information about the cap-talk
mailing list