In the process of iterating through lots of toy economic models and writing small scripts to analyze them (make plots, etc.).
I’ve gotten into the following workflow, and I’m wondering if (a) it’s reasonable (b) Other people share it and (c) if other people have formalized it into a package.
The workflow attempts to balance the ease of running a script at the REPL with
- use
] generate MyModelbecause ultimately I will want things in a package ] adda bunch of packages- Write my functions inside the
MyModelmodule - Write a
mainfunction insideMyModel - In the REPL, run
using Revise; using MyModel; exportall(MyModel). The last command sends all names toMain - Make
mainlook like this
function main()
@eval Main begin # everything available at the REPL
...
end
end
- Go to
src/MyModel.jland copy and paste all theusingstatements into the REPL so that everything is available at the REPL. - Run
main()at the REPL. Everything insidemainis visible. - Use
@infiltrateextensively while debugging.
The reason for main with @eval is so that I can take things inside main and easily spit them out into helper functions that are also in the MyModel module.
This gives me the best balance of having a package and having stuff accessible at the REPL.
Anyone else do this? I use Sublime Text and a terminal, btw.