From: Dan Sugalski Date: 2002-12-19T08:00:18+09:00 Subject: Re: help -- persuade my boss to adopt ruby At 6:51 AM +0900 12/19/02, MikkelFJ wrote: >"Dan Sugalski" wrote in message >news:a05200f1cba2657db1f13@[63.120.19.221]... > >> >dynamic typing can coexist with static typing in one program >> >> It doesn't get you any of the benefits you wanted it for, though. >> There's no speed win without a lot of work and there's no safety win. >> What, then, is the point? > >Doesn't Dylan do this quite convincingly. >Of course it always turns out the way you don't bother with static typing - >as I recall the Dylan hackers a ICFP contest never got around to really >optimize the code. The idea was to prototype quickly and then optimize the >critical bits. >As an alternatively to moving to another langauge it is quite compelling. I'm not sure Dylan's a great example. It does have some pretty interesting optimizations, which took a number of very smart people a fair amount of effort. On the other hand, it is somewhat lacking as a general-purpose language, if its adoption is anything to go by. What it is good for is to prove that it can be done, but that's never been in doubt. > > >DS> Partial typing is of no use for speedups. The only way to get an easy >> >DS> speedup is to go fully-typed and forbid runtime method redefinition. > >I'm not sure this is true: By using more space you can have a default >implementation and a fast implementation. Quite often the method is not >dynamically modified - the trick is to quickly detect which version to use. >And it as non-trivial to do compiler inlining - therefore you need very fast >function calls. You missed the word "easy" in that sentence of mine. :) Yes, it's definitely possible to generate fast code in the common case. It's very much a non-trivial thing, which has been the big point all along. While it's *possible* to do this, it isn't *easy* to do this, and as such it's not likely to get much effort put into it, unless you're in a position to muster the sort of brainpower that was used to do it for the research languages and focus it on Ruby. (Which has been the point all along--the benefits for the proposed typing changes won't materialize without some concentrated, smart effort, and until you have that effort handy the changes needed to put in the static typing bits will only get in the way and be very unRubylike) -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai dan@sidhe.org have teddy bears and even teddy bears get drunk