from Hacker News

Embedding Lisp in C++ – A Recipe

by pieterk on 6/8/21, 6:12 AM with 16 comments

  • by anentropic on 6/9/21, 9:21 AM

    A couple of others that may be of interest:

    - https://ferret-lang.org/ "Ferret is a free software lisp implementation designed to be used in real time embedded control systems. Ferret lisp compiles down to self contained C++11" "Easy FFI (Inline C,C++. See Accessing C,C++ Libraries)" "Easily Embeddable (i.e Ferret fns are just C++ functors.)"

    - https://github.com/clasp-developers/clasp "Clasp is a new Common Lisp implementation that seamlessly interoperates with C++ libraries and programs using LLVM for compilation to native code."

  • by hide-difference on 6/10/21, 2:31 AM

    Not trying to be a Lisp gatekeeper, I just want to give credit since Common Lisp is such a gigantic standard:

    Embeddable Common Lisp is a conforming implementation. It's what it says in the title, pretty much any Common Lisp library and still embeddable in C/C++. Use it with SLIME and all that.

    I do like exo-lisps like Fennel, Ferret and Hy. They just have very different goals from the project referenced in this article.

  • by brundolf on 6/9/21, 5:47 AM

    Plug: for fun I made a (less ambitious) version of this kind of thing for Rust which I ended up being pretty happy with

    https://github.com/brundonsmith/rust_lisp

  • by jackdaniel on 6/9/21, 11:43 AM

    Cool post :)

    I'm one of ECL maintainers, if you have questions about the implementation itself then I'll be happy to answer.

  • by ncmncm on 6/9/21, 3:13 PM

    I thought guile was specifically designed for embedding, like lua. And, isn't it JITted nowadays?
  • by beders on 6/9/21, 6:39 AM

    In styles.css line 6697 or so:

        p {
            color: #333;
        }