0.5.7 (2025-02-26)

We’re happy to announce the release of Scala Native 0.5.7.

Breaking changes

  • Scala Native 0.5.7 is backward compatible with all previous Scala Native 0.5 versions, but it is not forward binary compatible with 0.5.6. Users of libraries published using Scala Native 0.5.7 are required to update to Scala Native 0.5.7 or higher

Highlights of the release

  • Scala Native runtime no longer requires C++ standard library (on Unix systems) by default. @scala.scalanative.unsafe.linkCppRuntime annotation can be used on extern methods bindings to require linking with C++ standard library if these are used. Scala Native would still use C++ runtime on Windows or if the LTO is enabled, due to not yet resolved issues. Adding -fno-cxx-exceptions or -fcxx-exceptions settings to NativeConfig.compileOptions allows to explicitlly control if Scala Native should use it’s own exception handling implementation or to continue using C++ exception wrappers.

  • StackOverflowError can now be detected and handled instead of terminating program

  • SCALANATIVE_THREAD_STACK_SIZE environment variable can now be used to control default platform Thread size at runtime (-Xss on the JVM)

  • Optimized layout of Class virtual tables to reduce size of binaries

  • Implemented many Java standard library methods introduced in JDK 9 and later

Supported Scala versions

Scala Binary Version Supported Scala Versions
2.12 2.12.14 ... 2.12.20
2.13 2.13.8 ... 2.13.16
3 3.1.2 ... 3.1.3
3.2.0 ... 3.2.2
3.3.0 ... 3.3.5
3.4.0 ... 3.4.3
3.5.0 ... 3.5.2
3.6.2 ... 3.6.3

Upon release of new Scala version (stable, or Scala 3 RC) version dependent artifacts would be published without a new release.

Commits since last release 90
Merged PRs 85
Contributors 10

Contributors

Big thanks to everybody who contributed to this release or reported an issue!

$ git shortlog -sn --no-merges v0.5.6..0.5.7
    41	Wojciech Mazur
    29	LeeTibbert
    11	Lorenzo Gabriele
     3	Eric K Richardson
     1	Anton Sviridov
     1	Arman Bilge
     1	Dimi Racordon
     1	Jiahui (Jerry) Tan
     1	dependabot[bot]
     1	faveoled

Merged PRs

0.5.7 (2025-02-26)

Full Changelog

Merged pull requests:

Scala Native compiler plugin

Scala Native runtime

Scala Native toolchain

  • Show both original defns and transformed instructions after lowering phase failure #4086 (WojciechMazur)

  • Cache and reuse unwind handlers for the same nir.Next input #4088 (WojciechMazur)

  • Enhance build error handling for a build module named native #4092 (ekrich)

  • Get function name from DWARF when available #4094 (lolgab)

  • Support PIE (Position Independent Executables) #4111 (lolgab)

  • Generate GC yield instructions when looping on the same block #4119 (WojciechMazur)

  • Use config.targetsPlatform instead of Platform.isPlatform #4124 (lolgab)

  • Polyinline improvements #4135 (lolgab)

  • Convert boxing runtime calls into NIR box/unbox instructions #4139 (lolgab)

  • Reuse hasUnwind lazy val in Opt.scala #4110 (lolgab)

  • Emit missing file attribute in debug metadata of BasicMonitor union and scala.Array types #4163 (WojciechMazur)

  • Fix detection of using system threads when using ThreadBuilders.start API #4162 (WojciechMazur)

  • Fix missing unwind symbols when linking with lld #4160 (lolgab)

  • Compilation Support for native Windows toolchain #3866 (ekrich)

  • Always inline when code is annotated with @alwaysinline #4106 (lolgab)

  • Refine when to apply alwaysinline attribute #4170 (WojciechMazur)

  • Eliminate redundant box -> bitcast -> unbox chains #4158 (lolgab)

  • Add missing dbg metadata to generated scalanative_catch calls #4179 (WojciechMazur)

  • Optimize throwing exception to local handler as jump #4194 (WojciechMazur)

  • Fix handling of intrinsic methods in lowering in non-optimized builds #4186 (WojciechMazur)

  • Don’t warn on unresolved intrisnic method call that is defined inside handled intrinsic method #4202 (WojciechMazur)

  • Improve detection when system threads are used. #4204 (WojciechMazur)

  • Refine when to check for StackOverflowError #4203 (WojciechMazur)

Scala Native sbt plugin

Java Standard Library