{"id":13566521,"url":"https://github.com/julienrf/scalm","last_synced_at":"2025-09-22T03:47:31.935Z","repository":{"id":51390180,"uuid":"116729319","full_name":"julienrf/scalm","owner":"julienrf","description":"Elm-inspired Scala library for writing web user interfaces","archived":false,"fork":false,"pushed_at":"2021-05-12T11:45:19.000Z","size":99,"stargazers_count":119,"open_issues_count":4,"forks_count":7,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-09-19T07:32:12.902Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/julienrf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-08T21:19:36.000Z","updated_at":"2024-07-04T10:11:27.000Z","dependencies_parsed_at":"2022-09-11T01:50:26.099Z","dependency_job_id":null,"html_url":"https://github.com/julienrf/scalm","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/julienrf/scalm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julienrf%2Fscalm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julienrf%2Fscalm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julienrf%2Fscalm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julienrf%2Fscalm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/julienrf","download_url":"https://codeload.github.com/julienrf/scalm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julienrf%2Fscalm/sbom","scorecard":{"id":542176,"data":{"date":"2025-08-11","repo":{"name":"github.com/julienrf/scalm","commit":"ff1789ba493d6a4c58c8980af0e72c8df5d20ace"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":5,"reason":"Found 8/14 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T08:28:53.646Z","repository_id":51390180,"created_at":"2025-08-20T08:28:53.646Z","updated_at":"2025-08-20T08:28:53.646Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276342530,"owners_count":25625581,"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","status":"online","status_checked_at":"2025-09-22T02:00:08.972Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-01T13:02:11.208Z","updated_at":"2025-09-22T03:47:31.917Z","avatar_url":"https://github.com/julienrf.png","language":"Scala","funding_links":[],"categories":["Scala"],"sub_categories":[],"readme":"scalm\n=====\n\n[![Join the chat at https://gitter.im/julienrf/scalm](https://badges.gitter.im/julienrf/scalm.svg)](https://gitter.im/julienrf/scalm?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nElm-inspired Scala library for writing web user interfaces.\n\n## Installation\n\nscalm supports Scala 2.12 and Scala.js 0.6.\n\nSince scalm uses a JavaScript library ([snabbdom](https://github.com/snabbdom/snabbdom))\nunder the hood, you will have to use [scalajs-bundler](https://scalacenter.github.io/scalajs-bundler/):\n\n~~~ scala\n// project/plugins.sbt\naddSbtPlugin(\"ch.epfl.scala\" % \"sbt-scalajs-bundler\" % \"0.9.0\")\n~~~\n\n~~~ scala\n// build.sbt\nenablePlugins(ScalaJSBundlerPlugin)\nlibraryDependencies += \"org.julienrf\" %%% \"scalm\" % \"1.0.0-RC1\"\n~~~\n\n## Overview\n\n### Elm Architecture\n\nScalm provides a runtime environment for executing applications designed\naccording to the [Elm architecture](https://guide.elm-lang.org/architecture/).\n\nIn essence, the state of the application is modeled by an immutable `Model`,\nevents that change the state of the application are modeled by an immutable\n`Msg` type, state transitions are implemented by a `(Msg, Model) =\u003e Model`\nfunction, and finally, a `Model =\u003e Html[Msg]` function defines how to render\nthe state of the application in HTML.\n\n### Reacting to User Input\n\nHere is how the usual\n[counter example](https://guide.elm-lang.org/architecture/user_input/buttons.html)\nlooks like with scalm:\n\n~~~ scala\nimport scalm.{Html, Scalm}\nimport scalm.Html._\nimport org.scalajs.dom.document\n\nobject Counter {\n\n  def main(): Unit = Scalm.start(document.body)(init, update, view)\n\n  type Model = Int\n\n  def init: Model = 0\n\n  sealed trait Msg\n  case object Increment extends Msg\n  case object Decrement extends Msg\n\n  def update(msg: Msg, model: Model): Model =\n    msg match {\n      case Increment =\u003e model + 1\n      case Decrement =\u003e model - 1\n    }\n\n  def view(model: Model): Html[Msg] =\n    div()(\n      button(onClick(Decrement))(text(\"-\")),\n      div()(text(model.toString)),\n      button(onClick(Increment))(text(\"+\"))\n    )\n\n}\n~~~\n\n### Dealing With Effects\n\nIn the architecture presented above, the state of the application evolves\nwith DOM events but there is no way to perform HTTP requests or register a\ntimer. We call this kind of actions “effects”. We classify them into two\ngroups: commands and subscriptions. Commands let you *do* stuff, whereas\nsubscriptions let you register that you are interested in something.\nYou can find more information on effects\n[here](https://guide.elm-lang.org/architecture/effects/).\n\nHere is how the\n[clock example](https://guide.elm-lang.org/architecture/effects/time.html)\nlooks like in scalm:\n\n~~~ scala\nimport scalm.{App, Cmd, Html, Scalm, Sub}\nimport scalm.Html._\nimport org.scalajs.dom.document\n\nimport scalajs.js\nimport concurrent.duration.DurationInt\n\nobject Clock extends App {\n\n  def main(): Unit = Scalm.start(this, document.body)\n\n  type Model = js.Date\n\n  def init: (Model, Cmd[Msg]) = (new js.Date(), Cmd.Empty)\n\n  case class Msg(newTime: js.Date)\n\n  def update(msg: Msg, model: Model): (Model, Cmd[Msg]) =\n    (msg.newTime, Cmd.Empty)\n\n  def subscriptions(model: Model): Sub[Msg] =\n    Sub.every(1.second, \"clock-ticks\").map(Msg)\n\n  def view(model: Model): Html[Msg] = {\n    val angle = model.getMinutes() * 2 * math.Pi / 60 - math.Pi / 2\n    val handX = 50 + 40 * math.cos(angle)\n    val handY = 50 + 40 * math.sin(angle)\n    tag(\"svg\")(attr(\"viewBox\", \"0, 0, 100, 100\"), attr(\"width\", \"300px\"))(\n      tag(\"circle\")(attr(\"cx\", \"50\"), attr(\"cy\", \"50\"), attr(\"r\", \"45\"), attr(\"fill\", \"#0B79CE\"))(),\n      tag(\"line\")(attr(\"x1\", \"50\"), attr(\"y1\", \"50\"), attr(\"x2\", handX.toString), attr(\"y2\", handY.toString), attr(\"stroke\", \"#023963\"))()\n    )\n  }\n\n}\n~~~\n\n## Discussion\n\nTo my experience, correctly implementing a user interface is hard.\n\nThe very disciplined Elm programming model helps me\na lot to reason about the user interface implementation.\n\nMore specifically, in this programming model the mapping between the\nstate of the application and the rendered HTML is easy to follow.\nFurthermore, commands and subscriptions simplify resource management\na lot (you don’t have to worry about cancelling some event handler\nanymore, this is taken care of by the runtime).\n\nOn the other hand, the architecture is, by design, not extremely efficient:\non each event the entire application state is recomputed. We use a\nvirtual-dom technique to patch the DOM as efficiently as possible, but still,\nthat’s a lot of work that’s not needed with approaches like\n[monadic-html](https://github.com/OlivierBlanvillain/monadic-html) or\n[Binding.scala](https://github.com/ThoughtWorksInc/Binding.scala).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulienrf%2Fscalm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulienrf%2Fscalm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulienrf%2Fscalm/lists"}