What other languages use the same data model as Python?

Terry Reedy tjreedy at udel.edu
Sun May 1 15:10:11 EDT 2011


On 5/1/2011 4:45 AM, Steven D'Aprano wrote:
> Python uses a data model of "name binding" and "call by object"
> (also known as "call by sharing"). I trust I don't need to define my
> terms, but just in case:
>
> http://effbot.org/zone/call-by-object.htm
> http://effbot.org/zone/python-objects.htm
>
>
> Now, this is different from languages like C and Pascal, which is
> based on variables,

Or Fortran or Basic (and I suspect, but do not know, Algol) and other
descendents: Ada?, PL/1?). In statistical languages, user-defined names
typically refer to typed data columns (eash a set of storage locations) 
or user-defined functions.

> "Python's data model is different from other languages"
>
> which is perfectly correct, if you think of C as "other languages".
> But it's equally correct to say that Python's data model is the same
> as other languages.

You defined Python's 'data model' as having two aspects: 'name binding' 
and 'call by object'. A language could match one but not the other. I 
believe Lisps have name-binding, but I know not all only have 
call-object. Macro calls (and earlier predecessors) are call-by-code-text.

  As I understand it, Python and Ruby have the same
> data model. So does Java, so long as you only consider objects and
> ignore unboxed native values. I believe (but could be wrong) that
> another language of about the same vintage as Python, Emerald, also
> uses the same model. That's not surprising, because I believe that
> Emerald (just like Python) was strongly influenced by CLU.

While Guido does not, that I know of, credit CLU as Python's direct 
inspiration, I think it (and Barbara Liskov) as the originator of 
Python's data model. I believe she thought of the call-by-object 
semantics as something of an innovation.

> What other languages use the same, or mostly similar, data model as
> Python?

Natural languages. That is why I think it is better to think of Python 
as an algorithm language or information-object manipulation language 
rather than as just a linear-memory machine language. A linear memory 
with bytes addressed from 0 to max-int or max-long is an explicit part 
of the definition of assembly languages and C. It is no part of the 
definition of Python.

Nice begin-a-thread post.

-- 
Terry Jan Reedy




More information about the Python-list mailing list