<p>Did anybody here ever used a scripting language embedded in a Go application?( javascript go-duktape for instance). Did you run into any issue? (interoperability between js context and go, performances...) . do you think it's viable for a web application where the user could define "custom hooks in js (such as some validation logic, query...)" on some requests, or a CMS application. Thanks. </p>
<hr/>**评论:**<br/><br/>TUSF: <pre><p>There are <a href="https://github.com/avelino/awesome-go#embeddable-scripting-languages" rel="nofollow">examples of embedded languages in Golang</a>. There are several Lua implementations, as well as <del>two</del> three different Javascript engines. Some of them are just bindings and ports of other software, but it's a good example of it already being implemented.</p>
<p>Whether or not it's viable is entirely up to how you implement it, but I think using it for a CMS application could turn out fine.</p></pre>DOP251: <pre><p>Make that three different Javascript engines :) <a href="https://github.com/dop251/goja" rel="nofollow">https://github.com/dop251/goja</a></p></pre>viiralvx: <pre><p>Have worked with a JS VM, Otto, in Go before. Hasn't been that problematic. We used it to define a DSL for writing end to end tests, what's nice about it is that you get the familiarity of JavaScript with the synchronous nature of Go. I'll have to post a link to an example when I'm back at my computer.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传