When the host isn't Linux...
gVisor provides a linux syscall interface to the guest, but ultimately calls a linux syscalls when it needs to invoke something in the host. That obviously doesn't work for a linux-on-fuschia compat layer. I guess you could re-use the guest side, but if gVisor wasn't written for pluggable backends it's probably more work to do that refactor than just build a separate tool.
This isn’t actually true. gVisor contains full implementations of Linux syscalls and only relies on host syscalls being the same for some interoperability features between sandboxed and host applications. It would be completely possible to port gVisor to a non-Linux operating system.
I'm not sure it's strong logic to re-use something else because it implements linux syscalls, the hard part is what it does after it receives the syscall.
gVisor is used in a lot of places[1] that require more performance than a clock. I'm not saying you can't achieve more performance with C++/rust, what I'm saying is that this probably isn't the primary concern.
1. https://cloud.google.com/kubernetes-engine/docs/concepts/san...
https://gvisor.dev/docs/architecture_guide/performance/#netw...
Network performance in gvisor is awful and, by gvisor's own documentation, this is a matter of "implementation costs" ie: it is how gvisor is written, not gvisor's fundamental constructs, that makes it slow.
The rest of the benchmarks are notable as well, there are a few other places where the implementation is called out as being a problem.
1. It's designed to run on Fuschia, not Linux
2. Go FFI is very inefficient, you can't just "extend" a Go project with native bindings and get the same performance wins
3. Hopefully the gvisor team learned the obvious lesson that Go is not suitable for this kind of work
You mean you'd like to read a source to back up that statement.
Nothing is required...
I see NIH is growing even stronger at Google. Why not build on gVisor, rather than re-implement everything from scratch?
[1] https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/s...
[2] https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/s...
[3] https://gvisor.dev/