Skip to content

v1.4.1

Compare
Choose a tag to compare
@Gedochao Gedochao released this 18 Jul 10:11
· 304 commits to main since this release
dbb3285

Pass compiler args as an @argument file

You can shorten or simplify a Scala CLI command by using an @argument file to specify a text file that contains compiler arguments.

-d
outputDirectory

The feature may help to work around the Windows command line character limit, among other things, making sure your scripts run on any operating system of your choice.

scala-cli run -e 'println("Hey, I am using an @args file!")' @args.txt

This works similarly to the command-line argument files feature of Java 9 and fixes backwards compatibility with the old scala runner (pre-Scala-3.5.0).

Added by @kasiaMarek in #3012

Explicitly enable or disable multithreading in Scala Native

It is now possible to explicitly enable or disable multithreading in Scala Native builds.
You can do it by setting the //> using nativeMultithreading directive:

//> using platform native
//> using nativeMultithreading
import scala.concurrent._
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
val promise = Promise[Int]()
val thread = new Thread(new Runnable {
    def run(): Unit = {
      Thread.sleep(100)
      promise.success(42)
    }
  })
thread.start()
val result = Await.result(promise.future, 2.seconds)
println(result)

Or the --native-multithreading command line option:

scala-cli run native_multithreading.sc --native --native-multithreading

Added by @Gedochao in #3011.

Features

  • Add a command line option & directive for enabling/disabling Scala Native multithreading by @Gedochao in #3011
  • feat: allow to pass scalac options using files by @kasiaMarek in #3012

Fixes

Documentation changes

Updates

New Contributors

Full Changelog: v1.4.0...v1.4.1