{"id":13565212,"url":"https://github.com/tweag/asterius","last_synced_at":"2025-09-27T08:31:10.772Z","repository":{"id":27618327,"uuid":"111412813","full_name":"tweag/asterius","owner":"tweag","description":"DEPRECATED in favor of ghc wasm backend, see https://www.tweag.io/blog/2022-11-22-wasm-backend-merged-in-ghc","archived":true,"fork":false,"pushed_at":"2022-11-14T00:45:01.000Z","size":92407,"stargazers_count":1971,"open_issues_count":137,"forks_count":58,"subscribers_count":74,"default_branch":"master","last_synced_at":"2025-01-11T11:52:25.419Z","etag":null,"topics":["compiler","ghc","haskell","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tweag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-20T13:18:05.000Z","updated_at":"2025-01-09T10:48:26.000Z","dependencies_parsed_at":"2022-07-14T04:30:35.605Z","dependency_job_id":null,"html_url":"https://github.com/tweag/asterius","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweag%2Fasterius","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweag%2Fasterius/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweag%2Fasterius/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweag%2Fasterius/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tweag","download_url":"https://codeload.github.com/tweag/asterius/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234410737,"owners_count":18828280,"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","ghc","haskell","webassembly"],"created_at":"2024-08-01T13:01:42.619Z","updated_at":"2025-09-27T08:31:03.262Z","avatar_url":"https://github.com/tweag.png","language":"Haskell","funding_links":[],"categories":["Haskell","Compilers"],"sub_categories":[],"readme":"# Asterius: A Haskell to WebAssembly compiler\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/terrorjack/asterius.svg)](https://hub.docker.com/r/terrorjack/asterius)\n![](https://github.com/tweag/asterius/workflows/pipeline/badge.svg?branch=master)\n[![Netlify Status](https://api.netlify.com/api/v1/badges/e7cfe6ef-b0e6-4a17-bd74-8bce6063f147/deploy-status)](https://asterius.netlify.app)\n\nAsterius is a Haskell to WebAssembly compiler based on GHC. It compiles\nHaskell source files or Cabal executable targets to WebAssembly+JavaScript code\nwhich can be run in [Node.js][nodejs] or browsers.\nIt features seamless JavaScript interop\n(lightweight Async FFI with `Promise` support) and small output code (~600KB\n`hello.wasm` for a [Hello\nWorld](https://hackage.haskell.org/package/hello-1.0.0.2)). A lot of common\nHaskell packages like `lens` are already supported. The project is actively\nmaintained by [Tweag I/O](https://tweag.io/).\n\n[nodejs]: https://nodejs.org\n\n## Demos\n\nDemos of popular Haskell apps, running in your browser:\n\n- [`diagrams`](https://asterius.netlify.app/demo/diagrams/hilbert.html)\n- [`ormolu`](https://asterius.netlify.app/demo/ormolu/WebOrmolu.html)\n- [`pandoc`](https://asterius.netlify.app/demo/pandoc/pandoc.html)\n- [`todomvc`](https://asterius.netlify.app/demo/todomvc/index.html)\n\n## Quickstart using the prebuilt container image\n\nWe host a prebuilt container image on [Docker\nHub](https://hub.docker.com/r/terrorjack/asterius). The image also ships ~2k\nprebuilt [packages](https://github.com/tweag/asterius/issues/354) from a recent\nStackage snapshot for convenience of testing simple programs without needing to\nset up a Cabal project.\n\nTo use the image, mount the working directory containing the source code as a\nshared volume, then use the `ahc-link` program:\n\n```console\nterrorjack@hostname:/project$ podman run -it --rm -v $(pwd):/workspace -w /workspace terrorjack/asterius\nroot@hostname:/workspace#\n```\n\nThere are a lot of link-time options available to `ahc-link`, e.g. targeting\nthe browser platform instead of `node`, adding extra GHC options or setting\nruntime parameters. Check the [documentation](https://asterius.netlify.app/) for\nfurther details.\n\nIt's also possible to use `ahc-cabal` as a drop-in replacement of `cabal` to\nbuild a Cabal project. Use `ahc-dist` with `--input-exe` on the output\n\"executable\" file to generate actual WebAssembly and JavaScript artifacts. See\nthe `diagrams` blog\n[post](https://www.tweag.io/posts/2019-12-19-asterius-diagrams.html) for an\nexample.\n\nCheck the documentation [section](https://asterius.netlify.app/images.html)\nabout the prebuilt image for more information, e.g. versioning policy, how to\nuse with `podman`/`docker`, etc.\n\n## Building and using `asterius` locally\n\nSee the [Building guide](https://asterius.netlify.app/building.html) in the\ndocumentation for details.\n\n## Hacking on Asterius\n\nWe recommend using [VSCode Remote\nContainers](https://code.visualstudio.com/docs/remote/containers) to reproduce\nthe very same dev environment used by our core team members. See the [Hacking\nguide](https://asterius.netlify.app/hacking.html) in the documentation for\ndetails.\n\n## Documentation\n\nWe have [documentation](https://asterius.netlify.app/) and blog posts:\n\n- [Fibonacci compiles end-to-end: Haskell to WebAssembly via\n  GHC](https://www.tweag.io/posts/2018-05-29-hello-asterius.html)\n- [Haskell WebAssembly calling JavaScript and back\n  again](https://www.tweag.io/posts/2018-09-12-asterius-ffi.html)\n- [Asterius GHC WebAssembly backend reaches\n  TodoMVC](https://www.tweag.io/posts/2018-12-20-asterius-todomvc.html)\n- [Haskell art in your browser with\n  Asterius](https://www.tweag.io/posts/2019-12-19-asterius-diagrams.html)\n- [Edge computing with Servant on\n  Cloudflare](https://www.tweag.io/blog/2020-10-09-asterius-cloudflare-worker/)\n\nAlso checkout the [HIW 2018 lightning\ntalk](https://icfp18.sigplan.org/details/hiw-2018-papers/6/Lightning-talk-Asterius-Bringing-Haskell-to-WebAssembly),\nand the slides of an introductory talk in 2020\n[here](https://docs.google.com/presentation/d/1AZJIf2ykheqONOM23oC6F3LJ9m5W9gbl69pDVdZszHg/edit?usp=sharing).\n\nNote that they may be slightly out-of-date as the project evolves. Whenever you\nfind something in the docs of blog posts which doesn't reflect the status quo,\nit's a bug and don't hesitate to open a ticket :)\n\n## Project status \u0026 roadmap\n\nSee the [roadmap](https://asterius.netlify.app/roadmap.html) section in the\ndocumentation for details.\n\n## Contributors\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[\u003cimg src=\"./docs/tweag-logo.svg\" height=\"65\"\u003e](https://tweag.io)\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[\u003cimg src=\"https://i.imgur.com/tAag5MD.jpg\" height=\"65\"\u003e](https://iohk.io)\n\nAsterius is maintained by [Tweag I/O](https://tweag.io/).\n\nHave questions? Need help? Tweet at [@tweagio](https://twitter.com/tweagio).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftweag%2Fasterius","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftweag%2Fasterius","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftweag%2Fasterius/lists"}