To speed up my workflow, I’ve made a “continuous testing” package for seeing function output on every editor save called EyeOfRa.jl. This aims to make the edit/save/run loop of function writing/debugging more comfortable.
The package piggy backs off
Revise.jl to notice when a module has been updated and reruns a given function, displaying the return value, its Type, run time and stdout/stderr. A difference in inferred type will also be noticed. In the future this will also show a diff of the outputs.
To use from the REPL, make sure
EyeOfRa are imported, then call:
Now edit your code and save, and observe the changes in output.
For example, a call
@observe MyModule.greet() could generate the following output:
Module code throwing an exception after a previous successful run, showing stacktrace and previous success:
I have also created an emacs package to interface with this through
julia-repl, which is hosted at julia-funcobs. This allows for
Plots.jl objects returned from functions to be displayed:
If anyone is interested in a similar implementation for VSCode or another editor, I eagerly await your pull request!
The inspiration for this package came from a talk by Brett Victor: Inventing on Principle.
I have described this as “continuous testing” but I’m sure there is a better term for this, as CT brings to mind CI testing in repositories, rather than local updates.