Re: [TYPES] The type/object distinction and possible synthesis of OOPand imperative programming lang

Discussion in 'Python' started by Ian Kelly, Apr 17, 2013.

  1. Ian Kelly

    Ian Kelly Guest

    On Tue, Apr 16, 2013 at 5:16 PM, Mark Janssen <> wrote:
    > Understood, but I feel this is where theory has gone too far away from
    > reality.


    How so? Turing machines and lambda calculus were both invented in the
    30s, before any real mechanical computers existed. If anything, it is
    programming that has strayed too far from theory. ;-)

    > While I understand the interest in purely theoretical models, I wonder
    > two things: 1) Are these distinct models of computation valid?


    If they provide an algorithmic/mechanical means of solving problems,
    then they are valid models of computation. An abacus is a valid model
    of computation, although I wouldn't want to compute a million digits
    of pi on it. I may be missing what you really mean by "valid" here.

    > 2) If so, shouldn't a theory of types announce what model of
    > computation they are working from?
    >
    > You say the C/C++ model is the exception, but in the programmer
    > community (excepting web-based languages) it is the opposite. The
    > machine model dominates.


    In C/C++ the types are based on the hardware. You have 16-bit ints
    and 32-bit ints and 64-bit floats and what not because those are the
    types that fit neatly in the storage units of the hardware.

    In higher-level languages like Python, the types are abstract, not
    based on the hardware. Python doesn't have 32-bit ints, except as an
    implementation detail that the programmer need not be aware of.
    Python ints have arbitrary precision.

    > In fact, I'm not even sure how Java
    > operates, but through some sorcery I don't want to take part in.


    It compiles to an intermediate language that is executed by a virtual
    machine, much like Python.
     
    Ian Kelly, Apr 17, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page