[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strong Typing, Dynamic Languages, What to do?



Noel Welsh:

> A [static] type system is a state of mind.  A way of
> viewing the world.  Specifically a way of saying
> statically what is and isn't a valid program.

> So we can take a dynamically type system and by
> limiting the language we use we can turn it into a
> statically typed system.  Any statically typed system.
> 
> Now lets go the other way.  Hmmm... Can't be done.  If
> the type system you use fits your program then you're
> home.  So writing compilers in ML and simulations in
> Java probably doesn't suck.  It's when you go the
> other way that you feel the pain.

> So for my money I'd rather use Scheme than ML.  A lot
> of my programs look like ML but there are occasions
> where they don't and its those outliers that make the
> difference.

===

PLEASE!
For people who have some mileage behind, and know more or less that stuff,
you present a perfectly decent ideology, I won't argue about.

For people who *seriously* pose themselves the question which type system
(or lack thereof) use in practical programming, independently of the human
side of the affair, of the ergonomics, of debugging, etc. there is also
a question of brutal efficiency.

Strongly typed systems permit the compiler to optimize the programs much
more thoroughly, to get rid of plenty of runtime checks. To resolve statically
a lot of overloading/polymorphism issues.

This might not be important for you, but it isn't a good idea to hide under
the rug the efficiency issues.


Jerzy Karczmarczuk
Caen, France

PS. Actually, I would love to have a Scheme implementation with internals
(say, "keywords" style #*car#, #*plus_int#, etc.) which omit all the checks, and
brutally explode if used illegally, but VERY fast, and usable in a context
where the type checking has been done by some plugged-in module.