1. 3

    Signify on PicoLisp

    1. 15

      PicoLisp is an interesting example of a purely interpreted language, though it doesn’t meet your request for a popular interpreter. It uses dynamic variable binding, which was historically a common feature of the directly-walking-sexpressions approach to interpreting Lisp.

      Emacs’s Elisp used to be implemented similarly, but now has a byte-compiler. Earlier than that, almost all Lisp and Scheme systems used to include a directly-walking-sexpressions interpreter for use at the REPL because compilers had too high latency to use interactively. But compilers have gotten fast enough that many systems have switched over to just using a compiler everywhere, to avoid having maintain a separate interpreter. One that still has both an interpreter and a compiler is Chez Scheme, which is now open source (and like all Scheme interpreters, it does lexical variable binding). The interpreter has lost most of its reason for existence though: historically, the Chez business model was that the interpreter, Petit Chez, was free and cross-platform, while platform-specific native-code compilers were sold as products.

      1. 10

        Emacs’s Elisp used to be implemented similarly, but now has a byte-compiler.

        Though Emacs has a byte compiler, it’s not used exclusively. Nearly every Emacs setup runs a mix of interpreted and compiled code, so Emacs may contain the most widely-used non-bytecode interpreter in the world.

        1. 2

          This is very interesting to learn. Are there large pure PicoLisp projects? Do you happen to know what’s the last version of ELisp that was still interpreted? I’ve never looked but I’m guessing Emacs is mostly written in ELisp?

          Edit: Ok, so I just looked at some PicoLisp source for PilBox and it seems to me that the call graph is pretty shallow. That is, functions in these libraries call primitives but not each other very much. That and using its Java FFI for Android is really cool! But doesn’t quite help with examples of what I’m trying to find (tricks to get around the speed issue from nesting in direct AST interpretation).

            1. 1

              On a related note, femtolisp was used in Julia compiler. They rewrote Julia in mostly Julia. So, I’m not sure how much femotlisp is in there now.

              1. 2

                Thanks!

                even though many primitives (e.g. filter and for-each) are written in the language instead of C.

                This sounded promising but then it went on to

                femtolisp uses a bytecode compiler and VM

                which is unfortunate for the current question. Otherwise, Julia should have certainly been a large enough example of a femtolisp program.

                1. 1

                  I seem to recall that femtolisp was a straight up interpreter at one point in time, but I think I may be confusing that with the tiny implementation, which I’d guess is less used than femtolisp itself, and therefore purely academic in nature. :)

                2. 2

                  On a related note

                  I’m not sure how this is at all related, to be honest. :)

                  1. 1

                    Yeah, I read it too quickly or forgot no bytecode by the time I replied. My bad. Least author found the link interesting.

            1. 2
              1. 2

                Add kangaroo12 to nim

                  1. 1

                    I’m not sure what the relevance is?