<p>Hello. I'd like to study the code generated by golang, do you have any good debuggers on windows for that?</p>
<p>Or alternatively, can you describe how interfaces and first class functions work like in go, internally?</p>
<p>About first class functions, I created a function that is running recursively, and uses two variables from it's "parent functions". Do they get copied at the time of function creation, and this first class function keeps these two as it's internal state?</p>
<p>About interfaces, how different they are from vtables and COM? When you pass something into a function that expects interface, you actually pass two values (actual object and object's type, or maybe actual object and object's vtable?)?</p>
<hr/>**评论:**<br/><br/>Smt923: <pre><p>A tool that's pretty useful for playing with various snippets of code and showing ASM is <a href="https://go.godbolt.org/" rel="nofollow">Godbolt</a> which has Go support</p>
<p>I don't know much about more advanced, offline stuff but there seems to be some useful info with <a href="https://golang.org/doc/asm" rel="nofollow">https://golang.org/doc/asm</a> and <a href="https://golang.org/cmd/asm/" rel="nofollow">https://golang.org/cmd/asm/</a>, plus of course I'm sure you can find a "objdump for windows" type thing and look at it that way but I like I said don't know much about that kinda thing with Go</p></pre>qu33ksilver: <pre><p><code>go tool compile -S file.go</code></p>
<p>gives you the assembly generated by Go. Its not the actual processor assembly mind you .. there is a very thin abstraction layer. But its as close to what you get if you want to see what is the actual code generated.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
0 回复
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传