Wysna Programming Examples
Run Wysna examples from the official repository and explore a native audit CLI, an application shared with WebAssembly, and an HTTP-to-SQLite workflow.
Start with Hello World in Wysna for a single-file program. These larger examples from the official Wysna repository show how multi-file applications are organized. Follow the installation guide to set up the toolchain first.
wysofia-ops (Operations Audit CLI)
Validates telemetry batches with contracts, creates a JSON report, and offers a separate SQLite target using the C interface.
shared-browser-app (Cross-Target Quoter)
Shares one typed pricing and validation module across a native CLI, a persistent SQLite service, and a browser WebAssembly build — traceable via wysna graph --rel impact.
automation-sync (Bounded Measurement Sync)
Fetches bounded HTTP/JSON batches with explicit timeout and size caps, validates records, and commits them transactionally into SQLite.
Try the Cross-Target Impact Workflow (shared-browser-app)
Section titled “Try the Cross-Target Impact Workflow (shared-browser-app)”examples/shared-browser-app demonstrates sharing a single typed validation and pricing rule across a native CLI, a persistent SQLite service, and a WebAssembly browser build:
git clone https://github.com/WashingtonYandun/Wysna.gitcd Wysna
# Trace which targets and tests are affected by changing the shared rulewysna graph --manifest examples/shared-browser-app/wysna.toml \ --symbol quote_validation_code \ --rel impactRun the Native Operations Audit CLI
Section titled “Run the Native Operations Audit CLI”The wysofia-ops example validates telemetry with contracts and can write the results to SQLite through the C interface. Use the Native SDK and run these commands from the root of a Wysna v1.1.0 source checkout.
wysna project check --manifest examples/wysofia-ops/wysna.toml --output-format=json-v1wysna project test --manifest examples/wysofia-ops/wysna.tomlwysna project run --manifest examples/wysofia-ops/wysna.toml -- --demoImport Measurements from HTTP into SQLite
Section titled “Import Measurements from HTTP into SQLite”The measurement synchronization example uses two commands. The first downloads a bounded JSON batch. The second validates the batch and writes it to SQLite in a transaction. The example README lists the build dependencies, input format, and validation command.