16

I'd like to start learning Lisp as it sometimes leads to interesting answers on this site with concepts borrowed from this language, so I'm curious. As I already spend most of my programming time in Mathematica, is there a way to execute Lisp programs from the Mathematica frontend?

Same question for related languages, like Haskell or OCaml.

sblom
  • 6,453
  • 3
  • 28
  • 45
faysou
  • 10,999
  • 3
  • 50
  • 125
  • 2
    I suppose you've seen this: http://stackoverflow.com/a/5451304/695132 Are you looking for a way to run some other language from the front end or to call it from the kernel? – Szabolcs Apr 13 '12 at 07:19
  • @Szabolcs: I guess what he wants is something like MathLink, but for Lisp. – celtschk Apr 13 '12 at 07:45
  • @Szabolcs yes I was looking for something like in the answer of WReach. The link of rubenko seems to do this. – faysou Apr 13 '12 at 08:37
  • One possible appraoch is to use a Lisp that runs on the JVM (for instance, ABCL), and then get at Mathematica through J/Link. – Pillsy Apr 13 '12 at 13:49
  • @Pillsy I think your comment could be an answer even if it's not tested yet. – faysou Apr 13 '12 at 13:56
  • Of course, one possibility would be to implement a Lisp interpreter in Mathematica. – celtschk Apr 14 '12 at 19:24

5 Answers5

12

Have a look at SchemeLink.

Peter Mortensen
  • 759
  • 4
  • 7
11

Clojure is often described as a "modern-day LISP" (hosted on the JVM) that offers strong support for multi-threaded code.

If the Clojure dialect of LISP is an option for you then you might want to investigate using the JLink-based interface to Clojure provided courtesy of this package: Clojuratica

Regarding Haskell and OCaml, your best bet may be trying to access F# (which is closely related to Haskell and OCaml) through .NETLink.

StackExchanger
  • 1,511
  • 13
  • 20
6

I haven't actually tried this, but you might want to investigate using one of the Lisps for the JVM, such as Armed Bear Common Lisp, and interface to Mathematica through J/Link.

Pillsy
  • 18,498
  • 2
  • 46
  • 92
5

These pages contain related links about a lisp interpreter in Mathematica:
http://www.umcs.maine.edu/~chaitin/#LISP
http://library.wolfram.com/infocenter/MathSource/729/
http://mathematics-diary.blogspot.fr/2011/10/limits-of-mathematics-or-lisp.html

faysou
  • 10,999
  • 3
  • 50
  • 125
1

For creating this Common Lisp package, Richard Fateman was reportedly once threatened with a lawsuit by Wolfram:

https://dl.acm.org/doi/10.1145/1089419.1089421

StackExchanger
  • 1,511
  • 13
  • 20