Making D better than other programming languages (warning: rant, drivel)

Daniel Keep daniel.keep.lists at gmail.com
Tue Oct 31 00:00:23 PST 2006



Walter Bright wrote:
> Dave wrote:
>> Often I see that dynamic typing will mask errors, and make them a lot
>> more time consuming to both debug and (sometimes) workaround once they
>> are found. And often they make it through to production code as well.
>>
>> So I'm wondering if, in the grand scheme of things, dynamic typing
>> really accounts for a 2.5x difference in productivity anyhow?
> 
> I've been using dynamic typing in the DMD front end in a few places, and
> it's been a source of a couple bugs. I've been using type inference more
> and more in D, and it's been eliminating bugs rather than causing them.
> It's especially useful in foreach where I don't have to worry about
> getting the element value or index type right, especially when the type
> of the aggregate changes.

I sometimes think that whilst dynamic typing can be *very* handy to
have, it's ultimately just a panacea for a "proper" type system.  Type
systems like C's are really annoying because you spend so much time
telling the compiler the same thing over and over again, even when it's
not even really important (float, double?  I don't care; I just want a
number, damnit!).

But given something like, say, Nemerle's type system where you have full
inference and things like disjunction types (can't remember the proper
name: where you can say a variable is Type1 OR Type2 OR ...), you get
most of the benefits, with a lot of the safety static typing gives you.

I also find it interesting that a lot of the dynamically typed languages
I've seen seem to be slowly growing static typing abilities because
people get so sick of continually having to test the type of something :P

Same problem, different place, I suppose.

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even
make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/



More information about the Digitalmars-d mailing list