Skip to content

Add Rust FFI example#12

Merged
chaploud merged 2 commits intoclojurewasm:mainfrom
jtakakura:feat/rust-example
Mar 22, 2026
Merged

Add Rust FFI example#12
chaploud merged 2 commits intoclojurewasm:mainfrom
jtakakura:feat/rust-example

Conversation

@jtakakura
Copy link
Contributor

Adds examples/rust/ — a minimal Rust FFI example using the zwasm C API via extern "C" bindings.
Mirrors the existing C and Python examples.

Note: segfaults on x86_64 due to a known C API issue (see #11 ), same as the Python example.
Works correctly on aarch64.

@chaploud chaploud merged commit 775224c into clojurewasm:main Mar 22, 2026
chaploud added a commit that referenced this pull request Mar 22, 2026
- .gitignore: scope target/ and Cargo.lock to examples/rust/
- book en/ja c-api.md: add Rust FFI quickstart section + example ref
- ci.yml: add Rust FFI example build+run step after Setup Rust
chaploud added a commit that referenced this pull request Mar 22, 2026
Follow-up to PR #12: scope .gitignore to examples/rust/, add Rust
quickstart to book (en/ja), add CI step for Rust example build+run.
@chaploud
Copy link
Contributor

@jtakakura

Thank you for the contribution! 🎉

This has been merged, and I've also pushed a follow-up commit (b25f7c7) with:

  • Scoped .gitignore entries to examples/rust/
  • Added a Rust FFI quickstart section to the book (English & Japanese)
  • Added a CI step to build and run the Rust example

By the way, the segfault issue you reported in #11 has been fixed in 86cb5ae — the Rust example now works on x86_64 Linux as well.

Thanks again for both the bug report and the example!

@jtakakura jtakakura deleted the feat/rust-example branch March 22, 2026 04:25
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.

2 participants