Skip to content

Add a small C ABI interoperability example #662

Closed

Description

@LunaStev

Why

Wave supports stable extern(c) and export(c) boundaries and the compiler regression suite verifies native C ABI interoperability, but examples/ does not contain a small user-facing project that shows the workflow end to end.

Scope

Add a self-contained native C interoperability example under examples/ using a small Wave source file, a small C source file, and a short README with the build commands.

Demonstrate both directions:

  • Wave calls a C function declared with extern(c);
  • C calls a Wave function exposed with export(c).

Use simple scalar arguments and return values so the example teaches the ABI boundary without introducing struct-layout or variadic-call complexity. Reuse the compiler's existing supported native link-input workflow rather than adding new build-system behavior.

Completion criteria

  • The Wave source passes wavec check independently.
  • The documented commands compile the C helper and Wave source and produce a runnable native program on a supported CI host.
  • The program verifies deterministic values in both Wave-to-C and C-to-Wave calls.
  • The example does not depend on a third-party C library or network access.
  • The README or examples index clearly distinguishes pub module visibility from export(c) ABI visibility.

Activity

  1. added
    documentation
    good first issue
    needs testing
    on Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationgood first issueneeds testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions