Packages

  • package root
    Definition Classes
    root
  • package swam
    Definition Classes
    root
  • package binary
    Definition Classes
    swam
  • package decompilation
    Definition Classes
    swam
  • Decompiler
  • DecompilerException
  • RawDecompiler
  • TextDecompiler
  • package runtime

    This package contains all the classes and types related to running WebAssembly modules.

    This package contains all the classes and types related to running WebAssembly modules.

    The entry point for almost all users will be Engine. A typical use of the engine is:

    import swam._
    import text._
    import runtime._
    import exports._
    
    import cats.implicits._
    import cats.effect._
    
    import java.nio.file.Paths
    
    val tcompiler = Compiler[IO]
    val engine = Engine[IO]
    
    for {
      tcompiler <- tcompiler
      engine <- engine
      mod <- engine.compile(/* source of the module */)
      inst <- mod.newInstance()
      f <- inst.exports.function1[Int, Int]("f")
      res <- f(43)
    } yield res
    
    println(res.unsafeRunSync())
    Definition Classes
    swam
  • package syntax

    Instructions in this package are grouped by category as described in the specification.

    Instructions in this package are grouped by category as described in the specification.

    Definition Classes
    swam
  • package text
    Definition Classes
    swam
  • package traversal
    Definition Classes
    swam
  • package util
    Definition Classes
    swam
  • package validation
    Definition Classes
    swam
p

swam

decompilation

package decompilation

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. abstract class Decompiler[F[_]] extends ModuleLoader[F]

    Generic class to implement a decompiler.

    Generic class to implement a decompiler. It takes a module in binary format and outputs a formatted Doc out of it.

  2. class DecompilerException extends SwamException
  3. class RawDecompiler[F[_]] extends Decompiler[F]

    A decompiler from binary format, that formats sections as they come.

    A decompiler from binary format, that formats sections as they come. This is a raw decompiler, not performing any validation, nor transforming the binary format.

  4. class TextDecompiler[F[_]] extends Decompiler[F]

    A decompiler from binary format, that formats into the text representation.

    A decompiler from binary format, that formats into the text representation.

    This decompiler requires a valid module (validation is performed by the decompiler) to be able to work. It uses the fact that all types are valid to smartly use the folded syntax for all operators and function calls.

    This decompiler also takes advantage of the custom name section if present to add identifier to the output.

Value Members

  1. object RawDecompiler
  2. object TextDecompiler

Ungrouped