提交 cd146ef2 编写于 作者: 3 3dgen

Merge branch 'master' of https://github.com/wa-lang/wa

......@@ -11,8 +11,10 @@ import (
func ExampleRunCode() {
const code = `
var gBase: i32 = 1000
fn main() {
println(add(40, 2))
println(add(40, 2) + gBase)
}
fn add(a: i32, b: i32) => i32 {
......@@ -28,5 +30,5 @@ func ExampleRunCode() {
fmt.Print(string(output))
// Output:
// 42
// 1042
}
# 版本日志
- v0.2.2 (2022-10-11)
- Windows 增加 exe 图标
- Windows 平台增加 Notepad++ 语法高亮支持
- Playground 改进异步加载wasm资源, 支持多个例子
- Wat 后端改善全局变量支持
- 增加 `#wa:xxx` 模式注释, 支持通过凹语言实现底层的 runtime 函数
- 实验特性: 简化无参数和返回值函数定义
- v0.2.1 (2022-09-16)
- 支持纯浏览器编译执行: [https://wa-lang.org/playground](https://wa-lang.org/playground)
- 命令行增加打印 logo 子命令
......
......@@ -11,6 +11,7 @@ import (
"path/filepath"
"runtime"
"strings"
"sync"
"github.com/tetratelabs/wazero"
"github.com/tetratelabs/wazero/api"
......@@ -97,7 +98,12 @@ func InstallWat2wasm(path string) error {
return nil
}
var muRunWat2Wasm sync.Mutex
func RunWat2Wasm(args ...string) (stdoutStderr []byte, err error) {
muRunWat2Wasm.Lock()
defer muRunWat2Wasm.Unlock()
if wat2wasmPath == "" {
logger.Tracef(&config.EnableTrace_app, "wat2wasm not found")
return nil, errors.New("wat2wasm not found")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册