TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Proposal: Add bare metal support to Go

83 点作者 rbanffy3 天前

4 条评论

Someone3 天前
FTA:<p><pre><code> &#x2F;&#x2F; printk emits a single 8-bit character to standard output &#x2F;&#x2F; &#x2F;&#x2F;go:linkname printk runtime.printk func printk(c byte) </code></pre> So, printing “Hello, world!”, necessarily will have to make 13 calls to this function. I think I would have required a <i>printk</i> that prints an array of bytes. I expect that can be significantly faster on lots of hardware.<p>In contrast, there’s<p><pre><code> &#x2F;&#x2F; getRandomData generates len(b) random bytes and writes them into b &#x2F;&#x2F; &#x2F;&#x2F;go:linkname getRandomData runtime.getRandomData func getRandomData(b []byte) </code></pre> Here, they seem to acknowledge that it can be faster to make a single call.
评论 #43920616 未加载
评论 #43920224 未加载
评论 #43920566 未加载
jasonthorsness3 天前
We use &#x27;scratch&#x27; containers for many of our Go applications, so they have no user-space stuff other than our application binary. It reduces exposure for security vulnerabilities. This proposal seems to be taking that approach to the extreme - not even a kernel. Super-interesting; I wonder if it could run on cloud VMs? How tiny could the image become?
评论 #43921619 未加载
评论 #43920874 未加载
评论 #43920770 未加载
评论 #43920845 未加载
advanderveer2 天前
I would be interested in this if it enabled deterministic simulation testing for the Go programming languages. There have been some efforts in this area but with little success.
rcarmo2 天前
I use TinyGo, and it does that job well. Not sure if it’s necessary to mainline it.
评论 #43924662 未加载