Crystal 1.21.0 is released!
Crystal 1.21.0 enables execution contexts (RFC 0002) by default. Fibers are no longer pinned to a thread, even with the default parallelism of 1, so code relying on thread-local state across fiber yields needs review, and `spawn(same_thread:)` is deprecated. The automatic fallback to legacy PCRE is also removed. Other changes include a `%W` interpolating string array literal, `Channel(T)` implementing `Iterator(T)`, synchronous `HTTP::WebSocket#receive`, experimental `Socket#sendfile`, `case` branches with multiple types now splitting into separate type restrictions, and OpenSSL 4.0 support.
Related posts
- Releasing Execution Contexts
Crystal Blog mediumAdeptCrystal replaces its preview MT model with Execution Contexts, an interface for orchestrating fibers across threads with three built-in types: Concurrent (one thread at a time), Parallel (work-stealing, auto-scaling up to a configured maximum roughly every 100 ms), and Isolated (a fiber owns a thread). The default context is parallel with parallelism 1, so existing apps stay single-threaded until they call resize, and CRYSTAL_WORKERS is no longer read automatically. Breaking changes: fibers can migrate between threads, schedulers can hop threads during blocking syscalls like getaddrinfo (which affects thread-locals and main-thread-bound C libraries), and spawn(same_thread: true) now raises in parallel contexts. The without_mt and preview_mt flags revert to the legacy schedulers for now.
- Crystal 1.22.0 is released!
Crystal Blog mediumAdeptCrystal 1.22.0 makes processes exit immediately on EPIPE when writing to STDOUT/STDERR, mimicking SIGPIPE, with an opt-out via `STDOUT.exit_on_broken_pipe = false`. It also removes the long-deprecated `Process.fork` and adds type declarations on constants. aarch64-linux is promoted to Tier 1, and a reworked DWARF parser scans sections on demand, builds an index once and caches decoded backtrace lines in an LRU cache. Native epoll/kqueue event loops are now the default on all targets with libevent opt-in, alongside many HTTP validation fixes and LLVM 23.1/24.0 support; Kernel TLS was enabled but reverted in 1.22.1.
- Crystal 1.22.3 is released!
Crystal Blog mediumAdeptCrystal 1.22.3 is a patch release of 14 changes from 4 contributors, focused on security fixes and regressions. Sockets now reject port numbers above 65535 instead of silently truncating them, for example binding 73616 as 8080. The HTTP parser now rejects invalid headers, chunk lines and Content-Length values that could cause request desync, and a `close` token in the Connection header always closes the connection. The release also fixes `IO::Delimited` matching after a fragmented delimiter and an `Enum.parse?` regression from 1.22.0 that could cause out-of-bounds writes.
- Bun v1.3.11
Bun mediumAdept
Bun v1.3.11 adds Bun.cron, a cross-platform API that registers OS-level cron jobs (crontab, launchd, Task Scheduler) and parses cron expressions, plus Bun.sliceAnsi, an ANSI- and grapheme-aware string slicer that replaces slice-ansi and cli-truncate using a SIMD ASCII fast path and single-pass streaming. Bun.markdown.render list callbacks now receive richer metadata, with a fixed object shape kept for monomorphic inline caches. bun test gains --path-ignore-patterns, and Windows ARM64 gets a native .bin shim. The release also fixes macOS dgram UDP bugs caused by hardcoded Linux errno values, an http2 WINDOW_UPDATE stall, a TLS SNI loss with custom DNS lookups, and many Node.js compatibility crashes.
- What's coming to JavaScript
Deno mediumAdeptTC39's 108th meeting advanced nine JavaScript proposals. Explicit Resource Management (`using`/`await using` with `Symbol.dispose`), `Array.fromAsync` and `Error.isError` reached stage 4, and Immutable `ArrayBuffer` (`transferToImmutable`, `sliceToImmutable`) reached stage 3. Earlier-stage proposals include seeded PRNGs, `Number.prototype.clamp`, `Intl.NumberFormat` trailing-zero control, a standard value-inspection format for diffs, and a `Random` namespace for sampling and shuffling. Each proposal comes with code examples and runtime support status, and Deno plans to use immutable buffers to avoid copies and disposable `AsyncContext.Variable` to simplify tracing spans.