Paul Hsieh said:
Well I would call that a credible argument. Indeed, dynamically typed
languages are something entirely different. How does one encapsulate
an "interface" for example? I don't consider Javascript a real OO
language at all. Its a nice slow, HTML embeded dynamic language that
includes objects.
that is the issue, some people define OO in some overly narrow way (must
includes classes, instances, inheritence, ...).
now, not everyone agrees with this set of definitions...
I have a problem with complicated languages that don't include a
compile time type checker. They may have taken away seg faults, but
they also make every variable of type "void *". Only the PhDs at
Google have the ability to actually scale that to medium size
applications.
comparring dynamic types to 'void *' is, IMO, more than a little too lax.
additionally, not all languages with dynamic types, have only dynamic types
(though in many languages, it is one or the other). not all of them, have
purely runtime checking either (many systems using 'type inference' are
capable of handling both a dynamic type system, and also detecting known
type errors at compile time, and generating code that, in many cases, works
much the same as in some other statically-typed language).
the last of my dynamicly-typed languages (my following effort was a C
compiler), included both JIT and type inference, and in some
narrowly-defined cases could approach "C-like" levels of performance...
a pure C compiler turned out to present many new and interesting issues, and
turned into a fairly interesting, if different, project.
my compiler turns out to be sometimes faster and sometimes slower than gcc
with fairly 'generic' compiler options (in development, I had slightly
overestimated the speed gains of going "SSE everywhere", and there are more
than a few cases where good old ugly x87 outperforms my sometimes slightly
awkward vector-based code...).
dynamic programming language have their place, but objects without
strict typing offer too little in comparison to ordinary modular
programming.
I personally, like using hybrid approaches.
in C, sadly, there is not a lot one can do (using a customeized dynamic type
system is possible, but is awkward, compromises optimization, and type
safety). even as such, this is a common practice in my case (I write
primarily statically-typed code, using the dynamic type system if/when it
makes sense).
however, it is more than possible that a language could natively include
both systems, handling static types in the good old constraint-driven
manner, and dynamic types through a combination of inference and with
occasional dynamic type checks (in cases where the type is not statically
provable).
as for OO, one idea I had considered was to use a hybrid object system as
well, where, rather than the objects themselves being statically defined,
they need only conform to a statically defined interface.
this can allow much of the usual checking mechanics (for example, raising a
type error if an incompatible object is passed, allowing type-optimized slot
and method access, ...), while still allowing dynamic features (ad-hoc
object construction, delegation, ...), and allowing dynamically changing the
'class' of a pre-existing object.
however, this would likely be a somewhat different beast than either
class/instance or prototype OO.