Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
An implementation of Common Lisp targeting Lua (codeberg.org/gsou)
120 points by hollimolli on Nov 9, 2023 | hide | past | favorite | 15 comments


Is there a set of code written in a subset of Common Lisp which implements the parts of Common Lisp not currently part of this Lua+CL ?

Since there were many Lisp variants when Common Lisp first came out, there ought to be a lot code created when trying to first get compatibility working. How much of that historic code is available now ?


That's pretty much the objective of SICL, which is "intentionally divided into many implementation-independent modules that are written in a totally or near-totally portable way, so as to allow other implementations to incorporate these modules from SICL, rather than having to maintain their own, perhaps implementation-specific versions".

   https://github.com/robert-strandh/SICL


CMUCL was developed as "open source" (Publich Domain). It was a reworked Spice Lisp. Several other implementations used code from there. Additionally there was an open source LOOP, an open source CLOS implementation, etc.


As former maintainer of ECL, another open software Common-Lisp, I can attest that both CMUCL's and SBCL's are extremely useful as reference implementation for much of ANSI CL. I learned a lot regarding LOOP, or how to implement the floating point printer, which has a lot of complexity (and reproducibility) as compared to ANSI C and other standards.


I thought that was pretty much what the standard was. Being together as much of each of the other Lisps as possible.


How do this compare to Fennel?


Well, for starters, Fennel is designed to not introduce a runtime over Lua. That means things like lists only exist at compile-time (mostly for macros manipulating code, and partly because linked lists dont make sense in Lua, and partly because technomancy thinks lists should never be used as a data structure).

Moreover, Fennel aims to be a fusion of Clojure and technomancy's own thoughts on what Clojure should have (e.g. pattern matching in the core language).

If LCL is meant to be a Common Lisp implementation, then it will necessarily have a runtime in order to implement conditions, CLOS, etc. So really, your question boils down to "How does Common Lisp compare to a Clojure dialect?" The answer is: they are worlds apart.


cue 'Fennel is not a lisp' etc.

This looks like Common Lisp, so the full kitchen sink, with all the, um, historical, 'car' 'cdr', caaadr' stuff etc.

Fennel is more a lisp-like (clojure-like) syntax for Lua, but IMHO it is an improvement over Lua syntax, simplifies some things, and is good for teaching.


Because it promises one day to implement the full common lisp standard, the hope is that you would be able to run old, previously written code (as long as it was portably written) on LCL with only minor edits.


At a cursory glance Fennel is not a Common Lisp. It is an unknown to me lisp dialect.


Does anybody know of something similar for Go? I think it could work well: both languages use mutable datastructures, have a GC and are expected to be reasonably fast. It would bring all the Go libraries to CL.


I wonder how they plan to implement systems level programing features from Common Lisp on top of Lua.


I'm not familiar with Common Lisp or its systems programming features, but they can access any C API through LuaJIT FFI: https://luajit.org/ext_ffi.html

LuaJIT is so good that it is actually able to inline calls to C on the generated native code


Would this or Fennel allow one to write lispy code in LuaLaTeX, theoretically at least?


Fennel works anywhere that Lua works. It tries to be a fairly transparent layer over Lua. For example it's become popular in the Neovim community. You can even set up Lua to interpret Fennel code at import time, no need for a separate "compilation" step to generate Lua code.

Whereas I wouldn't expect a CL implementation that compiles to Lua to work so seamlessly.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: