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

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



Matthias Felleisen writes:
> And why does SML[/NJ]'s performance suck, if static types are really
> all that great for performance? Once you have polymorphism you don't
> need dynamic types to mess up your performance.

If your polymorphism is resolved at compile-time, as in the C++ STL,
it doesn't mess up your performance (except, possibly, by bloating
your code and thrashing your icache.)

--
/* By Kragen Sitaker, http://pobox.com/~kragen/puzzle5.html */
char b[2000],m[]={1,-80,-1,80};main(){int i,x=1000,s=2000,d=0;while(1+(i=
getchar()))switch(i){case'f':b[x]=1;case'g':x=(x+m[d/2]+s)%s;d--;case'+':d+=2;
case'-':d+=7;d%=8;}for(i=0;i!=s;i++)putchar(" #"[b[i]]);}