
A basic Lisp interpreter in R - juliuste
https://github.com/dirkschumacher/llr
======
clircle
Ihaka (co-creator of R) may still be working on a new statistical programming
language based on Common Lisp.

[https://www.stat.auckland.ac.nz/%7Eihaka/downloads/Compstat-...](https://www.stat.auckland.ac.nz/%7Eihaka/downloads/Compstat-2008.pdf)

~~~
hatmatrix
That was the inspiration behind Incanter[1], but I haven't heard about efforts
by R. Ihaka beyond his writings/presentations 2008-2010 or so.

[1] [http://incanter.org/](http://incanter.org/)

------
jordigh
If you enjoy this sport, there's also Make-a-Lisp (MAL), an ongoing project to
write lisp in every programming language:

[https://github.com/kanaka/mal](https://github.com/kanaka/mal)

In particular, here's their R version:

[https://github.com/kanaka/mal/tree/master/r](https://github.com/kanaka/mal/tree/master/r)

~~~
c3534l
"Implement a Lisp" seems to be Lisp's version of "rewrite it in Rust."

~~~
clappski
If done for educational purposes then there isn't anything wrong with that.

~~~
c3534l
You say that like there's something wrong with rewriting it in Rust.

------
peatmoss
This is brilliant. It kind of reminds me of hy
([https://github.com/hylang/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.

~~~
bachmeier
> 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.

------
huac
From one of the linked issues, a "Lisp-like R":
[https://github.com/chanshunli/jim-emacs-fun-r-
lisp](https://github.com/chanshunli/jim-emacs-fun-r-lisp)

------
pvaldes
You can also open a lisp interpreter and open an R session from here. Probably
more efficient.

If you want to open a lisp repl inside R you can just open an R session and
write:

system("sbcl", intern=FALSE)

That's all... use intern true if you want to save the session to an R object

foo <-system("clisp", intern=TRUE)

~~~
sciencerobot
One of the point's is that you can use R's functions in a LISP-like language.

~~~
bachmeier
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.

[1]
[https://bitbucket.org/bachmeil/rinsidec](https://bitbucket.org/bachmeil/rinsidec)

------
lottin
R with Lisp syntax. Cool stuff.

