Hacker News new | past | comments | ask | show | jobs | submit login

Doesn’t that not work on many OSes since they treat libc as the stable ABI surface and make no guarantees about the syscall interface? If I recall correctly that’s what gave Go so many headaches on MacOS as they chose a similar strategy until, if I recall correctly, they abandoned it in recognition that it’s not tenable.



> since they treat libc as the stable ABI surface

For the subset that Virgil uses to get off the ground, I haven't been broken by the kernel changing system calls. MacOS has been a pain for a number of other reasons though, not the least of which is deprecating 32-bit altogether...with a student's help I finally got around to generating x86-64 Mach-O binaries. That works on x86 macs again. But something is still wonky and they don't run under Rosetta 2.

Linux is rock solid though. I've never been broken by the kernel.


That’s because Linux is very unique in treating the syscall boundary as the ABI. I’m not sure which other OSes do that. Maybe Windows? Not sure. Certainly none of the BSDs.


Linux is the only operating system that guarantees kernel binary interface stability. You can discard the entire user space and write dependency-free software that interfaces with Linux directly. You can even boot Linux straight into your own program and bring up the system yourself.

This single function is all you need to do literally anything on x86_64 Linux from writing to a file descriptor to graphics card ioctls:

https://github.com/matheusmoreira/liblinux/blob/master/sourc...

In all others, interfacing with the kernel directly eventually leads to breakage because the people in charge change the system calls. Go binaries broke on OS X because of this. We're not meant to bypass their system libraries.


That’s crazy that other os’s don’t do that


It’s not that crazy when you consider that C has been the lingua franca of OS development for 50 years with a very thin library interface that’s been ported to every single platform under the sun. That’s a pretty sane maintenance choice all things considered since every single other language linked against libc for those 50 years, especially since the underlying hardware and OS has evolved (easier to maintain a highly standardized C library with the high level semantics you wish to standardize vs magic values in registers that are fixed for the duration of that platform and sometimes even across platforms.

I think Go was the first language that tried to buck that trend and it did not go well (aside from Linux).


Windows doesn't




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: