4 ms·
Which is the way it should be. Not everything needs to be in std lib.
by marcrosoft 6y ago
Which is the way it should be. Not everything needs to be in std lib.
- donatj 6y agoWhile I agree that "not everything needs to be in std lib", having worked with other languages that support embedding out of the box, let me tell you it's handy. It also seems like an area where it'd be nice for there to be a single uniform way to do it.
- Gibbon1 6y agoOf all things C is missing the ability to import binary assets. Which is kinda deranged when you think about it.
- shakna 6y agoFor runtime, you can certainly read any arbitrary binary file in C without problems. For compile time, I make heavy use of xxd -i to generate header files in a range of projects. It is no longer installed by default on most +nix systems, but it is generally still in your package manager (often installed alongside vim), and has been around since 1990.
- anitil 6y agoOh I wish I'd known about 'xxd -i' ! When I saw it in the video linked above I was so annoyed that I hadn't used it before
- pjmlp 6y agoISO C surely, C based SDKs on macOS and Windows do support embedding resources since 16 bit days.
- pjmlp 6y agoSure, but then it isn't guaranteed to work everywhere there is a compiler for the language.
- yencabulator 6y agoThe third party solutions have to resort to writing out source files, proper support in tooling can be much more efficient.