Skip to content

Releases: getkyo/kyo

v0.14.1

20 Nov 03:37
0f3701d
Compare
Choose a tag to compare

Improvements

Fixes

  • [prelude] fix Stream#drop with small Chunks by @hearnadam in #826
  • [prelude] provide Flat evidences for Loop.Outcome* by @fwbrasil in #822
  • [kyo-data] avoid printing trees when Flat macro fails by @hearnadam in #840
  • [core][combinators] workaround issue with nested boundaries by @fwbrasil in #850
  • [core] fix interrupts in Fiber.parallelUnbounded by @fwbrasil in #835

Breaking changes

  • [prelude][core] Remove as from the pending type + make andThen always discard by @fwbrasil in #827
  • [prelude] remove unused type parameters in ArrowEffect.handle by @fwbrasil in #844

New Contributors

Full Changelog: v0.14.0...v0.14.1

v0.14.0

06 Nov 16:00
3726166
Compare
Choose a tag to compare

New Features

kyo-data

  • Text: Optimized API for string manipulation that avoids copying the underlying char array.
  • Schedule: A new data type for representing complex scheduling.

kyo-prelude

  • Parse Effect: New effect with support for backtracking, lookahead, and cut operations. The Parse effect is implemented using Var to track parsing position and Choice to evaluate multiple possible branches. The API is designed to provide a more intuitive experience by using an imperative-like approach for consuming inputs and evaluating alternatives, rather than composing parsers with special operators. The effect also supports incremental parsing through integration with Stream in Parse.run.

kyo-core

  • Unsafe Queue and Channel: New protected Unsafe APIs added for both Queue and Channel.
  • Time Shift and Control: Clock introduces two new APIs:
    • Clock.withTimeControl: Enables manual time control
    • Clock.withTimeShift: Allows speeding up or slowing down computation execution based on a factor
      Additionally, Timer has been merged into Clock, ensuring both time control methods work with scheduled execution. For example: Clock.withTimeShift(factor = 2)(Clock.repeatWithDelay(2.seconds)(computation)) will schedule the computation every 1 second of wall-clock time, as the shift doubles the time passage speed.
  • Monotonic Clock: New Clock.nowMonotonic method provides results based on System.nanoTime for improved precision in time measurement. Clock.stopwatch has been updated to use this feature.
  • Isolated Locals: New functionality prevents Locals from being automatically inherited by forked fibers through Local.initIsolated. This mechanism provides fiber identity by ensuring isolated locals remain within a computation's scope.
  • Reentrant Meters: Mutexes, semaphores, and rate limiters are now reentrant by default, with customization options to disable reentrancy. This feature uses isolated locals to track meters acquired by a fiber.
  • Abort[Nothing] in Async: The Async effect now includes Abort[Nothing] by default to handle unexpected failures (panics in Kyo's terminology).

Other Changes

  • Timer functionality has been moved to Clock.repeat* methods.
  • Added a new recommended compiler flag to ensure proper handling of Kyo computations.
  • A bug was recently introduced in Async.timeout making interrupts not propagate correctly. This bug has been fixed and tests were added to ensure the feature works correctly with kyo-sttp.

Benchmark Results cafc6d6 2024-10-30

30 Oct 20:34
Compare
Choose a tag to compare
Pre-release

Benchmark results for commit cafc6d6 on 2024-10-30

v0.13.2

29 Oct 16:27
c9f7e82
Compare
Choose a tag to compare

New/Improved APIs:

  • data: Schedule by @fwbrasil in #733
    • Improves Retry API surface. Breaking.
  • data: Instant improvements by @fwbrasil in #781
  • core: more convenient Random customization by @fwbrasil in #782
  • core: Log improvements by @fwbrasil in #783
  • core: Console improvements by @fwbrasil in #785
    • Exposes typed errors via Abort[IOException]
  • core: simplify KyoApp by @fwbrasil in #780
    • Merges KyoApp.Unsafe.run* to a single runAndBlock method.

Fixes

Updates

Full Changelog: v0.13.1...v0.13.2

v0.13.1

17 Oct 20:12
3e5682b
Compare
Choose a tag to compare

New APIs

  • Abort.recover: enables more convenient handling of errors. It supports safely selecting a subset of possible failures via a type union.
  • Kyo.pure: method meant to facilitate widening of pure values into Kyo computations in cases that the compiler can't automatically infer the widening.
  • Result.contains: a convenience method to check if the result contains a Success with a specific value.
  • SafeClassTag now provides a CanEqual instance.

Improvements

  • The integration with ZIO now uses a more efficient internal encoding that doesn't require intermediate Future execution. API remains the same.
  • Fibers were changed from Fiber[E, A] to Fiber[+E, +A], improving type inference, and new unsafe APIs were added.
  • Duration.show was improved to show the duration at the maximum possible resolution without losing information. It was previously always printing nanoseconds.
  • Tags for common Kyo types were fixed to use a more compact representation.

Breaking changes

  • Maybe.Defined was renamed to Present and Maybe.Empty to Absent. Both are now available directly in the kyo package.
  • KyoApp.* methods now require an AllowUnsafe evidence.
  • Aspect.apply doesn't allow effects in its value input anymore.

Full Changelog: v0.13.0...v0.13.1

v0.13.0

12 Oct 00:30
f4446dc
Compare
Choose a tag to compare

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 on Async, 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's ClassTag that can express union, intersection, and literal types. The SafeClassTag implementation ensures materialized tags always properly represent their types without falling back to java.lang.Object for special types like AnyVal or Nothing.
  • Richer Abort effect: The Abort effect was update to use the new SafeClassTag, enabling Abort.run with union types to handle multiple failure types at once.
  • Async masking: Introduction of Async.mask and fiber.mask methods, similar to uninterruptible 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 in kyo-data module improves integration with other Kyo APIs like Clock and Duration.
  • Optimized Batch effect: Implemented optimizations to lower the effect's overhead, including improvements to Chunk, Loop, and Kyo.foreach* methods.

Breaking Changes

  • The kyo-tag module has been merged into kyo-data.
  • The Unit suffix was renamed to Discard in some Async methods.
  • Stream.Ack considers 0 max items as Stop.
  • The when method in kyo-combinators now returns a Maybe instead of a pending Abort.

Full Changelog: v0.12.2...v0.13.0

v0.12.2

29 Sep 23:10
b00a51c
Compare
Choose a tag to compare

What's Changed

Dependency updates

Full Changelog: v0.12.1...v0.12.2

v0.12.1

23 Sep 15:40
7f2d1fa
Compare
Choose a tag to compare

What's Changed

Updates

New Contributors

Full Changelog: v0.12.0...v0.12.1

v0.12.0

13 Sep 18:54
f359d2d
Compare
Choose a tag to compare
  • Initial Scala Native support: The modules kyo-data, kyo-tag, and kyo-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 or IO 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 the Abort 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 single pipe 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

29 Aug 18:12
b34a863
Compare
Choose a tag to compare

What's Changed

Notably, this release fixes publishing JS artifacts, squashes bugs in TypeMap & Layer, and upgrades to Scala 3.5.

Documentation

Dependencies:

New Contributors

Full Changelog: v0.11.0...v0.11.1