boot

:boot-clj: https://boot-clj.github.io/ — build tooling for Clojure. Dev chat in #boot-dev
2019-01-08T14:05:47.056400Z

here's a boot riddle (does work in leiningen and clj):

(let [t (System/nanoTime)]
  (spit "src/foo.clj" (str "(ns foo)\n(def t " t ")")) 
  ;(Thread/sleep 20) delay only required for boot-clj
  (require 'foo :reload) 
  (let [t0 (var-get (resolve 'foo/t))] 
    (if (= t t0) 
      :great 
      (list 'not= t t0))))
I'm expecting :great, but boot-clj doesn't detect the change without a delay

flyboarder 2019-01-08T16:46:51.057100Z

@jeroenvandijk I dont understand the question, is this in a repl?

2019-01-08T16:47:51.058Z

yeah it is from the repl. But I ran into the issue running require programmatically

2019-01-08T16:49:06.060Z

So my question is why is there a delay with boot-clj, but not in the other environments

flyboarder 2019-01-08T16:49:12.060100Z

@jeroenvandijk this is going to depend on your boot task structure, generally you shouldn’t need to do that unless you are spinning up a pod

flyboarder 2019-01-08T16:49:35.060400Z

boot uses a filesystem cache

2019-01-08T16:49:57.060600Z

ah that would explain it 🙂

flyboarder 2019-01-08T16:50:15.060900Z

the file watchers take time to update

flyboarder 2019-01-08T16:51:00.061800Z

but I would say your issue is probably how you are doing the require programmatically

2019-01-08T16:51:46.063100Z

So I'm using another file watcher (hawk) that hooks into mac osx events. I guess that this is faster than the boot watcher

flyboarder 2019-01-08T16:51:46.063200Z

is this for a boot task or just within the repl for exploration purpose?

2019-01-08T16:52:24.063800Z

yeah i'm just using boot as repl now. i'm not using any watch functionality (explicitly)

2019-01-08T16:53:00.064600Z

That could be an improvement point maybe, but I don't want to couple it to boot (yet)

2019-01-08T16:53:19.065100Z

But the delay is ok for now , at least now I know 🙂

2019-01-08T16:53:21.065300Z

Thank you

flyboarder 2019-01-08T16:53:54.065900Z

yeah we could implement a watch task using Hawk if it becomes a sticking point

2019-01-08T16:55:57.067200Z

I guess in this case that could make the issue even more difficult to see as latency would be minimal and it wouldn't happen all the time 🙈

2019-01-08T16:56:25.067600Z

I should get rid of the my custom file watcher then

flyboarder 2019-01-08T16:57:18.067900Z

what is the file watcher for?

2019-01-08T16:57:38.068300Z

i'm trying to implement autotesting at function level

2019-01-08T16:57:51.068600Z

like autotest for midje, but much smarter

2019-01-08T16:59:20.070300Z

It involves a lot of macro magic so I was a bit afraid that the cause was my rewriting code