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

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




  > Date: Fri, 22 Mar 2002 15:29:00 -0800
  > X-Authentication-Warning: orchestra.cs.caltech.edu: mvanier set sender to mvanier@cs.caltech.edu using -f
  > From: Michael Vanier <mvanier@cs.caltech.edu>
  > Cc: karczma@info.unicaen.fr, plt-scheme@fast.cs.utah.edu
  > 
  > > X-Authentication-Warning: fast.cs.utah.edu: majordom set sender to owner-plt-scheme@flux.cs.utah.edu using -f
  > > From: Matthias Felleisen <matthias@ccs.neu.edu>
  > > Reply-To: matthias@ccs.neu.edu
  > > Date: Fri, 22 Mar 2002 16:35:34 -0500 (EST)
  > > 
  > > Jerzy, 
  > > 
  > > with all due respect, I think Noel was on to the right answer.
  > > 
  > > And why does SML'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. 
  > 
  > And yet ocaml's performance is really good.  I thought at least part of the
  > reason for this was that ocaml uses the stack in much the same way that C
  > does (which pretty much rules out continuations) while SML is more
  > scheme-like in its stack management (and has continuations).

One counter-example is enough. But, yes I can cite many more. 

There is nothing Scheme-ish about SML/NJ's stack management. The only
Scheme compiler that ever did a job like that was T. And that's where 
SML/NJ started from, excepted that it didn't shift things from the heap to
the stack. 

  > 
  > OTOH Common Lisp systems, which are dynamically typed by default, can
  > compile to very fast code as well.  Certainly the presence of run-time
  > checks can slow your program down a lot, but there's nothing in scheme or
  > lisp which prevents the implementor from removing these checks if possible.
  > Some schemes (bigloo, dunno about chez) have type declarations, for
  > instance, and all CL systems have them.
  > 
  > Mike
  > 


It's not types that make things fast (alone). However, if type are
instructions to the compiler to allocate so-many bytes and bits, as 
in C (see K&R), then a compiler can do a very good job. Then  again 
these types have nothing to do with human mumbo-jumbo as Jerzy would
say. 

-- Matthias