{"id":16538324,"url":"https://github.com/japgolly/scala-graal","last_synced_at":"2025-04-07T18:14:25.225Z","repository":{"id":39802730,"uuid":"155969595","full_name":"japgolly/scala-graal","owner":"japgolly","description":"Make usage of Graal features easy and safe from Scala. Also features Scala-based React SSR.","archived":false,"fork":false,"pushed_at":"2024-08-21T16:10:22.000Z","size":1351,"stargazers_count":194,"open_issues_count":16,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-12T18:45:07.279Z","etag":null,"topics":["fp","graal","graalvm","react","scala","scalajs","ssr"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/japgolly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"japgolly"}},"created_at":"2018-11-03T09:44:35.000Z","updated_at":"2023-12-28T03:21:25.000Z","dependencies_parsed_at":"2024-10-25T18:28:46.902Z","dependency_job_id":"a1d04643-0949-46fb-8fc8-615454aec795","html_url":"https://github.com/japgolly/scala-graal","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japgolly%2Fscala-graal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japgolly%2Fscala-graal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japgolly%2Fscala-graal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japgolly%2Fscala-graal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/japgolly","download_url":"https://codeload.github.com/japgolly/scala-graal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704571,"owners_count":20982298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fp","graal","graalvm","react","scala","scalajs","ssr"],"created_at":"2024-10-11T18:45:01.642Z","updated_at":"2025-04-07T18:14:24.771Z","avatar_url":"https://github.com/japgolly.png","language":"Scala","funding_links":["https://patreon.com/japgolly"],"categories":[],"sub_categories":[],"readme":"# scala-graal\n\n```scala\nlibraryDependencies ++= Seq(\n  \"com.github.japgolly.scala-graal\"  %% \"core\"           % \"2.0.0\"\n  \"com.github.japgolly.scala-graal\" %%% \"core-js\"        % \"2.0.0\"\n  \"com.github.japgolly.scala-graal\" %%% \"ext-boopickle\"  % \"2.0.0\"\n  \"com.github.japgolly.scala-graal\"  %% \"ext-prometheus\" % \"2.0.0\"\n)\n```\n\n\n# Goals\n\n* Make it quick, easy and safe to interface with embedded languages from Scala\n* Hide and automate a lot of required [GraalVM](https://www.graalvm.org) boilerplate\n* Support [React SSR](https://css-tricks.com/server-side-react-rendering/) for [Scala.JS](https://www.scala-js.org/) applications\n\n\n# Demo\n\n```scala\nimport japgolly.scalagraal._\n\n// Use semantics and implicit config for JS\n// (GraalVM also supports Python, R, Ruby, LLVM)\nimport japgolly.scalagraal.js._\nimport GraalJs._\n\n// 1. Pre-compile expression functions for fast invocation.\n// 2. Typeclasses translate and/or marshall data between JVM and JS.\nval expr: (Int, Int) =\u003e Expr[String] =\n  Expr.apply2((a, b) =\u003e s\"($a + $b) * 2 + '!'\").compile(_.asString)\n\n// Use a basic synchronous JS environment\nval ctx = GraalContext()\n\nval result = ctx.eval(expr(3, 8))\nassert(result == Right(\"22!\"))\n```\n\n\n# Learning\n\n* [API \u0026 how to use](doc/API.md)\n* [Recipes](doc/RECIPES.md)\n* [Scala SSR tutorial (part 1)](https://blog.shipreq.com/post/scala_react_and_ssr_part_1)\n* [Scala SSR tutorial (part 2)](https://blog.shipreq.com/post/scala_react_and_ssr_part_2)\n\n\n# Features\n\n* Expressions\n  * composition\n  * purity\n  * result parsing\n  * error handling\n  * null handling\n  * binding typeclasses\n  * binding codecs (eg binary/json/whatever)\n* Service\n  * single-threaded\n  * multi-threaded pool\n  * synchronous\n  * asynchronous\n  * optional time limits\n  * before/around/after hooks\n  * automatic metrics\n* Warmup\n  * ability to warmup VM\n  * rules (eg. `up to 10000 reps/thread \u0026 up to 30 sec | until completes within 20ms`)\n* React SSR (Server-Side Rendering)\n  * support for rendering JS components from JVM\n  * conversion to constant-time (conditionally)\n  * `window` and especially `window.location` management\n* Integrations\n  * [Prometheus](https://prometheus.io) - export metrics to Prometheus\n  * [BooPickle](https://github.com/suzaku-io/boopickle) - marshall data back and forth using binary codecs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjapgolly%2Fscala-graal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjapgolly%2Fscala-graal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjapgolly%2Fscala-graal/lists"}