1. 8

  2. 6

    “Easy” compared to what? It’s all relative. There’s a good bit of literature about building full Scheme interpreters and compilers. That makes it easier to build one for the first time. Building one for the second time is easier still. At that point it’s a fairly easy thing to keep in one’s head and repeat in multiple implementation languages.

    I would compare building a full Scheme interpreter to building a basic discrete event simulator, as a comparison.

    1. 1

      I also think it’s very rare that someone who says “it’s easy to write a Scheme” is talking about full R7RS compatibility. Most people carve out a comfortable chunk and have a go at it; there’s no shame in building something that doesn’t tick off all the check boxes.

      In fact, I heard several years ago that the number of fully-R6RS-compliant implementations was in the single digits. No one is calling that an easy achievement.

      1. 1

        Agreed. I need to remember and clarify that I stopped paying attention to the standard at R5RS which is a good bit smaller than full R6 or R7.

    2. 3

      Author might have found the link below helpful. I posted it on their site. Im considering it for a secure, compiler-bootstrapping project along with it being a Scheme in and of itself. What yall think about it in terms of easy to learn? (Not a Schemer.)


      1. 3

        I’ve used that paper to try and implement a compiler myself before. It was decent for the first few steps, but around 3.9 (closures) I started getting confused, and had to use other resources besides that paper.

        In terms of giving a rough overview of a compiler, it’s pretty good, but I’m not sure how viable it is to write a full-fledged compiler from that paper when there’s so little to go off of. It compilers straight to x86, which is nice for presentation and learning purposes, but is difficult to write real optimizations before.

        I’m currently working on a lisp project as well, and I’ve decided that it’s probably easier/better to go with a bytecode interpreter that’s easy to embed (like Lua), than to try and implement a compiler that’s secure, fast, and correct (compilers are hard, I’ve found).

      2. 1

        Shaka Scheme source code is… interesting. Don’t think I’ve ever seen non-template code broken up into header.h and header_impl.h files before. I bet their compiles times are fun.

        I guess it works, but it probably hurts their ability to find contributors with a strong C++ background.