3 ms·
I can't speak for the author of course, but probably their argument is that a systems language should be able to directly manipulate bits and bytes without outs
by camgunz 9y ago
I can't speak for the author of course, but probably their argument is that a systems language should be able to directly manipulate bits and bytes without outside dependencies. I don't know that I agree. A reasonable counter example is that you need library support to allocate memory in C. The argument is that it's a feature to not require C implementations to include dynamic memory allocation because not all projects allow it. My point being that what "should" be in a language usually depends on what you're using it for, and for a general purpose language keeping that very small is at least a consistent design.
- benlorenzetti 9y agoYou don't need a library to allocate memory in C. For example on Linux, use sbrk() system call to grow the heap, then start using it. But your larger point still stands.
- camgunz 9y agoAha yeah, fair point :)
- Sharlin 9y agoI think that the point was more that heap allocation is not a standard language primitive in C. And indeed, it would be ludicruous to require dynamic allocation support from freestanding implementations (no standard library because typically your platform doesn't even have an OS).
- benlorenzetti 9y agoAh sorry camgunz I interpreted the counter example as claiming malloc() was a dependency. referencing the wrong subject!
- Sprocklem 9y agoFor what it's worth, C++ can have freestanding implementations and it provides dynamic allocation support at a syntactic level. Freestanding applications, however, need to provide an "operator new" function (with the appropriate memory allocation code) if they want to use it.