by Araq · 10y ago · 0 comments
Furthermore, if your frontend doesn't know about structure layout then you forgo some important systems language features. For example, you can't implement sizeof as a compile time constant.
Sure and you only need to call libclang for each different platform. Or is it on every platform? ;-)
(I agree that it's a tradeoff generally, I'm just not sure this example is particularly motivating.)
No, because the interface is
int stat(const char *path, struct stat *buf);?
(Which is how stuff like https://docs.rs/libc/0.2.16/libc/fn.stat.html is built)