Skip to content

Add C Language Plugin Support#6

Merged
topheman merged 15 commits into
masterfrom
feat/c_modules
Jul 18, 2025
Merged

Add C Language Plugin Support#6
topheman merged 15 commits into
masterfrom
feat/c_modules

Conversation

@topheman
Copy link
Copy Markdown
Owner

@topheman topheman commented Jul 18, 2025

This PR introduces support for WebAssembly Component Model plugins written in C, expanding the plugin ecosystem beyond Rust implementations.

You will be able to run this kind of command in the REPL: echoc foo which will act like the echo plugin (made in rust).

✨ Key Features

  • C Plugin Infrastructure: Added complete toolchain and build system for C-based plugins
  • Echo Plugin Implementation: Created a C version of the echo plugin (c_modules/plugin-echo/component.c) as a reference implementation
  • WASI SDK Integration: Integrated wasi-sdk for compiling C code to WebAssembly components
  • CI/CD Updates: Added wasi-sdk download step to CI workflows for both Rust host and web host
  • Web Host Support: Added jco transpile integration to run C plugins in the browser

🔧 Technical Implementation

  • Memory Management: Proper C string handling with null-termination and memory allocation
  • WIT Bindgen Integration: Generated C bindings from WIT interface definitions
  • Build System: Added just tasks for C plugin development (just dl-wasi-sdk, just c-wit-bindgen-plugins)
  • Testing: Added end-to-end tests for C plugins with full CI integration
  • Web Transpilation: C plugins are compiled to WASM and jco transpile provides JavaScript bindings for browser execution

📚 Documentation

  • Comprehensive C plugin development guide in c_modules/README.md
  • Updated main README with C plugin information
  • Added development workflow documentation

🧪 Testing

  • Added e2e tests for C echo plugin functionality
  • Split test infrastructure for better organization
  • CI integration for C plugin builds

📦 Resources

C Tooling

This feature enables developers to write plugins in C, providing more language options for the WebAssembly Component Model REPL ecosystem while maintaining the same plugin interface and functionality as Rust implementations. C plugins now work seamlessly across both CLI and web hosts.

@topheman topheman self-assigned this Jul 18, 2025
@topheman topheman merged commit f167b78 into master Jul 18, 2025
6 checks passed
@topheman topheman deleted the feat/c_modules branch July 19, 2025 09:02
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.

1 participant