I’m wondering if there is a way to have the following work flow:
I’m editing in VIM
I have a dune build -w running, which recompiles on source change.
(I don’t have this part yet). I have dune utop running, then every time that dune build -w succeeds, it causes the dune utop to reload the latest modules. (If I end up losing some state, that’s fine ,I’ll develop techniques to work around it.)
So the overall work flow is:
I write some code in vim, hit :w
dune build -w tries to recompile; on error, it displays error
if step 2 succeeds, dune utop reloads the new module into the repl
Sorry to be pedantic, I’m new to the OCaml toolchain and want to make sure I understand this correctly.
Previously, I was running with “dune build -w”, which has the benefit that on every Vim save, it auto recompiles.
Does the approach you are suggesting eliminate this? I.e. I need to manually trigger recompile by killing utop and rerunning it ?
One situation where this is inconvenient is that if I am doing a refactoring and there are many errors, with the “dune build-w” approach, I fix an error, I get next error; whereas with this approach, I have to constantly re-trigger the compile myself.