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

> why does a system which goal is security still use C for utilities/programs that are not really CPU-bound?

I think it has something to do with compiler ubiquity.

Let's use Python as a good example of "get shit done if you don't care too much about perf." The source tarball for Python is 18MB - even the Windows binaries are 25MB. TCC[1] is 100KB. We can use that as a bad estimate of how hard the platform/runtime is to port.

Let's say you wanted to get Doas working on some pet Unix OS that you are writing. If it was written in Python you'd have to first get the entirety (25MB) of Python working; if it was written in C you'd simply cross-compile as you would be already doing for everything else. I'd put good money on you wanting to get Doas/Sudo working before you get Python working or the bajillion different runtimes that all the utils are written in.

In that way C has this very peculiar portability: it's not write-once-run-everywhere but it can be write-once-compile-everywhere. It's a common denominator.

I could be completely wrong and it could just come down to: old habits die hard.

[1]: http://bellard.org/tcc/



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

Search: