Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Babashka and sci internals @ London Clojurians December 2020

Babashka and sci internals @ London Clojurians December 2020

Slides from presentation about babashka and sci internals at the London Clojurians Meetup given in December 2020.

Video: https://youtu.be/pgNp4Lk3gf0

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

Bbb17eeeecd3d9d06f4db310ab630a12?s=128

Michiel Borkent

November 30, 2020
Tweet

Transcript

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

  2. Thanks to sponsors! • Sponsors: • Github sponsors • OpenCollective

    • Ko-fi • Clojurists Together
  3. • 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
  4. None
  5. None
  6. 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
  7. 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.
  8. None
  9. REPL https://gist.github.com/borkdude/66a4d844668e12ae1a8277af10d6cc4b

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