Repository navigation
Releases: CodingAnarchy/catallaxy
Release list
Catallaxy 0.4.1
A safety release. Ordinary Catallaxy code could crash catx with a segfault, kill it through deep recursion in native code, or hang it after an internal error. 0.4.1 fixes all three: the type checker rejects the programs that got wrong-typed values into native code, the runtime raises a catchable error wherever a check is still needed, and internal failures end only the thread they happen on. Upgrading is recommended. Milestone: 0.4.1.
Install
curl -fsSL https://raw.githubusercontent.com/CodingAnarchy/catallaxy/main/install.sh | sh # Linux, macOS
cargo install catallaxy # any platform with RustFixes
No more crashes from wrong-typed values (#147)
- Built-in methods and the interpreter's field, list, tuple and call instructions check the kind of object they're given, and raise
TypeError: expected X, got Ywith a trace instead of segfaulting or reading garbage. This covers values that arrive throughDyn, which the checker can't see.
The checker closes the holes that let wrong-typed values through
- Overrides must have compatible signatures (E0227, #148): they accept the overridden method's parameter types, return a compatible type, keep its defaults, and don't move a parameter name to another position.
- Type tests (
is,as?,match) can't narrow by generic type arguments that are erased at run time (E0374, #149). Test the erased form (is Box) instead. - Interfaces with
Selfparameters, such asComparableor a userMerge, can be used only as generic bounds, not as value types (E0375, #150). Writefn bigger[T: Comparable](a: T, b: T).
Deep recursion raises SystemStackError (#154)
- Deep
==, hashing,<=>, JSON, and recursion throughMutex.lock,Atomic.updateorpar_mapnow raise a catchableSystemStackErroron the main thread, threads, fibers and pool workers, instead of killing the process.
Internal errors no longer hang the program (#155)
- An internal Rust panic ends only its thread, fiber or pool job.
joinreturnsErr("internal error: …"), the collector keeps working, and on the main thread the program prints the error and exits 101. - Nesting
with lockon one object more than 1,000 deep is aLockError.
Upgrade notes
- Newly rejected programs: the checker now rejects some programs that 0.4.0 accepted: incompatible overrides, type tests on erased generic arguments, and interfaces with
Selfparameters used as value types. Each such program could crash or misbehave at run time. The error messages include a suggested fix, anddocs/errors.mdhas an example for each new code. - Performance: benchmarks are within noise. Loops that do nothing but read fields or destructure tuples are about 3% slower, from the new kind checks.
What's Changed
- Checker: overrides must have compatible signatures (E0227) by @CodingAnarchy in #151
- Checker: type tests must not narrow by erased type arguments (E0374) by @CodingAnarchy in #152
- Checker: interfaces with Self parameters are bounds, not value types (E0375) by @CodingAnarchy in #153
- Natives and instructions check object kinds: TypeError instead of a crash (#147) by @CodingAnarchy in #195
- Runtime: internal panics end only their thread; deep with lock is a LockError by @CodingAnarchy in #197
- Runtime: deep native recursion raises SystemStackError instead of crashing (#154) by @CodingAnarchy in #199
- Release 0.4.1 by @CodingAnarchy in #201
Full Changelog: v0.4.0...v0.4.1
Catallaxy 0.4.0
Install
curl -fsSL https://raw.githubusercontent.com/CodingAnarchy/catallaxy/main/install.sh | sh # Linux, macOS
cargo install catallaxy # any platform with RustThis is the first release with prebuilt catx binaries: Linux and macOS on x86_64 and arm64, plus Windows x86_64. Each archive has a .sha256 file, and SHA256SUMS lists them all. Milestone: 0.4.0 (44 issues).
Highlights
Language and standard library
- Formatting: string format specs (
"#{x:>8.2f}") andString.format. - Collections: O(1) ASCII string indexing and
Deque[T]. - JSON: integers of any size stay exact.
- New APIs: lazy sequences (
xs.lazy(),Lazy[T]);Duration,InstantandDateTime;Csv,Bytes,Digest,Env.set,Stdin.lines. - Language:
import a.b as c,Enum.values(), and(obj.f)(x)for calling a function stored in a field. - Optionals:
??=,ok_or, and nil narrowing of fields.
Type checker
- Soundness fixes: untyped-parameter functions, members of union types, narrowing across loops, branches and closures, and
Selfthrough bounds. - Comparable: sorting needs
Comparable, and tuples and lists areComparable. - New diagnostics: E0206, E0372, E0373, a StringBuilder lint (W0004) with a quick fix, and
# allow(CODE)to silence warnings. - Error reference: every code is documented in
docs/errors.md, andcatx checklinks to it.
Memory and performance
- Garbage collection:
- Stale registers no longer keep garbage alive.
- Empty heap segments go back to the OS.
- Small lists store their elements inline.
- Minor collections scan only the written part of large old containers.
- Out of memory: raises
MemoryErrorwith a trace instead of aborting, for oversized requests, heap growth, strings, collections, stacks, threads and fibers.CATX_MAX_HEAPcaps the heap. - Speed: string concatenation is about 3× faster.
Tooling
- Editors: a VS Code extension, in
editors/vscode(build it from source; it's not on the Marketplace yet). - Language server:
- Quick fixes, and
catx fixto apply them from the command line. - References, rename and workspace symbols cover the whole workspace, including classes that conform to an interface.
- It warms its cache in the background, and the shared prelude makes that faster.
- Quick fixes, and
- Formatting:
catx fmtandcatx checkaccept directories. - C API: uses Catallaxy's allocator by default, and
cx_allocator_active()reports whether it's in use.
Breaking changes
- Untyped-parameter functions: some calls that used to type-check and then fail at run time are now rejected. See reference §6.3.
- Narrowing and unions: code that relied on the unsound narrowing or union rules above no longer checks. Each newly rejected program would have panicked at run time.
Time.millis(): counts milliseconds since the Unix epoch, not since program load.join(): on a thread that panicked, it returnsErr(message)without a trace. A panicked thread that is never joined is reported, with its trace, when the program exits.- JSON:
Json.parsereads-0as theInt0. catxallocator: the binary now installs its own global allocator. Rust programs embedding thecatallaxycrate can opt in; the C API (catallaxy-capi) uses it by default through itsglobal-allocatorfeature.
What's Changed
- release.yml: reliable already-published check by @CodingAnarchy in #46
- Checker:
Selfin an interface used as a bound resolves to the bound parameter by @CodingAnarchy in #70 - CI hygiene: job timeouts, release guards, process.cx temp dir by @CodingAnarchy in #69
- catx fmt/check accept directories; format drifted .cx files; check in CI by @CodingAnarchy in #72
- LSP quick fixes and catx fix by @CodingAnarchy in #80
- Docs: reference fixes and a getting-started guide by @CodingAnarchy in #87
- Json.stringify: write big integers as JSON numbers by @CodingAnarchy in #71
- GC: clear registers left by returned calls so they don't root dead objects by @CodingAnarchy in #73
- Strings: O(1) ASCII indexing and a sparse char index; add Deque[T] by @CodingAnarchy in #74
- Strings: single-copy concatenation; large temporaries die young by @CodingAnarchy in #89
- String formatting: format specs in interpolation, String.format, Int.to_s(base) by @CodingAnarchy in #75
- Date and time: Duration, Instant, DateTime; fix Time.millis by @CodingAnarchy in #86
- Script stdlib: CSV, Bytes, digests, Env.set/all, stdin lines by @CodingAnarchy in #83
- Lazy sequences: Enumerable.lazy() and Lazy[T] by @CodingAnarchy in #81
- Lists: adopt the Vec's allocation instead of copying it by @CodingAnarchy in #76
- Checker: check implicit-generic requirements with their member types by @CodingAnarchy in #77
- GC: return empty heap segments to the OS by @CodingAnarchy in #78
- Prebuilt release binaries and install.sh by @CodingAnarchy in #79
- gc test: make the segment-release test independent of earlier tests by @CodingAnarchy in #93
- Miri: run the string-index test in its own binary (about 6 min → 75 s) by @CodingAnarchy in #95
- Out-of-memory requests panic with MemoryError and a trace; add CATX_MAX_HEAP by @CodingAnarchy in #82
- VS Code extension: grammar, catx lsp client, end-to-end tests (and two LSP fixes) by @CodingAnarchy in #84
- Getting started: install script and the VS Code extension by @CodingAnarchy in #97
- Compiler: import a.b as c by @CodingAnarchy in #85
- Enum.values(); document alternatives to Int.MAX/MIN by @CodingAnarchy in #88
- Checker: sorting needs Comparable; tuples and lists are Comparable by @CodingAnarchy in #90
- Checker: narrowing of fields and ??=, and optional/Result glue by @CodingAnarchy in #92
- Checker and diagnostics: small correctness fixes by @CodingAnarchy in #91
- Drop the redundant homepage field from the manifests by @CodingAnarchy in #94
- CI: run Clippy on test code too (--all-targets) by @CodingAnarchy in #96
- Call a parenthesized callee: (self.f)(x) by @CodingAnarchy in #107
- Json.parse: integers wider than 64 bits parse as Int by @CodingAnarchy in #108
- LSP: rename and references on an interface member cover the conforming classes' methods by @CodingAnarchy in #109
- Checker: check union members against every member's signature by @CodingAnarchy in #110
- Checker: drop narrowings of locals that a loop may break by @CodingAnarchy in #114
- Lint W0004: suggest StringBuilder for string appends in loops by @CodingAnarchy in #111
- Store small lists' elements inline in the list object by @CodingAnarchy in #113
- Docs: an error-code index, checked against the compiler by @CodingAnarchy in #112
- MemoryError instead of abort: heap segments, strings, stacks, threads by @CodingAnarchy in #115
- MemoryError instead of abort: list and dict growth by @CodingAnarchy in #117
- LSP: include unopened workspace files in references, rename and symbols by @CodingAnarchy in #126
- Ignore editors/vscode/.vscode-test/ by @CodingAnarchy in #128
- C API: use catallaxy_gc::Allocator by default by @CodingAnarchy in #125
- Checker: end narrowings of closure-assigned locals at calls by @CodingAnarchy in #127
- Checker: remove E0302, which only followed E0230 by @CodingAnarchy in #133
- Checker: start each branch from the narrowings before it by @CodingAnarchy in #132
- LSP: warm the workspace cache in the background at startup by @CodingAnarchy in #134
- MemoryError instead of abort: natives that build collections by @CodingAnarchy in #135
- Compil...
Catallaxy 0.3.0
What's Changed
- Repo hygiene: rustfmt, Windows CI, release workflow by @CodingAnarchy in #26
- VM: cheaper calls and returns by @CodingAnarchy in #27
- VM: compare-with-immediate jumps and fused field pairs by @CodingAnarchy in #28
- Fibers: results live in their handles; keywords as method names by @CodingAnarchy in #29
- Scripting stdlib: Regex, Process, directories and paths by @CodingAnarchy in #30
- Evaluate concurrent marking: not now by @CodingAnarchy in #35
- LSP: references, rename, signature help, inlay hints, symbols by @CodingAnarchy in #31
- ThreadSanitizer over the full conformance suite (VM, stdlib, fibers) by @CodingAnarchy in #32
- Differential fuzzing of whole programs across builds and GC modes by @CodingAnarchy in #38
- Checker: freeze and move apply to the variable and its aliases by @CodingAnarchy in #39
- Networking: TCP sockets and an HTTP client, integrated with fibers by @CodingAnarchy in #33
- net: fix connect hang (lost readiness edge) by @CodingAnarchy in #43
- Evaluate minor-collection cost (minor tracing, nursery override) by @CodingAnarchy in #34
- catx test: per-program timeout by @CodingAnarchy in #41
- Evaluate escape analysis: not now by @CodingAnarchy in #36
- Docs: refresh README and reference for 0.3 by @CodingAnarchy in #44
- Release 0.3.0 by @CodingAnarchy in #45
Full Changelog: v0.2.0...v0.3.0