dundalek / closh

Bash-like shell based on Clojure
Eclipse Public License 1.0
1.62k stars 66 forks source link

Proof of concept for fast startup time in script mode #123

Closed jeroenvandijk closed 5 years ago

jeroenvandijk commented 5 years ago

This is a proof of concept where a closh script is using an existing process to speedup boottime of the closh script (< 20-40ms). It's a bit messy, but it works.

Instructions

(clojure.core.server/start-server {:port 49999 :name "closh-server" :accept 'clojure.core.server/repl})


* Step 2: Start a closh shell
* Step 3: Compile this project with GraalVM `boot build && ~/bin/graalvm-ee-1.0.0-rc7/Contents/Home/bin/native-image -jar target/myapp-0.1.0-SNAPSHOT-standalone.jar`
* Step 4: run example script from `myapp` dir: `./client-closh.clj`

(Follow up of #105, but focus on scripting)
dundalek commented 5 years ago

Very cool :+1: It will need some hammock time, but I think this will be a good basic block for implementing the speedup in the future.

jeroenvandijk commented 5 years ago

I've put this work in a seperate repo and is now independent of Closh. (For some reason pomegrate doesn't work yet)

See https://github.com/jeroenvandijk/clojure-scripting

dundalek commented 5 years ago

Closing the PR since it has been extracted into a separate project.