|
|
Darren New schrieb:
>>> Actually, Ada can do this too, I'm pretty sure, even without using
>>> its OO features.
>>
>> "Non-OO mainstream (imperative) language"?
>>
>> These languages all don't appear to fit that bill.
>
> You don't think Ada or Tcl is mainstream? Just because you haven't run
> into them doesn't mean they're not widely used.
My copy of Wikipedia categorizes Tcl as "multi-paradigm:
object-oriented, functional, procedural, event-driven programming"
(emphasis added; I haven't done enough Tcl coding to verify this claim)
- even though it does appear to be mainstream indeed, it doesn't seem to
fit the bill of "Non-OO ... (imperative) language".
As for Ada: When I think "mainstream", I don't usually think avionics,
weapon systems or spacecraft - or any other embedded or real-time
application, for that matter.
>> Though it wouldn't stand in the way of that.
>
> To some extent it would, depending on how your OO is integrated with the
> rest of your system. OO tends to have many references to one object
> scattered about in other objects. You have to avoid that if you're going
> to incrementally upgrade code as it runs.
As I said, it depends on the runtime. If for instance the runtime would
store object references as a combination of a "data address" and a "type
identifier", it would be more than problematic to add data fields (due
to inability to move the object on the heap), or to "upgrade" only some
objects to the new implementation; if the runtime instead stores object
references as pointers to memory blocks including both the data and a
virtual method table, data size may still not grow, but implementation
could be changed for individual objects of a type; and a runtime that
happens to use chained references for garbage collection would have all
the necessary power to actually relocate objects on the heap, thus
allowing for arbitrary changes to the data structure. With such a
runtime, your "object network" can be arbitrarily complex. Similar
flexibility can be achieved by adding a level of indirection between the
reference and the actual data.
Post a reply to this message
|
|