Skip to content

Releases: gengoscript/gengo

v0.5.0-pre2

18 Jun 16:25

Choose a tag to compare

v0.5.0-pre2 Pre-release
Pre-release

See CHANGELOG for details.

v0.5.0-pre1

15 Jun 18:51

Choose a tag to compare

v0.5.0-pre1 Pre-release
Pre-release

See CHANGELOG for details.

v0.4.1

12 Jun 07:34

Choose a tag to compare

Patch release: v0.4.0 shipped no binaries because the release workflow failed to cross-compile. Language and runtime content is identical to v0.4.0 — see those notes for what's new in 0.4.

Fixed — Cross-Platform Release Builds

  • macOStimeval.usec is c_int on Darwin but i64 on Linux; the cap:net deadline code now casts to the platform's field types.
  • Windowscap:fs read/exists used std.posix.openat (absent on Windows) since the post-v0.3.1 perf rewrite (#73); on Windows they fall back to the std.Io implementation that v0.3.1 shipped.

No behavior changes on Linux.

Full changelog: CHANGELOG.md · v0.3.1...v0.4.1

v0.4.0

12 Jun 06:24

Choose a tag to compare

Warning

No binaries. The release build failed to cross-compile (macOS timeval widths, Windows cap:fs). Binaries shipped in v0.4.1, which is content-identical apart from the build fixes. The notes below remain the 0.4 release notes.

The release where the type system stopped negotiating — and the engine learned to say its own name.

Breaking

  • Strict nominal types. Named values no longer mix with bare base values in arithmetic or comparison: Severity(4) >= 3 is a TypeError. Write Severity(4) >= Severity(3) or unwrap with int(s). Subtypes still mix with their parent type.
  • Strict int/float ordering comparisons. 1.5 > 1 is now a TypeError, matching arithmetic (1.5 + 1 was already rejected). Convert one side explicitly — 1.5 > float(1) — or write the literal as 1.0. Equality (==) is unchanged and still evaluates to false across types.

Improved

  • Runtime errors explain themselves (#107). Type and range errors name the operand types and suggest a remedy (cannot apply '>' to float and int; use matching numeric types such as 2.0 or float(2)), and the REPL prints the same --> repl:line:col location and caret block as file mode.
  • Heap scaling (#104). Slab size classes scale with the configured heap (up to 2 MiB blocks), a new 16 MiB server preset joins tiny/dev/stress, and allocations above the block ceiling fail gracefully with AllocationTooLarge instead of OOM.
  • String safety (#101). The .string immortality invariant is enforced with a debug tripwire; GC-safety fixes in fs.list, the split family, and dynamic string concat.
  • std.math abs/min/max/sign preserve int inputs instead of widening to float.

Infrastructure

  • Versioning discipline (#106). gengo --version, gengo_engine_version() in the C API (returns bare "0.4.0", machine-parseable), version source of truth in build.zig, stability policy in the README, tagging workflow in CONTRIBUTING.
  • The docs build themselves. docs.gengoscript.org is generated by a Gengoscript script (tools/site-builder) — every docs deploy is an end-to-end test of the language. This release it was rewritten around structs, templates, multiline strings, and multi-value returns, and the dogfooding surfaced three engine issues (#109, #110, #111) now slated for v0.5.0.
  • New native capability test lane; bench and heap tests join the CI gates.

Full changelog: CHANGELOG.md · v0.3.1...v0.4.0

v0.3.1

07 Jun 08:58

Choose a tag to compare

Language

Predicate subtypes
Named types may include a predicate function evaluated at construction time:

type Port int predicate func(x) { return x >= 1 && x <= 65535 }
p := Port(80)   // ok
p2 := Port(0)   // PredicateViolation

The predicate compiles as a closure and may capture variables from the enclosing scope.

Variant records with shared fields
Variants may declare bare fields in their body alongside arm declarations. Shared fields are present on every value and accessible without a match:

type Shape variant {
    x float,
    y float,
    circle { radius float },
    rect   { width float, height float },
    point
}
s := Shape.circle { x: 1.0, y: 2.0, radius: 5.0 }
std.io.println(s.x)  // no match needed

Multi-field variant arms
Variant arms may carry a struct-like payload bound in pattern matching:

switch s {
    case .circle(f) { std.io.println(f.radius) }
    case .rect(f)   { std.io.println(f.width, f.height) }
}

Embedding

Host-defined module registration
Hosts can register named modules callable from scripts:

engine_register_module(handle, "@module:mylib", funcs, func_count);

Scripts import with import("@module:mylib").

Host ABI v2
Five new host dispatch IDs for std.conv.* and std.core.bytelen. ABI version bumped to 2; capability bits guard the new calls with fallback to embedded implementations.

Native shared library
New build targets produce libgengo-engine.so / .dylib / .dll with the same C API as gengo-engine.wasm:

zig build -Dpreset=dev engine-native

ValueWire arrays and maps
engine_call results may now return arrays and maps across the boundary as ValueWire tag 4 (array) and 5 (map).

TypeScript SDK
sdk/typescript/ wraps gengo-engine.wasm with typed GVal encoding and a GengoEngine class.

Runtime

fix: predicate closure GC
Predicate closures on named types were being collected during long loops. The named_type GC mark path now traces the predicate field.

fix: Windows CLI cross-compile
Two type mismatches in the CreateFileA extern declaration caused the Windows release build to fail in v0.3.0. Fixed by declaring the path buffer as a sentinel-terminated array and hTemplateFile as optional.

REPL

  • Auto-print top-level expression results in interactive sessions
  • Typed redeclaration detection for globals
  • Error display includes source snippet and caret

Platform

  • Windows native CLI (x86_64-windows, no-libc)
  • std.time.sleep removed

Conformance

146 pass-cases · 133 fail-cases

v0.2.0

05 Jun 08:51

Choose a tag to compare

Full Changelog: v0.0.1-pre1...v0.2.0

v0.0.1-pre1

02 Jun 20:00

Choose a tag to compare