Make usage of Graal features easy and safe from Scala. Also features Scala-based React SSR.
libraryDependencies ++= Seq( "com.github.japgolly.scala-graal" %% "core" % "1.1.1" "com.github.japgolly.scala-graal" %%% "core-js" % "1.1.1" "com.github.japgolly.scala-graal" %%% "ext-boopickle" % "1.1.1" "com.github.japgolly.scala-graal" %% "ext-prometheus" % "1.1.1" )
import japgolly.scalagraal._// Use semantics and implicit config for JS // (GraalVM also supports Python, R, Ruby, LLVM) import japgolly.scalagraal.js._ import GraalJs._
// 1. Pre-compile expression functions for fast invocation. // 2. Typeclasses translate and/or marshall data between JVM and JS. val expr: (Int, Int) => Expr[String] = Expr.apply2((a, b) => s"($a + $b) * 2 + '!'").compile(_.asString)
// Use a basic synchronous JS environment val ctx = GraalContext()
val result = ctx.eval(expr(3, 8)) assert(result == Right("22!"))
up to 10000 reps/thread & up to 30 sec | until completes within 20ms)
windowand especially
window.locationmanagement