Can golang write an operating system?
Of course it is possible.
This is a paper from the 2018 OSDI: The benefits and costs of writing a POSIX kernel in a high-level language. In this paper, the author compares the difference between writing operating system kernels in Go language and C language. The final conclusion is:
In comparing experiments nearly identical system call, page fault, and context switch code paths written in Go and C, the Go version was 5% to 15% slower.
In an experiment comparing nearly identical system call, page fault and context switch code paths written in Go and C , the Go version is 5% to 15% slower.
In addition, you can also learn about Google's open source gvisor and the user-mode "linux kernel" implemented in Go language.
Related recommendations: golang tutorial
The above is the detailed content of Can golang write an operating system?. For more information, please follow other related articles on the PHP Chinese website!