Skip to content

Bit 0.36.0

Choose a tag to compare

@mdwekat mdwekat released this 03 Oct 18:34
bb2584a

Bit 0.36.0

Breaking changes

  • The standard library's newX factory functions are gone. Construct by the class name: Sha256(), Mutex(), Builder(), Sampler(ratio), Tracer(...).
  • std/crypto: hmac, hkdf, pbkdf2 and the signers take a HashAlg value.
  • std/tls: TlsConfig is the client config; listen takes a TlsServerConfig.
  • The checker refuses an unhandled fallible call, a non-bool condition, and defer or spawn of a fallible call (E0190).
  • std/http refuses HTTP/1 header lines with whitespace before the colon, obs-fold, an empty name or a bare control byte, and refuses h2 and h3 requests whose fields would inject header lines.
  • Packages released with this version use constructors in place of their newX factories: web 0.9, auth 0.4, orm 0.3, jobs 0.3, redis 0.3, s3 0.2, yaml 0.2.

Highlights

  • for x of it? { } iterates a next(): Option<T>! iterable and returns a failed next() from the enclosing function.
  • spawn { ... } and defer { ... } take a block.
  • A T is accepted where an Option<T> is expected.
  • Module-level let cells hold objects, filled at startup.
  • std/hash: CRC-32 and CRC-64/NVME. std/time: RFC 3339, epoch seconds and HTTP-date. std/xml: a bounded pull tokenizer and a validating writer. std/http: streamed request and response bodies.
  • fib runs in 985.6M cycles, from 1021.1M on 0.35.0 (bench/RESULTS.md).
  • An idle program no longer spins the scheduler: 6,000 trace events in place of 400,000 to 610,000 for 1,000 timer waits.

Compiler

  • compiler: package workspace, pkg/bit.work resolves member deps from the tree (21df84e)
  • Collector: scan traced module let cells as roots through a per-program table (d03f54a)
  • Startup initializers run on rooted cells: drop the traced-cell refusals (ffd40c9)
  • Lower module-level decimal cells at their real 16-byte size (9dcc035)
  • Startup initializers fill array-typed module cells by element copy (336b660)
  • Delete BIT_CONST_STRING_FOLD, BIT_MAP_PRESENCE and BIT_STRBOX_JOIN (23267cd)
  • codegenlive: hold every call-word interval to the end of its run (f2c4645)
  • regalloc: a plain call's last-use argument may take a caller-saved register (ba4b8a3)
  • Make decimal a real slice, array and map element (37d5f7b)
  • codegen: fold x == nil / x != nil as a compare against 0 (cbz/cbnz, testq) (994ead6)
  • spawn and defer take a block or a closure call: spawn { ... }, defer { ... } (ae1a4dc)
  • for x of it? over a next(): Option! iterable (4362a50)
  • arm64: bind an Op.CallValue's Op.CallWord run in one parallel move (84fa9e7)
  • Install executables by write-temp-plus-rename, never in place (7883e39)
  • fmt: keep parens on a spawn/defer operand that would open with '{', format check_forof_try_infallible (f1b3aa7)
  • arm64: restore callee-saved GPRs one ldr each, never an ldp (ea04577)
  • selfcheck: check the unpaired epilogue restore in its own function (2954f12)

Runtime

  • Remove private tool, workspace-path and owner-hostname tokens from tracked files; scan them repo-wide (4aff3af)
  • gcmarkpar: count a late wake from the notify completing, not from gcMkDone (5a673a0)
  • runtime/sched: take the poller token before an idle drain (7e7526e)

Standard library

  • stdlib/crypto: replace the newX factories with constructors called by the class name (2a43171)
  • stdlib sync/time/strings/rand/metrics/sql: replace the 13 newX factories with constructors (89ce8e5)
  • stdlib: call sites of the removed sync/time/strings/rand/metrics/sql newX factories use the constructors (7f68a61)
  • std/crypto: hmac, hkdf, pbkdf2 and the signers take a HashAlg value (3ccbf0f)
  • std/tls, std/quic: the key schedule takes the suite's HashAlg (16bf39d)
  • std/tls: TlsConfig is the client config, listen takes a TlsServerConfig (d4502e2)
  • std/trace: Sampler(ratio), Tracer(...), TraceId.random() and SpanId.random() replace the newX factories (17ebd5b)
  • std/trace: export TraceId.hi, TraceId.lo and SpanId.value so callers can read the id (15ae906)
  • Add CRC-32 (IEEE 802.3, reflected 0xEDB88320) to std/hash (4add5f8)
  • std/time: parseHttpDate and formatHttpDate, RFC 9110 HTTP-date (123cd8a)
  • stdlib/xml: pull tokenizer core, DOCTYPE refused, bounded depth, attributes and input (0b7ba12)
  • stdlib/xml: Writer with escaping, name and character validation, and namespace checks (83adaa2)
  • std/http: BodyReader and Client.send(req, stream = true) with the status before the body (7e9d555)
  • std/http: refuse differing Content-Length fields and Content-Length with Transfer-Encoding in every reader (c3a5947)
  • std/http: a streamed response's connection returns to the pool only after a full read (e8aa3fe)
  • std/http: reject whitespace before the colon, obs-fold, empty field names and bare controls in every HTTP/1 header parser (4319eb4)
  • std/http: refuse h2 and h3 requests whose fields would inject header lines (ed8db37)
  • quic: acceptStream hands out streams the peer already opened before reporting closed (6309bf8)
  • std/http: check h2/h3 peer request fields while copying them into the block (f969b71)
  • Add CRC-64/NVME to std/hash (crc64nvme, crc64nvmeUpdate), slicing-by-8 (1cb396a)
  • std/time: parseRfc3339 and parseEpochSeconds (ae38eaf)

Tests

  • checker: a const fixes the binding, not the object it holds (b0f211c)
  • docs: neutralize private repo and host names; test-docs rejects them (05160ba)
  • stdlib tls/quic: replace the 8 newX factories with constructors (50bdaac)
  • Neutralize private names in tracked text and scan every tracked text file for them (d67ca2d)
  • stwcollect: add phase K, the ROOT CLASS 11 case for traced module let cells (9c67672)
  • Refuse a module cell with no zero value and no initializer (af8504f)
  • Lower compound assignment on a decimal through the two-word arithmetic (0c6ce9e)
  • tests, examples, bench, tools, scripts: use the constructors in place of the removed std newX factories (f5e5b2d)
  • releasesurface: allowlist the HashAlg signature changes in std/crypto, std/tls, std/quic (0c3f0a8)
  • releasesurface: reword the allowlist comment (de7d89e)
  • checker: seed an arrow argument's expected type from a class init's parameters (e77abce)
  • Accept T where Option is expected and lower it as Some(v) (ba1425e)
  • golden and checkerdiag census: re-derive after the merges (run 612, checker cases 288) (51e9624)
  • lower: scope a body's checker rebinds to that body (b3ca015)
  • Checker: refuse an unhandled fallible call and a non-bool condition (67410fc)
  • Re-point the SPEC.md line citations the §13.1 and §18.3 additions shifted (c8b7f25)
  • Refuse a function-local const with no initializer (7f5722a)
  • Copy a long startup array cell with a counted loop (1eaac7d)
  • tests/imports/quictls: split quicE2E so it fits the 80-line limit (19da53c)
  • tests/cases/run_option_lift_arg: bit fmt (d09212f)
  • checker: refuse defer/spawn of a fallible call with E0190 (43807e2)
  • benchgate: move the CPU verdict (wasDescheduled, checkCpu, cpuReport) to benchhost.bit (c04e1c2)
  • Move the three decimal checker-refusal fixtures to tests/bit/checkercases (c5cfcf1)
  • Add test-oraclelag and move six run fixtures the pinned oracle cannot build out of tests/cases (cfc8206)
  • stripMine: rebind the header's ids to OUTER's after OLATCH; verify SSA dominance (4f10008)
  • benchgate: judge user CPU against a host-speed reference workload (6f03eca)
  • Repoint the match-binder-arity citations to spec/SPEC.md:4633 after grew the spec (3ff2b62)
  • Move run_strip_exit_header_{const,param} to tests/bit/oraclelag: pinned 0.35.0 lacks the fix (ebc1191)
  • pkg/s3: SigV4 signer signs every header except the unsignable set, S3 path encoding, header normalisation (e314af2)
  • stress: chantimerwake and chantimerresetwake confirm a timing-only overshoot with one fresh pass (17ae7fb)
  • pollfree: list schedPollerDrain as a reviewed exception (5903425)

Documentation

  • docs/stdlib/crypto: restore the blake2b one-shot section, which is 64 bytes (4cf2327)
  • pkg: call sites of the removed std newX factories use the constructors (e65fb2b)
  • docs: stdlib sync/time/strings/rand/metrics/sql pages and book examples document the constructors (6389285)
  • pkg/auth, pkg/postgres, pkg/s3, pkg/web: call hmac/pbkdf2 with HashAlg (7ec7d2a)
  • pkg/yaml: AnchorTable() replaces newAnchorTable; install line names 0.2.0 (f08548a)
  • pkg/redis: Batch() replaces newBatch; install line names 0.3.0 (4fff255)
  • pkg/s3: Client(cfg) replaces newClient; install line names 0.2.0 (3ca94c2)
  • pkg/orm: Logger(sink, options) replaces newLogger and newLoggerWithOptions (c0fa5b1)
  • pkg/jobs: PostgresStore(db) and PostgresLocker(db, keep) replace the newX factories (63ef4d6)
  • pkg/web: Ctx(...), Stream(...), SSE(c) constructors and randomSessionId() replace newCtx, newStream, newSSE, newSessionId (317ede0)
  • pkg/auth: PasswordStrategy(lookup), OidcStrategy(OidcSource, ...), JwksCache(uri, tls, JwksSource) replace the newX factories (d8d9550)
  • pkg/web: README install line names 0.9.0 (3360030)
  • Keep auth's web requirement at ^0.8.0 until web 0.9.0 is tagged; docs/stdlib/trace.md examples are not main (ffdca8a)
  • Inkwell and the Bit Book: BearerStrategy(secret), randomToken() and randomId() replace newBearerStrategy, newOpaqueToken and newId (73ae007)
  • docs/stdlib: handle the write errors the io and os examples dropped (b95889c)
  • docs/stdlib/xml: wrap the Writer examples to canonical width (a7bcef3)
  • pkg/orm schema.test: the live tsvector proof calls the fallible Rows.next() with ? (5034009)
  • Document for x of it? and the next() iterator protocol (d120428)
  • pkg/orm sync live test: one scratch program, not three cold compiles (a66c551)
  • pkg: auth requires web ^0.9.0, orm pins postgres 0.1.3 and mysql 0.2.2; install lines name the 0.36 package releases (5be03fa)
  • web guide 10: the auth install line names auth 0.4.0 (bcbc8b1)

Build and tooling

  • Name no private repo or host in pkg/dist/runtime docs; test-docs scans them (947d332)
  • selfhost-diffsafepoints: read ELF relocations in the instantiation-target check; diffall names exit-2 constituents as undecided, not timed out (fe7042c)
  • Repin stage0 to 0.35.0 and retire the four declared IR signatures (03783a2)
  • Keep the decimal map-key check under the complexity ceiling; keep ABI.md line numbers stable (42317db)
  • tools/gens3: vendor the trimmed S3 Smithy model, pin it, add trim.bit (7faf2c1)
  • selfhost-ir-signatures: declare 6679-generic-join-param-retype, 6570-fail-zero-decimal-box and 6564-arrow-ctor-seeded oracle lag (0abd3d5)
  • lint-debt: drop E0201 tools/build/artifactsteps.bit, paid down by (0aefbbe)
  • Add test-exec-replace: bit build -o replaces an executable by rename (f168f3a)

Benchmarks

  • bench: regenerate for 0.36.0 (f1fa77b)

Artifacts

Published for aarch64-linux, aarch64-macos, x86_64-linux and x86_64-windows.
See dist/README.md for the full target table, the archive layout,
the required BIT_STDLIB/BIT_LIBBITRT environment, and the
SHA256SUMS format.

Verify a download before running it:

sha256sum --check --ignore-missing SHA256SUMS   # shasum -a 256 on macOS

Full commit log: v0.35.0..HEAD