Kent Dybvig's Scheme Machine (heap-lisp)

Languages and libraries

scheme interpreter

SHOW HN2025

Kent Dybvig's Scheme Machine (heap-lisp)

Kent Dybvig's Scheme Machine in 400 Lines of C (Heap-Memory Model)

gist.github.com

#scheme#interpreter#c#lisp#dybvig

226points
44comments
#273of 3,837 in 2025
Top 8%of 2025 by points

How HN took it

CuriousMostly questions and neutral comments

2 positive, 10 neutral or asking, 0 mixed, 4 critical, out of 16 comments about the project. Thread score -0.07.

Idea: 2 for, 2 againstExecution: 0 for, 2 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Delightful, clean, inspiring small interpreter

    From 2 comments
    • What an utterly delightful itty bitty scheme. <3
      dented42 on HN
    • Reading and hacking on the Chez Scheme codebase is always a treat and rather inspiring, especially compared with more mainstream compilers and code generators. As well as Kent…
      qhwudbebd on HN

Objections

  • Does not run properly; undefined behavior and assertion failures reported

    From 3 comments
    • No matter what I try, I always get: heap-lisp: heap-lisp.c:99: cons: Assertion `istext(textptr)' failed. I wonder if the ptr comparison in istext is actually UB?
      lynx97 on HN
    • I couldn't get it to do much. Also noticed a subtle bug here: ``` next = compile(read(buffer), cons("halt", NULL)); ``` C doesn't guarantee the order in which arguments to a…
      spyrja on HN
    • Have you tested this? Does it work?
      djmips on HN
  • Can only demonstrate semantics, cannot do arithmetic

    From 1 comment
    • It works but it can’t do much other than demonstrate semantics. The evaluator won’t even be able to add numbers for example.
      swatson741 on HN

Requests

  • Bootstrap via Forth or from bare metal assembly

    From 2 comments
    • Do Forth bootstrapping now
      iberator on HN
    • Amazing, and you could see how this could be translated into perhaps a couple of thousand lines of assembly code to boostrap Scheme almost from the bare metal, similar to the…
      lambdaone on HN

Questions

  • Is the top-level environment missing?

    From 2 comments
    • > note! repl implies there's a top-level but there isn't... I'm a little confused. How could it not have a top-level environment? There are environments which are extended on…
      matheusmoreira on HN
    • Can someone give more info on the relevance of this particular code?
      rogerallen on HN

Alternatives named

  • Chez Scheme

    From 1 comment
    • Kent Dybvig also wrote Chez Scheme [1] which on most benchmarks is far-and-away the fastest [2] Scheme implementation. Racket recently got rewritten to be based off of Chez [3]…
      ashton314 on HN
  • MIT Scheme

    From 1 comment
    • I believe MIT Scheme compiled directly to C by intermingling switch statements and gotos to emulate its call stack. Problem was, as programs grew, compile times weren't linear. I…
      glouwbug on HN
  • GNU Mes / Guix bootstrap

    From 1 comment
    • This is the path that the GNU Mes and Guix folks are taking: https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/ (sans LLMs -- I…
      dannyobrien on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/45491609)