{"id":22687908,"url":"https://github.com/lue-bird/elm-syntax-to-roc","last_synced_at":"2026-07-03T09:03:52.435Z","repository":{"id":267263286,"uuid":"900701563","full_name":"lue-bird/elm-syntax-to-roc","owner":"lue-bird","description":"transpile elm to roc","archived":false,"fork":false,"pushed_at":"2025-01-16T14:36:28.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T08:48:00.849Z","etag":null,"topics":["elm","roc","roc-lang","roc-language","transpiler"],"latest_commit_sha":null,"homepage":"https://dark.elm.dmy.fr/packages/lue-bird/elm-syntax-to-roc/latest/","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lue-bird.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-09T10:08:35.000Z","updated_at":"2025-01-16T14:36:30.000Z","dependencies_parsed_at":"2024-12-09T11:27:02.080Z","dependency_job_id":"eb63082f-f022-4994-aae5-e93d33a82446","html_url":"https://github.com/lue-bird/elm-syntax-to-roc","commit_stats":null,"previous_names":["lue-bird/elm-syntax-to-roc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-syntax-to-roc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-syntax-to-roc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-syntax-to-roc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-syntax-to-roc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lue-bird","download_url":"https://codeload.github.com/lue-bird/elm-syntax-to-roc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246207508,"owners_count":20740723,"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":["elm","roc","roc-lang","roc-language","transpiler"],"created_at":"2024-12-10T00:12:05.890Z","updated_at":"2026-07-03T09:03:52.389Z","avatar_url":"https://github.com/lue-bird.png","language":"Elm","funding_links":[],"categories":["Tools 🛠️"],"sub_categories":[],"readme":"Print pure [`elm-syntax`](https://dark.elm.dmy.fr/packages/stil4m/elm-syntax/latest/) declarations as\n[roc](https://www.roc-lang.org/) code.\n\n```elm\nimport Elm.Parser\nimport ElmSyntaxToRoc\n\n\"\"\"module Sample exposing (..)\n\nplus2 n =\n    n + ([ 2 ] |\u003e List.sum)\n\"\"\"\n    |\u003e Elm.Parser.parseToFile\n    |\u003e Result.mapError (\\_ -\u003e \"failed to parse elm source code\")\n    |\u003e Result.map\n        (\\syntaxModule -\u003e\n            [ syntaxModule ]\n                |\u003e ElmSyntaxToRoc.modules\n                |\u003e .declarations\n                |\u003e ElmSyntaxToRoc.rocDeclarationsToModuleString\n        )\n--\u003e\nOk \"\"\"module [\n    samplePlus2\n]\n\nsamplePlus2 =\n    \\n -\u003e\n        Num.add n (List.sum [ 2 ])\n\n..and some default declarations..\n\"\"\"\n```\n\nTo try it out, you can\nrun [this node script](https://github.com/lue-bird/elm-syntax-to-roc/tree/main/node-elm-to-roc).\n\n### be aware\n\n-   only a subset of elm is currently supported. not supported:\n    -   `elm/regex`, `elm/file`, `elm/bytes`, `elm/http`, `elm/random`, `elm/url`, `elm/json`, `elm/parser`, `elm/virtual-dom`,\n        `elm/html`, `elm/svg`, `elm/browser`, `elm/time`, `elm-explorations/markdown`, `elm-explorations/webgl`, `elm-explorations/benchmark`, `elm-explorations/linear-algebra`\n    -   `Platform`, `Platform.Cmd`, `Platform.Sub`, `Task`, `Process`\n    -   ports, glsl, the prefix operator functions `(\u003e\u003e)` and `(\u003c\u003c)`,\n        curried functions like `List.map (Basics.remainderBy 2)` or applicative pipelines\n    -   `String` uses UTF-8 instead of UTF-16 internally which means some helpers relying on code point offsets (like `String.length`) can return different results\n    - `Char.toUpper`, `Char.toLower`, `String.toUpper`, `String.toLower` only convert latin letters a-Z and keep any other letter unchanged\n    -   `++` will default to `List.append` unless one of the arguments is a string literal. So e.g. use `a ++ b ++ \"\"` to append string variables (which is also faster in elm).\n        Similarly, sorting operations `\u003c`, `\u003e`, `\u003c=` `\u003e=`, `Basics.min`, `Basics.max`, `Basics.compare`, `List.sort` will only work on numbers,\n        and `^` will not work if either argument is a concrete `Int` (not `Float` or `number` variable)\n    -   using True or False in a `case`-`of` pattern\n    -   potential future candidates: `Basics.(\u003c\u003c)`, `Basics.(\u003e\u003e)`, `Basics.truncate`, `Basics.clamp`, `Basics.degrees`, `Basics.turns`,\n        `Basics.radians`, `Basics.logBase`, `Basics.atan2`, `Basics.toPolar`, `Basics.fromPolar`, `Basics.never`, `String.reverse`, `List.map5`, `Char.toLocaleLower`, `Char.toLocaleUpper`, `Char.isAlpha`, `Char.isAlphaNum`, `Char.isDigit`, `Char.isOctDigit`, `Char.isHexDigit`, `List.sortBy`, `List.head`, `List.tail`, `List.unzip`, `List.partition`, `Dict.update`, `Dict.merge`, `Dict.intersect`, `Dict.partition`, `Bitwise`, `Set`, `Array`. Any help appreciated!\n-   no checks are performed before transpiling to roc. So if you don't add a compile check of your elm input,\n    you might e.g. get a running program that circumvents an elm opaque type or phantom type, or a roc program that can't be run\n-   not much care has been put into making the resulting code readable or even conventionally formatted\n    and comments are not preserved\n\nPlease [report any issues](https://github.com/lue-bird/elm-syntax-to-roc/issues/new) you notice \u003c3\n\n### why roc?\n\n-   it runs decently fast and can target Wasm\n-   it's pretty much a superset of elm and doesn't require any types which makes transpiling trivial (for the record I failed at transpiling to rust because I was not skilled enough to generate types for types like curried rc'd closures)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flue-bird%2Felm-syntax-to-roc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flue-bird%2Felm-syntax-to-roc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flue-bird%2Felm-syntax-to-roc/lists"}