Comment by skrebbel
3 years ago
C is pretty much the only language in common use for programming microcontrollers. Microntrollers seldomly have filesystems. To break the language on systems without filesystems or terminals means to break the software of pretty much every electronics manufacturer out there.
Thinking of it, JavaScript is a language that target mainly browser, which also doesn't have a filesystem.
Web requests are its filesystem.
Sure, but you don’t typically run the compiler on the microcontroller! It’s the host that needs a filesystem, not the target.
Of course, I can't see a reason why #embed wouldn't be useful for microcontrollers. In fact, I imagine it's a key target market for a feature like that, resource managers are complex and tools like bin2c have always felt like a terrible back.
I was solely replying to the commenter who said that all reasonable modern systems have filesystems so I put one in for the embedded software developers.
It may have no filesystem but it's extremely likely it has 8 bit bytes
CHAR_BIT != 8 on a lot of systems: https://stackoverflow.com/q/2098149/7509065
Yeah, if the number of platforms using an obscure corner of the spec were exactly zero, we wouldn't be talking about whether the niche size is worth the hassle.
My point was that this niche doesn't cover the entirety of the embedded / IoT space.
But you don't run the compiler on a computer without a file system. How would #include works otherwise?
This feature is precisely very useful when you don't have a filesystem to read data from at runtime. Embedding it to the binary to flash it is so much simpler with this.