We’re happy to announce the release of Scala Native. It’s the next maintenance release for Scala Native 0.4.x. As always it brings bug fixes and minor improvements.
Extern methods with a variadic number of arguments¶
For a long time, Scala Native supported C
scalanative.unsafe.CVarArgList. This allowed for interop with some of the C functions taking the variadic number of arguments. This release makes usage and definition of them easier, by restoring support for idiomatic ways of passing them using Scala variadic arguments lists.
void printf(char* format, ...);
@extern def printf(format: CString, args: Any*): Unit = extern @main def test() = val msg = c"MyMessage" printf("String '%s' is allocated at %p and has %d characters\n", msg, msg, strlen(msg))
Support for LLVM 15¶
The latest versions of LLVM added a new internal representation of pointers - their opaque variant replaces typed pointers. This change should not affect most of the users, but in some specific builds it could have lead to linking issues. Now Scala Native will try to detect version of LLVM toolchain. When using LLVM 15 or newer Scala Native toolchain would always generate opaque pointers in the compiled LLVM IR.
The Scala standard library used by this release is based on the following versions:
|Scala binary version||Scala release|
|Commits since last release||43|
Big thanks to everybody who contributed to this release or reported an issue!
$ git shortlog -sn --no-merges v0.4.10..v0.4.11 24 Wojciech Mazur 14 LeeTibbert 2 Arman Bilge 1 João Costa 1 Ondra Pelech 1 philwalk
Merged pull requests: