Been working on a julia build orchestrator, using llvm directly and clang for deps graphs and configuring to a toml, generating executables, shared libraries, or binary wrapping in julia, without the traditional hand coding of the entire wrapper but to make type stability and translation happen at the IR stage so that the converted code gets wrapped in julia and gets julia gc and runtime from the source. This is possibly extended to all languages that compile to IR, im solo on this and would like some community users to pick it apart. Theres 2 versions just the compiler and wrapper pipeline, and the other has daemonmode, module registry and other features i sidelined to focus on just source code to llvm to julia.
I actually made huge breakthrough in ffi gen with a 3 stage Validation system of AST tree deps, IR and DWARF debug info to generate julia binding automatically no manual coding, i need to handle inheritance and pointers, enums. This does require compiling the library your trying to generate bindings for but the compiler logic is built in as well as wrapper, with the biggest dependency being distributed, this 100% is better than clang.jl and CxxWrap.jl architectures. They rely on either parsing header info, or manual coding… both are terrible for generating bindings alone but IR, DWARF and AST together give the whole picture for julia to generate bindings from, its exciting because i can do this to anything that compiles against llvm, meaning julia users can bind in julia any library that uses llvm and c abi. Like rust, swift even python
This sounds great. Could you give a link to an example? I looked for the package RepliBuild.jl you mention but I could not find it.
RepliBuild.jl is in julia registry and on github.
Auto-generated Julia wrapper for struct_test
Generated: 2025-11-24 16:55:31
Generator: RepliBuild Wrapper (Tier 3: Introspective)
Library: libstruct_test.so
Metadata: compilation_metadata.json
Type Safety: Perfect - Types extracted from compilation
Language: Language-agnostic (via LLVM IR)
Manual edits: None required
module StructTest
const LIBRARY_PATH = “/home/grim/Desktop/Projects/RepliBuild.jl/examples/struct_test/julia/libstruct_test.so”
Verify library exists
if !isfile(LIBRARY_PATH)
error(“Library not found: $LIBRARY_PATH”)
end
=============================================================================
Compilation Metadata
=============================================================================
const METADATA = Dict(
“llvm_version” => “21.1.5”,
“clang_version” => “clang version 21.1.5”,
“optimization” => “2”,
“target_triple” => “x86_64-unknown-linux-gnu”,
“function_count” => 3,
“generated_at” => “2025-11-24T16:55:00.674”
)
=============================================================================
Struct Definitions (from DWARF debug info)
=============================================================================
C++ struct: Point (2 members)
mutable struct Point
x::Cdouble
y::Cdouble
end
export add_points, create_point, distance
“”"
add_points(arg1::Point, arg2::Point) → Point
Wrapper for C++ function: add_points(Point, Point)
Arguments
arg1::Pointarg2::Point
Returns
Point
Metadata
- Mangled symbol:
_Z10add_points5PointS_ - Type safety: From compilation
“”"
function add_points(arg1::Point, arg2::Point)::Point
ccall((:Z10add_points5PointS, LIBRARY_PATH), Point, (Point, Point,), arg1, arg2)
end
“”"
create_point(arg1::Cdouble, arg2::Cdouble) → Point
Wrapper for C++ function: create_point(double, double)
Arguments
arg1::Cdoublearg2::Cdouble
Returns
Point
Metadata
- Mangled symbol:
_Z12create_pointdd - Type safety: From compilation
“”"
function create_point(arg1::Cdouble, arg2::Cdouble)::Point
ccall((:_Z12create_pointdd, LIBRARY_PATH), Point, (Cdouble, Cdouble,), arg1, arg2)
end
“”"
distance(arg1::Point, arg2::Point) → Cdouble
Wrapper for C++ function: distance(Point, Point)
Arguments
arg1::Pointarg2::Point
Returns
Cdouble
Metadata
- Mangled symbol:
_Z8distance5PointS_ - Type safety: From compilation
“”"
function distance(arg1::Point, arg2::Point)::Cdouble
ccall((:Z8distance5PointS, LIBRARY_PATH), Cdouble, (Point, Point,), arg1, arg2)
end
end # module StructTest
Seems like 100% LLM slop TBH
Appreciate it, im solo as theres alot more julia users in julia than builders but if you wanna help, then your more than welcome to resolve some very big issues as another person. I use the llm. If you dont then thats a personal choice, or at least respind in a julia manner with references and actual concerns. Thank you
Please do not just plop LLM slop into the forums here. It’s effectively a denial of service of our collective attention.
This is a forum for humans, to be read and written by humans.