Next: , Up: machinery   [Index]


16.1 Simplification assumptions

To make it easy to explain the run time behaviour of Vicare, we will assume the validity of the following simplifications:

  1. At the start of a user program execution: the Scheme stack is empty. This is false because, at Vicare launch time, the boot image is loaded and initialised, executing a lot of compiled Scheme code. But starting with an empty stack makes reasoning simpler.
  2. No expressions and function calls are inlined. This is false because the compiler precomputes some expressions, inlines some function calls and removes bindings whenever possible; this makes the executed code different from the original Scheme code. But we want to show sample Scheme code as close as possible to the one that gets executed.
  3. Unless otherwise specified: no tail call optimisation (TCO) is performed. This is false because, whenever it recognises a function call in tail position, Vicare always performs the call in such a way that the new stack frame overwrites the old one. But we want to show simple functions that create new stack frames.
  4. The function call/cc is implemented without subordinate function calls. This is depends upon the function call integration optimisations performed by the compiler. But reasoning about simple function call is simpler.
  5. There is no dynamic environment to be captured by continuations. This is false because whenever dynamic-wind is used stacks of in–guard and out–guard functions are created and captured by continuations; the continuation escape function, created by call/cc, does invoke such guard functions to keep the dynamic environment synchronised with the execution flow. But learning about continuations alone already introduces enough complications.
  6. When discussing sample programs we assume that only the code we see is executed. This is false because whenever a user program is run: the code is loaded and compiled, then some initialisation is performed before running it. Rather when dissussing the execution of:
    (import (rnrs))
    (define (one a)
      (+ a 1))
    (one 2)
    

    we assume that the first executed code is the expression (one 2).


Next: , Up: machinery   [Index]