I agree with that conclusion that the debate may become irelevant, though
not your reasoning.

First, Java really is not representative of static typing, that would be
like using the tellytubbies as an example of British television.

OCaml is good for typing, Scala is very good, the standard-bearer is
probably Haskell

Same thing for dynamic typing, don't look to Groovy or Fantom, the clear
king of this approach has to be Lisp (including Clojure)

So what's happening in these systems that I hold up as good examples?
 Nothing much in Lisp, that pretty much got it right from conception.  But
in Scala (as with the others), things are getting interesting...

1. The type system is turing-complete.  It's able to represent any type that
can possibly be conceived.  Incomplete type systems have always been a big
driver towards dynamic typing.

2. it uses inference, liberally.  This removes most of the pain of static
typing without sacrificing the benefits.

3. Type classes allow the composition of logic in interesting ways.  Have a
List of waveforms that you want to sum?  Just implement an implicit
Numeric[Waveform] object and use the existing sum functionality on lists.
 This truly does feel like the flexibility of a dynamic language in many
ways.

4.  Structural typing (or duck typing, if you prefer).  Scala allows you to
specify "any object with a close() method" as a type.  It works just like
duck typing in any dynamic language, and uses reflection behind the scenes.


With this lot, you really don't need dynamic typing any more.  Your code
really does look and feel just like dynamically-typed code in almost all
scenarios, but your compiler and IDE will always know exactly what type any
expression is, long before it actually executes.


In fact... too much would break down if you took a hybrid approach.  if `x`
is dynamic, then the only possible inferred type of `x + 1` is also dynamic.
 It's contagious!
and how could type classes ever work alongside such a scenario?


So yes, the distinction between static/dynamic typing will fade, because
static typing will look ever-more dynamic, even though it won't be.





On 30 August 2010 13:19, Casper Bang <[email protected]> wrote:

> > On the other hand, Scala gives you the equally awesome power
> > of type classes, which demand static typing.  Take your pick!
>
> Umm, feels like you're missing something: Fantom gives you static
> typing when you can, dynamic typing when you can't - the time of
> having to pick one over another, is gone. Several language luminaries
> anticipate the whole static vs. dynamic debate to be moot by the next
> decade.
>
> --
> You received this message because you are subscribed to the Google Groups
> "The Java Posse" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<javaposse%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>
>


-- 
Kevin Wright

mail/google talk: [email protected]
wave: [email protected]
skype: kev.lee.wright
twitter: @thecoda

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to