Skip to content

v0.1.1

Choose a tag to compare

@elbayoumi elbayoumi released this 04 Dec 11:11
· 523 commits to main since this release
49a4700

midad 0.1.1. Read the breaking changes before upgrading from 0.1.0.

Breaking changes

  1. / is real division. 7 / 2 is now 3.5, not 3, on every path. Integer division is idiv(a, b), which floors (idiv(-7, 2) is -4). midad check warns W008 at every / between two numbers. x /= 2 on a number variable is now a type error.
  2. Integer overflow is refused on the Cranelift backend. It used to wrap silently. It now stops with integer overflow, like the interpreter and the C backend. Tight arithmetic loops are slower for it: a 300-million-iteration add, multiply and remainder loop went from 217 ms to 327 ms, and the heavy workload by 4% (measured, see BENCHMARKS.md).
  3. Runtime errors have one format. Compiled programs print one line, midad runtime error: <message>, and exit with status 1. The C backend used mdx: <message> and status 70; Cranelift could abort with a signal. The interpreter keeps its source-located R0001 diagnostic.
  4. Mixing a number and a float stays a compile error (E0230) and now says how to convert. Exponent literals such as 1e21 stay unsupported and now say so clearly.

Also in this release

  • Functions as arguments: a parameter typed fn takes the name of a function (no closures).
  • for x in xs.
  • Clearer diagnostics for ?:, for x of, for (x in) and for i in 0..3.
  • Fixes: the interpreter, C and Cranelift now agree on overflow, string order, float text and float negation. In the C backend, chars() failed to link and unwrap_or on an error returned the wrong value. int() of a huge float crashed Cranelift binaries.

Full details are in CHANGELOG.md. Archives for Linux (x86_64, arm64) and macOS (Apple silicon, Intel) are attached by the release workflow, each with a .sha256.