Skip to content
vic

strymonas/strymonas-scala

Fast streams for Scala 3

strymonas/strymonas-scala.json
{
"createdAt": "2020-05-05T19:14:19Z",
"defaultBranch": "master",
"description": "Fast streams for Scala 3",
"fullName": "strymonas/strymonas-scala",
"homepage": "",
"language": "Scala",
"name": "strymonas-scala",
"pushedAt": "2025-02-08T16:12:41Z",
"stargazersCount": 56,
"topics": [
"functional-programming",
"scala",
"scala3",
"stream"
],
"updatedAt": "2025-09-08T08:19:44Z",
"url": "https://github.com/strymonas/strymonas-scala"
}

strymonas is a library providing fast-streams for Scala 3 through multi-stage programming and partial evaluation.

ci Join the chat at https://gitter.im/strymonas/strymonas

libraryDependencies += "io.github.strymonas" %% "strymonas" % "0.1.0"
import scala.quoted.staging._
import strymonas._
import strymonas.Code.given
given Code.Compiler = Compiler.make(getClass.getClassLoader)
given raw: Raw = Raw(Code)
val t = run {
// Construct a streaming pipeline here
Cooked.of_int_array(Array(1,2,3,4,5,6,7,8,9,10)).fold(0, (_+_))
}
println(t)

Construct a streaming pipeline using the Cooked Object (defined in [Stream.scala]!(src/main/scala/strymonas/Stream.scala)).[^1] Then, invoke the pipeline with scala.quoted.staging.run.

Refer to the [examples directory]!(examples) for more details.

[^1] !: If you are familiar with machine learning frameworks, you can think of this as an analogy to a Static Computational Graph.

strymonas is built with SBT 1.7.1 or later.

  • Use sbt compile to build the project from the source
  • Use sbt test to run the tests
  • Use sbt bench/jmh:run to run the benchmarks
Terminal window
# 1. Install SBT: https://docs.scala-lang.org/getting-started/index.html, https://get-coursier.io/docs/cli-overview
## macOS Case:
brew install coursier && coursier setup # Maybe `source ~/.profile` or `reboot` is required
## Linux Case:
curl -fL https://github.com/coursier/coursier/releases/latest/download/cs-x86_64-pc-linux.gz | gzip -d > cs && chmod +x cs && ./cs setup
source ~/.profile # or reboot
# 2. Clone this repo
git clone git@github.com:strymonas/strymonas-scala.git
cd strymonas-scala
# 3. Compile via SBT
sbt compile
# (4. Clean compilation artifacts as needed)
sbt clean
rm -rf target/ project/target/ project/project/

strymonas has its origins in a paper published by Oleg Kiselyov (okmij.org), Aggelos Biboudis (@biboudis), Nick Palladinos (@palladin) and Yannis Smaragdakis (site) and this repo has its aim into making this library available for Scala 3.

The initial prototypes (that correspond directly to the paper, were developed for Scala/LMS and OCaml/BER MetaOCaml) and the initial commit for the Scala 3 port is based on the case study presented for the paper published by Nicolas Stucki @nicolasstucki.