h1

Object Orientation is Inherently Dynamic

June 29, 2014

Even in static and compiled languages, therefore the despatch of a method to an object needs to be decided at run time. This is true of C++, where the _vtable is used for runtime dispatch, and also if function oanguages, where variant types ……. a variable whose actual type is decided by its current value….are used for despatch.

This raises the question of whether the best way to add OO to a static language is minimally , as C++ does, or add a whole dynamic layer as Objective C does….and if you are going down the latter route, should the layers have different or .similar syntax? Id be inclined to go for a minimal difference.

How to glue a dynamic layer to a static layer? If static code is embedded in dynamic code, some kind of dynamic despatch will be needed based on runtime parameter values. ( I’m assuming the dynamic layer will have only duck typing)

Static types passed into an embedded dynamic call will have to have their values boxed. Returns from dynamic calls , including data fetched from dynamic storage, is tricked. It can’t .be reliably unboxed into a naturally typed value,….either a runtime error will have to be thrown, or iy will have to into a variant.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: