gecko-dev/third_party/rust/wat
Ryan Hunt 4f62abea70 Bug 1624363 - Vendor wat 0.1.14. r=lth
This commit updates the wat version in tree.
 * Implements MVP GC syntax
 * Updated abs SIMD opcodes

Differential Revision: https://phabricator.services.mozilla.com/D69405

--HG--
extra : moz-landing-system : lando
2020-04-02 19:42:57 +00:00
..
examples Bug 1612534 - Include vendored files. r=lth 2020-03-23 16:16:46 +00:00
src Bug 1612534 - Include vendored files. r=lth 2020-03-23 16:16:46 +00:00
tests Bug 1624363 - Vendor wat 0.1.14. r=lth 2020-04-02 19:42:57 +00:00
.cargo-checksum.json Bug 1624363 - Vendor wat 0.1.14. r=lth 2020-04-02 19:42:57 +00:00
CODE_OF_CONDUCT.md Bug 1612534 - Include vendored files. r=lth 2020-03-23 16:16:46 +00:00
Cargo.lock Bug 1624363 - Vendor wat 0.1.14. r=lth 2020-04-02 19:42:57 +00:00
Cargo.toml Bug 1624363 - Vendor wat 0.1.14. r=lth 2020-04-02 19:42:57 +00:00
LICENSE Bug 1612534 - Include vendored files. r=lth 2020-03-23 16:16:46 +00:00
ORG_CODE_OF_CONDUCT.md Bug 1612534 - Include vendored files. r=lth 2020-03-23 16:16:46 +00:00
README.md Bug 1612534 - Include vendored files. r=lth 2020-03-23 16:16:46 +00:00
SECURITY.md Bug 1612534 - Include vendored files. r=lth 2020-03-23 16:16:46 +00:00

README.md

wat

A Bytecode Alliance project

A Rust parser for the WebAssembly Text Format (WAT).

Crates.io version Download docs.rs docs docs.rs docs

Usage

Add this to your Cargo.toml:

[dependencies]
wat = "1.0"

And then you can parse WAT to binary WebAssembly via:

// Parse from a file ...
let binary = wat::parse_file("./foo.wat")?;

// ... or a string
let wat = r#"
    (module
        (func $foo)

        (func (export "bar")
            call $foo
        )
    )
"#;
let binary = wat::parse_str(wat)?;

Low-level parsing

This repository and project also aims to provide low-level parsing support for the WAT and WAST formats. Effectively, if you've got an s-expression lookalike that you'd like to parse, you should be able to parse it!

The wat crate does not support this because it strives to provide strong API-level stability guarantees, but the wast crate has all the low-level details and is the implementation of the wast crate. Be sure to check out its README.md for more information.

Stability and WebAssembly Features

Consult the crate documentation for more information, but the general idea is this crate will not issue a semver-breaking change for breaking changes in the WAT format, either for MVP features or post-MVP features. No opt-in is required to use WebAssembly features, so using them may break if the upstream spec changes.

License

This project is licensed under the Apache 2.0 license with the LLVM exception. See LICENSE for more details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.