- Notifications
You must be signed in to change notification settings - Fork21
takeoutweight/clojure-scheme
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This project is unmaintained and I won't likely investigate any issues.
Pervasive tail-call optimization anyone?
A few cosmetic changes to the lovely ClojureScript compiler and we are producing output suitable for compilation to C viaGambit Scheme!
Clojure/West 2013 hosted a talk introducing clojure-scheme. Theslides are online and the corresponding video will be made available this August.
The fastest way to get started is to try the self-hosted clojure-scheme REPL:
- Install Gambit Schemefrom source or from anOSX/Win32 installer.
- Put
gscon your PATH (make installputs gsc in /usr/local/Gambit-C/bin by default). - InstallLeiningen.
git clone https://github.com/takeoutweight/clojure-scheme.git- In the root clojure-scheme directory, run
lein install - In the samples/repl directory, run
lein runto build the self-hosted REPL. (src/build.clj demonstrates how to compile .clj files to scheme code). - run
sh run-clojure-replto launch the REPL, and enter(install-clojure-repl)to switch from Scheme mode to Clojure mode.
Gambit seems to be a promising compile target for Clojure:
(scm* [] (load "core"))(ns bench)(defn fib [n] (if (or (identical? n 0) (identical? n 1)) 1(+ (fib (dec n) ) (fib (- n 2)))))(prn "fib 36:" (fib 36))... in the Clojure REPL ...
cljs.compiler> (time (fib 36))"Elapsed time: 1138.814 msecs"24157817cljs.compiler> (compile-file "bench.cljs")... in the shell ...
$ gsc -exe bench.scm$ time ./benchfib 36: 24157817real0m0.775suser0m0.737ssys0m0.009sAbout
Clojure to Scheme to C to the bare metal.
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.