英文:
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
当然,你可以用几乎任何(图灵完备的)语言来开发操作系统。通常需要一些小的汇编层,而且通常必须使用该语言的受限子集来实现操作系统的某些部分。
例如:
- JavaOS。
- Singularity。(仅适用于某些限制)
至于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:
- JavaOS.
- Singularity. (Applies with some limits only.)
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论