wasm

Library for parsing and interpreting WebAssembly, including: * WebAssembly Text Representation Parser * WebAssembly Binary Represetnation encoder and decoder * Spec-compatible Module validator (checked with Spec Core Test Suite) * Spec-compatible Interpreter (checked with Spec Core Test Suite) * Extended scripting grammar parser and executor * WebAssembly Module building eDSL


Keywords
language, library, mit, program, Propose Tags , Language.Wasm, Language.Wasm.Binary, Language.Wasm.Builder, Language.Wasm.Interpreter, Language.Wasm.Lexer, Language.Wasm.Parser, Language.Wasm.Script, Language.Wasm.Structure, Language.Wasm.Validate, compiler, haskell, toolkit, webassembly
License
MIT
Install
cabal install wasm-1.1.1

Documentation

Haskell WebAssembly Toolkit

Goals

  • Provide a WebAssembly code generation tool for Haskell
  • Create an infrastructure for Cmm to WebAssembly code generator
  • Have Fun :)

Status

  • Lexer: supports nested block comments and all lexemes from the WebAssembly Spec
  • Parser: parses all examples from WebAssembly Core TestsSuit (including folded instructions parsing)
  • Renaming Phase: substitute identifiers with correct indexes, expand all implicit type declarations)
  • Binary format parser/serializer
  • Validation Phase: execute a verification procedure from the Spec
  • Execution Phase: implement a simple interpreter
  • Support extended Core Test Suit assertion grammar
  • Compile Core Tests to Tasty test cases and pass all tests

Todo

  • Improve error messages for text representation parsing
  • Text Representation pretty-printer
  • Command line tool for calling interpreter/compiler/validator
  • Codegen interface for type enforced generating valid WASM code

Development

Clond sources to directory and use stack for running tests:

stack build && stack test