Optimizing the far-out

Efficient implementation of first-class environments

What is first-class environments?

Being first-class means environments are in the domain of values in the language.

think first class functions

We need two rules:

  • create this value (introduction)
  • use it (elimination)

by providing ways to

  • save a snapshot of current environment
  • execute code in a specific environment

(let ((my-env (let ((x 42)
                (capture-environment)))))
(let ((x 23))
  (with-environment x my-env)))

The CEK machine

Implementation

Optimizing first-class environments

Questions?

Optimizing the far-out

By Rajan Walia

Optimizing the far-out

  • 285