sci 2022-09-30

@goomba You can copy macros, but if CLJS doesn't have those macros at runtime then there's nothing left to copy

Copying macros on the JVM works seamlessly, but in CLJS you often have to ensure that they exist at runtime by copying them as functions and adding ^:macro to them, so SCI knows it's a macro

E.g.:

#?(:cljs 

(defn ^:macro [form env x y z]
  `(+ ~x ~y ~z)))
works with copy-ns and copy-var

So wait — macros are definable in sci, but importing macros is not. So as long as I import the source code of the dependency it should be fine, right? Except for deftype

What do they calls those in #babashka ? Super something… where all the scripts get concatenated. So hypothetically with a topological sort of the dependencies, slurping the source code, and concatenating the results — maybe some macros would work 🤔