Secd: A silly implementation of the SECD machine

This page summarizes the projects mentioned and recommended in the original post on

Our great sponsors
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • Mergify - Updating dependencies is time-consuming.
  • SonarQube - Static code analysis for 29 languages.
  • secd

    A simple implementation of the SECD abstract machine (

    Arguably, it's a bit silly, in the same way that the one page Lisp definitions written in Lisp are a bit silly. It's a naive implementation. It basically maps the SECD machine, directly to the underlying Clojure environment, which being Lisp, is very close in semantics. (Since SECD was first intended to implement Lisp.)

    Consider how it evaluates a variable in an environment: It's the simplest, and worst, solution -- iterate over the linked list from the start until you find the value you want. Performance degrades exponentially the more variables you have. In a more "serious" interpreter or compiler, you'd want to do a transform at some point, and slip in the value directly, if possible. And if not, you want to call out to a fast lookup method, like a hash table or balanced tree.

  • lispkit

    FUNCTIONAL PROGRAMMING: Application and Implementation, Peter Henderson, ISBN 0-13-331579-7

    I've actually recently read "FUNCTIONAL PROGRAMMING: Application and Implementation", by Peter Henderson from 1980, which contains a description of the SECD machine and a compiler for a simple purely-functional Lisp dialect called Lispkit.

    This <> looks like a good repo if you want to know more, although I'm not related to it in any way.

    I can't say how it compares the book by Kogge mentioned in this post since I haven't read that, but I can say I think it's an excellent book and worth reading if you're interested in this kind of thing.

  • InfluxDB

    Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.

  • ocaml

    The core OCaml system: compilers, runtime system, base libraries

    Might be of interest: the ocaml interpreter runs on some kind of ZINC machine iirc, which is implemented here:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts