Slide 1

Slide 1 text

and sci internals Michiel Borkent @borkdude 2020-12-01

Slide 2

Slide 2 text

Thanks to sponsors! • Sponsors: • Github sponsors • OpenCollective • Ko-fi • Clojurists Together

Slide 3

Slide 3 text

• Native Clojure scripting tool, single binary, no JVM • Can be used to replace “the grey areas” of bash • Installable via script, brew (macOS, linux), aur (linux), scoop (Windows) $ time bb '(+ 1 2 3)'
 6
 0.00s user 0.00s system 67% cpu 0.013 total

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Small Clojure Interpreter (def f (sci/eval-string "#(+ 1 2 %)")) (f 1) ;;=> 4 - Clojure interpreter - Works on JVM / GraalVM / JS - Sandboxing
 - Works in CLJS advanced compiled apps

Slide 7

Slide 7 text

SCI eval • Why does sci work with GraalVM and clojure.core/ eval doesn't? • core eval = compile = generating classes • A native image cannot load new classes at runtime • Sci eval does not generate any new classes.
 Compilation -> interpretation.

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

REPL https://gist.github.com/borkdude/66a4d844668e12ae1a8277af10d6cc4b

Slide 10

Slide 10 text

Thank you! https://github.com/borkdude/babashka
 https://github.com/borkdude/sci And the Small Clojure Interpreter