All Projects → tweag → Asterius

tweag / Asterius

A Haskell to WebAssembly compiler

Programming Languages

haskell
3896 projects
javascript
184084 projects - #8 most used programming language
c
50402 projects - #5 most used programming language
Nix
1067 projects
python
139335 projects - #7 most used programming language
shell
77523 projects
HTML
75241 projects

Projects that are alternatives of or similar to Asterius

Ghc Grin
GRIN backend for GHC
Stars: ✭ 123 (-93.16%)
Mutual labels:  compiler, ghc
Walt
⚡ Walt is a JavaScript-like syntax for WebAssembly text format ⚡
Stars: ✭ 4,513 (+150.86%)
Mutual labels:  compiler, webassembly
Webml
A Standard ML Compiler for the Web
Stars: ✭ 326 (-81.88%)
Mutual labels:  compiler, webassembly
Customasm
💻 An assembler for custom, user-defined instruction sets! https://hlorenzi.github.io/customasm/web/
Stars: ✭ 211 (-88.27%)
Mutual labels:  compiler, webassembly
Viper
[WIP] A Pythonesque language with a design that focuses on efficiency and expressiveness. Compiles to WebAssembly
Stars: ✭ 23 (-98.72%)
Mutual labels:  compiler, webassembly
Cone
Cone Programming Language
Stars: ✭ 257 (-85.71%)
Mutual labels:  compiler, webassembly
Jwebassembly
Java bytecode to WebAssembly compiler
Stars: ✭ 426 (-76.32%)
Mutual labels:  compiler, webassembly
Wag
WebAssembly compiler implemented in Go
Stars: ✭ 177 (-90.16%)
Mutual labels:  compiler, webassembly
Ring
Innovative and practical general-purpose multi-paradigm language
Stars: ✭ 716 (-60.2%)
Mutual labels:  compiler, webassembly
Webassemblyjs
Toolchain for WebAssembly
Stars: ✭ 566 (-68.54%)
Mutual labels:  compiler, webassembly
Ppci
A compiler for ARM, X86, MSP430, xtensa and more implemented in pure Python
Stars: ✭ 210 (-88.33%)
Mutual labels:  compiler, webassembly
Evm2wasm
[ORPHANED] Transcompiles EVM code to eWASM
Stars: ✭ 96 (-94.66%)
Mutual labels:  compiler, webassembly
Binaryen.js
A buildbot for binaryen.js, a port of Binaryen to the Web, with TypeScript support.
Stars: ✭ 201 (-88.83%)
Mutual labels:  compiler, webassembly
Speedy.js
Accelerate JavaScript Applications by Compiling to WebAssembly
Stars: ✭ 300 (-83.32%)
Mutual labels:  compiler, webassembly
Prototype
(deprecated) The journey continues at ASNEXT: https://github.com/AssemblyScript/assemblyscript
Stars: ✭ 2,114 (+17.51%)
Mutual labels:  compiler, webassembly
Bytecoder
Rich Domain Model for JVM Bytecode and Framework to interpret and transpile it.
Stars: ✭ 401 (-77.71%)
Mutual labels:  compiler, webassembly
Assemblyscript
A TypeScript-like language for WebAssembly.
Stars: ✭ 13,152 (+631.07%)
Mutual labels:  compiler, webassembly
Wah
a slightly higher-level language superset of webassembly
Stars: ✭ 147 (-91.83%)
Mutual labels:  compiler, webassembly
Turboscript
Super charged typed JavaScript dialect for parallel programming which compiles to WebAssembly
Stars: ✭ 487 (-72.93%)
Mutual labels:  compiler, webassembly
Wasm Forth
A Forth implementation compiling to WebAssembly.
Stars: ✭ 92 (-94.89%)
Mutual labels:  compiler, webassembly

Asterius: A Haskell to WebAssembly compiler

Docker Pulls Netlify Status

Asterius is a Haskell to WebAssembly compiler based on GHC. It compiles Haskell source files or Cabal executable targets to WebAssembly+JavaScript code which can be run in Node.js or browsers. It features seamless JavaScript interop (lightweight Async FFI with Promise support) and small output code (~600KB hello.wasm for a Hello World). A lot of common Haskell packages like lens are already supported. The project is actively maintained by Tweag I/O.

Demos

Demos of popular Haskell apps, running in your browser:

Quickstart using the prebuilt container image

We host a prebuilt container image on Docker Hub. The image also ships ~2k prebuilt packages from a recent Stackage snapshot for convenience of testing simple programs without needing to set up a Cabal project.

To use the image, mount the working directory containing the source code as a shared volume, then use the ahc-link program:

terrorjack@hostname:/project$ podman run -it --rm -v $(pwd):/workspace -w /workspace terrorjack/asterius
root@hostname:/workspace#

There are a lot of link-time options available to ahc-link, e.g. targeting the browser platform instead of node, adding extra GHC options or setting runtime parameters. Check the documentation for further details.

It's also possible to use ahc-cabal as a drop-in replacement of cabal to build a Cabal project. Use ahc-dist with --input-exe on the output "executable" file to generate actual WebAssembly and JavaScript artifacts. See the diagrams blog post for an example.

Check the documentation section about the prebuilt image for more information, e.g. versioning policy, how to use with podman/docker, etc.

Building and using asterius locally

See the Building guide in the documentation for details.

Hacking on Asterius

We recommend using VSCode Remote Containers to reproduce the very same dev environment used by our core team members. See the Hacking guide in the documentation for details.

Documentation

We have documentation and blog posts:

Also checkout the HIW 2018 lightning talk, and the slides of an introductory talk in 2020 here.

Note that they may be slightly out-of-date as the project evolves. Whenever you find something in the docs of blog posts which doesn't reflect the status quo, it's a bug and don't hesitate to open a ticket :)

Project status & roadmap

See the roadmap section in the documentation for details.

Contributors

                     

Asterius is maintained by Tweag I/O.

Have questions? Need help? Tweet at @tweagio.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].