This is brilliant. It kind of reminds me of hy (https://github.com/hylang/hy) in addition to Norvig's lis.py that the author cites as inspiration.
I feel like lots of folks in the R community secretly or not-so-secretly pine for lisp. My own "someday project" is to implement some portion of R in Racket—"Arket". Of course all the native libraries that have been wrapped in R are the tricky bit.
> Of course all the native libraries that have been wrapped in R are the tricky bit.
Everything in R is an SEXP struct. The native code is all shared libraries on Linux and Mac, and mostly DLLs on Windows. There should be almost no problem calling the native libraries if you have an existing R installation.
That doesn't apply if you are talking about a complete reimplementation of R, but that would be a massive project, in which case calling native libraries would be of little relevance.
In that case, why not just embed an R interpreter inside Lisp? I've published a slightly modified fork of RInside that lets you embed R inside anything with a C FFI[1]. Tested only on Linux.
https://www.stat.auckland.ac.nz/%7Eihaka/downloads/Compstat-...