sci

https://github.com/babashka/SCI - also see #babashka and #nbb
ikitommi 2020-07-22T19:32:35.331900Z

got the dynaload + preload + sci kinda working, just need kaocha to co-operate.

ikitommi 2020-07-22T19:32:51.332200Z

looks like this atm:

(ns malli.sci
  (:require #?(:clj  [borkdude.dynaload-clj :refer [dynaload]]
               :cljs [borkdude.dynaload-cljs :refer-macros [dynaload]])))

(defn evaluator [options]
  (let [eval-string* @(dynaload 'sci.core/eval-string* {:default nil})
        init @(dynaload 'sci.core/init {:default nil})
        fork @(dynaload 'sci.core/fork {:default nil})]
    (if (and eval-string* init fork)
      (let [ctx (init options)]
        (fn eval [s] (eval-string* (fork ctx) s))))))

ikitommi 2020-07-22T19:33:33.333100Z

the main-ns creates the evaluator with options and re-uses that.

borkdude 2020-07-22T19:33:49.333500Z

Been there. I tried to fix the malli unit tests that are ran with koacha, but I ran into issues and decided to just write the library 😉

borkdude 2020-07-22T19:34:12.333800Z

E.g. the preloads feature only works with clojure, not with clojurescript

ikitommi 2020-07-22T19:34:24.334100Z

😱