sci

borkdude 2022-09-30T09:33:49.403059Z

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

borkdude 2022-09-30T09:34:04.096639Z

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

borkdude 2022-09-30T09:35:28.055449Z

E.g.:

#?(:cljs 

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

Lone Ranger 2022-09-30T01:02:52.155029Z

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

Lone Ranger 2022-09-30T01:05:42.617569Z

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 🤔