The project

Migration to 0.2.0-dev

Additional changes in 0.3.0-dev

  • Annotations now enforce contracts. Correct mismatches, remove annotations for dynamic code, or use Any. The integer annotation is Int.
  • try, catch, throw, record, and enum are new reserved keywords for bindings; map keys and property names may use keywords.
  • zy check also validates known contracts and imported exports without running code. Dynamic values remain runtime-checked.
  • IP parsers now accept IPv6, and split/allocation support both address families.
  • Projects can use zy.json, isolated zy test functions, and locked local dependencies. See projects and types/errors.

The older numeric migration details below still apply.

This development version changes numeric behavior and rejects previously tolerated invalid programs. No stable release has been published by this update.

Previous behaviorCurrent behaviorRequired adjustment
7 / 2 returned integer 3Returns Float 3.5Use div(7, 2) for integer division
Exact integer division displayed 24 / 2 displays 2.0Use div() or explicitly convert if integer output is intended
Out-of-range literals silently saturatedLocated syntax errorUse in-range integers or an explicit finite Float
Integer arithmetic lost precision or overflowedExact values or overflow errorsFix bounds; explicitly convert to Float only when rounding is acceptable
Invalid math returned NaN/InfLocated runtime errorCheck mathematical domains and magnitudes
break/continue outside a loop were ignoredSyntax error, including inside a nested functionMove control flow into a loop in that function
Top-level return stopped executionSyntax errorUse a function; use assert() to signal a failed script
Extra method arguments could be ignoredArgument-count errorsMatch documented signatures
string.split() used an implicit spaceExplicit separator requiredWrite string.split(" ")
List sort mixed strings/numbersRequires all numbers or all stringsNormalize or separate values before sorting
A collection did not equal its own aliasIdentity equality for collectionsSeparate collections with identical content still compare unequal
Allocating huge ranges/splits was unboundedLimit of 65,536 entriesDivide work into smaller inputs
import, export, and as were valid identifiersReserved module keywordsRename variables, parameters, or other identifiers using these words

zy file.zy remains supported. zy run file.zy and zy check file.zy are additional commands. Script arguments follow the filename; args() exposes them. Use zy run --timeout=2s file.zy for a cooperative deadline.

check validates syntax, control-flow context, and the complete local import graph. It now reads dependency source and rejects missing imports, cycles, and graph-limit violations. It does not type-check dynamic values, check undefined expression names or exported member accesses, read input JSON, or execute policies.

Use local modules for reusable code and CLI tooling for fmt, fmt -w, and fmt --check. Formatting preserves inline layout and statement boundaries. No existing file is reformatted automatically.

Read numeric semantics, runtime limits, and standard library for the exact contracts.

Found something to improve?Edit this page on GitHub ↗
Search guides, language features, and APIs ↵ to open first result