页首Html代码

返回顶部

golang 解释器

前面看了 plugins 插件的实现方案: https://www.jb51.net/article/219027.htm

里面提到了

 "github.com/traefik/yaegi/interp"
 "github.com/traefik/yaegi/stdlib"

 

看了一下, 的确有点意思,不过可惜了,目前连 interface 接口都不支持,主要是 主进程与脚本之间的传递。

其次是, 貌似还不支持go mod ,还在GOPATH 的目录结构当中。

 

 

 

 

 

参考资料

Yaegi,让你用标准 Go 语法开发可热插拔的脚本和插件

https://github.com/traefik/yaegi 

https://github.com/sbinet/go-eval 

 

https://github.com/hexops/valast #运行时将变量转化为AST

 https://github.com/yuin/gopher-lua #lua解决方案,  

posted @ 2022-05-29 13:11  ayanmw  阅读(175)  评论(0编辑  收藏  举报

页脚Html代码