Skip to content

Add a target-specific declarations example #660

Closed

Description

@LunaStev

Why

Wave supports #[target(...)] declarations for selecting code by operating system and architecture, and the frontend has regression coverage for filtering complete declarations. There is no small maintained example showing how application code should use the feature.

Scope

Add a focused example under examples/ that defines the same small interface with target-specific implementations selected by #[target(os="...")] and/or #[target(arch="...")].

The example should:

  • contain at least two target-specific declarations;
  • keep target-dependent code small and observable;
  • avoid direct platform syscalls so the example is about declaration selection rather than OS APIs;
  • include comments explaining which declaration is selected for each demonstrated target.

Use only target conditions already supported by the compiler.

Completion criteria

  • The source passes wavec check for the normal host target.
  • Focused CI or documented commands check the example for at least two supported targets without requiring cross-target execution.
  • Only the declaration matching the selected target participates in compilation.
  • The example does not duplicate a full platform provider or introduce new target syntax.
  • The example is listed in the examples index or local README.

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