Message Passing and Shared Data

bearophile bearophileHUGS at lycos.com
Mon Apr 11 12:53:52 PDT 2011


dsimcha:

> Ok, I guess this is just a fundamental world view difference.

Right. The world has so many different computer languages also because programmers see programming in different ways :-)
(And if we are both using D2 this means we share part of that world view.)


> Some programmers (such as yourself) actually **like** static typing.

I am writing lot of code both in dynamically typed and statically typed languages, so I like about equally both. If a language is well designed, it gives me different advantages, that pay back for the disadvantages of the language:
- A well designed dynamically typed language is quick to write, flexible, allows short code, is never fussy regarding types, allows me to write Pseudocode-like code with a clean syntax, avoids many problems using higher level constructs, etc.
- A good statically typed language gives more runtime efficiency, but its type quite flexible system must give me something more back, many more static guarantees about the correctness of the code (Java is not good enough on this). This way, the static typing has paid me back enough to compensate the time needed to get the types right, to add those annotations, the reduced flexibility, etc.


>I especially dislike the "fancy" type system features because they interact so poorly with generic code.  (Yes, this problem is in principle fixable but it's a drain on our limited manpower and doesn't seem to be getting fixed in practice.)<

Designing a very flexible static type system (and those "fixes" for the generic code) is quite harder than designing a dynamically typed language. D design surely needs to fix and improve some more of those (auto ref, inout, switchable purity and non-throw-ness, etc).


>If you could somehow get both efficient code and the ability to do low-level work in a dynamically typed language (the first is theoretically possible but insanely hard in practice, the second is arguably impossible since dynamic typing is so contrary to how the machine works at the lowest levels), I'd take a dynamically typed language any day of the week.<

When you look at languages like ATS, Lua-JIT, BitC, Haskell, and D, you see the design space of programming languages is very wide, so much that we're far from having explored a significant percentage of it. My guess is what you ask for will eventually become possible.

Bye,
bearophile


More information about the Digitalmars-d mailing list