Re: Static vs. Dynamic typing

From: Dmitry A. Kazakov (mailbox_at_dmitry-kazakov.de)
Date: 07/26/04


Date: Mon, 26 Jul 2004 10:18:57 +0200

On Sat, 24 Jul 2004 19:54 +0100 (BST), Dave Harris wrote:

> mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) wrote (abridged):
>>> Another reason is that in order to be statically decidable the type
>>> system has to be "weak", ie not Turing Complete,
>>
>> Do you mean the type system or the whole system?
>
> Just the type system.

But should it be Turing Complete?

>>> You can have a more powerful and expressive type system if it
>>> doesn't need to be statically checkable. Probably simpler too.
>>
>> That's questionable.
>
> Well, consider Eiffel's Design by Contract. It's a dynamically checked
> system, which means it can express truths which a simple static type
> checker could not prove.

Should be contracts mapped to types, or rather types are just a part of
contracts. There is a beauty in equalizing both, but I am not sure whether
it is feasible. Anyway nobody argues against things that cannot be checked
statically. So far people are arguing that nothing should be done
statically even if it could be. That's silly.

>> We could think of types as a static component of the whole system,
>> while *all* dynamics of the system is represented by values.
>
> Err, yes. I'm not sure what your point is.

Then you would need no dynamic type checks, because everything could be
checked statically. In my understanding it is always possible to do so.
When dynamic types come into consideration in a statically typed language,
then it is always related to large open-end systems, which require
enhancements during their life-circle. That is the rationale for
dynamically polymorphic types, IMO. Now when the dynamic camp tries to put
everything in a big dynamic cauldron, what remains from types then? Isn't
it just a camouflaged desire to deal with untyped values?

>> The decisive question to be answered is how much truly dynamic types are
>> required in an average system, and to which degree dynamic polymorphism
>> conforms to.
>
> I'd like more experience with hybrid static/dynamic systems. Sometimes
> with OLE/COM, for example, it feels like individual modules are statically
> checked, but the interfaces between them are dynamically checked. You find
> out whether a given object conforms to the interface you want at run-time,
> by using QueryInterface. Maybe that's a good mix (if given some decent
> syntax).

Yes it is much as I see it. Though, I'd like to describe interfaces in a
kind of meta-language, which again would be statically typed. The values of
that language would be types and values of the first level language. As I
said earlier, I do not believe that one could deal with that in *one*
language. In my view, as the systems will grew in size, we will experience
higher levels of this hierarchy: interfaces between interfaces etc.
Probably each level will need a *statically* typed language of its own.

> I've argued previously that static checking works best in the
> small, and becomes increasingly painful the bigger the project.

Divide and conquer!

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


Relevant Pages

  • Re: Static vs. Dynamic typing
    ... > checker could not prove. ... Should be contracts mapped to types, or rather types are just a part of ... When dynamic types come into consideration in a statically typed language, ... but the interfaces between them are dynamically checked. ...
    (comp.programming)
  • Re: a dozen cpus on a chip
    ... I am no expert on WG13s work, but the premise of the verification checkers is that at the lowest level the checker checks itself and is checked by other independently developed tools. ... It is always possible that they all share some common design flaw, but the bootstrap process starting from a checker that is small enough for a manual proof would seem to be watertight if done carefully. ... Remember that hardware designs are generally designed and simulated on software tools before they are committed to fabrication. ... We got fed up waiting for the language committee to finish diddling with things and sloppy C / Windows GUI bindings eventually became a show stopper on the ubiquitous PC. ...
    (sci.electronics.design)
  • Re: High performance alternative to MI of virtual bases
    ... > implementations of interfaces. ... Heavy use of MI is abuse for the same reasons that simple inheritance is ... Inheritance -- multiple or otherwise -- is meant ... use of the core standard C++ language... ...
    (comp.lang.cpp)
  • Re: There is no market for real cameras anymore.
    ... People often defend their poor language skills, or those failings in others, by claiming English is some variation of a "living language". ... However many will see grammatical, spelling, and usage errors in my own words... ... My checker tolled me sew. ... Eye trussed too bee a joule. ...
    (rec.photo.equipment.35mm)
  • Re: Static vs Dynamic
    ... > When you use reflection like this, it tells me that the base language ... Reflection as a base API distinguishes Java from its C++ ... interfaces are great for stabalizing types if you need to. ... Dog dog = new Dog; ...
    (comp.lang.lisp)

Loading