wavefnd / wavefnd/Wave

Add a focused pointers and fixed arrays example

Open Beginner friendly
#659 0 comments 0 reactions 0 assignees View on GitHub
documentation good first issue needs testing
Dominant language
Rust
Stars
53
Forks
16
Avg merge
4h 22m
Merged PRs (30d)
46

Description

## Why

Pointers, address-of expressions, `deref`, fixed-size arrays, and pointer parameters are fundamental Wave features, but the current examples only show them as pieces of larger programs such as `struct_proto_semantics.wave`, `game.wave`, and the WebAssembly smoke modules.

A smaller example would make the supported pointer/array model easier to understand without requiring readers to extract it from unrelated code.

## Scope

Add a focused runnable example under `examples/` that demonstrates:

- taking the address of a variable with `&`;
- declaring and passing `ptr` values;
- reading and modifying a value through `deref`;
- declaring and indexing a fixed-size `array`;
- passing a pointer to the first array element to a helper function.

Keep the example within ordinary safe-to-run hosted code. Do not expand it into allocator, raw syscall, FFI, or ownership semantics.

## Completion criteria

- [ ] The example passes `wavec check` and `wavec run` on a supported hosted target.
- [ ] A pointer-based helper visibly updates caller-owned data.
- [ ] Fixed-array indexing and pointer access are both demonstrated.
- [ ] The code avoids undefined out-of-bounds or dangling-pointer behavior.
- [ ] The example is listed in the examples index or local README.

Contributor guide

Open the contributing guide

Research direction

Start in examples/ by comparing struct_proto_semantics.wave, game.wave, and the WebAssembly smoke modules, then check the local examples index or README. Add a focused runnable Wave example and verify it with `wavec check` and `wavec run` on a supported hosted target. Done means the pointer, fixed-array, safe indexing, helper update, and examples listing criteria are all met.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.