lawspec 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,532 @@
1
+ # Changelog
2
+
3
+ ## 0.15.2
4
+
5
+ Generated data types are the types you would write by hand, so adapters no
6
+ longer cast. A product (a type with one constructor) is named after its type
7
+ and read directly; a sum (several constructors) is a closed family that the
8
+ language's own pattern matching checks for exhaustiveness. Laws, tests,
9
+ evidence and codec checks are unchanged, but the generated types adapters
10
+ compile against change:
11
+
12
+ | Target | Before | After |
13
+ | --- | --- | --- |
14
+ | Java | `var d = (Drink.DrinkCase) value0; d.shots` | `value0.shots()` (a `record`) |
15
+ | Java | `new Size.LargeCase()`, `x instanceof Size.LargeCase` | `new Size.Large()`, `case Size.Large large ->` (sealed interface of records) |
16
+ | Kotlin | `(value0 as Drink.DrinkCase).shots` | `value0.shots` (a `data class`) |
17
+ | Kotlin | `Size.SmallCase()`, `is Size.LargeCase` | `Size.Small` (a `data object`), `is Size.Large` |
18
+ | Go | `value0.(DrinkDrink).Shots`, `DrinkDrink{...}` | `value0.Shots`, `Drink{...}` (a plain struct) |
19
+ | Rust | `let Drink::Drink { shots, .. } = value0;` | `value0.shots` (a `struct` with public fields) |
20
+ | Python | `data.DrinkDrink(...)` | `data.Drink(...)` |
21
+ | JavaScript, TypeScript | `new data.DrinkDrink(...)` | `new data.Drink(...)`; TypeScript's `Drink` is the class |
22
+ | Haskell | `Data.DrinkDrink size shots` | `Data.Drink size shots` |
23
+
24
+ - A case is named after its constructor. When that name equals the type's name
25
+ or clashes with another case, Java and Kotlin keep a `Case` suffix.
26
+ - Java records compare by value. A field named like a `java.lang.Object`
27
+ method (`hashCode`, `toString`, ...) is rejected, since its accessor would
28
+ override that method.
29
+ - A nullary case of a generic Kotlin sum is a class with value equality
30
+ (`Chain.Stop<T>()`); other nullary cases are `data object`s.
31
+ - Sums in Go, Rust, Python, JavaScript, TypeScript and Haskell keep their
32
+ names (`SizeSmall`, `Size::Small`).
33
+
34
+ ## 0.15.1
35
+
36
+ A maintenance release. The language and generated code are unchanged.
37
+
38
+ - **Documentation** moves into a [Diátaxis](https://diataxis.fr) site in
39
+ `docs/`: tutorials, how-to guides, reference and explanation. It replaces the
40
+ README's version-history sections, the per-target guides, `LANGUAGE.md`,
41
+ `NATIVE-BINDINGS.md`, `PRIMITIVES.md`, `REFINEMENTS.md`, `API-MIGRATION.md`
42
+ and the separate release notes, which this changelog now collects.
43
+ - **Lessons.** Eight tutorials build a coffee shop's ordering system, in Java,
44
+ Python and JavaScript tracks. Each lesson's specification is editable and
45
+ compiles in the browser, and the JavaScript tests run in the page. The lesson
46
+ implementations are a new acceptance suite, `lessons`, with a mutant per
47
+ lesson on each of the three targets.
48
+ - **The site** is static and built with `make docs`: `make docs-serve` previews
49
+ it and `make docs-deploy` deploys it to Cloudflare Pages. It runs the npm
50
+ package's `core.wasm` through a browser launcher with a minimal WASI shim,
51
+ and highlights LawSpec and every target language, in the editor too. Every
52
+ example is an editable sandbox: **Check** shows each law's evidence, and
53
+ lessons' **▶ Run** runs the generated JavaScript or TypeScript tests against
54
+ an editable implementation in an isolated frame, reporting each law's
55
+ examples, boundary cases and generated cases. Generated tests are read-only.
56
+ The `lessons` acceptance suite also covers TypeScript.
57
+ - **Evidence.** A law whose equation compares two Boolean expressions now shows
58
+ its claim as written (`isWeekend d == (d == 0 || d == 6)`), not as the
59
+ equivalence the prover uses.
60
+ - **Generated JavaScript.** Every JavaScript file in the repository is generated
61
+ from `templates/` by `lawspec-dev generate`, with the version, targets,
62
+ scaffolds and test commands filled in from the Haskell sources. The
63
+ compiler's own facts are no longer copied by hand into the npm CLI.
64
+ - **Development.** 121 unmaintained integration scripts, most of which needed
65
+ manual setup and no longer ran, are removed; the acceptance suites and the
66
+ Hspec tests cover what they did. The TypeScript API type check becomes an npm
67
+ test. The Makefile covers every task (`make` lists them), `lawspec-dev bump`
68
+ sets the version everywhere, and `RELEASING.md` documents the release.
69
+ - The npm package ships `README.md`, `CHANGELOG.md` and `LICENSE`; the
70
+ documentation is online.
71
+
72
+ ## 0.15.0
73
+
74
+ ### Evidence and discharge
75
+
76
+ Every obligation of a program reports how it is discharged, strongest first:
77
+
78
+ - `proved`: statically. Definition postconditions and indices, as since 0.12,
79
+ and now laws that call only checked definitions.
80
+ - `exhaustively-checked`: every input of a finite domain, by the compiler for
81
+ laws over checked definitions and otherwise by the generated tests. A law with
82
+ no inputs is a single case.
83
+ - `property-tested`: generated cases, boundary cases and examples.
84
+ - `runtime-checked`: adapter contracts, definition preconditions, constructor
85
+ constraints and native type bindings, at every native boundary.
86
+ - `assumed`: adapters, native functions, custom generators and codec hooks,
87
+ taken on trust. Each adapter reports how many laws call it, or that none does.
88
+
89
+ `lawspec check` summarizes the obligations by status, and the new
90
+ `lawspec evidence` lists each with its claim and reason (`--json` for the API
91
+ records, and a unit or `unit::declaration` filter). See
92
+ [evidence and discharge](docs/reference/language/evidence-and-discharge.md).
93
+
94
+ ### Laws proved and refuted by the compiler
95
+
96
+ A law over checked definitions is attempted as a proof by the same exact linear
97
+ arithmetic that proves definition results, from its input refinements, with
98
+ definitions that have no preconditions unfolded into the claim. When it is not
99
+ proved and its domain is finite, the compiler evaluates every input; a
100
+ counterexample is a compile error with code `refuted`, such as
101
+ `law always positive is false for x = -128`. Specifications that compiled
102
+ before may therefore be rejected if a law over definitions is false.
103
+
104
+ The prover also handles constant factors on integer expressions (`x * 2`),
105
+ which it previously treated as non-linear, so more definition results are
106
+ proved.
107
+
108
+ ### API
109
+
110
+ `evidence` items have the five statuses above and new stages: `law`,
111
+ `adapter`, and, with native bindings, `binding`, `codec`, `generator` and
112
+ `native-function`. `claim` is `null` for obligations without one. The
113
+ TypeScript API declares `ObligationEvidence` and `DischargeStatus`. See
114
+ [API migration](docs/explanation/api-migration.md#evidence-and-discharge-0150).
115
+
116
+ ## 0.14.0
117
+
118
+ ### Imports
119
+
120
+ ```lawspec fragment
121
+ unit shop.orders
122
+ import shop.domain as domain (Money, Cents, `commutative`)
123
+ ```
124
+
125
+ A unit imports other units by name. Every declaration of an imported unit is
126
+ available through the alias (`domain.Usd`, `domain.centsOf`), and listed names
127
+ also unqualified. Types, wrappers, indexed families, refinements, checked
128
+ definitions and generic laws can be imported. Adapters and concrete laws stay
129
+ with their unit. Import cycles, unknown units and missing or ambiguous names are
130
+ reported at the import, with the reason: an adapter, a constructor listed
131
+ without its type, or a law without parameters.
132
+
133
+ Names are scoped to their unit, so units compiled together no longer need
134
+ distinct constructor names. Targets with one data namespace (Python,
135
+ JavaScript, TypeScript, Go and Haskell) name colliding types after their unit,
136
+ `ShopDomainCurrency` and `ShopOrdersCurrency`, and their constructors
137
+ `ShopDomainCurrencyUsd`. Java, Kotlin and Rust qualify only the type. Earlier
138
+ versions qualified only the colliding names, for example
139
+ `ShopDomainTypeCurrencyUsd` next to `CurrencyEur`.
140
+
141
+ Imports are resolved before type checking, like indexed families and domain
142
+ models, so Core and the eight backends are unchanged.
143
+
144
+ ### Packages
145
+
146
+ A `lawspec-package.json` names a package, its version, its source directories
147
+ and the version ranges of its dependencies. Package units are named after the
148
+ package, a unit imports only from its own package and direct dependencies, and
149
+ every range must accept the supplied version. A project lists `dependencies` and
150
+ the `packages` directories in `lawspec.json`. A package's adapters and laws are a
151
+ published contract: dependent projects implement and test them as their own.
152
+ `lawspec package` checks a package and summarizes it. See
153
+ [imports and packages](docs/reference/language/imports-and-packages.md).
154
+
155
+ The compiler API accepts `dependencies`, `packages` and `package`, and reports
156
+ the resolved packages (see
157
+ [API migration](docs/explanation/api-migration.md#imports-and-packages-0140)).
158
+
159
+ ### Other changes
160
+
161
+ - Rust: a law without quantified inputs no longer emits an untyped empty case
162
+ vector, which did not compile.
163
+ - The VS Code grammar highlights `import` and `as`.
164
+ - A new acceptance suite, `packages`, runs the
165
+ [package example](examples/packages) on all eight targets in both machine
166
+ profiles and rejects five adapter mutants plus the bare stubs. `lawspec-dev ci`
167
+ includes it.
168
+
169
+ ## 0.13.2
170
+
171
+ A maintenance release. The language, generated code and API are unchanged.
172
+
173
+ - The repository has no hosted CI. `stack run lawspec-dev -- ci` runs the
174
+ complete check locally: compiler, npm, parity, package and editor checks, then
175
+ for each target the dependency bootstrap, every acceptance suite in both
176
+ machine profiles, and the installed native-binding example. It logs each step to
177
+ `.artifacts/ci/` and exits non-zero on any failure. `--target`, `--core`,
178
+ `--fail-fast`, `--rust-toolchains` and `--rust-targets` select what to run.
179
+ `make ci` is equivalent.
180
+ - The JavaScript acceptance runners and fixture modules replaced by
181
+ `lawspec-acceptance` are removed.
182
+ - The package smoke test's per-command timeout is ten minutes: exporting every
183
+ bundled example had exceeded the former two-minute limit on slower machines.
184
+ - The integration bootstrap restores missing scaffold files in existing projects.
185
+
186
+ ## 0.13.1
187
+
188
+ A maintenance release. The language, generated code and API are unchanged from
189
+ 0.13.0.
190
+
191
+ - Repository checks move from JavaScript to Haskell. `lawspec-dev boundaries` and
192
+ `lawspec-dev integrity` replace `tools/check-boundaries.mjs` and
193
+ `tools/build-integrity.mjs`. The integrity check now also rejects staged npm
194
+ copies of documentation and examples that differ from their sources.
195
+ - `lawspec-acceptance` runs the bundled-example acceptance suites
196
+ (`integration`, `algebra`, `scalar`, `refinement`, `indexed`, `domain`) in
197
+ process. Adapters and mutants are real files under `acceptance/`, and a
198
+ mutant that only breaks the build now fails the suite. This exposed a
199
+ TypeScript scalar mutant that previously counted as rejected because it
200
+ failed type-checking; it now exercises the laws.
201
+ - Build-file scaffolds are defined once in Haskell (`LawSpec.Scaffold`) and
202
+ checked against the npm templates byte for byte.
203
+ - Compiler API contract tests formerly in `npm/test` run in hspec against the
204
+ same JSON boundary that `core.wasm` exports. A new npm test checks that
205
+ generation never rewrites build files and that regeneration is a no-op on
206
+ every target.
207
+
208
+ ## 0.13.0
209
+
210
+ ### Wrappers and constrained primitives
211
+
212
+ ```lawspec fragment
213
+ wrapper UnitQuantity is Int32 where value >= 1 && value <= 1000 end
214
+ wrapper NonEmptyList (a :: Type) is List a where prelude.length value > 0 end
215
+ ```
216
+
217
+ A wrapper declares a distinct nominal type with one field, `value`, and an
218
+ optional constraint. Its constructor checks the constraint, so an invalid value
219
+ cannot be constructed in an example (the compiler rejects `UnitQuantity 0`),
220
+ produced by a generator, or decoded from native code. `valueOf<Name>` unwraps a
221
+ value. Wrappers may take type parameters. They elaborate to a single-constructor
222
+ product with a refined field, so all eight targets represent them natively with
223
+ no new runtime machinery.
224
+
225
+ ### Workflows and state distinctions
226
+
227
+ ```lawspec fragment
228
+ workflow placeOrder :: UnvalidatedOrder -> Either OrderError PricedOrder is
229
+ validateOrder :: UnvalidatedOrder -> Either OrderError ValidatedOrder
230
+ priceOrder :: ValidatedOrder -> Either OrderError PricedOrder
231
+ end
232
+ ```
233
+
234
+ A workflow declares its steps as adapters and checks the pipeline: each step
235
+ must accept the previous step's state, and fallible steps must share an error
236
+ type. The workflow's result must match `Either E T` when any step can fail, or
237
+ `T` otherwise. The compiler adds the law `placeOrder composes its steps`: the
238
+ native workflow must equal the railway composition of the native steps.
239
+ Diagnostics name the step and the mismatched types, with the workflow's source
240
+ location. See [domain modeling](docs/reference/language/domain-modeling.md).
241
+
242
+ ### Evidence
243
+
244
+ Constructor field constraints, including wrapper constraints, appear in the
245
+ evidence as `construction` obligations with status `runtime-checked`, next to
246
+ the contract obligations introduced in 0.12. The TypeScript API declares these
247
+ records as `ObligationEvidence`; the 0.12 typing was not published.
248
+
249
+ ### Examples and acceptance
250
+
251
+ `examples/specs/domain_modeling.lawspec` combines wrappers, a parameterized
252
+ `NonEmptyList`, order states and the workflow. It runs on all eight targets in
253
+ both machine profiles. Correct adapters pass; mutants that break a wrapper
254
+ invariant, the railway composition, or a non-empty list operation fail.
255
+
256
+ ### Compatibility
257
+
258
+ `wrapper` and `workflow` begin new declarations. Specifications that do not use
259
+ them compile as in 0.12. API schemas 3 and 4 are unchanged, apart from the
260
+ additive `construction` stage in `evidence`.
261
+
262
+ ## 0.12.0
263
+
264
+ ### Proved indices
265
+
266
+ Checked definitions may return natural-indexed families, and the compiler
267
+ proves their result indices statically:
268
+
269
+ ```lawspec fragment
270
+ definition concatV (xs :: Vec n Int8) (ys :: Vec m Int8) :: Vec (n + m) Int8 is
271
+ match xs with
272
+ | VNil -> ys
273
+ | VCons h t -> VCons h (concatV t ys)
274
+ end
275
+ end
276
+ ```
277
+
278
+ The totality prover now treats calls of checked definitions as pure linear
279
+ atoms, so equal calls have equal results. A single-argument definition that
280
+ matches on its argument unfolds on a known constructor, so `nOfVec (VCons h t)`
281
+ is `nOfVec t + 1`. Natural measures are non-negative. Together with the existing
282
+ match facts and the induction hypothesis from recursive calls, this proves
283
+ definitions such as `concatV`, and tree flattening through nested calls. It
284
+ rejects definitions whose result indices do not follow, including an unchanged
285
+ length, a dropped element, an extra element and a wrong recursive argument.
286
+ See [proved indices](docs/reference/language/indexed-families.md#proved-indices).
287
+
288
+ ### Evidence
289
+
290
+ Every contract obligation is recorded as `proved` or `runtime-checked`.
291
+ Definition postconditions are proved, and generated code on all eight targets no
292
+ longer re-checks them at runtime. Definition preconditions, which guard native
293
+ callers, and adapter contracts remain runtime-checked. `lawspec check` prints a
294
+ summary, and API responses include an additive `evidence` array; see
295
+ [API migration](docs/explanation/api-migration.md#evidence-0120).
296
+
297
+ The indexed example now includes proved definitions `concatV` and `flattenV`,
298
+ used as reference models for the native `append` and `flatten` adapters. The
299
+ eight-target acceptance runner executes them in both machine profiles and still
300
+ rejects every index-breaking adapter mutant.
301
+
302
+ ### Compatibility
303
+
304
+ Specifications that compiled with 0.11 compile unchanged. Generated definition
305
+ code omits postcondition checks that are now proved, which changes generated
306
+ output but not behavior. API schemas 3 and 4 are unchanged apart from the
307
+ additive `evidence` field. Index equalities between sibling fields, non-linear
308
+ indices and type-refining GADTs remain open; see the
309
+ [current limits](docs/reference/language/index.md#current-limits).
310
+
311
+ ## 0.11.0
312
+
313
+ ### Natural-indexed families
314
+
315
+ Data declarations may take `Natural` parameters, and each constructor states
316
+ its index equation:
317
+
318
+ ```lawspec fragment
319
+ type Vec (n :: Natural) (a :: Type) is
320
+ | VNil where n = 0
321
+ | VCons head :: a tail :: Vec m a where n = m + 1
322
+ end
323
+
324
+ append :: (xs :: Vec n Int8) -> (ys :: Vec m Int8) -> (r :: Vec (n + m) Int8)
325
+ ```
326
+
327
+ A family elaborates before inference into ordinary erased data, a checked
328
+ structural measure per index (`nOfVec`), and a refinement relating the measure
329
+ to the index. Core and all eight emitters are unchanged. Native code works with
330
+ the erased type, and every index claim is evidence checked at test time: a
331
+ dependent result such as `Vec (n + m) Int8` is an adapter postcondition.
332
+
333
+ An index variable that is otherwise unbound is implicit. The first binder whose
334
+ family type mentions it determines it, and later occurrences read that binder's
335
+ measure. Index expressions are sums of natural literals and index variables.
336
+ `Natural` is also available as a value type. Diagnostics use the `indexed` code.
337
+ See [indexed families](docs/reference/language/indexed-families.md).
338
+
339
+ ### Index-directed generation
340
+
341
+ A quantifier constrained by a linear structural measure, including a fixed index
342
+ (`Vec 3 Int8`) or a shared one (`zip`'s second argument), is generated by solving
343
+ the constructor equations backwards instead of filtering. Multi-field equations
344
+ such as `Bin … where n = l + r + 1` split the remaining index across fields.
345
+ Python, JavaScript, TypeScript, Java, Kotlin, Go, Haskell and Rust construct these
346
+ values natively, and framework shrinking stays within the index. The same
347
+ planning applies to user-written linear measures over declared data.
348
+
349
+ `examples/specs/indexed_families.lawspec` runs on all eight targets. Correct
350
+ adapters pass free, fixed and shared index laws; mutants that add, drop or lose
351
+ elements fail their dependent contracts.
352
+
353
+ ### Tower-polymorphic Integer results restored
354
+
355
+ 0.9 had narrowed Kotlin and Haskell adapters whose result is the abstract
356
+ `Integer` to `BigInteger` and `Integer`. They again return `Number` (Kotlin) and
357
+ `LS.IntegerValue` (Haskell), as in 0.8 and as Java always did. `Integer` is the top
358
+ of the integral tower: an implementation may return any integral native value,
359
+ and the result bridge rejects non-integral values and checks the logical domain.
360
+ Adapters written against 0.9 or 0.10 stubs that return `BigInteger` or `Integer`
361
+ still compile, because both are integral.
362
+
363
+ This regression had kept the Kotlin and Haskell target checks failing since
364
+ 0.9. Those checks, and the scalar mutation fixtures, now pass with the documented
365
+ typed Symbol, Decimal, Utf16Text and Optional representations.
366
+
367
+ ### Compatibility
368
+
369
+ Specifications without indexed families generate the same code as 0.10, apart
370
+ from the Integer result signatures above. API schemas 3 and 4 are unchanged.
371
+ GADTs that refine type arguments, non-linear indices and index equalities between
372
+ sibling fields remain future work.
373
+
374
+ ## 0.10.0
375
+
376
+ ### Existing application models
377
+
378
+ Native bindings connect LawSpec products and sums to existing application types
379
+ on Java, Python, JavaScript, TypeScript, Go, Haskell, Kotlin and Rust. Configure
380
+ constructor and field mappings, bind adapter declarations to existing functions,
381
+ or supply paired conversion hooks for representations requiring custom code.
382
+ Bindings resolve against typed declaration identities; they do not change the
383
+ meaning of arithmetic, equality, definitions or refinements. See
384
+ [Bind native types and functions](docs/how-to/bind-native-types.md).
385
+
386
+ Checked bridges compose through generic and recursive types and the built-in
387
+ containers. They preserve exact numeric values, Symbol identity and distinct
388
+ absence states. Invalid native inputs, results, generator samples and shrink
389
+ candidates fail with context.
390
+
391
+ ### Native generators
392
+
393
+ Factories return their framework's generator: JetCheck, Hypothesis, fast-check,
394
+ Rapid, Hedgehog, Kotest or Proptest. Generic factories receive child generators.
395
+ Composition retains native shrinking. Explicit examples, deterministic boundaries
396
+ and finite-domain enumeration still run when the factory's distribution excludes
397
+ those values.
398
+
399
+ A factory can ignore an uninhabited parameter, as in `Phantom Empty`. Requesting a
400
+ value from that parameter fails generation; it cannot turn a property into a
401
+ vacuous success. Finite inhabited containers such as `List Empty` still enumerate.
402
+
403
+ Optional `stub: true` generator bindings create user-owned implementation files.
404
+ Regeneration preserves edits and reports changed factory signatures for review.
405
+
406
+ ### API and migration
407
+
408
+ Native binding requests negotiate schema 4. Schema 3 remains supported for
409
+ specifications without bindings. Structured native references and strict
410
+ configuration validation prevent older compilers from silently ignoring mappings.
411
+ Go additionally supports explicit import aliases; Rust binds tests to the
412
+ application library's type identities.
413
+
414
+ Existing adapter files cannot be overwritten by adopting a binding. Move their
415
+ implementations into the application module and save the old adapters before
416
+ generation. Generated source bridges, test helpers and user-owned application
417
+ files retain separate placement and ownership. See the
418
+ [migration guide](docs/explanation/api-migration.md#native-bindings-schema-4-0100) and
419
+ [adopting bindings](docs/how-to/bind-native-types.md#adopt-bindings-in-an-existing-project).
420
+
421
+ ### Runnable payment projects
422
+
423
+ `lawspec examples --example payments` exports a project for every target; use
424
+ `--target rust` or another language to select one. Each project includes an
425
+ application model, native generator, configuration, build files and instructions.
426
+ The shared specification checks exact fees, currency preservation, sum payloads,
427
+ ordered archives, duplicates and absence. Re-exporting preserves application
428
+ edits and the separate compiler generation manifest.
429
+
430
+ Both 32-bit and 64-bit logical machine profiles and readable/compact output are
431
+ covered by the acceptance matrices. Java 25+, Python 3.13+ and the other published
432
+ toolchain baselines remain unchanged. Python output follows PEP 8.
433
+
434
+ ## 0.9.0
435
+
436
+ This release adds structural data and checked total definitions across Java,
437
+ Python, JavaScript, TypeScript, Go, Haskell, Kotlin and Rust.
438
+
439
+ ### Language
440
+
441
+ - `List a` supports nested contextual literals, structural equality, exact
442
+ length, deterministic boundaries, and native framework generation/shrinking.
443
+ - Algebraic `Maybe a` and `Either a b` provide `Nothing`/`Just` and `Left`/`Right`.
444
+ They remain distinct from interoperability `Nullable` and `Optional` values.
445
+ - Named parameterized products and sums have constructors and ordered fields.
446
+ Generated native types and typed adapters preserve their structure.
447
+ - Total definitions support exhaustive matching and checked structural recursion.
448
+ The compiler rejects partial matches and recursion it cannot establish as
449
+ terminating. Generic definitions specialize to their concrete uses.
450
+ - Refined definition signatures become executable native contracts. Scoped
451
+ payload predicates preserve type-parameter roles through recursive and mutual
452
+ data declarations, including predicates that depend on preceding inputs.
453
+
454
+ Existing scalar semantics remain intact: exact arithmetic does not wrap,
455
+ conversions to bounded adapter parameters are checked, floating equality follows
456
+ IEEE rules, and Symbol equality uses identity.
457
+
458
+ ### Generated output
459
+
460
+ Readable code is the default for runtimes, declarations, definitions, adapters,
461
+ tests, and scaffolds. Explicit `--minify` selects compact output for `init`,
462
+ `generate`, and `examples`; the compiler API accepts `minify: true`.
463
+
464
+ Output follows Google language-specific guidance where applicable, PEP 8 for
465
+ Python, standard Go and Rust formatting, and an 80-column Haskell layout.
466
+ Formatting is deterministic in both native and WASM compilation and requires
467
+ no formatter download. Compact output preserves required layout, literal
468
+ contents, and semantics. Changing formatting mode does not overwrite edited
469
+ adapters or create false adapter-signature updates.
470
+
471
+ ### API and compatibility
472
+
473
+ API schema 3 adds named data declarations, structural values, checked definitions,
474
+ construction/matching expressions, and scoped payload predicates. Existing scalar
475
+ wire encodings are unchanged. Exhaustive expression visitors must handle the
476
+ new variants; see [API migration](docs/explanation/api-migration.md#structural-data-and-definitions-090).
477
+
478
+ Java 25+, Python 3.13+, Node 22+, and Rust 1.85+ baselines remain unchanged.
479
+ Machine-width profiles, custom source/test directories, generation manifests,
480
+ and user ownership of adapters/build files remain supported. Framework-specific
481
+ strategies stay separate from reusable runtime source.
482
+
483
+ ### Examples and release acceptance
484
+
485
+ Bundled examples cover reverse involution, sorting idempotence/sortedness/length/
486
+ permutation, nested presence, products/sums, exhaustive matches, total functions,
487
+ and recursive payload refinements. Release acceptance includes compiler and
488
+ native/WASM checks, native execution on all eight targets, deliberately incorrect
489
+ adapters, independent formatting/syntax checks, regeneration protection, and
490
+ installation of the packed npm artifact.
491
+
492
+ ## 0.8.0
493
+
494
+ Rust support and a shared typed compiler boundary are the focus of this release.
495
+ The compiler remains implemented in Haskell and ships as prebuilt WebAssembly.
496
+
497
+ ### Changes
498
+
499
+ - Rust 2024, with Rust 1.85 as the minimum toolchain, Cargo scaffolding, Proptest
500
+ generation/shrinking, the complete scalar catalog, refinements, and contracts.
501
+ - An independent numeric Rust runtime with owned native bridges, exact arithmetic,
502
+ checked conversions, direct IEEE rounding, raw text, Symbol identity, and
503
+ distinct nested absence states. Proptest support is emitted separately.
504
+ - A typed core and proposition tree shared by all eight emitters. Resolved IDs,
505
+ parsed source ranges, contextual literals, arithmetic evidence, and conversions
506
+ survive elaboration. Emitters no longer import source syntax or inference.
507
+ - An independent core validator and evaluator. Testing plans distinguish semantic
508
+ validity from execution feasibility and preserve dependent refinement domains.
509
+ - API schema v3 with explicit wire views and unchanged lossless scalar encodings.
510
+ Explicit schema-v2 requests receive a migration diagnostic.
511
+ - Rust module wiring, custom layouts, Cargo preflight, adapter preservation,
512
+ generation manifests, bundled examples, and installed-package coverage.
513
+ - Exact algebra and numeric currying examples. Logical `Integer` replaces their
514
+ former modular Int32 contracts. Examples cover Int32 overflow, large products,
515
+ Int32-minimum negation, and values beyond machine/safe-number bounds; deliberately
516
+ wrapping adapters are rejected on every target.
517
+
518
+ See [Rust](docs/how-to/targets/rust.md), [the language reference](docs/reference/language/index.md),
519
+ [primitives](docs/reference/primitives.md), [refinements](docs/reference/refinements.md), and
520
+ [API migration](docs/explanation/api-migration.md#schema-2-to-schema-3-080).
521
+
522
+ ### Compatibility and scope
523
+
524
+ Java 25+, Python 3.13+, and Node 22+ baselines remain unchanged. Existing LawSpec
525
+ source remains compatible. API clients must migrate to schema v3. All nonempty
526
+ plans emit scalar runtime source; existing Haskell projects need direct `text`
527
+ and `bytestring` dependencies in the component compiling that source. Build
528
+ files and implementation adapters remain user-owned.
529
+
530
+ Machine-sized domains use an explicit 32/64-bit profile. Native machine-sized
531
+ bindings reject an architecture mismatch. Rust adapters take owned values;
532
+ borrowing/lifetimes do not become LawSpec language constructs.