# Save/load REPL state

**URL:** <https://discourse.julialang.org/t/save-load-repl-state/102433>\
**Category:** General Usage\
**Created:** [August 3, 2023, 4:07am UTC](https://discourse.julialang.org/t/save-load-repl-state/102433 "2023-08-03T04:07:06Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [August 3, 2023, 11:35pm UTC](https://discourse.julialang.org/t/save-load-repl-state/102433/8 "2023-08-03T23:35:55Z")

</div>

> [@mrufsvold](#):
>
> This is a feature that R supports. You can save all the variables defined in the current session so you can come back tomorrow without rerunning your script. It should be awesome if, when I open a Pluto notebook, it was just ready for me to code instead of running the whole thing from the top again, potentially running very expensive computations.

A major difference is that R retains their functions in source code form, while Julia does not. While you might be able to recursively serialize the data structures in the current workspace, serializing JIT compiled functions does not make sense. JIT compiled code contains optimizations relevant only to JIT such as runtime pointer references which would be invalid when deserialized.

To get serializable native code, you help to get Julia into an mode where it is caching native code to disk. See `julia --help-hidden` for options.

```julia
 --compile={yes*|no|all|min}
                          Enable or disable JIT compiler, or request exhaustive or minimal compilation

 --output-o <name> Generate an object file (including system image data)
 --output-ji <name> Generate a system image data file (.ji)
 --strip-metadata Remove docstrings and source location info from system image
 --strip-ir Remove IR (intermediate representation) of compiled functions

 --output-unopt-bc <name> Generate unoptimized LLVM bitcode (.bc)
 --output-bc <name> Generate LLVM bitcode (.bc)
 --output-asm <name> Generate an assembly file (.s)
 --output-incremental={yes|no*}
                          Generate an incremental output file (rather than complete)
 --trace-compile={stderr,name}
                          Print precompile statements for methods compiled during execution or save to a path
 --image-codegen Force generate code in imaging mode

```

---

_[View the full topic](https://discourse.julialang.org/t/save-load-repl-state/102433)._
