# Calling Julia program from C and avoiding recompiling

**URL:** <https://discourse.julialang.org/t/calling-julia-program-from-c-and-avoiding-recompiling/97800>\
**Category:** Performance\
**Created:** [April 23, 2023, 12:39am UTC](https://discourse.julialang.org/t/calling-julia-program-from-c-and-avoiding-recompiling/97800 "2023-04-23T00:39:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mb96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mb96/32/45786_2.png) [@mb96](https://discourse.julialang.org/u/mb96)\
**Post date:** [April 23, 2023, 12:39am UTC](https://discourse.julialang.org/t/calling-julia-program-from-c-and-avoiding-recompiling/97800/1 "2023-04-23T00:39:35Z")

</div>

Hi!

I am planning on calling my Julia programs from my C script where the calling will have to be done many times. However, I am worried about whether this will mean having to recompile the functions all the time as if the Julia code was ran for the first time every time.

Does someone know whether this in inevitable or have any tips on avoiding it?

thanks in advance.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 23, 2023, 4:07am UTC](https://discourse.julialang.org/t/calling-julia-program-from-c-and-avoiding-recompiling/97800/2 "2023-04-23T04:07:05Z")

</div>

It isn’t clear what you’re doing in C: are you starting a Julia process each time (which isn’t a great idea given the startup cost), or are you [embedding Julia](https://docs.julialang.org/en/v1/manual/embedding/) in your application which wouldn’t have any repeated re-compilation for the same code, within the same session?

---

<div class="post-metadata">

**Author:** ![mb96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mb96/32/45786_2.png) [@mb96](https://discourse.julialang.org/u/mb96)\
**Post date:** [April 24, 2023, 9:44pm UTC](https://discourse.julialang.org/t/calling-julia-program-from-c-and-avoiding-recompiling/97800/3 "2023-04-24T21:44:34Z")

</div>

I am calling a julia program which contains functions written in julia and which I want to use. Embedding in Julia seems like it only works to use julia commands but I actually want to call a julia program that returns a number after some input from the C code.
