Skip to content

Introduce C library for Pkl#1238

Draft
bioball wants to merge 1 commit into
apple:mainfrom
bioball:c-library
Draft

Introduce C library for Pkl#1238
bioball wants to merge 1 commit into
apple:mainfrom
bioball:c-library

Conversation

@bioball
Copy link
Copy Markdown
Member

@bioball bioball commented Oct 15, 2025

This introduces native C bindings for Pkl.

This uses native-image to generate a C library for Pkl. This generated library from native-image is wrapped with our own library, in pkl.h.

This produces a static and a dynamic library for each os/arch variant that Pkl currently supports.

Supersedes #1136

@colinmarc
Copy link
Copy Markdown

This would be an amazing addition for those of us wanting to use pkl from rust!

@z-jxy
Copy link
Copy Markdown

z-jxy commented May 11, 2026

Curious if there were any changes planned for the C API?

I have an implementation against pkl.h (46db74a) from a few months back and was planning on doing a safe wrapper around the bindings, but don't want to get too far ahead if things might change before its released

This uses native-image to generate a C library for Pkl.
This generated library from native-image is wrapped with our own library,
in `pkl.h`.

This produces a static and a dynamic library for each os/arch variant
that Pkl currently supports.

Co-authored-by: Kushal Pisavadia <kushal.p@apple.com>
@bioball
Copy link
Copy Markdown
Member Author

bioball commented Jun 2, 2026

@z-jxy I don't anticipate too many more changes to the pkl.h API, although it's always possible that something will change before this is merged

@KushalP
Copy link
Copy Markdown
Contributor

KushalP commented Jun 2, 2026

@bioball can you merge this into a feature branch please? I'll then open PRs on top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants