Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But those are technically the OS system calls, not libc.

Would the Rust team accept PR to remove the dependencies on libc for Windows?



> But those are technically the OS system calls, not libc.

They're libc calls, libSystem is the union of a bunch of libraries including libc. In fact, these unioned libraries are just symlinks to libSystem:

    libc.dylib -> libSystem.dylib
    libdbm.dylib -> libSystem.dylib
    libdl.dylib -> libSystem.dylib
    libgcc_s.1.dylib -> libSystem.B.dylib
    libinfo.dylib -> libSystem.dylib
    libm.dylib -> libSystem.dylib
    libmx.dylib -> libSystem.dylib
    libpoll.dylib -> libSystem.dylib
    libproc.dylib -> libSystem.dylib
    libpthread.dylib -> libSystem.dylib
    librpcsvc.dylib -> libSystem.dylib


Still, isn't ironic that a systems programming language isn't able to be used without C, because its runtime was made to rely on libc instead of the raw OS APIs?

I understand the shortcut as a way to reduce development time, but maybe that is something to improve.

Go made the right decision by integrating directly with the OS APIs.


> rely on libc instead of the raw OS APIs?

The argument here is that on Windows and Mac OS X, the libc library is the ‘raw OS API’ and it hence makes perfect sense to rely on it if you want to support such operating systems.


On Windows it isn't. Microsoft has made it clear that you aren't supposed to link to the msvcrt.dlls shipped in Windows. See https://sourceforge.net/p/mingw-w64/wiki2/The%20case%20again...


If I want to zero memory on Windows without libc dependencies, I use ZeroMemory() or FillMemory() and not memset().

No need to have any dependency on msvcr*.dll or the equivalent for Borland, Intel and other Windows compilers, which are effectively the Windows libc.


there is a baremetal rust os that avoids libc. I think it achieves this by avoiding the rust standard library.




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

Search: