# Juliac using packages

**URL:** <https://discourse.julialang.org/t/juliac-using-packages/135103>\
**Category:** General Usage\
**Created:** [January 16, 2026, 6:52pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103 "2026-01-16T18:52:18Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thomas008/32/204169_2.png) [@Thomas008](https://discourse.julialang.org/u/Thomas008)\
**Post date:** [January 16, 2026, 6:52pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/1 "2026-01-16T18:52:18Z")

</div>

I use juliac to generate small binaries from julia code. It is a great tool.  
There are unfortunately only few packages that can be applied when using juliac (e.g. DataStructures.).  
Applying other useful packages (e.g. TOML, XML, CSV, DataFrames) result in errors when compiling: Verifier errors occur  
(e.g. “unresolved call from statement DataFrames.length”).

What is the reason for failing when compiling?  
Is it, because the packages are not type-stable enough, for juliac?

It would be very beneficial to use packages when generating stand-alone binaries using juliac.  
Is it possible, or is there interest, to re-implement some of the packages, for applying in juliac?

---

<div class="post-metadata">

**Author:** ![gbaraldi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gbaraldi/32/22101_2.png) [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)\
**Post date:** [January 16, 2026, 7:06pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/2 "2026-01-16T19:06:00Z")

</div>

Yeah those packages are type unstable. Maybe something like TypedTables works? But dealing with formats like those in a static way that’s looks like what Julia usually does is quite tricky sadly. You would need to implement something that’s more akin to what the C++ or even the C version of libraries look like. The sciml ecosystem mostly works for example, due to years of getting rid of all type instabilities in it.

---

<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:** [January 16, 2026, 10:32pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/3 "2026-01-16T22:32:47Z")

</div>

Direct reimplementation to 100% type-stable, generic code would often cause other compilation problems, see: [Why DataFrame is not type stable and when it matters | juliabloggers.com](https://www.juliabloggers.com/why-dataframe-is-not-type-stable-and-when-it-matters/). Even statically typed languages will handle similar situations dynamically, just fundamentally limited (single dispatch, static type/interface restrictions on dynamically dispatchable methods, designated virtual methods, sum types, pattern matching) to the point a compiler can compile every possible call and objects can simply look those up. Julia chose different limitations, but that also means we can’t reasonably make a lookup table of compiled functions (not the same as the global method table) in advance for a lot of things out there. I expect actively developed packages to follow base Julia in the shift toward supporting JuliaC, but it’s very likely that different, more limited implementations will crop up. Limited doesn’t mean simple here, a lot can happen within limitations.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [January 16, 2026, 10:44pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/4 "2026-01-16T22:44:01Z")

</div>

> [@Thomas008](#):
>
> TOML, XML, CSV

File IO packages like those fundamentally need a special design to be type-stable. In particular, the user needs to explicitly pass types for the expected structure, be it CSV column names + types or TOML tree structure.  
Naturally, this wasn’t a priority or focus of many people before, and even now there’s only a relatively small subset of Julia users who really need full type-stability end-to-end. But it’s possible!

> [@Thomas008](#):
>
> DataFrames

After data is loaded, the situation is different – there’s no shortage of type-stable tables and operations on them!  
Types include at least base Julia vector-of-namedtuple, StructArrays, TypedTables; tabular operations – base Julia map/filter/…, and SplitApplyCombine, DataManipulation, etc packages.  
I have no idea whether these work with juliac out of the box, but at least they are mostly designed to be type-stable already.

---

<div class="post-metadata">

**Author:** ![Thomas008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thomas008/32/204169_2.png) [@Thomas008](https://discourse.julialang.org/u/Thomas008)\
**Post date:** [January 17, 2026, 5:42pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/5 "2026-01-17T17:42:32Z")

</div>

Thank you! Your replies give hope that it is possible to use packages for compiling with juliac. Proabably the packages have to be adapt or to restrict.

I tried `TypedTables` indeed. It works when the column names are known within the Table contructor, e.g. `t = Table(a = [1, 2], b = [2, 4])`. However, I need to construct a table dynamically, i.e. from a vector of column names. juliac does not seem to compile this so far. For example,

```julia-auto
function (@main)(args::Vector{String})::Cint
  column_names = [:a, :b]
  values = [[1, 2], [2, 4]]
  n = (; zip(column_names, values)...)
  return 0
end

```

results in error messages.  
Already `NamedTuple{(:a,:b)}([[1,2],[2,4]])`cannot be compiled (see [https://github.com/JuliaLang/JuliaC.jl/issues/93](https://github.com/JuliaLang/JuliaC.jl/issues/93)).

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [January 17, 2026, 6:59pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/6 "2026-01-17T18:59:54Z")

</div>

The `NamedTuple` problem seems to be that it doesn’t infer from a `Vector{T}` argument and a tuple of symbols of length `N` that the resulting type for the values needs to be `NTuple{N, T}`. So in your case, `NamedTuple{(:a,:b)}([[1,2],[2,4]])`, you have 2 symbols `(:a, :b)` so therefore you’d expect value type `NTuple{2, Vector{Int}}`. But instead you get a UnionAll. Here’s an example. I had to work around the fact that printing of the UnionAll type is broken (it tries to do the `@NamedTuple{a::X, b::Y}` style but there’s no `X` and `Y`)

```julia
julia> function without_value_types()
           nt = NamedTuple{(:a, :b)}
           nt([1, 2])
       end
without_value_types (generic function with 1 method)

julia> # this is a UnionAll type, Julia seemingly doesn't infer how many Int64s there should be,
       # even though it can only be 2 without erroring
       Base._return_type(without_value_types, Tuple{}).body.parameters
svec((:a, :b), NTuple{N, Int64})

julia> function without_value_types_tuple()
           nt = NamedTuple{(:a, :b)}
           nt((1, 2))
       end
without_value_types_tuple (generic function with 1 method)

julia> # this is concrete because (1, 2) has length 2 in the type
       Base._return_type(without_value_types_tuple, Tuple{}).parameters[2]
Tuple{Int64, Int64}

julia> function with_value_types()
           nt = NamedTuple{(:a, :b), Tuple{Int,Int}}
           nt([1, 2])
       end
with_value_types (generic function with 1 method)

julia> # and giving the value type explicitly as Tuple{Int,Int} is also fine
       Base._return_type(with_value_types, Tuple{}).parameters[2]
Tuple{Int64, Int64}

```

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [January 17, 2026, 7:00pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/7 "2026-01-17T19:00:07Z")

</div>

> [@Thomas008](#):
>
> However, I need to construct a table dynamically, i.e. from a vector of column names. juliac does not seem to compile this so far. For example,

This is fundamentally type-unstable

---

<div class="post-metadata">

**Author:** ![Thomas008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thomas008/32/204169_2.png) [@Thomas008](https://discourse.julialang.org/u/Thomas008)\
**Post date:** [January 19, 2026, 4:11pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/8 "2026-01-19T16:11:06Z")

</div>

@Jules Thank you! From your examples and description, I found that the compiling with juliac succeeds, as soon the names and the iterators are tuples instead of vectors.  
For example:

```julia-auto
function (@main)(args::Vector{String})::Cint
  column_names = (:a, :b)
  values = [[1, 2], [3, 4]]
  nt = NamedTuple{column_names}((values[1], values[2]))
  t = Table(nt)
  return 0
end

```

Constructing a named tuple from a vector of column names or values does not work. Also converting a vector to a tuple with e.g.

```julia-auto
column_names = Tuple(column_names)

```

or

```julia-auto
column_names = NTuple{length(column_names), Symbol}(column_names)

```

fails when compiling.  
So it seems to be fundamentally type-unstable, as @aplavin mentions.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [January 19, 2026, 4:30pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/9 "2026-01-19T16:30:09Z")

</div>

Well all parts of the NamedTuple type need to be knowable at compile time, so runtime names or runtime value types don’t work. But you can still have type stable table code with runtime names, just not with a NamedTuple.

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [January 19, 2026, 7:15pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/10 "2026-01-19T19:15:56Z")

</div>

If I forget about the experimental `trim` option (and hence type stability issues), is it easy to use `juliac` as a convenient command-line front-end of good old PackageCompiler to generate standalone app bundles?

---

<div class="post-metadata">

**Author:** ![Thomas008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thomas008/32/204169_2.png) [@Thomas008](https://discourse.julialang.org/u/Thomas008)\
**Post date:** [January 19, 2026, 8:24pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/11 "2026-01-19T20:24:09Z")

</div>

@jules

> [@jules](#):
>
> But you can still have type stable table code with runtime names

Can you give an example?  
I used a matrix (of strings), but I would prefer something more in the direction of typed tables.

---

<div class="post-metadata">

**Author:** ![Thomas008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thomas008/32/204169_2.png) [@Thomas008](https://discourse.julialang.org/u/Thomas008)\
**Post date:** [January 19, 2026, 8:40pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/12 "2026-01-19T20:40:36Z")

</div>

@greatpet Yes, without the trim option, there are not these type-stability issues. For example, for generating a typed table from a vector of column names and values, juliac generates a 189 MB stand-alone executable that does this job.

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [January 19, 2026, 8:52pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/13 "2026-01-19T20:52:48Z")

</div>

In case you know, is the `precompile_execution_file` option of PackageCompiler exposed to juliac? (Of course, you’d only need such an option for non-`trim` builds.)

---

<div class="post-metadata">

**Author:** ![Thomas008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thomas008/32/204169_2.png) [@Thomas008](https://discourse.julialang.org/u/Thomas008)\
**Post date:** [January 20, 2026, 7:36pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/14 "2026-01-20T19:36:33Z")

</div>

@greatpet At least I did not find the the `precompile_execution_file` option in the source code of juliac.

---

<div class="post-metadata">

**Author:** ![bvdmitri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bvdmitri/32/22935_2.png) [@bvdmitri](https://discourse.julialang.org/u/bvdmitri)\
**Post date:** [January 23, 2026, 8:16am UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/15 "2026-01-23T08:16:23Z")

</div>

> [@gbaraldi](#):
>
> The sciml ecosystem mostly works for example, due to years of getting rid of all type instabilities in it.

How to use the sciml ecosystem if one cannot load the data for it?

---

<div class="post-metadata">

**Author:** ![Thomas008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thomas008/32/204169_2.png) [@Thomas008](https://discourse.julialang.org/u/Thomas008)\
**Post date:** [February 5, 2026, 4:06pm UTC](https://discourse.julialang.org/t/juliac-using-packages/135103/16 "2026-02-05T16:06:53Z")

</div>

Regarding the issue of constructing a NamedTuple from a vector of values, and thus constructing a TypedTable from a vector of values, it can be compiled when annotating the types for the compiler. Here is an example:

```julia-auto
function (@main)(args::Vector{String})::Cint
  column_names = (:a, :b)
  values = [[1, 2], [3, 4]]
  values_tuple = NTuple{length(column_names), Vector{Int64}}(values) 
  nt = NamedTuple{column_names}(values_tuple)
  t = Table(nt)
  zeige(t)
  return 0
end

```
