← Back to context

Comment by eikenberry

2 years ago

Why aren't these changes made in kernel to keep the syscall ABI standardized and safe instead of requiring the use of an unsafe language wrapper? We should be discouraging more use of unsafe languages, not forcing it.

Then don't run a OS with a kernel written in C. That would rule out Windows, Mac, Linux and *BSD.

  • Using syscalls means you can replace the kernel. Using libc means you are locked into and FFI/C calling convention for anything other than C. Apples/Oranges.

    • There’s nothing wrong with the C calling convention, at least from a security perspective.

The C ABI doesn't necessarily force you to use C. Maybe to turn some pesky macros into proper functions. Bury the bindings deep in the language's stdlib. Done.

Under the hood, it's all assembly language instructions invoking an operating system written in C. Operating systems care very much about types, but can't offer type safety. Programming languages can.