TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Rustgo: Calling Rust from Go with near-zero overhead (2017)

185 pointsby telotortium10 months ago

9 comments

nickcw10 months ago
That was a great read. All that linker wrangling is sure to break on the next version of go&#x2F;rust&#x2F;linker isn&#x27;t it?<p>I wonder if it would have been easier to disassemble the rust binary and turn it into Go assembly and use that.<p>That would need a fairly complicated program to process the binary back into assembler. Maybe getting the rust compiler to output assembly and processing into Go assembly would be the way.<p>Using Go assembly would save fighting with the linker, be more likely to survive upgrades and it would be cross platform (well at least on platforms with the same CPU arch).
评论 #41118279 未加载
评论 #41117595 未加载
hardwaregeek10 months ago
lol I remember looking at this when doing our major port from Go to Rust. I noped out once I saw the raw assembly portion. Great for a side project but probably not the move for a cross platform binary run by thousands of people. Still a very cool post and the literature for Go&#x2F;Rust interop is def lacking
yutijke10 months ago
<a href="https:&#x2F;&#x2F;github.com&#x2F;petermattis&#x2F;fastcgo">https:&#x2F;&#x2F;github.com&#x2F;petermattis&#x2F;fastcgo</a>, which is now 7 years old seems to do something similar without the need to about obscure CGO FFI configuration. It also seems to be more generally applicable for any language with C interop.<p>There had been an issue for having something similar in the language itself - <a href="https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;42469">https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;42469</a>, but the Golang compiler team rejected it. If you have followed similar discussions around this with the Golang compiler team, you will notice a pattern of interaction that strongly indicates that they are very much opposed to ever accepting this into the compiler.
评论 #41117593 未加载
评论 #41118537 未加载
zxilly10 months ago
There are many years since the article being written. I&#x27;m wondering if there is a better solution in 2024.
评论 #41117080 未加载
评论 #41117604 未加载
评论 #41117001 未加载
gnabgib10 months ago
(2017) Discussions:<p>2017 (282 points, 68 comments) <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15017519">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15017519</a><p>2019 (107 points, 37 comments) <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20600178">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20600178</a>
评论 #41118577 未加载
odanalysis10 months ago
Does this mean you could now use gokrazy to run rust apps on an sbc with better startup speeds than linux??
评论 #41117837 未加载
sitkack10 months ago
This is totally sick! I can&#x27;t wait to go through these repro steps using new versions.
ethegwo10 months ago
it makes me think about <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=41117749">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=41117749</a> it is the mirror of this project: effient wal to call Go from Rust
Havoc10 months ago
What is the benefit of this?<p>I was under the impression that go isn&#x27;t that far off from rust on most speed metrics being both compiled. So this adds complexity for what gain?
评论 #41117172 未加载
评论 #41117305 未加载
评论 #41122796 未加载
评论 #41117287 未加载
评论 #41120360 未加载
评论 #41117179 未加载
评论 #41119843 未加载