沉寂多年的node之父ry又出手了,这次他想把golang跟node打通
发布于 9 年前 作者 Pana 12804 次浏览 最后一次编辑是 8 年前 来自 分享

https://github.com/ry/v8worker Minimal golang binding to V8. This exposes a non-blocking message passing interface to the V8 javascript engine. Go and JavaScript interact by sending and receiving messages. V8 will block a thread (goroutine) only while it computes javascript - it has no “syscalls” other than sending and receiving messages to Go. There are only three built in functions exposed to javascript: $print(string), $send(msg), and $recv(callback)

目前项目处于早期状态,不知道未来会有怎样的影响

12 回复

失误, 我发重复了… 没弄明白为了解决什么问题做的, 直接用 Go 不好吗.

同表示看不懂…这主要是想给 go 的开发者调用 js,还是给 js 的开发者调用 go?

个人觉的可能是想把go的优秀特质引入到node世界了,打通两个平台,让各自做各自擅长的事情

给js添加了几个和go通信的接口,为了让js把阻塞任务交给go?

@alsotang 看代码中那个测试应该是想给 go 的开发者调用 js 代码,ry 难道想用 go 重写一个 node.js 。。。

@dayuoba 有可能

ry 原话 when you want to embed a javascript sandbox in your go program.

很明显,作者在重写一个node…

让 go 程序员能调用大量的 npm packages,好事啊。node 转 go 会容易很多。

hello world可以跑起来了么?

回到顶部