Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/satabin/swam
WebAssembly engine in Scala
https://github.com/satabin/swam
cats cats-effect fs2 scala scodec wasm wast webassembly
Last synced: about 1 month ago
JSON representation
WebAssembly engine in Scala
- Host: GitHub
- URL: https://github.com/satabin/swam
- Owner: satabin
- License: apache-2.0
- Archived: true
- Created: 2018-04-03T21:11:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-25T21:38:39.000Z (about 4 years ago)
- Last Synced: 2024-05-17T03:12:03.724Z (7 months ago)
- Topics: cats, cats-effect, fs2, scala, scodec, wasm, wast, webassembly
- Language: WebAssembly
- Homepage: https://swam.gnieh.org
- Size: 8.56 MB
- Stars: 50
- Watchers: 10
- Forks: 10
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-wasm-tools - repo
- awe-wasm - Swam - activity/m/satabin/swam) ![Language](https://img.shields.io/github/languages/top/satabin/swam) (Runtimes / **WebAssembly**)
README
# Swam [![Build Status](https://travis-ci.org/satabin/swam.svg?branch=master)](https://travis-ci.org/satabin/swam) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/6cadb836067c4e4696c3c15ab9510a3a)](https://www.codacy.com/app/satabin/swam?utm_source=github.com&utm_medium=referral&utm_content=satabin/swam&utm_campaign=Badge_Grade)
Swam is a [WebAssembly][1] interpreter written in Scala with the [cats][7] library. It passes all the official specification tests. It is under an Apache 2 license.
[![Cats Friendly Badge][6]][7]
[![Join the chat at https://gitter.im/satabin/swam](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/satabin/swam?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
## Getting Started
To build it, we use [mill](http://www.lihaoyi.com/mill/). Mill is not packaged for all Linux distributions, but you can use curl to install it (see Installation instructions in the [doc](http://www.lihaoyi.com/mill/)).
You can also use the [mill wrapper](https://github.com/lefou/millw) provided in this repository with the recommended mill version. It will download mill for you if you do not have it already, and run it. To use it, replace following `mill` commands by `./millw`
If you want to run the specification tests, just type:
```sh
mill runtime.test
```It you want to test swam in a REPL session, just type tostart an ammonite shell with runtime project in classpath.:
```sh
mill -i runtime.console
```If you want a REPL session with both runtime and text, the easiest way is to start a session for the runtime.test project:
$ mill -i runtime.test.console
## Architecture
This project defines several modules:
- The [`core`](core/) module is a library that makes it possible to manipulate [binary][3] representation of WebAssembly modules. In particular it contains:
- a streaming parser for the binary format;
- a compiler from text to binary format.
- The [`runtime`](runtime/) module is a [non-web embedding][4] to instantiate and run WebAssembly modules.
- The [`text`](text/) module is a library that makes it possible to manipulate [text][2] representation of WebAssembly modules.
It is not included in the `core` module as text representation is more of a debug feature, and the runtime does not want to bring
that dependency with it.If you want more details, please refer to the [website][website].
[1]: https://webassembly.org/
[2]: https://webassembly.org/docs/text-format/
[3]: https://webassembly.org/docs/binary-encoding/
[4]: https://webassembly.org/docs/non-web/
[6]: https://typelevel.org/cats/img/cats-badge-tiny.png
[7]: https://typelevel.org/cats
[website]: https://swam.gnieh.org