wavefnd / wavefnd/Wave

Add sorting and binary-search examples

Open
#664 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

`examples/` already contains a graph traversal example, but there is no small collection showing basic array algorithms in Wave. Sorting and binary search are useful teaching examples because they exercise fixed arrays, indexing, loops, comparisons, mutation, and helper functions without depending on the standard library or platform APIs.

## Scope

Add small algorithm examples under `examples/` for:

- one simple in-place sorting algorithm such as insertion sort or selection sort;
- binary search over a sorted fixed-size integer array.

Keep the examples intentionally straightforward rather than optimized. They should demonstrate Wave syntax and data manipulation, not benchmark performance or introduce a generic collections library.

The sorting and search examples may be separate files or a small shared directory if that makes the teaching flow clearer.

## Completion criteria

- [ ] The sorting example transforms an unsorted fixed array into a known ascending order and verifies the result.
- [ ] The binary-search example covers at least a found value and a missing value.
- [ ] All added `.wave` files pass `wavec check` and run successfully on a supported hosted target.
- [ ] The code uses deterministic local data and requires no input, network, or external files.
- [ ] The examples are listed in the examples index or local README.

Contributor guide

Open the contributing guide

Research direction

Start by reading the existing graph traversal example under examples/ to learn Wave syntax and the local conventions. Add straightforward sorting and binary-search .wave examples using deterministic fixed arrays, then run wavec check and each example on a supported hosted target. Done means both results are verified, found and missing searches are covered, and the examples are listed in the examples index or local README.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.