Thank you for all the fast comments. I am really impressed by how warm and kind the julia community is with beginners.
Context
My real use case of the problem is similar to my initial question. I am working on developing a library for program synthesis (creating programs that have a certain grammar an satisfy input/output examples. for instance given 10 examples as 1,2 | 2,3 | 3,4 | ... 10,11 the algorithm should realize that the function that relates input to output is f(x) = x + 1).
The code base is already structured using modules like Search
, Grammar
, Evaluation
, Constraints
and in order to run everything there is a module Main
that includes all the modules and adds the necessary usings.
module Main
include("path/to/Grammar.jl")
include("path/to/Constraints.jl")
include("path/to/Search.jl")
using .Grammar
using .Constraints
using .Search
export
Grammar,
Constraints,
Search
end # module
To keep the code clean whenever I want to test if an algorithm works I have include all the submodules in a Temporary.jl
even though I call include("Main.jl")
Thus Temporary.jl
has something like
include("src/Main.jl")
using .Main
using .Grammar
using .Constraints
using .Search
// code that creates a problem with examples and tries out an algorithm on it.
It is a bit unfortunate that even though I have the include
to Main.jl
I still need to add all the usings.
I think that for my use case Reexport.jl
would be best suited.
@lmiq I can’t really stop using modules because the code base is already structured like that. The reason is that each modules (e.g Search
, Grammar
, Constraints
) will need to be published separately when the library is released.
My new question
Whenever I make a small change in Search
for instance I need to kill the Julia REPL from VsCode and start another one. This is quite time consuming because the REPL takes some time to start.
I saw that Revise.jl
can solve this problem but I am quite new to Julia and the from the documentation I see that I only need using Revise
at the top of Temporary.jl
.
Unfortunately it does not work as expected.
When I go to VsCode and change a function from Search
to print some debug information and I run Temporary.jl
in the Repl by clicking the run button I don’t see any output from the print function.
Only if I kill the Julia session and start it again I will see the print statements.
Thank you in advance for taking the time to read through this long post and answer my question