Skip to content

v1.0.0-beta1

Compare
Choose a tag to compare
@jubianchi jubianchi released this 03 Dec 20:22
· 222 commits to master since this release
61605b6

Changed

  • The whole API changed to better match Wasmer and Wasm C API

    // Create an Engine
    engine := wasmer.NewEngine()
    
    // Create a Store
    store := wasmer.NewStore(engine)
    
    fmt.Println("Compiling module...")
    module, err := wasmer.NewModule(store, wasmBytes)
    
    if err != nil {	 
        fmt.Println("Failed to compile module:", err)
    }
    
    // Create an empty import object.
    importObject := wasmer.NewImportObject()
    
    fmt.Println("Instantiating module...")
    // Let's instantiate the Wasm module.
    instance, err := wasmer.NewInstance(module, importObject)
    
    if err != nil {	 
        panic(fmt.Sprintln("Failed to instantiate the module:", err))
    }

    Please refer to the examples and documentation to learn more about the changes.