Releases: getkyo/kyo
v0.13.0
New Features
- More flexible integration with ZIO and cats-effect: The integrations were previously implemented with custom effects, which had limitations with some
Async
operations. The new implementation is based directly onAsync
, allowing unrestricted use of ZIO and cats-effect computations with Kyo's async primitives. - Safe class tags: The
kyo-data
module provides an alternative to Scala'sClassTag
that can express union, intersection, and literal types. TheSafeClassTag
implementation ensures materialized tags always properly represent their types without falling back tojava.lang.Object
for special types likeAnyVal
orNothing
. - Richer Abort effect: The
Abort
effect was update to use the newSafeClassTag
, enablingAbort.run
with union types to handle multiple failure types at once. - Async masking: Introduction of
Async.mask
andfiber.mask
methods, similar touninterruptible
in other effect systems. These mask asynchronous computations from potential interruptions. - First-class support for unsafe APIs: Most primitives in
kyo-core
now provide protected unsafe access. This feature enables development of libraries on top of Kyo with better performance and facilitates integrations.Unsafe
APIs are available in companion objects, e.g.,Fiber.Unsafe
,LongAdder.Unsafe
. - Kyo-native Instant: A new
Instant
implementation inkyo-data
module improves integration with other Kyo APIs likeClock
andDuration
. - Optimized
Batch
effect: Implemented optimizations to lower the effect's overhead, including improvements toChunk
,Loop
, andKyo.foreach*
methods.
Breaking Changes
- The
kyo-tag
module has been merged intokyo-data
. - The
Unit
suffix was renamed toDiscard
in someAsync
methods. Stream.Ack
considers0
max items asStop
.- The
when
method inkyo-combinators
now returns aMaybe
instead of a pendingAbort
.
Full Changelog: v0.12.2...v0.13.0
v0.12.2
What's Changed
- prelude: fix order of empty Stream type parameters by @steinybot in #700
- core: translate exceptions in Fiber.fromFuture by @fwbrasil in #666
- Fix drop return type by @steinybot in #686
- prelude: support handling Abort[Nothing] by @fwbrasil in #695
- core: async fixes by @fwbrasil in #685
- Fix Emit.Ack.Continue to pull the correct amount by @steinybot in #688
- Omit snippet for internal Frames by @hearnadam in #701
Dependency updates
- Upgrade Caliban to 2.9.0 by @ghostdogpr in #697
- Update tapir-json-zio to 1.11.5 by @scala-steward in #703
- Update sbt-scalajs to 1.17.0 by @scala-steward in #704
- Update sbt-scoverage to 2.2.1 by @scala-steward in #706
- Update scala-library to 2.13.15 by @scala-steward in #705
- Update scala3-library to 3.5.1 by @scala-steward in #675
- Update tapir-core, tapir-json-zio, ... to 1.11.5 by @scala-steward in #684
Full Changelog: v0.12.1...v0.12.2
v0.12.1
What's Changed
- prelude: use Ansi in LayerMacros by @fwbrasil in #663
- fix readme by @mio-19 in #661
- core: async optimizations by @fwbrasil in #667
- tag: fix inference in generic scopes by @fwbrasil in #676
- prelude: remove unused type param from Abort.run (#680) by @steinybot in #681
- Fix Stream.runDiscard not processing any stream elements by @lukestephenson in #673
Updates
- Update tapir-core, tapir-json-zio, ... to 1.11.3 by @scala-steward in #662
- Update sbt-mdoc to 2.6.0 by @scala-steward in #665
- Update sbt to 1.10.2 by @scala-steward in #664
- Update zio-http to 3.0.1 by @scala-steward in #669
- Update tapir-core, tapir-json-zio, ... to 1.11.4 by @scala-steward in #668
- Update sbt-mdoc to 2.6.1 by @scala-steward in #670
New Contributors
- @mio-19 made their first contribution in #661
- @lukestephenson made their first contribution in #673
Full Changelog: v0.12.0...v0.12.1
v0.12.0
-
Initial Scala Native support: The modules
kyo-data
,kyo-tag
, andkyo-prelude
are now cross-compiled to Scala Native 0.5.5. -
Batch: A new effect that provides functionality similar to solutions like Haxl/Stitch/ZIO Query to batch operations. The effect can be safely composed with others without a separate monad!
-
kyo-prelude: The kyo-prelude module contains the new kernel of the library and a collection of
IO
-free effects. It's a quite complete effect system with mutability only to handle stack safety, tracing, and preemption. Other than that, the entire module is pure without any side effects orIO
suspensions, including the effect handling mechanism. -
System: Provides access to system properties, environment variables, and OS-related information. A convenience
Parse
type class is provided to parse configurations. -
Check: A new effect that provides a mechanism similar to assertions but with customizable behavior, allowing the collection of all failures (
Check.runChunk
), translation to theAbort
effect (Check.runAbort
), and discarding of any failures (Check.runDiscard
). -
Effect-TS-inspired pipe: The pending type now offers
pipe
methods that allow chaining multiple transformations into a singlepipe
call. -
ScalaDocs: The majority of Kyo's public APIs now offer ScalaDocs.
-
cats-effect integration: The new Cats effect provides integration with cats-effect's
IO
, allowing conversion of computations between the libraries in both directions. -
New Clock APIs: New convenience APIs to track deadlines and measure elapsed time.
-
Barrier: An asynchronous primitive similar to
Latch
to coordinate the rendezvous of multiple fibers. -
Integration with directories-jvm: The
Path
companion object now provides methods to obtain common paths based on the directories-jvm library:Path.basePaths
,Path.userPaths
,Path.projectPaths
.
v0.11.1
What's Changed
Notably, this release fixes publishing JS artifacts, squashes bugs in TypeMap & Layer, and upgrades to Scala 3.5.
- Env.runLayer can handle effects introduced by layers by @johnhungerford in #604
- Scala 3.5 by @fwbrasil in #605
- remove unused code by @fwbrasil in #607
- re-enable JS build for ZIO artifacts by @fwbrasil in #609
- fix release of JS artifacts by @fwbrasil in #610
- Return Unit for
TypeMap#get[Any]
on empty TypeMap by @hearnadam in #613 - rename top-level files package.scala to avoid assembly conflicts by @scalavision in #614
Documentation
- readme: Ansi by @fwbrasil in #597
- readme: Duration by @fwbrasil in #596
- readme: Retry by @fwbrasil in #594
- readme: update intro + get started by @fwbrasil in #592
- readme: Stream by @fwbrasil in #593
- readme: Debug by @fwbrasil in #598
- readme: TypeMap by @fwbrasil in #595
- readme: Memo by @fwbrasil in #591
- readme: Layer by @fwbrasil in #590
Dependencies:
- Update zio-logging, zio-logging-slf4j2 to 2.3.1 by @scala-steward in #599
- Update sbt-scoverage to 2.1.1 by @scala-steward in #601
- Update fs2-core to 3.11.0 by @scala-steward in #611
- Update zio-laws-laws, zio-prelude to 1.0.0-RC30 by @scala-steward in #616
- Update zio, zio-concurrent, zio-test, ... to 2.1.9 by @scala-steward in #615
New Contributors
- @vkurdin made their first contribution in #612
- @scalavision made their first contribution in #614
Full Changelog: v0.11.0...v0.11.1
v0.11.0
This is Kyo's largest release so far! It contains a major redesign of the library, introduces several new effects, and is a significant leap towards Kyo 1.0 🚀
- Layers: The
Layer
effect provides managedEnv
values inspired by ZIO. It offers APIs for manual composition as well as a macro-basedLayer.init
method that automatically wires multiple layers. Layers use a newMemo
effect to manage the lifecycle of components and support any other effects that may be required by their initialization. Developed by @hearnadam @kitlangton - Caliban Integration: The
Resolvers
effect integrates with Caliban andkyo-tapir
to serve GraphQL queries. The integration is designed so queries can contain arbitrary Kyo effects. Developed by @ghostdogpr - Combinators: The Zikyo project is now incorporated into Kyo's main repository in the
kyo-combinators
module. It provides extension methods to the pending type and theKyo
companion object resembling ZIO's approach with a unified API for multiple effects. Developed by @johnhungerford - Low-allocation Data Types: The new
kyo-data
module is published as a standalone artifact without a dependency on the effect system. It contains new data type implementations with a focus on performance. Developed by @hearnadam @kitlangton @fwbrasil- Maybe: An allocation-free alternative to
Option
, including proper support for nesting. - Result: A low-allocation data type that merges the functionality of
Try
andEither
in a single monad. - TypeMap: A type-safe heterogeneous map implementation based on Kyo's allocation-free tags.
- Maybe: An allocation-free alternative to
- System Utilities: The
kyo-os-lib
module has been removed and a new implementation with support for process spawning (Process
) and file operations with streaming (Path
) has been introduced inkyo-core
. Developed by @pablf - Forking with Effects: Fibers can now be forked with several effects like
Abort
,Env
, andRandom
. Developed by @fwbrasil - Stack-safe Recursion: Kyo's new design tracks the execution depth of computations and automatically inserts effect suspensions to provide stack safety by default. Developed by @fwbrasil
- Stack Traces: Computations now collect execution traces that are automatically injected in stack traces of exceptions with a short snippet of the source code. Developed by @fwbrasil
- Debug Effect:
Debug
offers APIs to log the result of computations, trace their execution, and inspect inputs and outputs. The solution uses Kyo'sFrame
, which provides source code snippets of transformations. Developed by @fwbrasil. Example output:
![image](https://private-user-images.githubusercontent.com/831175/360977443-1fbe626e-6efd-4046-a153-cbd86c39ab4a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNTI3NTAsIm5iZiI6MTczOTA1MjQ1MCwicGF0aCI6Ii84MzExNzUvMzYwOTc3NDQzLTFmYmU2MjZlLTZlZmQtNDA0Ni1hMTUzLWNiZDg2YzM5YWI0YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQyMjA3MzBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wOTYzNWViMGEwYTUwOTdlMjUwNTQwZmE2YTgwM2FhNWU3ODk2ZjMzMGViZDcwZjYxNWNlOTMyYWIyMDgwMTZkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.OMYD_8ar8aovsbczDWadcoQ3AZ9Qqs3PD7nq770gfIU)
A special thanks to @hearnadam for all the PR reviews and contributions! 🙏
Breaking Changes
This version introduces several breaking changes:
- The
Fibers
effect is renamedAsync
and theFibers.init
method is renamedAsync.run
. - The
Fiber
type now has an additional type parameterFiber[E, A]
, whereE
tracks typed errors translated from/toAbort
andA
represents the result of the computation. - The
.pure
method in the pending type is renamed to.eval
since it might be a computation with internal suspensions to ensure stack safety. - Most effects were renamed from plural to singular.
- Effects that integrate with external types like
Resolvers
for integration with Calibran andRoutes
for Tapir are still named using plurals.
New Contributors
- @carlosedp made their first contribution in #449
- @pablf made their first contribution in #428
- @taretmch made their first contribution in #488
- @mobley-trent made their first contribution in #415
Full Changelog: v0.10.2...v0.11.0
v0.10.2
What's Changed
This change contains a variety of fixes, improvements, mostly surrounding Kyo's scheduler
- Blocking: this release improves blocking performance significantly
- Scheduler: this release prepares for improvements to Kyo's Top
- ZIO Interop: you can now use the kyo-scheduler via extension of
KyoSchedulerZIOAppDefault
- Rename Zio -> ZIO by @hearnadam in #418
- add support for KyoSchedulerZIOAppDefault by @hearnadam in #401
Changes
- Update client3:core to 3.9.7 by @scala-steward in #402
- sbt build: use CrossType.Full for all modules by @fwbrasil in #405
- fix jmh benchmarks by @fwbrasil in #407
- Fix typo by @steinybot in #408
- zio-http bench by @hearnadam in #406
- Make kyo build with Intellij (#138) by @987Nabil in #404
- Update vertx-core, vertx-web to 4.5.8 by @scala-steward in #416
- scheduler: dispatch java interrupts by @fwbrasil in #417
New Contributors
- @steinybot made their first contribution in #408
Full Changelog: v0.10.1...v0.10.2
v0.10.1
What's changed
- This release fixes the output of the Scheduler's Top when using the Console
- You can enable console output for Top via property:
-Dkyo.scheduler.enableTopConsoleMs=n
- wheren
is > 0
Changes
- use ZIO v2.1.1 by @fwbrasil in #393
- avoid implicit conversions by @fwbrasil in #394
- Use
Top.print
to outputScheduler.Status
to console by @hearnadam in #397 - scheduler: fix console top to show deltas by @fwbrasil in #399
Full Changelog: v0.10.0...v0.10.1
v0.10.0
Kyo v0.10.0
This version introduces new major features and important fixes. Main highlights:
- kyo-tag: Kyo now has a new type
Tag
implementation that provides allocation-free sub-type checking. This new solution addresses safety issues with effect handling in generic scopes and its improved performance unblocks some important new features and fixes. A separate artifactkyo-tag
is produced with no dependency on any other Kyo modules, enabling the use of the newTag
in isolation by other projects. - kyo-zio: The initial implementation of the
ZIOs
effect is included in this new release. It provides a seamless integration between Kyo and ZIO via two methods:ZIOs.get
transforms a ZIO computation into a Kyo one, andZIOs.run
transforms Kyo computations into ZIO. These methods can even be used in a nested fashion, enabling the gradual adoption of Kyo within a ZIO codebase. Feedback is appreciated! - kyo-scheduler-zio: Provides a ZIO
Runtime
instance configured to replaceZExecutor
with Kyo's adaptive scheduler. Initial benchmarking shows promising performance improvements. We're looking for early adopters of this new module. It's also a standalone module without a dependency onkyo-core
. - Java Futures integration: Kyo fibers now integrate with Java futures via
Fibers.fromCompletionStage
andFibers.fromCompletionStageFiber
. Thank you @calvinlfer! - Flat Check Fixes: The
Flat
implicit is essential to guarantee the safe execution of Kyo computations. This mechanism was failing to engage properly in some scenarios; this version fixes those cases. - Exception handling regression: A performance regression was detected by one of the EasyRacer scenarios. The regression was narrowed down to a change in Kyo's exception handling, which has been reverted in this release. The work on this regression also produced a number of other smaller optimizations.
- Scheduler Top: A new command-line utility to observe the execution of Kyo's scheduler is provided as a main class under
kyo.scheduler.util.Top
. The solution works via JMX beans and is designed to be used in production environments as well. Example output:
![image](https://private-user-images.githubusercontent.com/831175/331890365-2d39b398-6108-4d8b-8404-c3574fc0caa1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNTI3NTAsIm5iZiI6MTczOTA1MjQ1MCwicGF0aCI6Ii84MzExNzUvMzMxODkwMzY1LTJkMzliMzk4LTYxMDgtNGQ4Yi04NDA0LWMzNTc0ZmMwY2FhMS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQyMjA3MzBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jOTIwZTJkNzg1NTk1ZGEzMmViYmZiOWU4Y2NlOWJiM2ZkZTM1NjlhMjFiZTkyOTgzNjRiYzA3YjYwMWM4ZjgzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.6yc2pOLpgyjf3YjrAKDKchjW2lOlnIuHil4eJSChK1o)
Special thanks to @hearnadam for all the contributions!
What's Changed
- Make HasAborts public again by @johnhungerford in #326
- Update client3:core to 3.9.6 by @scala-steward in #318
- Update zio, zio-concurrent, zio-test, ... to 2.1.0-RC5 by @scala-steward in #319
- Update scala-library to 2.13.14 by @scala-steward in #320
- Update sbt-scoverage to 2.0.12 by @scala-steward in #321
- Update log4cats-core, log4cats-slf4j to 2.7.0 by @scala-steward in #322
- zio integration by @fwbrasil in #303
- FFI for Java's CompletionStage by @calvinlfer in #324
- http client benchmarks by @fwbrasil in #328
- reproduce flat check bug (#327) by @fwbrasil in #334
- scheduler: don't check the availability of a submitter worker by @fwbrasil in #333
- requests: avoid switching to ForkJoinPool by @fwbrasil in #330
- fix Fibers.Interrupted to avoid lock contention in
Throwable::getCause
by @fwbrasil in #331 - Update zio-laws-laws, zio-prelude to 1.0.0-RC25 by @scala-steward in #336
- Update sbt to 1.10.0 by @scala-steward in #338
- Update http4s-dsl, http4s-ember-client to 0.23.27 by @scala-steward in #337
- requests: race 10k requests test by @fwbrasil in #332
- Update zio, zio-concurrent, zio-test, ... to 2.1.0 by @scala-steward in #344
- Update izumi-reflect to 2.3.9 by @scala-steward in #343
- benchs: detect runtime leaks by @fwbrasil in #345
- benchs: registry mechanism by @fwbrasil in #346
- logs: include scope information + convenience methods to log values by @fwbrasil in #341
- flat check fixes by @fwbrasil in #349
- Update zio, zio-concurrent, zio-test, ... to 2.1.1 by @scala-steward in #351
- Update opentelemetry-api, ... to 1.38.0 by @scala-steward in #352
- better support for other effects in Resources by @fwbrasil in #355
- (almost) allocationless tags ⚡ by @fwbrasil in #348
- move effect command from member type to type parameter by @fwbrasil in #356
- move Tag to separate module by @fwbrasil in #357
- Update zio-laws-laws, zio-prelude to 1.0.0-RC26 by @scala-steward in #358
- Tag optimizations by @fwbrasil in #359
- direct macro refactorings by @fwbrasil in #360
- workaround to declare effects as opaque by @fwbrasil in #361
- automatically derive Flat from Tag by @fwbrasil in #366
- kyo-sttp: avoid translating Interrupted exceptions by @fwbrasil in #365
- http client race bench by @fwbrasil in #364
- scheduler: top utility by @fwbrasil in #363
- cache stream handlers by @fwbrasil in #367
- scala-js: add java-time dependency by @hearnadam in #362
- scheduler top improvements by @fwbrasil in #369
- avoid
core.eval
for error handling by @fwbrasil in #373 - avoid
lazy val
to accessKyoSttpMonad
by @fwbrasil in #371 - Reproduce #368: Stream transform test by @hearnadam in #374
- kyo-sttp: ensure backpressure by @fwbrasil in #375
- Update zio-logging, zio-logging-slf4j2 to 2.2.4 by @scala-steward in #370
- kyo-sttp: backend meter by @fwbrasil in #376
- scheduler: ensure workers stop when inactivated by @fwbrasil in #372
- kyo-benchs: migrate TestHttpServer to Vert.x by @fwbrasil in #377
- http race contention bench: use a meter to avoid overloading the http server by @fwbrasil in #381
- kyo-tag: support type unions and intersections by @fwbrasil in #378
- Update zio-http to 3.0.0-RC7 by @scala-steward in #382
- scheduler: minor optimizations by @fwbrasil in #384
- scala 3.4.2 by @fwbrasil in #385
- zios: readme by @fwbrasil in #380
- kyo-scheduler-zio by @fwbrasil in #386
- Enable choosing a
Position
with/without owning scope by @hearnadam in #387 - Update os-lib to 0.10.1 by @scala-steward in #388
New Contributors
- @calvinlfer made their first contribution in #324
Full Changelog: v0.9.3...v0.10.0
v0.9.3
Kyo v0.9.3
Kyo 0.9.3 is a fairly substantial change from 0.9.2. Notable releases include:
- The core scheduler has been split to a distinct module, cross compiled for Scala 2/3
- zio-test integration has been published under kyo-test
- An allocation free Duration module has been created, with a
Long
backing type - Improved encodings of Envs, Aborts, Sums, and more!
What's changed
- introduce chunks by @fwbrasil in #267
- ensure the preemption signal is dispatched to all workers by @fwbrasil in #269
- streams chunking by @fwbrasil in #270
- add: multi-platform console backed logger by @hearnadam in #272
- introduce failure benchmark by @fwbrasil in #277
- Introduce Randoms bench by @hearnadam in #279
- Enable providing custom services in KyoApp by @hearnadam in #280
- New Scheduler by @fwbrasil in #278
- improve scheduler readability by @fwbrasil in #283
- Cross compile scheduler to Scala 2.12 and 2.13 by @fwbrasil in #284
- ZIO Test Integration by @hearnadam in #282
- Log the exception in logger by @sideeffffect in #286
- Loops-based Seqs by @fwbrasil in #287
- fix: null Fiber interruption exception message by @hearnadam in #288
- add type inferred Aborts API by @hearnadam in #289
- loops review by @fwbrasil in #290
- Interop Kyo Fiber & ZIO by @hearnadam in #291
- Update zio to 2.1.0-RC3 in benchmarks by @kyri-petrou in #293
- Avoid Tags in Aborts (fixes #275) by @fwbrasil in #292
- Improve Aborts handling of sub/super types by @hearnadam in #295
- Aborts-like encoding for Sums by @fwbrasil in #297
- Aborts-like encoding for Envs by @fwbrasil in #298
- fix kyo-test build by @fwbrasil in #301
- sums readme by @fwbrasil in #300
- Aborts-like encoding for Vars by @fwbrasil in #299
- introduce fork/join benchmark by @fwbrasil in #304
- fork/join contention bench by @fwbrasil in #305
- introduce option to replace Zio's executor with Kyo's in benchmarks by @fwbrasil in #306
- fork/join contention benchmark improvement by @fwbrasil in #309
- core: reduce bytecode size by avoiding type checks by @fwbrasil in #311
- introduce Defers effect by @fwbrasil in #310
- introduce core eval method by @fwbrasil in #312
- loops: repeat and forever by @fwbrasil in #313
- fix io task runtime tracking by @fwbrasil in #314
- Initial Duration module by @hearnadam in #296
New Contributors
- @sideeffffect made their first contribution in #286
- @kyri-petrou made their first contribution in #293
Full Changelog: v0.9.2...v0.9.3