@rdiaz02 and @patrick
I didnât answer before because I donât have that really prepared carefully.
I do have some short notes here:
https://m3g.github.io/JuliaNotes.jl/stable/modules/
and here:
https://m3g.github.io/JuliaNotes.jl/stable/workflow/
But reading such notes (and, IMHO, reading these instructions in general) doesnât give the user the correct idea. A small demonstration is usually much better. A small video is here illustrating the use of Revise.
But, basically, what one needs is to keep the REPL open, but develop the code mostly in files, which are tracked by Revise. Put the code in functions, even one when is just plotting something, like:
# file: myplot.jl
using Plots
function myplot(data)
plot(data, linewidth=2, color=:blue, label="test")
end
Because then you can, in the REPL, use something like:
julia> using Revise # normally started always by default in your startup.jl file
julia> includet("./myplot.jl")
julia> data = readdlm("mydata.dat")
julia> myplot(data) # this gets you the first plot, and may take some seconds
# change something in the `myplot` function above
julia> myplot(data) # this is fast now, and tunning the plot is easy
# change the data
julia> data2 = readdlm("./mynewdata.dat")
julia> myplot(data2)
#etc.
With that the responsiveness of the development is really good, better than other alternatives, because you donât need anymore to worry about compiling anything, rerunning the script, etc. Just modify the function (myplot
) in this case in the corresponding file, and run it again in the REPL.
If you are developing a package, then the same thing holds, but then the includet
will be substituted by using
your package, which is loaded installed as a dev
package in the environment.