@ppurang

20 Followers
44 Following
47 Posts

🔐 released sbt 1.12.7, featuring a security fix for CVE-2026-32948, Source dependency feature (via crafted VCS URL) leading to arbitrary code execution on Windows

this was discovered and fixed by Anatolii "Toli" Kmetiuk at Scala Center, who is also a new sbt committer
https://eed3si9n.com/sbt-1.12.7 #Scala

sbt new protip: to test drive a giter8 (g8) template locally (because you want to test changes):

```
sbt new file://./cats-seed.g8
```

that `file://` bit is important.

#scala #sbt

. @eed3si9n As sbt 2 comes close to a release is it too late to try and move towards scala-cli like dependencies notation, i.e. instead of "com.casualmiracles" %% "treelog" % "1.9.5" using com.casualmiracles::treelog:1.9.5 ? I assume that newer folks will come from scala-cli to sbt so one less hurdle, also makes copy pasting things across simpler. Just a thought. And thanks once again for making sbt awesome and the good work. Can't wait for sbt 2 :)
@matejcerny if one looks at https://github.com/matejcerny/pgmq4s/tree/main/examples/src/main/scala/pgmq4s/examples/skunk surely a win for being very terse. Does one loose out on other aspect(s)?
pgmq4s/examples/src/main/scala/pgmq4s/examples/skunk at main · matejcerny/pgmq4s

Contribute to matejcerny/pgmq4s development by creating an account on GitHub.

GitHub

And freaking good news for Typelevel Foundation. Congratulations everyone 🎉🎉. Very well deserved 

--

Discord announcement by Arman (https://github.com/armanbilge):

«Exciting news: the Typelevel Foundation was determined to be a 501(c)(3) public charity! 🎉 ... Read more on the blog [1]»

[1] https://typelevel.org/blog/charity.html

#scala #FunctionalProgramming #FP #plt #programing

armanbilge - Overview

Executive Director of Typelevel Foundation. (Distracted) computational evolutionary biologist. I write Scala, read DNA, and speak in conditional probabilities. - armanbilge

GitHub

Saw a toot about "Scala 3" Scaladoc static site generator. QOTD: Can it compile/run scala snippets embedded in docs, like mdoc?

Seems like it can: https://docs.scala-lang.org/scala3/guides/scaladoc/snippet-compiler.html

Feature parity with mdoc? Mdoc's integration with Docusaurus seems pretty nifty. sbt-typlelevel seems to have documentation covered with mdoc and laika.

What do/would you use and why?

#scala

Snippet checking

Scala Documentation

👩‍🔬 sbt 2.0.0-RC9 is released! sbt 2.0 is a new version of sbt, based on Scala 3 constructs and Bazel-compatible cache system

RC9 is a big change, featuring
- JDK 17 + Scala 3.8.1 in metabuild
- Maven BOM (Bill of Materials) usage support
- client-side `console` (forking Scala REPL from native sbtn client)
- `rootProject` macro
- experimental dependency lock
- experimental Ivyless publishing
- and a long list of contributed bug fixes
https://eed3si9n.com/sbt-2.0.0-RC9 #Scala

Using language.experimental.subCases interferes with pattern match exhaustivity checking · Issue #25234 · scala/scala3

Compiler version Scala CLI version: 1.12.2 Scala version (default): 3.8.1 Minimized code //> using scala 3.8.1 //> using options -deprecation -feature -Wunused:all -Werror import language.experimen...

GitHub

Took `strictEqualityPatternMatching` and `subCases` for a test ride.

`strictEqualityPatternMatching` works pretty good. also across `sum`/`enum` types and `union` types. Nice!

`subCases` interfered with exhaustivity checks. Maybe I am doing something wrong. `subCases` for `sum` types to tease them out separately would be solid.

`Integer` pattern match was deemed exhaustive when shouldn't have been. (will do some more tests here.)


https://scastie.scala-lang.org/CE9rW97WRSSnFkQsP83TKg

#scala #scastie

Scastie - An interactive playground for Scala.

//> using scala 3.8.1 //> using option -language:experimental.saferExceptions //> using option -language:experimental.captureChecking // Describes computations that can fail with error `E` final class CanThrow[-E] // Internal exception used to jump to the catch block private final case class Break[E](value: E, label: CanThrow[E]) extends RuntimeException(null, null, false, false) // Library version of `throw` def failWith[A](a: A)(using l: CanThrow[A]): Nothing = throw Break(a, l) // Provides a way to catch errors. object Catch: def apply[A, E](op: CanThrow[E] ?=> A)(default: E => A): A = given label: CanThrow[E] = new CanThrow() try op catch case Break(value, `label`) => default(value) // Error types sealed trait Error extends Exception case class NegativeNumber(i: Int) extends Error case class InvalidInput(s: String) extends Error // sqrt can fail if its argument is negative. def sqrt(i: Int)(using CanThrow[NegativeNumber]): Double = if i >= 0 then math.sqrt(i) else failWith(NegativeNumber(i)) // parse can fail if its argument is not a valid int. def parse(s: String)(using CanThrow[InvalidInput]): Int = scala.util.Try(s.toInt).getOrElse(failWith(InvalidInput(s))) // Composing both widens the type of the error to the parent of `NegativeNumber` and `InvalidInput`. def composed(s: String)(using CanThrow[Error]): Double = sqrt(parse(s)) // I like this better - auto-widening is nice, but note how `Error` is not sealed: `composedSubtype` // forces me to deal with error cases that don't exist. def composedBetter(s: String)(using CanThrow[NegativeNumber | InvalidInput] ): Double = sqrt(parse(s)) def printSqrt(s: String): Unit = Catch(println(composedBetter(s))): case NegativeNumber(i) => println(s"Negative number: $i") case InvalidInput(s) => println(s"Invalid input: '$s'") @main def run = printSqrt("abc") printSqrt("-4") printSqrt("4")