Embedding a scripting language in Go.

xuanbao · · 447 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<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&#39;s viable for a web application where the user could define &#34;custom hooks in js (such as some validation logic, query...)&#34; 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&#39;s a good example of it already being implemented.</p> <p>Whether or not it&#39;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&#39;t been that problematic. We used it to define a DSL for writing end to end tests, what&#39;s nice about it is that you get the familiarity of JavaScript with the synchronous nature of Go. I&#39;ll have to post a link to an example when I&#39;m back at my computer.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

447 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传