# Outputs of JuliaC compiled functions question

**URL:** <https://discourse.julialang.org/t/outputs-of-juliac-compiled-functions-question/135678>\
**Category:** General Usage\
**Tags:** compilation, juliac\
**Created:** [February 16, 2026, 2:40pm UTC](https://discourse.julialang.org/t/outputs-of-juliac-compiled-functions-question/135678 "2026-02-16T14:40:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JackC](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@JackC](https://discourse.julialang.org/u/JackC)\
**Post date:** [February 16, 2026, 2:40pm UTC](https://discourse.julialang.org/t/outputs-of-juliac-compiled-functions-question/135678/1 "2026-02-16T14:40:40Z")

</div>

I’ve been experimenting with the new JuliaC functionality for generating small binaries introduced in 1.12. I have been able to successfully compile and run example programs (such as the ones provided in [this](https://github.com/jbytecode/juliac) repo). However, I’ve noticed that in all the examples I’ve seen so far, the ultimate output for these functions is just to print statements to the console and returning the Int 0 to indicate that the program ran successfully. I guess my question is: How do we actually get these functions to return something usable? For example, if another programming language (i.e. Matlab, python, etc) needed to call this binary, how would one set it up to return the result of some calculation?

This is probably a really basic question, but I haven’t been able to find anything specific in the documentation, any specific examples, and my fiddling around with existing examples has just returned errors.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [February 16, 2026, 3:11pm UTC](https://discourse.julialang.org/t/outputs-of-juliac-compiled-functions-question/135678/2 "2026-02-16T15:11:25Z")

</div>

The most basic answer is that the binary would read its input from `stdin` and write its output to `stdout`, and it’s the callers responsibility to hook those up.

---

<div class="post-metadata">

**Author:** ![MDSW](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@MDSW](https://discourse.julialang.org/u/MDSW)\
**Post date:** [February 16, 2026, 3:22pm UTC](https://discourse.julialang.org/t/outputs-of-juliac-compiled-functions-question/135678/3 "2026-02-16T15:22:04Z")

</div>

This is a good thread, if you are looking to build a shared library callable from other tools rather than a separate process executable: [Creating fully self-contained and pre-compiled library](https://discourse.julialang.org/t/creating-fully-self-contained-and-pre-compiled-library/131374)

PackageCompiler may still be your best option, depending on what your code needs at runtime.

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [February 16, 2026, 11:29pm UTC](https://discourse.julialang.org/t/outputs-of-juliac-compiled-functions-question/135678/4 "2026-02-16T23:29:41Z")

</div>

_Most_ of the examples are intended for executables that take input text from the terminal and print output text to the terminal before returning the standard status code 0. clib.jl and mylib.jl are intended for shared libraries, and the README explains the latter is intended to be linked to mylibcaller.c. Tutorials on adapting C-compatible inputs and outputs to Julia code are rather lacking so far.

Other languages also generally interface with shared libraries via the C ABI, but they’ll have their own ways of doing it. I haven’t tried it with JuliaC binaries, but I have used Python’s standard library `ctypes` to roughly wrap shared libraries. There are many other ways for Python to wrap C more properly, but those involve more effort and features.
