Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will it be possible that implementing Clojure (or Clojure syntax) over SBCL(or Other fast Lisp)?

Tags:

clojure

lisp

sbcl

I've tried both SBCL and Clojure and found that I like the syntax of Clojure but it is very slow compared to SBCL for me. Are there any implementation of Clojure over SBCL or will it be possible?


I found https://github.com/ayrnieu/disclojure which can enlighten me. :-)

like image 714
chunsj Avatar asked Aug 13 '13 23:08

chunsj


2 Answers

Clojure is intended to target several backends. This is a side effect Clojure being a hosted language designed with the philosophy of embracing the host. It will never be the goal, for instance, to make the same code written for Clojure on the JVM run unmodified on, again for instance, the CLR. Substantial amounts of code are common between Clojure for the JVM and ClojureScript, which is a nice bonus.

It is currently stable for:

  • JVM
  • JavaScript/ECMAScript

Generally stable for:

  • CLR/.net

and I know of experimental builds for:

  • Python
  • C
  • Scheme
  • IOS (via Scheme)

More targets are showing up as interest and time intersect. If you would like to provide an implementation for your favorite Lisp, patches welcome! It would be advisable to base your implementation on the ClojureScript compiler as it best exemplifies the intended development methods for the compiler.

like image 93
Arthur Ulfeldt Avatar answered Sep 22 '22 12:09

Arthur Ulfeldt


While the previous answers stated the difficulties of hosting Clojure on different languages, there is one programming language which I think is interesting to look at: Shen. It has been designed with a minimal set of 45 primitive instructions, so that it will be easy to port to different languages. It currently runs under CLisp, SBCL, Clojure, Scheme, Ruby, Python, Java and Javascript. It seems that it's a mix of ML and Lisp, although I haven't programmed with it much.

like image 29
pooya72 Avatar answered Sep 22 '22 12:09

pooya72