{"id":13723113,"url":"https://github.com/elm-in-elm/compiler","last_synced_at":"2025-04-05T10:09:07.921Z","repository":{"id":39619819,"uuid":"164914422","full_name":"elm-in-elm/compiler","owner":"elm-in-elm","description":"Elm compiler written in Elm","archived":false,"fork":false,"pushed_at":"2024-01-31T17:26:29.000Z","size":18206,"stargazers_count":389,"open_issues_count":19,"forks_count":27,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-05-18T20:47:26.740Z","etag":null,"topics":["compiler","elm-lang","language"],"latest_commit_sha":null,"homepage":"https://elm-in-elm.github.io/compiler/","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elm-in-elm.png","metadata":{"files":{"readme":"README-library.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}},"created_at":"2019-01-09T18:15:46.000Z","updated_at":"2024-03-20T01:03:36.000Z","dependencies_parsed_at":"2023-02-18T08:45:56.839Z","dependency_job_id":"0851595a-042c-4ac3-86a2-0096c94f7ab2","html_url":"https://github.com/elm-in-elm/compiler","commit_stats":{"total_commits":436,"total_committers":15,"mean_commits":"29.066666666666666","dds":0.2018348623853211,"last_synced_commit":"2a0a7db0e826dd2277f6d15021356285c08594dd"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elm-in-elm%2Fcompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elm-in-elm%2Fcompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elm-in-elm%2Fcompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elm-in-elm%2Fcompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elm-in-elm","download_url":"https://codeload.github.com/elm-in-elm/compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318745,"owners_count":20919484,"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":["compiler","elm-lang","language"],"created_at":"2024-08-03T01:01:36.319Z","updated_at":"2025-04-05T10:09:07.894Z","avatar_url":"https://github.com/elm-in-elm.png","language":"Elm","funding_links":[],"categories":["Elm"],"sub_categories":[],"readme":"# elm-in-elm\n\nElm compiler written in Elm!\n\n_For more information on the `elm-in-elm` project in general read the [comprehensive documentation](http://github.com/elm-in-elm/compiler/tree/master/README.md)._\n\nThe entrypoint of this library is the [`Elm.Compiler`](/packages/elm-in-elm/compiler/latest/Elm-Compiler) module.\n\nThe typical flow of functions inside this library looks like this:\n\n![Stages of the compiler](https://github.com/elm-in-elm/compiler/raw/master/assets/stages.png)\n\n## Example usage - Elm to Elixir\n\nAn example of how the core of Elm to Elixir compiler might look; pay attention to the pipeline inside `elmToElixir`:\n\n```elm\nmodule ElmToElixir exposing (elmToElixir)\n\nimport Elm.AST.Typed as Typed\nimport Elm.AST.Typed.Unwrapped as TypedU\nimport Elm.Compiler\nimport Elm.Compiler.Error exposing (Error)\nimport Elm.Data.FileContents exposing (FileContents)\nimport Elm.Data.FilePath exposing (FilePath)\nimport Elm.Data.Module as Module exposing (Module)\n\n\n{-| Usage: \n\n    elmToElixir\n      { filePath = \"src/Foo.elm\"\n      , sourceCode = \n          \"\"\"\n          module Foo exposing (foo)\n\n          foo : Int -\u003e String\n          foo x =\n            String.repeat x \"FOO! \"\n          \"\"\"\n      }\n-}\nelmToElixir : { filePath : FilePath, sourceCode : FileContents} -\u003e Result Error String\nelmToElixir file =\n    file\n        |\u003e Elm.Compiler.parseModule\n        |\u003e Result.andThen Elm.Compiler.desugarOnlyModule\n        |\u003e Result.andThen Elm.Compiler.inferModule\n        |\u003e Result.map Elm.Compiler.optimizeModule\n        |\u003e Result.map (Module.map Typed.unwrap)\n        |\u003e Result.map emitElixirModule\n\n\n{-| The important part: emit Elixir source code!  -}\nemitElixirModule : Module TypedU.Expr -\u003e FileContents\nemitElixirModule m =\n    [ emitHeader m.name m.exposing_\n    , emitImports m.imports\n    , emitDeclarations m.declarations\n    ]\n        |\u003e String.join \"\\n\\n\\n\"\n\n\nemitHeader = Debug.todo \"emitHeader\"\nemitImports = Debug.todo \"emitImports\"\nemitDeclarations = Debug.todo \"emitDeclarations\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felm-in-elm%2Fcompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felm-in-elm%2Fcompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felm-in-elm%2Fcompiler/lists"}