# Do I need to restart the REPL every time before rerunning a Julia script?

**URL:** <https://discourse.julialang.org/t/do-i-need-to-restart-the-repl-every-time-before-rerunning-a-julia-script/99110>\
**Category:** VS Code\
**Tags:** question\
**Created:** [May 19, 2023, 12:30pm UTC](https://discourse.julialang.org/t/do-i-need-to-restart-the-repl-every-time-before-rerunning-a-julia-script/99110 "2023-05-19T12:30:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [May 19, 2023, 12:30pm UTC](https://discourse.julialang.org/t/do-i-need-to-restart-the-repl-every-time-before-rerunning-a-julia-script/99110/1 "2023-05-19T12:30:32Z")

</div>

Julia’s package loading process can be quite time-consuming, but when debugging code, I often need to run the script multiple times. To clear the previously produced results in the workspace, I employ the practice of restarting the workspace before every rerun. However, this approach results in all the loaded packages in the workspace being cleared. When I rerun the code, all the packages have to be reloaded, which is time-consuming. Is this approach correct, and is there any better way to handle this? (I use VS code)

![image](https://global.discourse-cdn.com/julialang/original/3X/2/f/2f2fd27a6bed916ae688e5d3a2e3e4bf4341481a.png)

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [May 19, 2023, 1:19pm UTC](https://discourse.julialang.org/t/do-i-need-to-restart-the-repl-every-time-before-rerunning-a-julia-script/99110/2 "2023-05-19T13:19:38Z")

</div>

No, you should use “Revise”, and have all your computations inside functions, that can be rerun and tested repeatedly after modification.

Some info about good workflows:

[![](https://global.discourse-cdn.com/julialang/original/3X/3/f/3f9be254349796f22d361e48939a812ca8b3d783.jpeg "Julia: Workflow Tips, and What is New in v1.9 | 2nd DigiWell Julia Seminar 2023") ](https://www.youtube.com/watch?v=qM9NtiYlXck)

> [@Nice workflows for using and developing in Julia 1.9+](https://discourse.julialang.org/t/nice-workflows-for-using-and-developing-in-julia-1-9/96017):
>
> I wrote a small step by step to help my students with of a good workflow for Julia [here](https://m3g.github.io/JuliaNotes.jl/stable/workflow/). Sharing it here because it might help new users. Updated (and properly formatted) versions will be available in that link when necessary. Nice workflows for using and developing Julia 1.9+ This a brief description of some nice development workflows for Julia, particularly for versions 1.9 or greater. This workflows are usually fairly personal, so many other useful ones may exist. juliaup The [juliaup](https://github.com/JuliaLang/juliaup) tool a…

---

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [May 20, 2023, 1:04am UTC](https://discourse.julialang.org/t/do-i-need-to-restart-the-repl-every-time-before-rerunning-a-julia-script/99110/3 "2023-05-20T01:04:19Z")

</div>

Thank you very much! I will look into this.
