I'm wondering if there is a simple solution to this, such as [...] a way to make the Julia repl, once opened, execute a .jl file [...].
You can execute a .jl file in a running Julia REPL with the include() function. For example, to execute a file foo.jl
, enter the Julia REPL and do:
julia> include("test.jl")
The file will then be executed within the REPL. However, this is unlikely to solve your problem, since the file execution will probably take multiple seconds as well. The REPL itself starts quickly, the long execution time stems from Julia taking a long time to load the file.
You can partially address this issue with Revise.jl. Revise.jl is a Julia package that automatically and quickly reloads your imported files and packages when they are edited. Thus, you could mitigate your issue by only having to load the .jl file once at startup. Here is a quick example of using Revise.jl:
julia> Pkg.add("Example")
INFO: Installing Example v0.4.1
INFO: Package database updated
julia> using Revise # importantly, this must come before `using Example`
julia> using Example
julia> hello("world")
"Hello, world"