golang能写操作系统吗

当然是可以的。

这个是 2018 OSDI 上面的一篇 paper : The benefits and costs of writing a POSIX kernel in a high-level language。在这篇 paper 中,作者就对比了用 Go 语言和 C 语言写操作系统内核的区别,最后的结论是:

In experiments comparing nearly identical system call, page fault, and context switch code paths written in Go and C, the Go version was 5% to 15% slower.

在比较用Go和C编写的几乎相同的系统调用,页面错误和上下文切换代码路径的实验中,Go版本的速度慢了5%至15%。

除此之外,Google 开源的 gvisor, Go 语言实现的用户态的 "linux 内核",也可以了解一下。

相关

golang能写操作系统吗