What other languages use the same data model as Python?

rusi rustompmody at gmail.com
Sun May 8 01:48:20 EDT 2011


On May 8, 7:17 am, Steven D'Aprano <steve
+comp.lang.pyt... at pearwood.info> wrote:
> On Sat, 07 May 2011 21:21:45 +1200, Gregory Ewing wrote:
> > Hans Georg Schaathun wrote:
>
> >> You cannot reference nor manipulate a reference in python, and that
> >> IMHO makes them more abstract.
>
> > You can manipulate them just fine by moving them from one place to
> > another:
>
> >     a = b
>
> I see no reference there, nor do I see any moving taking place. What I
> see is a name binding operation. What is happening is that the name "a"
> is being bound to the object "b" (or to be precise, to whatever object is
> currently bound to name "b").
>
> Since you haven't explained what you think is happening, I can only
> guess. My guess is that you are thinking about some implementation of the
> Python VM which uses some sort of reference internally. Perhaps it's
> CPython, which uses pointers, or some C++ implementation which actually
> uses an indirect pointer-like data structure called "reference", or maybe
> even some old-time FORTRAN I implementation that simulates pointers with
> integer indexes into a fixed size array. It could be anything.
>
> But whatever you're thinking of, it's not the behaviour of *Python* code,
> it's behaviour of the Python virtual machine's implementation.
>
> It astonishes me how hard it is to distinguish between abstraction levels
> when discussing computer languages. We don't have this problem in other
> fields. Nobody talking about (say) Solitaire on a computer would say:
>
> "Blat the pixels in the rect A,B,C,D to the rect E,F,G,H. That will free
> up the Ace of Spades and allow you to memcopy the records in the far
> right column of the tableau into the foundation."
>
> but when it comes to high-level computer languages like Python, we do the
> equivalent *all the time*.

It has to be so -- because the Turing machine like the modern computer
is an unbelievable abstraction squasher.  Yes unbelievable in the
sense that people simply cant come to terms with this.  [Witness your
"It astonishes me..." Harris: "I take exception.." etc]

The modern computer (von Neumann) <- self-modifying code <- Data=Code
<- Undecidability (Halting problem) <- Consistency XOR Completeness
(Godels theorem(s)) <- Leaky Abstractions as inevitable

If anyone thinks Godels theorems are easy trivial, he probably does
not know what he is talking about,  Yet we think that computers are
easy to understand?

[Ive personally witnessed PhDs in computer science not appreciate
compilers' inability to do certain things, and yet they could go and
take a bunch of lectures on the halting problem.  What they understand
is anybody's guess :-) ]

Coming back to topic:  The argument (about bindings, variables etc)
arises because python (like lisp) is an imperative language
masquerading as a functional one.
Such arguments dont arise in Haskell or in assembly language.
They arise and are tolerable in C.
They are terrible in C++ because all the abstractions are built to
leak.

Where python sits in this (circular) spectrum is an interesting
question
(and I watch the arguments with much interest)



More information about the Python-list mailing list