Donna 0.3.0

Donna 0.3.0 focuses on stricter compiler checks, clearer diagnostics, and a more dependable daily workflow.

Donna v0.3.0 release

Donna v0.3.0 is a compiler-quality release. It does not try to make the language bigger. It makes the existing toolchain stricter, clearer, and harder to misuse.

The main theme is simple: Donna should catch mistakes before code generation or linking, and it should explain those mistakes in Donna terms.

Better diagnostics

Type mismatch errors now use a fuller diagnostic layout with the expected and found types shown separately.

code
error: Type mismatch
  ┌─ src/main.donna:5:3
  │
5 │   get_number()
  │   ^^^^^^^^^^^^

The type of this returned value doesn't match the return type
annotation of this function.

Expected type:

    Nil

Found type:

    Int

Return type errors now point at the returned expression, not just the function header. String literals and call expressions also carry better spans, so carets underline the whole expression instead of a single quote or parenthesis.

Panics are checked

panic is now rejected by the checker. It no longer compiles into runtime output and a successful build.

Donna also checks the panic message expression. If the message is not a String, the compiler reports a type mismatch before code generation.

Undefined names stop earlier

Undefined value names now produce Donna checker errors instead of falling through into broken QBE or linker failures.

This also applies to missing imported module members. For example, calling io.stderr when the available function is io.eprint now reports the missing member directly instead of failing at link time.

Warnings are part of normal builds

Static analysis warnings now run during donna build, donna check, and donna test.

Donna reports unused variables, unused parameters, unused private functions, unused imports, unreachable code, todo placeholders, and debug-only echo usage. Cached modules are still analysed, so incremental builds should not hide warnings.

Duplicate functions and constructors

The checker now catches duplicate function definitions within a module and reports the second definition directly.

Qualified constructor patterns are also checked against imported constructor metadata, including opaque constructors. This makes ADT errors more precise across module boundaries.

Package and build improvements

The compiler now emits clearer summaries at the end of build and check output:

code
Found 1 error(s) and 0 warning(s)

Interface caches were updated to carry opaque-constructor metadata. Old caches are discarded automatically and rebuilt.

Breaking and compatibility notes

The standard library dependency should use the donna package key and the v0.3 range:

code
[dependencies]
donna = { git = "https://github.com/donna-lang/donna_stdlib", version = ">=0.3.0 and <1.0.0" }

User-facing output examples should import donna/io and call io.println.

code
import donna/io

pub fn main() -> Nil:
  io.println("Hello Donna")

echo remains a language feature, but it is intended for temporary debug output. For normal program output, use io.print, io.println, io.eprint, or io.eprintln.

Upgrade checklist

  • Run donna clean --all once if you have old compiler artifacts.
  • Replace user-facing echo calls with io.println or another donna/io function.
  • Check imports after adding donna/io.
  • Run donna format, donna check, and donna test.

What's next

The next work should keep pushing on diagnostics, package ergonomics, and documentation. Donna is still small, but each release should make it feel less surprising and more dependable.