Skip to content

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 23:46
· 14 commits to main since this release
0783dd1

Added

  • base64: RFC 4648 encoding and decoding, with a comptime codec (standard, standard_no_pad, url_safe, url_safe_no_pad) over caller-owned bytes. decode validates padding and the unused trailing bits. The kernel is picked from the target CPU at compile time: NEON on aarch64, AVX2 on x86_64_v3, AVX-512 VBMI on x86_64_v4. A build for the x86-64 baseline falls back to std.base64. No CPUID probe and no run-time dispatch: build with the target you want.
  • fmt.atoi: Options gains plus_sign and negative_zero. .plus_sign = .reject makes "+1" an error.InvalidCharacter, and .negative_zero = .reject does the same for "-0". Both default to today's behavior.
  • intern: intern.Pool keeps one copy of each string in chunk storage and hands out dense u32 ids. intern, lookup, get, and deinit take the allocator, and an id stays valid until deinit.
  • slot: slot.Pool(Entry, prev_field, next_field) is a fixed-capacity pool over a caller-owned entry slice, and slot.Array(Entry, prev_field, next_field, n) owns its entry array for a comptime capacity. The two link fields live in the entry, and their unsigned integer type is the handle type. acquire, acquireFront, release, get, isLive, moveToFront, popFront, and popBack are O(1), and iterator walks the live entries front to back.
  • swiss: rehash rebuilds the table at its current bucket count and clears every tombstone. Use it on a long-lived map that removes entries without growing. Pointers into the table are invalidated.
  • time.Timestamp: Timestamp.now(clock) reads a clock into the compact value with no error union, so a field takes a decl literal. Timestamp.elapsed(clock) returns the Duration to a fresh reading, and rejects .real at compile time because wall time can step backwards.
  • wire: Reader.readUntil(delimiter) returns the bytes before a delimiter and consumes it, for a field with no length prefix. A missing delimiter is error.UnexpectedEof, and the cursor does not move.