github typelevel/cats-effect v3.7.0-RC1

pre-releaseone month ago

This is the fifty-ninth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and intended to be fully source-compatible with the 3.7.x lineage. While we always strive to avoid making breaking changes between release candidate and final versions, in some cases it cannot be avoided and no strong guarantees are provided.

What's Changed

This is a relatively smaller minor release jump relative to 3.6.x since it contains a major and long-anticipated enhancement: support for Scala Native 0.5, including full multithreading on LLVM! This has been a very long time coming, and we've been planning how to provide this support and planting the seeds for several years now. As noted in previous release notes, the integrated runtime released in 3.6.0 provides the basic building blocks for true, practically usable multithreaded asynchronous I/O on LLVM, and this release finally brings all of those pieces to fruition.

Full support has been implemented for epoll and kqueue, and we intend to extend this support to io_uring in the future. These polling systems have been significantly upgraded and enhanced since 3.6.x in order to support the same sort of thread coordination that has been present on the JVM from the beginning.

Of course, the largest piece of this is the WorkStealingThreadPool itself. This was ported from JVM-only to cross-build entirely on both JVM and LLVM targets. Surprisingly, almost no changes were required to make this possible! It is a testament to the thought and effort which went into Scala Native 0.5 that this port was dramatically smoother and less complex than anyone could have reasonably predicted. While we did run into a few minor issues with Scala Native, only one major problem with its multithreading support was encountered, and it only applies in a very niche scenario which was easily worked around.

We really cannot stress enough how impressed we are with Scala Center and Virtus' work on this front. Scala Native 0.5 is quite the triumph, and Cats Effect 3.7 is the proof. Going forward, you should essentially expect rough parity between scheduling functionality on JVM and LLVM, with JavaScript now being the unusual one (due to its single-threaded nature).

As an aside, it's worth noting that this parity holds despite the fact that Scala Native actually implements subtly different memory publication semantics than the JVM in some very specific circumstances. The Cats Effect concurrency state model (i.e. Ref/Deferred) is such that these semantic differences are entirely invisible in userspace, while the performance benefits are present regardless. This is one example of the careful planning and coordination which went into this release spanning across many people and multiple projects.

The one area in which Cats Effect on Scala Native meaningfully lags behind the JVM is fiber tracing. This functionality should exist on LLVM, but it appears that the APIs do not work correctly at runtime. It is expected that these bugs will be resolved in a future Scala Native release, at which point we'll be able to enable the functionality in Cats Effect.

Enhancements

Bug Fixes

  • Don't expose private WSTP type in method signature by @armanbilge in #4290
  • Make IOFiber#{_join,_cancel} volatile on Native by @durban in #4400
  • Removed IORuntimeBuilder#addPoller on Scala.js by @djspiewak in #4419
    • As a brief callout, this change actually represents a binary-breaking change relative to Cats Effect 3.6.x on Scala.js! We almost universally avoid doing this, but in this case the type signature exposure was entirely accidental and the method never worked, so anyone who wrote code which called that method on Scala.js would have simply had broken code. For this reason, we felt justified in the binary break.
  • Make the heap in TimerHeap volatile on native by @armanbilge in #4443
  • Fix wstp shutdown interrupt (3.x edition) by @djspiewak in #4344
  • Use _exit instead of System.exit in fatal cases by @djspiewak in #4428
  • Fix source compatibility with Scala 3.6 by @mbovel in #4381

Documentation

Behind the Scenes

  • Update scala-library to 2.13.16 in series/3.x by @typelevel-steward[bot] in #4239
  • Update sbt-scalajs, scalajs-compiler, ... to 1.18.2 in series/3.x by @typelevel-steward[bot] in #4249
  • Revert documentation format changes by @mzuehlke in #4246
  • Update scala3-library, ... to 3.3.5 in series/3.x by @typelevel-steward[bot] in #4261
  • Replace specs2 with munit by @iRevive in #4216
  • Update scalafmt-core to 3.9.4 in series/3.x by @typelevel-steward[bot] in #4297
  • Replace deprecated commands in build.sbt by @iRevive in #4339
  • Update cats-core, cats-free, ... to 2.13.0 in series/3.x by @typelevel-steward[bot] in #4356
  • Update sbt-scalafix to 0.14.3 in series/3.x by @typelevel-steward[bot] in #4403
  • Update sbt-typelevel to 0.8.0 in series/3.x by @typelevel-steward[bot] in #4417
  • Update sbt, scripted-plugin to 1.11.3 in series/3.x by @typelevel-steward[bot] in #4427
  • flake.lock: Update by @typelevel-steward[bot] in #4414
  • Update sbt-mdoc to 2.7.2 in series/3.x by @typelevel-steward[bot] in #4441
  • SN 0.5.6 -> 0.5.7 -> 0.5.8 by @durban in #4362

New Contributors

Full Changelog: v3.6.3...v3.7.0-RC1

Don't miss a new cats-effect release

NewReleases is sending notifications on new releases.