Go的发展是否足够成熟,可以将其用于构建操作系统的核心部分?

huangapple go评论157阅读模式
英文:

Is Go developed enough to use it to make the core of an operating system?

问题

我想知道Go语言的发展是否已经足够成熟,可以将其用于构建操作系统的核心?换句话说,是否可以用Go替代通常使用C语言的部分?

英文:

I'm wondering if Go is developed enough to use it to make the core of an operating system? So basically replace what you would normally use C for with Go.

答案1

得分: 5

当然,你可以用几乎任何(图灵完备的)语言来开发操作系统。通常需要一些小的汇编层,而且通常必须使用该语言的受限子集来实现操作系统的某些部分。

例如:

至于Go语言,曾经有一个可用的(玩具级别的)Go内核实现,但它已经很久没有更新了。根据rsc的帖子

> 在代码库的历史记录中有一个名为“tiny”的玩具内核。
如果你运行hg log -k tiny,你会找到它。它无法在当前版本的Go中构建,但它说明了可能的做法。它在内核中包含了整个运行时包,包括垃圾回收器。

> Russ

英文:

Of course you can develop an OS in almost any (Turing complete) language. Usually there's some small assembly layer required, though. And usually one must implement some parts of the OS using only a restricted subset of the language in question.

Examples:

What concerns Go, there used to be a usable (toy) Go kernel implementation, but it is now obsoleted already for a long time. From rsc's post:

> In the repository history there is a toy kernel called "tiny".
If you run hg log -k tiny you'll find it. It doesn't build anymore
with the current version of Go but it illustrates what might
be done. It had the whole package runtime, including the
garbage collector, in the kernel.

> Russ

huangapple
  • 本文由 发表于 2013年6月4日 14:45:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/16911403.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定