Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第 55 期 Go&WebAssembly 简介 #445

Closed
chai2010 opened this issue Aug 12, 2019 · 5 comments
Closed

第 55 期 Go&WebAssembly 简介 #445

chai2010 opened this issue Aug 12, 2019 · 5 comments
Labels
Go 夜读 Go 夜读:主题分享 已分享 ✅ Go 夜读的分享状态:分享已完成。

Comments

@chai2010
Copy link

chai2010 commented Aug 12, 2019

WebAssembly 简介

WebAssembly是一种新兴的网页虚拟机标准,它的设计目标包括:高可移植性、高安全性、高效率(包括载入效率和运行效率)、尽可能小的程序体积。

根据 Ending定律:⼀切可被编译为WebAssembly的,终将被编译为WebAssembly。

本次分享Go&WebAssembly相关的用法。

分享时间

2019-08-15 21:00:00

分享地址

zoom 地址:https://zoom.us/j/6923842137

部分内容:浏览器中的超级玛丽

https://talks.godoc.org/github.com/chai2010/awesome-go-zh/chai2010/chai2010-golang-wasm.slide#18

预习资料

@yangwenmai yangwenmai added Go 夜读 Go 夜读:主题分享 分享话题 labels Aug 12, 2019
@yangwenmai yangwenmai pinned this issue Aug 12, 2019
@FelixSeptem
Copy link
Member

补充一下go官方给的wiki https://github.com/golang/go/wiki/WebAssembly 以及
WebAssembly 官网 https://webassembly.org/
个人比较倾向于对于 https://github.com/gopherjs/gopherjs 来比较理解,相对于go->js(包括react等等)的方案,WebAssembly带来的异同是什么?

@chai2010
Copy link
Author

chai2010 commented Aug 12, 2019

@FelixSeptem wasm和gopherjs最大的差异:wasm是官方支持,同时wasm是国际标准是其它语言认可的中间格式。

以前虽然很多工具输出js,那是因为没有wasm可以选择。
现在有了wasm,大家肯定只支持wasm而逐渐弱化js的支持。
毕竟wasm虚拟机实现比v8简单多了,性能又可以秒杀js。

wasm最大的潜力是在浏览器之外,甚至可以想象成一个轻量化的Docker环境。
我觉得这个才是wasm真正有意思的地方,wasm对于js完全属于降维打击。

@FelixSeptem
Copy link
Member

LGTM

@changkun
Copy link
Member

changkun commented Aug 12, 2019

还没有在生产环境使用过 wasm。从给的马里奥的例子来看,go wasm 本质上是分发由 Go 编译好 .wasm,而 Go 端的本质就是提供了一些能够解释为 wasm 的 utils。不太清楚会不会在分享中提及这一本质。

长远来看,这个 .wasm 文件在特性支持的情况下最终会包含完整的 Go 运行时,
但 go wasm 并没有明确在 web 场景下为什么一定需要它,当然不可否认它的确为兼容并移植 Go 代码来发展 web 应用带来了便捷,但前提是我们必须有足够多基础设施是基于 Go 的,但游戏并没有,非常希望看到一些能够说服用 Go 写 wasm 而不是其他语言(C/C++ 有着丰富的图形资产,而 Go 在这方面的积累为 0,甚至连马里奥的例子都是依赖一个 cgo 对 c sdl2 renderer 的封装)编译 wasm 的论点。

@yangwenmai yangwenmai changed the title 【Go 夜读】第 54 期 Go&WebAssembly简介 【Go 夜读】第 55 期 Go&WebAssembly 简介 Aug 13, 2019
@yangwenmai yangwenmai unpinned this issue Aug 21, 2019
@yangwenmai yangwenmai added 已分享 ✅ Go 夜读的分享状态:分享已完成。 and removed 分享话题 labels Sep 19, 2019
@chenxinlong
Copy link

对逆向工程和 WebAssembly 不太了解,不知道 wasm 反编译困难吗?

@yangwenmai yangwenmai changed the title 【Go 夜读】第 55 期 Go&WebAssembly 简介 第 55 期 Go&WebAssembly 简介 Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Go 夜读 Go 夜读:主题分享 已分享 ✅ Go 夜读的分享状态:分享已完成。
Projects
None yet
Development

No branches or pull requests

5 participants