Repository navigation
Releases
v1.0.0-RC7
v1.0.0-RC7 ships a new kernel and a large body of stabilization work on the way to 1.0. Resource release is now structural: a release runs however its region exits, including on interrupt. Ten issues close with it, and a trailing map chain goes from 507,800 to 560 us/op 🚀
Highlights:
- kyo-sql: embedded SQLite behind the same API as PostgreSQL and MySQL, every engine passing one conformance battery, and Dolt backends, a version-controlled SQL database whose tables branch, commit, diff, and merge, so an AI agent can work on a branch of real data and merge or discard it.
- kyo-system: file access on JVM, JS, Native, and Wasm from one module, plus processes and environment, with positioned channels, interrupt-safe locks, watching, and a virtualizable file system.
- kyo-system-doltfs: a file system stored in Dolt, so ordinary
Pathcode runs unchanged on a directory tree that branches, commits, diffs, and merges, and that answers SQL: an agent can edit files on a branch, and the change is reviewed as a diff and merged or discarded. - kyo-ai: typed decisions with calibrated probabilities through TypeSafe AI's Jev, and agents that call any MCP server's tools with no Scala types.
- Scala.js: effect dispatch 10x to 18x faster.
- Time control:
Clock.withTimeOffsetmoves the wall clock alone, joiningwithTimeShift, which scales the rate of time and sleeps with it, andwithTimeControl, which drives virtual time by hand. - Stabilization: kyo-flow's durable execution rebuilt for crash recovery, with every write fenced by the executor's claim, interrupt-safe SQL sessions, leak-free transport teardown, and a TLS hostname-verification hole closed.
Kyo now builds on Scala 3.9.0, so a project depending on the main modules needs 3.9 too. kyo-scheduler and its integrations, kyo-config, and kyo-stats-registry stay on 3.3.8 and 2.13, and the kyo-compat bindings other than kyo-compat-kyo stay on 3.3.8. Breaking changes lists the source changes, including Path moving to its own artifact and time subtraction that says when it has no answer instead of silently clamping to zero.
New Features
New modules
-
kyo-system(README) is the file I/O, process, and environment layer, on JVM, JS, Native, and Wasm. It takesPath,System,Process, andCommandout of kyo-core, keeping packagekyo, and puts aFileSystemservice behind them:Path.runuses the host,Path.runWithany other backend. Filesystem access is a tracked effect (PathRead,PathWrite), soPath.runReadOnlyrefuses a writing program at compile time. Failures are the sealedFileSystemExceptionhierarchy, replacingFileException, with marker traits for reads, writes, structure changes, and locks, options are named values (WriteOptions,MoveOptions,CopyOptions) instead of positional booleans, and listing takes aGlobinstead of a host pattern string. (by @DamianReeves in #1857, #1862, #1863, #1864) -
kyo-system: positioned channels, locks, watching, tailing: positioned channels read and write at absolute offsets with no shared cursor, scope-managed advisory locks come through
Path.lockandtryLock, a separatePathWatcheffect covers watching,Path.tailBytesfollows a file byte by byte, andStream.writeToandwriteLinesTogainappendand aWriteOptions, withappend = trueleaving the file in place when the stream fails. A watched root removed on Windows invalidates the watch instead of failing it. Processes are fixed along the way:waitFor(timeout)takes its deadline fromClock, a stdin feed ends with its process, andtext()streams child output instead of deadlocking on large output on the JVM. Hardening in the same cycle means a write that makes no progress fails withFileWriteStalledExceptioninstead of spinning, a broken pipe no longer kills a Native process, and a signal-killed Node child no longer hangswaitFor. (by @DamianReeves in #1865, #1866, #1867, #1852, #1861, #1857, #1862, @fwbrasil in #1966, #1970, #2002) -
kyo-sql-sqlite(README), withkyo-sql-sqlite-driver, is SQL without a server: behind the same kyo-sql API, a database is a file path or:memory:, with no server, no container, and nothing in a query body that names SQLite. The engine is compiled from a pinned, checksummed SQLite 3.53.4 source through kyo-ffi rather than linked against a hostlibsqlite3, since what a query answers depends on the version, and it runs on the JVM, Scala Native, and Node. What SQLite cannot do is refused with a typed error rather than quietly answered wrong: isolation levels it cannot run, advisory locks,GROUP BY ROLLUP,LATERAL, row locking,INTERSECT ALLandEXCEPT ALL, and mostcasttargets.kyo-sql-sqlite-driverholds the connection, codecs, and dialect with no C in it, so another engine speakingsqlite3_*can reuse it. (by @fwbrasil in #1945) -
kyo-flow-conformance,kyo-system-conformance, andkyo-sql-conformancepublish the suites kyo's own implementations pass, so a third-partyFlowStore,FileSystem, or SQL backend proves itself by running them as a test dependency:class MyEngineConformanceTest extends SqlConformanceTest(Seq(new MyEngineConformanceBackend)). Each is an abstract class to subclass, one per tier for kyo-system (read, write, watch), and each has a subclass outside packagekyoproving no package-private access is needed. The suites are documented in the kyo-flow, kyo-system, and kyo-sql READMEs. (by @fwbrasil in #2015) -
kyo-sql-dolt(README),kyo-sql-doltlite(README),kyo-system-doltfs(README), andkyo-sql-dolt-apilet a kyo SQL client branch, commit, diff, and merge its data through Dolt, the SQL database with Git's version model: together they give the client the database's history. A typedDoltAPI covers commit, branch, diff, merge with typed conflicts, reset, revert, cherry-pick, tags, and remotes with push, fetch, and pull.kyo-sql-doltdrives a Dolt server over kyo-sql's MySQL wire, andkyo-sql-doltlitedrives DoltLite, an embedded SQLite fork with versioned storage, reusing the SQLite driver (DoltLite does not run on Windows, since upstream publishes no build the driver can link).kyo-system-doltfsis aFileSystemwhose files are rows, so ordinaryPathcode runs on a directory tree that branches, merges, and diffs, and it passes kyo-system's read and write conformance suites. (by @fwbrasil in #1956, #2007)
The new kernel
-
One pooled evaluator stack of regions: handlers, context bindings, and releases are regions on it; computations stay immutable values, an interrupt is honored only at a pending node, and acquiring a resource and registering its release are one step at every acquire site. kyo-core is rebuilt on this:
Sync.ensureis a bracket, a nestedScope.runis a child whose resources release first, and a fiber owns a scope closed on an uninterruptible drain. (by @fwbrasil in #1988) -
Arrow: build a computation once, reuse it: anArrowis a transformation from anAto aB < Sreified as a plain value, so a hot path can build its pipeline once, apply it per input, and pay the composition and allocation cost once instead of on every run. It is also what a continuation is now: amapis one, a suspension holds one, and a handler clause receives its continuation as one and applies it as many times as it likes. (by @fwbrasil in #1988) -
ArrowEffect.Maskhides an effect from intermediate handlers: it tunnels the effect's operations past every handler between the mask and itsMask.run, so code that handles an effect for its own purposes no longer captures the same effect in whatever it was given, for arrow and context effects alike.Scopeis one use: a generic function can run its own scope without claiming the caller's finalizers. (by @fwbrasil in #1988) -
Region.NoEscape: compile-time escape checking: a marker in the effect row pins a value to the block it was handed to, so storing it, returning it, or moving it to another fiber does not compile. Handler continuations carry it, and so can any value the kernel must keep inside a block. It gives the guarantee capture checking (Caprese) is designed for, from ordinary effect rows and no compiler extension. (by @fwbrasil in #1988) -
mapchains fuse into straight-line code: eachmapisinline, sov.map(f).map(g).map(h)expands at compile time into small classes the JIT sees as monomorphic calls and compiles into one method, as if `h(g(f(v...
v1.0.0-RC6
v1.0.0-RC6 ships Kyo's own SQL module. kyo-sql pairs raw SQL with a typed DSL that mirrors SQL syntax, and underneath there is no JDBC: the drivers speak the Postgres and MySQL wire protocols directly on kyo's async network stack 🚀
kyo-sql is built the way the whole release is built: implementations written once, in shared source, that reach every platform. kyo-net lands as the transport and TLS stack that kyo-http, kyo-jsonrpc, and kyo-sql now share. Its transport and TLS are C libraries driven through kyo-ffi (shipped in RC5, gaining a Wasm backend this cycle), so the same implementations run on JVM, JS, Native, and Wasm. The I/O backend is chosen by the operating system, io_uring with an epoll fallback on Linux and kqueue on macOS and BSD, and TLS goes through a BoringSSL-first engine. Consolidating on one implementation also removed dependencies: JDBC never enters the tree, io.aeron and upickle leave kyo-aeron, and kyo-i18n and kyo-markdown ship pure Scala where the standard answer is a JavaScript-only runtime or a JVM-only library.
Thirteen new modules are published and two are removed. Almost all of the new work is in application-level modules rather than in the effect system itself. One note on the four-platform claims: Wasm cross-builds and is tested in CI, but Wasm artifacts are not published to Maven Central (see Breaking changes).
A Node.js process now runs kyo-net's io_uring transport and BoringSSL TLS through koffi, the same accelerated stack as the JVM, Native, and Wasm. Kyo also now has out-of-the-box GraalVM native-image support.
Kyo now requires JDK 25. The build's default compilation target moved from -release 17 to -release 25, so nearly every published artifact now declares the Java it actually needs. RC5's artifacts already could not run on JDK 17: they linked successfully and then failed at runtime. kyo-scheduler (with its -zio / -pekko / -finagle integrations) and the kyo-compat-* bindings still target Java 17. Breaking changes carries the full list of exceptions.
New Features
New modules
-
kyo-sql(README), withkyo-sql-postgres(README) andkyo-sql-mysql(README), is Kyo's SQL module. Rawsql"..."and typed queries are one surface that composes in both directions, and the typed DSL mirrors SQL syntax rather than translating collection operations: what you write keeps the shape of the statement it renders to. Typed queries can be generated at compile time through ordinary Scala 3 inlining, with no annotation or build step, and the SQL string lands in the artifact as a constant. JDBC never appears: each driver implements its server's wire protocol directly on kyo-net, a statement suspends a fiber instead of blocking a carrier thread, and one set of shared sources, protocols included, compiles for all four platforms, which is what makes a SQL client outside the JVM possible for Kyo at all. (by @fwbrasil in #1833) -
kyo-net(README) is the transport underneath kyo-http, kyo-jsonrpc, and kyo-sql: TCP, Unix-domain sockets, stdio, and TLS over one completion-based I/O driver. New this cycle, the accelerated transport and the BoringSSL TLS engine run on JS and Wasm too, driven through koffi, a Node FFI, where both previously fell back to Node's ownnet/tls, a different implementation with different semantics. JVM and Native behavior is unchanged. BoringSSL and theio_uringshim are not on most hosts, so kyo-net compiles both from source and ships them as classifier jars covering Linux and macOS, and the fast path is opt-in: addall-natives, or your host's pair of classifiers, the transport one (such aslinux-x86_64) plus its-boringsslcompanion, and install nothing else. Windows runs the NIO transport with JDK TLS by design, and no classifier means no native and the floor transport (NIO on the JVM, Node's networking on JS). (by @fwbrasil in #1758, #1831) -
kyo-schema splits into a format-agnostic core and six format artifacts.
kyo-schemanow carries derivation, theCodecengine,Structure, and optics. The wire formats ship as six separately published artifacts, each cross-built for JVM, JS, Native, and Wasm:kyo-schema-json,kyo-schema-yaml,kyo-schema-ion,kyo-schema-msgpack,kyo-schema-protobuf, and, new in this release,kyo-schema-bson. A project taking one format no longer drags the other five into its build. This is breaking for every existing user of any wire format, and the migration is in Breaking changes. (by @DamianReeves in #1769, #1742) -
kyo-i18n(README) parses and formats Fluent (.ftl) bundles in pure Scala, depending only on kyo-core and building on all four platforms. The common Fluent runtime is JavaScript-only. The active locale is aSignalandI18n.t(key, args)returns a bareSignal[String], so a language switch re-renders exactly the affected kyo-ui leaves, with nousingparameter threaded through call sites. (by @xsistens in #1775) -
kyo-markdown(README) renders a Markdown string to a kyo-uiUItree plus a heading outline through one entry point,Markdown.render, with no third-party Markdown dependency and no bundled syntax highlighter, building on all four platforms.renderis pure and total: no call site needs error handling, and the result is a plain value usable anywhere aUIsubtree is built, including reactive regions that require pure producers. Raw HTML in the source passes through un-escaped (the trust model a CommonMark renderer applies by default), so a caller rendering untrusted Markdown sanitizes the output itself. (by @fwbrasil in #1764) -
kyo-stats-machine(README) collects host metrics with no code to call: adding the dependency is the whole integration. The momentkyo.Statis first touched, a detached fiber samples once a second for the life of the process and writes the full picture of the host intokyo.Statas amachine.*taxonomy: CPU, memory and swap, per-mount disk, load average, and on Linux cgroup usage and PSI pressure. It works out of the box across OSes and platforms, carrying its own per-OS implementation: the same dependency samples genuinely on the JVM, Native, and JS/Wasm on Node, and a browser JS build degrades gracefully. (by @fwbrasil in #1756)
GraalVM native-image
- Kyo now has out-of-the-box GraalVM native-image support: a kyo app compiles to a native binary with no hand-authored metadata and no tracing agent. The blocker was the FFM layer, kyo-ffi's JVM Panama backend, kyo-net, kyo-http's native transport, or a user's own binding, where descriptors and reflective accessors had to be hand-authored per binding and went stale the moment a signature changed. That metadata now ships generated, so nothing is hand-maintained. Verified on GraalVM 25. (by @fwbrasil in #1834)
New primitives
-
kyo.UUIDis an opaque UUID value type in kyo-data with secure effectful RFC v4 and monotonic v7 generation across platforms, replacingjava.util.UUIDand UUID-formatted strings. Generation draws from platform cryptographic entropy only and never falls back toRandom, timestamp-only UUIDs, process counters, or weak PRNGs. The existingRandom.uuidAPIs are deliberately untouched, with a migration left to a separate PR. ASchemagiven renames with it (see Breaking changes). (by @DamianReeves in #1777) -
OrderedDict[K, V]andOrderedDictBuilder: an immutable, insertion-order-preserving map whose order survives an encode/decode round-trip on every codec. (by @DamianReeves in #1749) -
SecureRandom: cryptographically secure random as an ambient, let-scoped kyo-core capability with a per-platform secure source, and UUID generation draws from it. (by @DamianReeves in #1777, @fwbrasil in #1833)
kyo-ai
-
kyo-ai now behaves consistently across providers: a streamed turn, a stop at the output ceiling, and a mid-stream provider error are each handled one way on every backend, and each provider's own reasoning vocabulary (a token budget, a named effort level, or no support at all) is declared in the catalog rather than hand-coded per backend. Adding a provider or a model is a catalog entry, not a backend change, and a model's capabilities are declared rather than guessed from its id. (by @fwbrasil in #1765)
-
Claude Code and Codex are now completion backends, so kyo-ai can run on a harness subscriptio...
v1.0.0-RC5
v1.0.0-RC5 makes Kyo a place to build AI applications and the protocol tooling around them. kyo-ai makes a call to a language model a value you compose and runs the whole agentic loop for you, deriving the result schema, driving the tool-call loop, threading the conversation, and parsing the streaming reply, so what you write is the result type and the tools the model may call, and kyo-mcp exposes a Kyo service to an MCP host like Claude Desktop or drives an MCP server itself.
The thread tying the release together is protocols as typed values. MCP, the Language Server Protocol, the LLM APIs, and the browser's Chrome DevTools Protocol are each a composable value here rather than hand-rolled wire framing, and they all rest on two new pieces of shared machinery. kyo-jsonrpc is one cross-platform JSON-RPC 2.0 engine they all speak through, handling request/response correlation, cancellation, and progress in both directions, and underneath it a reworked kyo-schema (which shipped in RC2) co-derives a type's structure and its wire codec from a single macro, so the schema a type advertises is the exact shape it reads and writes. On that same engine, kyo-lsp is the Language Server Protocol 3.17 for building editor-tooling servers and clients, and kyo-compiler drives a warm Scala 3 presentation compiler for the completions, hover, and diagnostics such a server needs. They are the foundation for a Kyo-native language server, which the project is building toward as an alternative to Metals.
New Features
New modules
Every module here cross-compiles to JVM, JS, Native, and Wasm, except kyo-compiler, which is JVM-only.
-
kyo-ai(README) makes a call to a language model a value you compose and hands the whole agentic loop to the framework. Using an LLM used to mean a mainstream SDK plus around forty lines of your own orchestration: authoring the JSON schema, running the tool-call loop, threading the message list, retrying transport failures, and parsing streaming deltas. You now write only the result type you want back and the tools you grant the model, andAI.gen[A]derives the schema fromA, drives the loop, and decodes the reply. The API forms a ladder from stateless to persistent: a bareAI.genis a forgetful one-shot, a namedAIinstance remembers earlier turns in the same run, and anAgentis an actor-backed entity that holds its conversation across manyaskcalls, one input at a time. A tool runs your function when the model calls it mid-generation, and the loop recovers from both a bad decode and a thrown run function without escaping the generation. Streaming yields whole result objects one at a time rather than token text, and providers cover an OpenAI-compatible backend (OpenAI, DeepSeek, Gemini, Groq, Baseten, OpenRouter) and the Anthropic Messages backend, both on kyo-http with auto-config from environment API keys. (by @fwbrasil in #1707) -
kyo-mcp(README) is a Model Context Protocol server and client on the newkyo-jsonrpcengine. Exposing a Kyo service to an MCP host (Claude Desktop, IDE agents) or driving an MCP server is mostly protocol bookkeeping: the handshake, capability negotiation, tool/resource/prompt dispatch, and the reverse-direction calls. You now describe a server as a flat list of typed handlers, annotating only each tool's input type while the compiler infers the rest, and the engine runs the protocol. It works in both directions: the server can ask the connected client to sample its model, elicit user input, or list roots. Failures stay typed all the way out, a closed transport surfaces as a typedMcpConnectionClosedExceptionrather than a bareClosed, and each operation's error channel names exactly the failures it can raise. (by @fwbrasil in #1701) -
kyo-lsp(README) is a Language Server Protocol 3.17 server and client on the samekyo-jsonrpcengine. Every LSP server and client re-implements the same 3.17 scaffolding: the initialize/shutdown lifecycle, the message schemas, document synchronization, position-encoding negotiation, and capability gating. In kyo-lsp you register a typed handler per operation you support, and the engine advertises the matching capabilities, owns the handshake, negotiates position encoding, and tracks open documents. Like kyo-mcp it works in both directions, issuing server-initiated requests such as applying a workspace edit, showing a message or document, and reporting work progress. (by @fwbrasil in #1703) -
kyo-jsonrpc(README) is the JSON-RPC 2.0 engine the protocol modules stand on. Kyo had no JSON-RPC support, so every protocol on it (MCP, LSP, the browser's Chrome DevTools Protocol) hand-rolled request/response correlation, notification dispatch, cancellation, and progress. One peer type now both serves and calls in both directions: it handles correlation, cancellation, and progress for you and maps user errors to wire codes automatically, so whether a peer is a server, a client, or both is just a matter of which methods it answers and which it calls. Transports plug in down to the byte level (in-memory, line and content-length stdio, a JVM Unix domain socket), andkyo-jsonrpc-httpadds one over a kyo-http WebSocket. The browser module is ported onto it, its custom Chrome DevTools client replaced by a CDP session that runs as a jsonrpc peer. (by @fwbrasil in #1687) -
kyo-compiler(README) is the JVM-only Scala 3 presentation-compiler driver a language server draws on, giving Kyo a warm, cancellable source of IDE intelligence: completions, hover, signature help, and diagnostics for a project. It keeps a per-project compiler warm, resolves one per toolchain and classpath, caps how many run at once, and evicts idle instances, and every operation is cancellable by interrupting the calling fiber. When a request needs isolation, or the target Scala version does not match the host, it runs the compiler in a forked worker JVM that can be hard-killed on a stuck request, and the caller never has to choose a backend: results come back the same either way. (by @fwbrasil in #1718)
kyo-schema
kyo-schema shipped in RC2; this cycle reworks it into the type-safe wire-protocol foundation the new modules stand on, and expands it across formats, representations, and configuration.
-
A type-safe foundation for wire protocols: protocols like JSON-RPC could not be built type-safe on the old derivation, because a type's wire codec and its structure were derived by two separate macros that could silently disagree, so the JSON Schema a type advertised could not be trusted to match the bytes it wrote. Structure and codec are now co-derived from one macro, so the two cannot drift: the JSON Schema a type advertises is the exact shape it reads and writes.
Structure.Valuebecomes the first-class open value that everySchemaconverts to and from, andCodec.IntrospectingReadermakes "can read an open value" a type-level capability (JSON and YAML have it, Protobuf does not), so decoding through a non-self-describing codec is a compile error instead of a runtime surprise. This is the foundation kyo-jsonrpc, kyo-mcp, kyo-lsp, kyo-ai, and the browser CDP client are built on. (by @fwbrasil in #1682) -
MessagePack codec: kyo-schema dispatched to a pluggable
Codecbut had no self-describing binary option between Protobuf (compact but schema-required) and JSON (self-describing but text). A hand-rolled MessagePack codec with no third-party dependencies now cross-compiles to JVM, JS, Native, and Wasm, audited byte-for-byte against the spec, and because every MessagePack value carries a type tag its reader is aCodec.IntrospectingReader, soStructure.Valueand open-shaped envelopes round-trip through it, the capability Protobuf cannot offer. Key, Instant, and Duration encodings are configurable, and the output interoperates with standard MessagePack tooling in Python, JS, and Go. (by @DamianReeves in #1685) -
Four new sum representations, and a silent data-loss fix: kyo-schema serialized sum types under only two shapes, and the flat-discriminator form had a correctness hole that discarded any variant payload not a JSON object (a scalar, array, or null) with no error. A
UnionRepresentationenum now adds.adjacent,.tupleTagged,.tupleFlat, and.untagged(untagged decode tries each variant's decoder in declaration order, first clean parse wins), and the adjacent form fixes the silent drop by giving the payload the whole content position..discriminatoris reimplemented as sugar over the internal form and stays byte-identical, and the external-wrapper default remains inert. (by @DamianReeves in #1704) -
Codec-aware representation selection, field serde controls, and type-union derivation: a
Schema[A]fixed its wire shape at derivation with no awareness of the codec, so a sum declaring a top-level array shape hard-failed on a codec that cannot express it (Protobuf), and one schema could not serve both a JSON producer wanting a compact array and a Protobuf consumer needing an object envelope.Schema[A].representations(first, rest*)now declares an ordered preference and encode picks the highest-priority shape the active codec can express, degrading rather than thr...
v1.0.0-RC4
v1.0.0-RC4
This release supersedes v1.0.0-RC3, which was discarded for a compilation performance regression that has since been reverted.
v1.0.0-RC4 makes Kyo a place to build and drive the web. kyo-ui turns a web UI into a pure value that runs unchanged on the client, on the server, or as static HTML, and kyo-browser drives a real browser to exercise it, both on JVM, JS, Native, and now WebAssembly 🚀
The theme is one source reaching more targets, now even past Kyo itself: kyo-ffi binds native C libraries once and enables calling them in JVM, JS, and Native, kyo-compat enables shipping a single library to six effect backends, and WebAssembly joins as a fourth platform, now published to Maven Central. The framework is fully documented now, every module carrying a README whose examples compile in CI.
The new getkyo.io is itself a Kyo app, generated from those same docs.
New Features
New modules
-
kyo-ui(README) is a web UI framework where a signal stands in for a plain value in most places the API takes one, so a setter or child slot takingAalso takesSignal[A]orSignalRef[A]with no wrapper type and no binder operator. Invalid markup does not compile, and updates are fine-grained with no virtual DOM, re-rendering only the subtree bound to a changed signal. The same UI value runs unchanged across three runners (UI.runMountfor a Scala.js client,UI.runHandlersfor a server-driven app,UI.runRenderfor an HTML stream), and markup reaches past HTML to typed SVG and a typedChartlayer that lowers to it. (by @fwbrasil in #1649, #1654, #1664, #1665, #1671) -
kyo-browser(README) is cross-platform browser automation built directly onkyo-http's WebSocket transport speaking Chrome DevTools Protocol, with no WebDriver and no Node-driver shim, so it compiles on JVM, JS, Native, and Wasm. Every page-mutating action routes through a settlement pipeline (frame-lifecycle tracking, a mutation observer, a stability sampler, per-element actionability checks) so a call returns only when the page is ready for the next action, which is what makes it more suitable as the substrate for AI-agent browser driving. It replaces the JVM-onlykyo-playwright. (by @fwbrasil in #1644, #1671) -
kyo-compat(README) lets you write a library once against thekyo.compat.*surface and ship it to six effect backends (Kyo, ZIO, Cats Effect,scala.concurrent.Future, Ox, Twitter Future), selected by the consumer at deploy time.CIO[+A]is a per-backend opaque type and every method is aninline deflowering to the backend primitive, so there is no dispatch and no adapter, and eachkyo-compat-<backend>artifact depends only on its target library, so a non-Kyo consumer pulls zero Kyo code. Backend support is not uniform: Future, Ox, and Twitter Future are JVM-only; Cats Effect is JVM and JS; Kyo and ZIO are all three. (by @fwbrasil in #1627, #1637, @ghostdogpr in #1661, @DamianReeves in #1677) -
kyo-ffi(README) lets you bind a C library once with typed Scala signatures and call it from JVM (Panama), JS (koffi), and Native. You declare atrait X extends Ffiof typed method signatures (primitives, case-class structs, enums, unions, handles, buffers, callbacks) and build-time codegen generates the per-platform implementation. The runtime layers a safe tier over an explicitAllowUnsafetier, models absence and failure withMaybeandResult, and runs blocking JS calls on a fiber. (by @fwbrasil in #1668, #1674) -
kyo-tasty(README) is cross-platform TASTy reflection (JVM, JS, Native, Wasm) that answers reflection questions about Scala 3 code without a live JVM,Class.forName, or an agent. A classpath is bound for a block withTasty.withClasspath(roots) { ... }with noContextthreaded, and navigation, member traversal, subtyping, and rendering are pure instance methods on a sealed, immutable model so matches stay exhaustive. Cold load is optimized via memory-mapped reads, parallel decode, lazy symbol-body decode, and a binary snapshot cache. (by @fwbrasil in #1669) -
kyo-test(README) is a Kyo-native test framework that replaces ScalaTest and now runs most of the project's own test suites. You extendTest[S]and register cases with"name" - { ... }and"name" in { ... }whose body is a captured Kyo computation, so async and sync tests share one shape and an extra effect is declared inSand discharged with.handle. It ships a power-assertwith subexpression diagrams, property-based testing with shrinking and seeded replay, snapshot testing, decorators (retry,timeout,flaky,pending, platform gates, tags,focus), and a runner with console, TAP, and JUnit-XML reporters. (by @fwbrasil in #1658) -
kyo-slack(README) is a Slack Socket Mode client built around one scope-managed entry point,Slack.run(config)(handler), which streams typedSlackEnvelopevalues into the handler. The handler returns oneSlackAckand the framework emits exactly one wire ack from it, so forgetting to ack and double-acking are both unrepresentable. Reconnect defaults to overlap with a seen-id window and residue drain so no envelope is lost or duplicated. It is cross-platform across JVM, JS, Native, and Wasm. (by @fwbrasil in #1673) -
kyo-doctest(README) is a kyo-agnostic sbt plugin plus JVM runner that compiles (does not run) every fenced Scala block in a Markdown file against its module's classpath and validates every internal link, replacing mdoc. A block-level DSL in HTML-comment modifiers controls scope, expectation, target platforms, and setup prelude, and a content-hash cache keeps per-block cost near zero. Every module now carries a README, so the whole project is documented. (by @fwbrasil in #1645) -
kyo-case-app(README) connects case-app to Kyo entrypoints (KyoCaseApp[T],KyoCommand[T]) across JVM, JS, Native, and Wasm, so you can build a declarative CLI with options, positionals, and subcommands and register effectful work after parsing. It also introducesKyoAppRunnerinkyo-coreas the shared, public API for running Kyo effects after a third-party framework has started.KyoAppis refactored onto it, and it is made public so external entrypoints (decline, zio-cli, Spark-style mains) can use it without copying runner code. (by @DamianReeves in #1619) -
kyo-website(README) is a Scala 3 static-site generator plus akyo-uiandkyo-httpsingle-page bundle that replaces the hand-maintained docsify docs site. Content reads the live repo: the root README's Modules table drives the catalog and sidebar, each module README renders to a page, and a sharedSiteApprenderer produces both build-time HTML (JVM) and the browser's first paint (JS). (by @fwbrasil in #1676)
Platform parity
- WebAssembly (WasmGC) as a fourth cross-build target: a
WasmPlatformis added to the sbt cross-build (Scala.js with the experimental WebAssembly linker and ESModule output), and JS and Wasm share platform code through ajs-wasmsource directory. Every module targeting Scala.js now also targets Wasm, except the two cats-effect bridges (kyo-cats,kyo-compat-ce, which lack upstream Wasm support), and the full stack up to and includingkyo-httpservers runs on WasmGC, serving real HTTP and HTTPS over Node sockets. WebAssembly artifacts are published to Maven Central askyo-<module>_sjs1-wasm_3, alongside the JVM, JS, and Native coordinates. Requires Node 24 or later. (by @fwbrasil in #1663)
Improvements
Concurrency and scheduler
-
Reliable fiber interrupt delivery: A lost-update race on the single
@volatileTask.statecould clobber a just-set interrupt bit, so a fiber interrupt could be delayed to reach the worker via the fiber state. Interruption is now sourced fromIOPromise,Task.requestInterruptis removed andTask.statepacks only runtime and preemption, so there is no cross-thread interrupt write to race. (by @fwbrasil in #1628) -
Interrupt starvation under queue pressure: a CPU-bound fiber preempted into a worker's run queue and then interrupted could be starved before observing the interrupt, because a completed task did not reset its accumulated runtime and the heap did not re-sift an in-place priority change. A completed task now ca...
v1.0.0-RC2
v1.0.0-RC2
v1.0.0-RC2 is a large release. Nine new modules land, the HTTP stack is rewritten from scratch in pure Scala (with both client and server running on JVM, JS, and Native), and Scala Native picks up the remaining pieces it needed to be a viable target for everything Kyo ships 🚀
A recurring theme across the release is dependency reduction. Netty, libcurl, h2o, JCTools, Caffeine, HdrHistogram, the Java OpenTelemetry SDK, sttp, and tapir are all gone, replaced by pure-Scala implementations that share Kyo's scheduler and effect channels and compile to all three platforms. The new modules build directly on that foundation: durable workflows (kyo-flow), container orchestration (kyo-pod), feature flags (kyo-config), and OpenTelemetry export (kyo-stats-otlp) all rely almost exclusively on pure Scala implementations compiled to JVM, JS, and Native.
New Features
New modules
-
kyo-http(README) replaces the sttp and tapir integrations with a single client+server API that compiles to all three platforms, dropping Netty for a pure-Scala transport that handles TLS, WebSocket, Unix sockets, SSE, and NDJSON. Routes are an interpretable pure data structure with type-level field tracking viaRecord. (by @fwbrasil in #1479, #1518) -
kyo-pod(README) is a Docker and Podman client that talks the Docker Engine API directly over the Unix socket, with a shell execution fallback. Logs, stats, exec output, and image pulls stream from the first byte. Predefined containers for Postgres, MySQL, and MongoDB are provided for convenience. (by @fwbrasil in #1524) -
kyo-flow(README) is a durable workflow engine. AFlowis a plan, not an execution: every step is checkpointed before the next begins, and if the process crashes another executor claims the work via a time-limited lease and replays from the last checkpoint, skipping completed steps. Workflows suspend on declared inputs and resume when signals arrive through the engine API or the auto-generated HTTP endpoint, so human approval, async events, and other external triggers are first-class. Saga-style compensation, per-step retry and timeout, and an event audit trail are all built in. (by @fwbrasil in #1498) -
kyo-schema(README) is a single-source-of-truth schema module. DeriveSchema[A]from a case class and get JSON, Protobuf, type-safe lenses, structural diffs that ship and replay, batched mutations, incremental builders, and bidirectional conversions between structurally compatible types. No annotations, no boilerplate. The module depends only onkyo-dataand has no dependency on Kyo's effect runtime, so it can be adopted as a standalone library. (by @fwbrasil in #1517) -
kyo-parsemoves theParseeffect out ofkyo-preludeand parameterizes it on input type, so token-stream parsers compose with lexers. The internals are reworked to add error accumulation and AST recovery, which makes the effect suitable for real-world parsers like programming languages and LSPs. (by @Iltotore in #1305, #1404, #1421, @fwbrasil in #1400) -
kyo-config(README) provides typed feature flags and structured configuration.StaticFlagresolves once at class load for infrastructure settings;DynamicFlagevaluates per call for feature gates and A/B tests. Both support a rollout DSL with path matching, percentage weights, and deterministic bucketing, with automatic topology detection for K8s, AWS, and GCP. (by @fwbrasil in #1511) -
kyo-stats-otlpreplaces the JVM-onlykyo-stats-otelwith a from-scratch pure-Scala OTLP/HTTP exporter built onkyo-http. Speaks the protocol directly, runs on JVM, JS, and Native, and disables itself whenOTEL_EXPORTER_OTLP_ENDPOINTis unset. (by @fwbrasil in #1491) -
kyo-logging-jplandkyo-logging-slf4jare platform logging bridges extracted fromkyo-core.kyo-coreno longer pulls SLF4J as a dependency; pick whichever bridge matches your stack. (by @hygt in #1396)
Cross-platform process management
Path, Command, and Process now work consistently across JVM, JS, and Native, with safer APIs that drop java.* types in favor of Stream where it makes sense. The System effect also gains availableProcessors and architecture, classifying os.arch tokens consistently across platforms. (by @fwbrasil in #1505, #1522, #1532)
New primitives
-
Dictis a new low-allocation immutable map with a dual internal representation: a flatSpanfor up to 8 entries (linear scan, no hashing) and aHashMapabove that. Iteration takes separate key and value parameters to avoid boxing in hot paths. Used internally by the newRecordencoding. (by @fwbrasil in #1470, #1523) -
GatereplacesBarrierwith a primitive that covers both the cyclic-barrier and phaser use cases. Parties pass through together once everyone arrives, with multi-pass coordination and pass tracking; aGate.Dynamicvariant supports runtime join and leave plus hierarchical subgroups. (by @fwbrasil in #1480) -
Exchangeis a new low-level primitive for ID-multiplexed protocols like HTTP/2 and WebSocket subprotocols, where requests are tagged with an ID and responses are routed back by that ID. It encapsulates the pending-promise map, the reader fiber, the cleanup races, and backpressure for unsolicited events. Intended for protocol clients, not application code. (by @fwbrasil in #1501) -
New
Recordencoding: records no longer allow duplicate field names with different types. The old encoding stored a runtimeTagto disambiguate, which the new invariant plusConversion-based subtyping replaces, also reducing memory footprint. (by @fwbrasil in #1467, #1472) -
Base64: pure-Scala RFC 4648 implementation that cross-compiles to all three platforms without depending on
java.util.Base64. (by @fwbrasil in #1531)
Interop and convenience APIs
-
Kyo
Streamand ZIOZStreaminterop: bidirectional conversion between the two. (by @HollandDM in #1461) -
Abort.ignoreandAbort.loopUntil: two new error-handling combinators. (by @fwbrasil in #1507)
Improvements
Native parity
Scala Native catches up to JVM and JS on the modules where it used to be missing or partial. Full HTTP client and server support lands (by @fwbrasil in #1479), along with a JCTools queue port that replaces unoptimized stubs (by @fwbrasil in #1489), a Cache primitive that retires the JVM-only Caffeine dependency (by @fwbrasil in #1487), Prometheus and OTel-inspired histograms in kyo-stats that replace HdrHistogram (by @fwbrasil in #1483), signal handling so Native binaries respond to SIGINT and SIGTERM (by @hearnadam in #1408), and a scheduler jitter fix that addresses a Native-specific Thread.sleep contention (by @fwbrasil in #1485). reactive-streams now cross-compiles to JS and Native (by @fwbrasil in #1484), and the ZIO interop modules are enabled for Native (by @fwbrasil in #1482).
General
-
Scoped
Fiber.init: fibers used to be fire-and-forget by default, easy to lose track of.Fiber.initnow introduces aScopepending effect and registers a finalizer that interrupts the fiber when the scope closes.Fiber.initUnscopedpreserves the prior behavior. (by @johnhungerford in #1379) -
Reliable blocking detection and thread-interrupt propagation: the scheduler's stalled-worker detector now reads per-thread CPU time instead of thread state, which several kernel-level blocking operations leave at
RUNNABLEdespite genuinely being blocked. Fiber interrupts also reach into truly blocking I/O likeServerSocket.acceptnow: the JVM thread interrupt is dispatched, gated to fire only when the worker is genuinely parked so it can't damage in-flight work. (by @fwbrasil in #1510) -
Nested
.nowand.laterindirect:.nowand.laterinside another.now, and.laterinside another.later, now compile, removing a common ergonomic wart. (by @ahoy-jon in #1369) -
ConcreteTagderivation for unions and intersections: generic methods overAbort[E | Closed]compil...
Kyo 1.0-RC1: A New Era of Simplicity and Stability
We're excited to announce that Kyo is finally entering a period of API stabilization! 🚀 Over the past three years, we've quickly iterated on the abstractions of the library to ensure they're reliable and provide a good user experience, but adopting Kyo was challenging due to the constant breaking changes. The project has now reached a level of maturity where we're comfortable making a commitment regarding stability. The 1.0-RC1 release is the first in a series of releases meant as a final validation of the APIs before reaching the 1.0.0 release.
During the RC cycle, the project will maintain source compatibility and, for cases where an incompatible change proves important, we'll provide Scalafix rewrite rules. Paired with Kyo's mature set of primitives, adopting the library for production systems becomes a viable option. The duration of this period will depend on how much feedback we get, so bug reports, feature requests, and general feedback on the library are greatly appreciated 🙏
We're also proud to announce the core developers team leading the project. @hearnadam is now Lead Maintainer and we welcomed @ahoy-jon to the team!
- Flavio Brasil - Creator of Kyo 🚀
- Adam Hearn - Lead maintainer 👁️
- John Hungerford - Deep owner of Combinators and Streams 🥄
- Jonathan Winandy - Direct Style Magician 🔮
- Jason Pickens - Cooking up kyo-grpc 👨🍳
Improvements
-
Mature streaming: As mentioned in previous release notes, finalizing the
StreamAPIs was a major focus to enable the RC cycle. This release includes several major improvements. Enabled by the newTagimplementation, all related APIs now provide proper variance. A newPipeAPI was introduced to express streaming transformations in isolation, a pair ofhandleandunwrapmethods was introduced to facilitate the management of the pending set, and other new methods were introduced:stream.groupedWithin,stream.broadcast,Stream.fromIterator, andStream.fromIteratorCatching. (by @johnhungerford in #1254, #1259, #1268, #1268, #1274, #1281, #1166, #1170, #1239, #1238, @ahoy-jon in #1222, #1251, #1244, #1255) -
Deeper ZIO integration: The
kyo-ziomodule now provides bi-directional transformations between Kyo's and ZIO's layers and streams. (by @hearnadam in #1299, @HollandDM #1298) -
Direct syntax overhaul: The direct syntax had a series of major fixes and improvements, greatly improving its usability. New integrations with dotty-cps-async's
AsyncShiftenable transformations using.nowin functions for collection types,Maybe, and multiple issues with edge cases were fixed. (by @ahoy-jon in #1197, #1212, #1202, #1235, #1204, #1303, #1310, #1311) -
Better resource safety: Kyo's default APIs used to not register finalizers automatically. In this release,
Channel,Meter,Hub, andQueueautomatically register finalizers in theinitmethod and a new set ofinitUnscopedmethods is provided to initialize without finalizers. Additionally, finalizers are able to inspect errors when executing and an edge case with finalization backpressure got fixed. (by @johnhungerford in #1313, #1322, #1324, @fwbrasil in #1194) -
Effectful fibers and simplified isolates: Fibers used to have two type parameters representing the possible successful or failure outcomes without being able to express other pending effects like
Streamand other APIs do. This release changes it toFiber[+A, -S]whereSrepresents a pending effect set. To enable this change, contextual and stateful isolates were merged into a singleIsolate[Remove, -Keep, Restore]. When forking, the proper isolate is automatically inferred and anyRestoreeffects are added to the pendingSset of the theFiber. -
Async improvements: Fibers used to change identity on each asynchronous boundary, which prevented the implementation of some features. Fibers now keep a stable identity until completion. A new
Async.raceFirstmethod has been added,Async.timeoutwas improved to better handle timeouts with zero duration, and theTimeoutexception now shows the timeout duration. (by @fwbrasil in #1190, @hearnadam in #1229, #1340, #1225) -
Channel draining and closing on empty: Channels didn't have a convenient way for a producer to handle termination. In this release, a new
closeAndWaitEmptyenables an atomic close once the channel is empty,pendingPutsandpendingTakesprovide full visibility of the state of the channel, and streaming from channels was optimized via internal optimistic draining. (by @fwbrasil in #1191, #1203, @steinybot in #1193, #1264) -
Kyo companion: The
Kyocompanion object provides APIs for common operations. Its collection methods now keep the original collection types instead of just returningChunkand a new set ofKyo.whencombinators provides convenient composition of branching logic. (by @HollandDM in #1218, @johnhungerford in #1304) -
Data structures improvements:
Recordnow offers agetFieldmethod to enable access of fields with special or reserved names andChunknow has alastMaybemethod. (by @road21 in #1201, #1187, @steinybot in #1226) -
Lifting usability: Kyo's automatic lifting of values had an edge case where it prevented value discard warnings in the direct syntax that got fixed. Also, there was a usability issue with IDEs suggesting lifting of companion objects, which doesn't make sense. The lifting was changed to not allow lifting of companion objects. (by @ahoy-jon in #1314, #1291)
-
Parameterized generic aspects: The
Aspecteffect couldn't be used in scenarios where the aspect has a parameterized generic parameter. The effect was changed to operate on tags instead of object instances to overcome the limitation. (by @fwbrasil in #1327) -
Combinators cleanups: The zipping combinators now use a
Zippabletype to automatically flatten multiple zipped computations, theensuringmethod was fixed to acceptAbort[Throwable], and several cleanups were made in the APIs. (by @hearnadam in #1295, #1336, #1337, @johnhungerford in #1319, @ahoy-jon in #1307) -
Scalafix migration rules: The initial setup of Scalafix rewrites was done to support the RC cycle and rules to facilitate the migration from
0.19.0to1.0-RC1were added.
Breaking changes
- The
IOeffect was renamed toSync. (by @ahoy-jon in #1277) Resourcewas renamed toScope. (by @hearnadam in #1356)IO.applyandAsync.applywere renamed toIO.deferandAsync.defer. (by @fwbrasil in #1308, #1309)Async.runwas moved toFiber.init,Async.runAndBlockmoved toKyoApp.runAndBlock. (by @fwbrasil in #1316)fromCompletionStagemoved fromFibertoAsync(by @fwbrasil in #1195)KArraywas renamed toSpan. (by @fwbrasil in #1326)SafeClassTagwas renamed toConcreteTag. (by @fwbrasil in #1329)- In
kyo-direct, thedefermethod was renamed todirect. (by @ahoy-jon in #1236) Choice.evalnow takes a vararg param. (by @ahoy-jon in #1219)TScheduleremoved inkyo-stm. (by @fwbrasil in #1331)- Scala 2.12 support was dropped. (@ahoy-jon in #1266)
New Contributors
v0.19.0
This is the last release before we start a new 1.0 release candidate cycle! Yes, you heard that right. We know we've been breaking our APIs like... a lot 😅 but we feel we're finally ready to start making commitments regarding stability. The next release will be 1.0-RC1 and we'll have a series of releases (hopefully in a single digit) to validate our commitments regarding the APIs that the library will provide in the long term. During this period, we'll do our best to maintain source compatibility and, for cases where some breaking change is important, we're planning to provide scalafix rewrites.
Kyo 1.0 here we gooooo!!!! 🚀
New features and improvements
First-class support for computation nesting: Kyo uses an optimized internal representation for computations that is able to represent regular values as computations without a wrapper object, avoiding allocations in case there are no effect suspensions. This internal characteristic used to leak to user-facing APIs via a Flat evidence, which used to provide a way to ensure the value of a computation wasn't itself another computation. In this release, this limitation has been lifted! Flat has been removed and nesting is encoded as an internal concern of the kernel. When plain values are lifted to computations, if a nested computation is detected, an internal wrapper object is instantiated to provide proper nesting, following a pattern similar to Maybe and Result. This change improves usability to define new effects and facilitates integration with other libraries since it enables free use of Kyo in generic contexts, including effect handling, without the requirement of a Flat evidence. (by @fwbrasil in #1148)
New Tag: Kyo's Tag used to have a number of limitations. It was designed to avoid allocations by leveraging bytecode-defined strings and to enable the definition and use of Kyo's current set of effects, but it couldn't represent all Scala types, including not handling variance. This limitation required effects like Env to use erased tags and less-safe effect handling internally. This release includes a built-from-scratch Tag that is able to represent all types required to express Kyo computations and effects including variance support. The kernel has been changed to support effects with variance but the current effect implementations still use erased tags, pending migration. If you're curious about algebraic effects and their relation to delimited continuations, this test should be an interesting reading (by @fwbrasil in #1171, #1181)
Stream improvements: Streams remain a major focus of the project towards Kyo 1.0. In this release, new APIs were added: concurrent stream merging via Stream.collectAll and stream.merge, parallel stream transformation via stream.mapPar and stream.mapChunkPar, lazily evaluated stream sources via Stream.repeatPresent, and stateful stream sources via Stream.unfoldKyo. We're not expecting major API changes to Stream itself but we're exploring optimizations and still extending its API. (by @johnhungerford in #1123, #1156, @vladpo in #1139, and @HollandDM in #1164)
Sink: Stream used to provide a few methods for execution but their functionality was limited. Sink extends the functionality of Stream by providing convenient stream handling logic. Like Stream is backed by the Emit effect in kyo-prelude, Sink is its dual based on Poll. Sink provides several stream consumption strategies and can be composed with other sinks. (by @johnhungerford in #1157)
Karray: The new KArray type in kyo-data is an alternative to IArray with optimized methods to avoid allocations and function dispatch overhead. Methods like exists and forall have performance equivalent to hand-written while loops and avoid boxing via inlining. This new data structure was an important optimization in the new Tag implementation, enabling zero-allocation sub-type checking. (by @fwbrasil in #1180)
More flexible effect handling: The kernel has been improved to provide more control to effect handler implementations. Previously, support for introducing new effect suspensions during the handling of an effect was limited to handleState, which required handlers to use it even without the need for state. ArrowEffect now provides a new set of handleLoop methods following the API pattern of the Loop effect and providing more fine-grained control over effect handling including the abilities to perform new effect suspensions and to stop effect handling. (by @fwbrasil in #1150)
Generic collection methods: The collection handling methods in the Kyo companion objects aren't restricted to Seq anymore and now accept IterableOnce. (by @HollandDM in #1149)
Support for Text in Log: The Log API now supports Text in addition to String. (by @hearnadam in #1163)
Time-slice preemption in JS: The JS scheduler used to be a simple delegate to the JS runtime without handling preemption, which required explicit yields. This release introduces time-based preemption like in the JVM. (by @fwbrasil in #1145)
More flexible resource handling: We're planning a major change to the Resource effect before 1.0-RC1. As a preparation, the effect was changed to enable abstraction of finalizers. (by @hearnadam in #1137)
Value return in Loop.foreach: The API now supports returning a final value via Loop.done. (by @hearnadam in #1160)
Choice.runStream: The Choice effect can now stream results as they become available. This can be useful when the Choice effect is used to evaluate multiple options with different depths of rejection and completion. (by @fwbrasil in #1182)
Optimizations
Chunk: Commonly used Chunk methods were specialized to provide efficient execution without the overhead of the default Scala collection methods. In addition, chunks of a single item now have a specialized internal representation to reduce allocations. (by @fwbrasil in #1184, @HollandDM in #1142)
Resource: The effect handling now avoids unnecessary computations when the scope has no resources to close. (by @fwbrasil in #1144)
Fixes
Abort in STM: The STM effect wasn't retrying transactions in case of Abort suspensions due to inconsistent STM reads. This behavior has been fixed to automatically retry aborts when the transaction isn't consistent, even if it doesn't reach the commit phase. (by @fwbrasil in #1169)
NPE in trace enriching: The logic to insert Kyo traces in stack traces could throw an NPE, which has been fixed. (by @hearnadam in #1174)
Fix Promise variance: The encoding of Promise had an issue with variance, which enabled completing the promise with an incorrect type. (by @fwbrasil in #1143)
Breaking changes
Monix removal: The integration with Monix has been removed in this release due to maintenance challenges. (by @fwbrasil in #1147)
New Contributors
Full Changelog: v0.18.0...v0.19.0
v0.18.0
Kyo 0.18.0
New Features
-
Actors: The new
kyo-actormodule introduces type-safe actors built on top of other effects likeChannelandPoll. The API enables composition with other effects both within an actor implementation and in itsActor.runcreation scope. For example, actors can requireEnvvalues in their initialization or leverageRetryandAbortto compose supervision strategies in their bodies. This initial version includes local actors only, but theSubjectabstraction is designed to enable remote communication. The goal is eventually integrating the module withkyo-aeronfor distributed actors. This work was based on a collaboration with @DamianReeves. Thank you! (by @fwbrasil in #1107) -
Abort with literals: The
Aborteffect now supports short-circuiting computations with a literal value for situations where creating a new type for aborting isn't convenient. For instance,Abort.literal.fail["invalid"]will provide a computation with a pendingAbort["invalid"]that can be handled viaAbort.literal.run. (by @hearnadam in #1118) -
Playwright browser integration: The
kyo-playwrightmodule provides a new Browser effect for programmatic browsing with support for several features like screenshotting, mouse usage, and extracting readable content. The effect also provides a low-level API viaBrowser.Opclasses designed to enable LLM interaction via tools. (by @fwbrasil in #1113)
Improvements
-
Async.fillIndexedmethod to repeat a computation multiple times with their indexes. (by @fwbrasil in #1110) -
Stream.splitAtmethod to take a specific number of elements out of a stream and return it with a new stream with the remaining emissions. (by @HollandDM in #1092) -
Var.updateWithmethod to enable updating a var and performing a transformation in a single allocation. (by @fwbrasil in #1135) -
Scaladocs in
kyo-corewere reviewed and improved to better document the motivation of effects and their behaviors. (by @fwbrasil in #1104) -
The repository now has a CONTRIBUTING.md with general information on how to contribute. (by @c0d33ngr in #1112)
-
The
kyo-combinatorsmodule had a major refactoring, reorganizing the code into multiple files and making the APIs and implementations more consistent with the rest of the codebase. (by @johnhungerford in #1102) -
We're starting to explore providing first-class support for Java in the
kyo-schedulermodules. As a first step, we've validated that the current APIs are usable from Java. (by @hearnadam in #1121) -
Most of Kyo's classes were marked as
Serializable, enabling support for Java serialization of computations. The main exception isFibers and classes that hold references to them since persisting the state of a running fiber would produce inconsistent behaviors. (by @fwbrasil in #1132)
Fixes
-
Channelhad an edge case with zero capacity where the behavior wasn't well defined. This version includes a new implementation with proper support for zero-capacity channels. (by @johnhungerford in #1108) -
Pathhad an encoding issue in Windows that has been fixed. (by @ffilipus in #1109) -
A memory leak related to a single fiber handling multiple parking operations and their interruptions was fixed. (by @fwbrasil in #1125)
Breaking Changes
-
The
pipemethod in the pending type (<) has been renamed tohandleto better indicate that the API is meant primarily for effect handling even though it still supports arbitrary transformations. (by @fwbrasil in #1115) -
The project used to use a pattern with
Opsclasses to enable multiple type parameter groups. These were now migrated to the new clause interleaving language feature. This change improves usability with the newly namedhandlemethod with effect handlers. (by @fwbrasil in #1114) -
Var.setAndThenhas been renamed toVar.setWithto follow the new naming pattern in the codebase whereWithindicates that the operation takes a continuation function. (by @fwbrasil in #1133)
New Contributors
Full Changelog: v0.17.0...v0.18.0
v0.17.0
This is likely one of the last releases before the 1.0-RC cycle! Please report any issues or difficulties with the library so we can address them before committing to a stable API 🙏
Also, Kyo has a new logo! Thank you @Revod!!! (#1105)
New features
-
Reactive Signal: A new Signal implementation has been introduced in
kyo-core, inspired by fs2. Signals can change value over time and these changes can be listened for via the methods that integrate withStream. (by @fwbrasil in #1082) -
Consistent collection operations: Handling collections with the
Kyocompanion object is very flexible, while doing the same withAsyncused to be less convenient and with a completely different API approach. In this release, a new set of methods to handle collections was added to the Async effect, mirroring the naming of theKyocompanion. With this, most collection operations can either useKyofor sequential processing orAsyncfor concurrent/parallel processing. (by @fwbrasil in #1086) -
Partial error handling: The
Aborteffect had a limitation that doesn't allow the user to handle only expected failures without panics (unexpected failures). This release introduces APIs to handle aborts without panics in the Abort.*Partial methods. Similarly, a new Result.Partial type was introduced to represent results without panics. (by @johnhungerford in #1042) -
Record staging: Records can now be materialized from a type signature using a function to populate the values. This feature is meant to enable the creation of DSLs. For example, given a record type
"name" ~ String & "age" ~ Int, it's possible to stage it for a SQL DSL as"name" ~ Column[String] & "age" ~ Column[Int]. (by @road21 in #1094) -
Aeron integration: The new Topic effect in the
kyo-aeronmodule provides a seamless way to leverage Aeron's high-performance transport with support for both in-memory IPC and reliable UDP. Stream IDs are automatically derived from type tags, providing typed communication channels, and serialization is handled via upickle. (by @fwbrasil in #1048) -
Direct Memory in Scala Native: The Memory effect provides direct memory access with automatic handling of resources via scoping. The module now also has support for Scala Native! (by @akhilender-bongirwar in #1072)
Improvements
-
Unified Isolate mechanism: In this release, two mechanisms used to provide support for effects with forking,
IsolateandBoundary, were merged into a single implementation with better usability.Isolate.Contextualprovides isolation for contextual effects likeEnvandLocal, whileIsolate.Statefulis a more powerful mechanism that is able to propagate state with forking and restore it. A few effects provide defaultIsolateinstances but not all. For example, given the problematic semantics of mutable state in the presence of parallelism,Vardoesn't provide anIsolateevidence, which disallows its use with forking by default and requires explicit activation (seeVar.isolate.*). (by @fwbrasil in #1077) -
More convenient discarding methods: Methods that execute a provided function but don't use its result used to require functions to return
Unit. In this release, methods were changed to acceptAnyas the result of the function. For example, theunitcall inResource.ensure(queue.close.unit)can now be omitted:Resource.ensure(queue.close). (by @johnhungerford in #1070) -
Less verbose errors: Kyo logs rich failures including a snippet of the failing code for a better development experience. This behavior is problematic in production systems due to the verbosity. A new Environment mechanism was introduced to detect if Kyo is executing in a development mode and disable the rich failure rendering if not. The detection mechanism currently only supports SBT, but the user can enable the development mode via a system property. (by @fwbrasil in #1057)
-
Better resource handling in Hub: The
initmethods ofHubweren't attaching a finalizer via theResourceeffect. This has been fixed in this release. (by @johnhungerford in #1066) -
Remove IOException from Console APIs: The
Consolemethods used to indicate that the operation could fail withAbort[IOException], but that was an incorrect assumption. The underlying Java implementation doesn't throw exceptions and a separate method is provided to check for errors. Kyo now reflects this behavior by not trackingAbort[IOException]and providing a newConsole.checkErrorsmethod. (by @rcardin in #1069) -
Multi-get Env APIs: The new Env.getAll/useAll methods enable getting multiple values from the environment at once. For example:
Env.getAll[DB & Cache & Config], which returns aTypeMap[DB & Cache & Config]. (by @fwbrasil in #1099) -
Rename
runprefix in Stream: Some of the methods inStreamwere prefixed withrunto indicate that they will evaluate the stream, which wasn't very intuitive. The prefix was removed and, for example,Stream.runForeachis nowStream.foreach. (by @c0d33ngr in #1062) -
Non-effectful Stream methods: The methods in the Stream class were designed to assume that all operations are effectful, which introduces overhead due to the unnecessary effect handling when the function is effect-free. This release includes overloaded versions of methods, which allows the compiler to select the non-effectful version if possible. Benchmark results show a major improvement. (by @johnhungerford in #1045)
-
Maybe.collect optimization: The method has been updated to use
applyOrElse, which avoids the need to call the partial function twice. (by @matteobilardi in #1083) -
Path.readAll fix: The method wasn't returning the correct file names. (by @hearnadam in #1090)
New Contributors 👏
- @rcardin made their first contribution in #1069
- @matteobilardi made their first contribution in #1083
- @akhilender-bongirwar made their first contribution in #1072
- @Revod made their first contribution in #942
Full Changelog: v0.16.2...v0.17.0
v0.16.2
What's Changed
- [data] records more than 22 AsFields (#1006) by @road21 in #1013
- [stm] fix TTable index initialization by @fwbrasil in #1012
- core: exit KyoApp on failure by @hearnadam in #1031
- remove IO.unit by @fwbrasil in #1041
- [core] Fix SLF4J log levels by @hearnadam in #1046
There are a few new features that will be announced with 0.17.0.
Full Changelog: v0.16.1...v0.16.2