squint

borkdude 2025-08-25T15:12:20.735189Z

maybe mutable vars in squint wouldn't be so bad after all? it will have an impact on bundle size... but at least binding will work since you can mutate shit in ES modules this way for REPL it won't be a solution since ES modules themselves are still immutable https://clojurians.slack.com/archives/C061V0G8Z/p1756134459403209

borkdude 2025-08-26T09:07:56.490639Z

that will only work when you are setting something in the same namespace

borkdude 2025-08-26T09:08:09.059439Z

e.g. (binding [foo/bar ...]) won't work due to ES module limitations

👍 1
borkdude 2025-08-25T15:28:47.823859Z

maybe an intermediate solution would be to just do this for dynamic vars... but then you'd have to track which things are dynamic vars

Chris McCormick 2025-08-26T00:29:48.955249Z

When I was hacking on the mr-clean-in-squint thing the LLM suggested an implementation for binding which was basically wrapping everything in a try-finally. Not sure if that's relevant to what you're saying.

🧟‍♂️ 1
Chris McCormick 2025-08-26T00:45:33.917879Z

This but in js:

(let [old-watcher *watcher*]
  (try
    (set! *watcher* new-watcher)
    ;; ... body where *watcher* has the new value ...
    (finally
      (set! *watcher* old-watcher))))
I guess the problem is when there are consts?