[comp.lang.lisp] Scheme optimization

barmar@think.com (Barry Margolin) (01/17/91)

In article <20544@yunexus.YorkU.CA> oz@yunexus.yorku.ca (Ozan Yigit) writes:
>Scheme literature thus far available (Steele [1], Dybvig [2], Kranz et al.
>[3] just to mention a few) seem to suggest that scheme may not need much in
>the way of efficiency tricks (except perhaps to indicate to the compiler
>that built-in functions will not be re-defined) to be compiled and
>optimized properly.  [On the other hand, arguably a case may be made for
>additional constructs for even *better* results]

Most of the papers I've seen about optimizing Scheme compilers have
concentrated on optimizing the *control* structures (the simplest of which
is the basic transformation of a tail call into a jump).  Common Lisp
optimizations are geared towards removing some of the overhead of dynamic
typing, i.e. allowing generic functions (arithmetic and array operations,
in particular) to be compiled into type-specific code.


--
Barry Margolin, Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar

oz@yunexus.yorku.ca (Ozan Yigit) (01/18/91)

In article <1991Jan17.054800.9036@Think.COM> barmar@think.com
(Barry Margolin) writes:

>Common Lisp
>optimizations are geared towards removing some of the overhead of dynamic
>typing ...

Ah, I see what he means by optimization tricks now. I presume it can pay
off for scheme compilers as well, given that some implementations already
use something similar, i.e. (integrate-usual-procedures) to inform the
compiler that it can make the assumption that the built-in procedures will
not be redefined or assigned so it is *ok* to go ahead and (for example)
inline them.

oz
---
We only know ... what we know, and    | Internet: oz@nexus.yorku.ca 
that is very little. -- Dan Rather    | UUCP: utzoo/utai!yunexus!oz

  

gateley@rice.edu (John Gateley) (01/18/91)

In article <20598@yunexus.YorkU.CA> oz@yunexus.yorku.ca (Ozan Yigit) writes:
   In article <1991Jan17.054800.9036@Think.COM> barmar@think.com
   (Barry Margolin) writes:
   >Common Lisp
   >optimizations are geared towards removing some of the overhead of dynamic
   >typing ...

   Ah, I see what he means by optimization tricks now. I presume it can pay
   off for scheme compilers as well

Yes it can, having worked on a type inferencer used for both Scheme
and Common Lisp. The main difference is that Common Lisp declares
provide hints to the inferencer (inferrer?) in a concise form, while
Scheme has no such mechanism.

John
gateley@rice.edu

--
"...Yes, I've got some questions that are guaranteed to shake you up. How
much marriage urges a windmill to paint infinity? Is a magic hide-a-bed
the vile home of spanish fire? Is firm corn merrier under gifts of less
important love? We wonder ..." The Residents