# DETLEF examples

| Example | Purpose |
| --- | --- |
| [C host](c/full_host.c) | Execution, callbacks, records, and value handling |
| [C package host](c/package_host.c) | Loading the courier package and printing a quote |
| [Node](js/node.mjs) | Initializing Wasm and evaluating a script |
| [Browser](js/browser.html) | A live editor with console I/O |
| [Node package host](js/package_host.mjs) | Loading the same archive in JavaScript |
| [Courier package](packages/courier/README.md) | Application-specific pricing with typed arguments and record results |

## Packages

The [courier package](packages/courier/README.md) implements a fictional parcel
shop's tariff. It uses the shared C SDK to expose
`courier_quote(weight_grams, express)` and a `CourierQuote` record. One source and
registration table compile for both supported package targets; hosts load the same
archive. The example includes build instructions and calls for both package hosts.

## JavaScript

Build the Wasm bindings first, then run Node or start the browser server:

```console
python crates/detlef-wasm/build.py
node examples/js/node.mjs
python examples/js/serve.py
```

The browser server prints the editor URL. Ctrl+C stops it.

For native build requirements and package tooling, see the
[C SDK](../docs/c/index.md).
