# Stage 6 — DSL

Verdict on this Mac: **PASS**. Linux: **PENDING**.

Author input is `tools/dsl/decls.json`. `tools/dsl/generate.py` checks schedules and ownership, then writes:

- `native/generated/arith.mojo` and `Mojoler.Dsl.Arith.add/2`, calling `native/examples/arith_user.mojo`
- `native/generated/bytes.mojo` and `Mojoler.Dsl.Bytes`, calling `native/examples/bytes_user.mojo`
- `native/generated/box.mojo` and `Mojoler.Dsl.Box`, calling `native/examples/box_user.mojo`

The user files do not mention `ErlNifEntry`. `--check` diffs the committed wrappers.

`tools/dsl/bad_schedule.json` fails with `schedule sideways`. `tools/dsl/bad_borrow.json` fails because a borrow is combined with `dirty_cpu`. Both exits are 1. The generator does not write those modules.

`shift/1` returns `{:ok, binary, nbytes}` and is an explicit copy. `borrow_len/1` returns `{:error, :not_binary}` for a list and for `<<1::7>>`. `Box.bump` adds through `step/2` on a resource. `Arith` and `Bytes` load in the same VM. Their `nif_init` symbols are in different files, so they do not clash.
