# Save compiled functions to file (bytecode in Julia)

**URL:** https://discourse.julialang.org/t/save-compiled-functions-to-file-bytecode-in-julia/78432
**Category:** General Usage
**Tags:** question
**Created:** [March 24, 2022, 11:49pm UTC](https://discourse.julialang.org/t/save-compiled-functions-to-file-bytecode-in-julia/78432 "2022-03-24T23:49:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nharr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nharr/32/24698_2.png) [@nharr](https://discourse.julialang.org/u/nharr)
#### Post date: [March 24, 2022, 11:49pm UTC](https://discourse.julialang.org/t/save-compiled-functions-to-file-bytecode-in-julia/78432/1 "2022-03-24T23:49:53Z")

</div>

Just curious, does Julia have some way to save functions it has compiled to a file alongside the script it ran?

I’ve used PackageCompiler.jl, but to my understanding this saves a version of the entire Julia runtime along with compiled functions from the code that you had it run. I’m thinking something more along the lines of a Julia version of Java .class or Python .pyc files that the standard Julia system image can run (maybe in tandem with the original script). So maybe the difference is the compiled parts are saved with the target script rather than the system image. The creation and reuse of the compilation file is handled automatically when running a script from the command line.

I don’t understand all the inner workings of Julia, so some clarification here would be great.

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [February 24, 2026, 11:29am UTC](https://discourse.julialang.org/t/save-compiled-functions-to-file-bytecode-in-julia/78432/2 "2026-02-24T11:29:41Z")

</div>

Julia doesn’t have bytecode, but this new alternative (subset) implementation does:

> **[Supported Features (英語, English)](https://github.com/AtelierArith/SubsetJuliaVMSupportRepository/wiki/Supported-Features-(%E8%8B%B1%E8%AA%9E,-English))**
>
> Issue tracker repository for SubsetJuliaVM. Contribute to AtelierArith/SubsetJuliaVMSupportRepository development by creating an account on GitHub.

> - AoT / Bytecode
> - Save/load .sjbc bytecode files

[I’m guessing the .sjbc file format for the bytecode, is just for this project; standing for “subset Julia bytecode”?]

> [@SubsetJuliaVM: A Julia Subset Execution Environment for iOS and Web](https://discourse.julialang.org/t/subsetjuliavm-a-julia-subset-execution-environment-for-ios-and-web/134814/11):
>
> I bought the iPad app to support your interesting efforts. However, if you want to expand to more than just Julia enthusiasts and in fact broaden educational usage, not to mention make your application far more useful, here are some suggestions: Add in the app the list of currently supported syntax elements. Since you have to parse these, it should not be difficult at all for you to add this list. That way, we can avoid trial and error in figuring out what is and is not supported The above sho…

> <https://github.com/AtelierArith/julia-vm-oss/blob/5b103ee0a17fc07fa5af64206c83e02fc3783b91/subset_julia_vm/src/bytecode.rs#L4>
