| ▲ | inigyou 3 hours ago | |||||||||||||
I assume it already doesn't work on Windows. At some point you have to define your compatibility boundary. And high performance often coincides with mediocre compatibility. | ||||||||||||||
| ▲ | ChrisSD 40 minutes ago | parent | next [-] | |||||||||||||
You can call into the kernel just fine in Windows. The fact you use a function call wrapper instead of a raw syscall is not really relevant. Most Windows NT kernel functions take a buffer to use rather than allocating their own memory. Even many Win32 functions don't allocate (although there you have to be much more careful). | ||||||||||||||
| ▲ | galangalalgol 3 hours ago | parent | prev [-] | |||||||||||||
A good example is go. On linux you can use a from scratch image fairly easily because it only uses syscalls. But for windows or mac the moving target wasn't maintainable so they link against shared objects. Linus enforcing the don't break userspace rule is what made that possible. That definitely has tradeoffs. At some point relibc or something similar will allow the same (stably) for rust. But using posix as that compatibility boundary gets you a much larger set of OS and only occasionally has a performance penalty. Often, a posix api tuned to the kernel is more performant. Musl is an exception precisely because it makes an openbsd-esque trade of performance for simple small attack surface. | ||||||||||||||
| ||||||||||||||