3 ms·
Personally I'm inclined to think that an IDL is the Right Way to specify an interface. OTOH, that has been tried, many times (ntauthority describes one series o
by notacoward 5y ago
Personally I'm inclined to think that an IDL is the Right Way to specify an interface. OTOH, that has been tried, many times (ntauthority describes one series of attempts by MS but there have been others). Every one has succumbed to secondary complexity and/or simple lack of adoption. One common issue I've seen has been that the definitions end up feeling pretty non-idiomatic for most languages because they only support a minimal common subset of features. Would exceptions be more idiomatic? Too bad. How about union types? Too bad. What about ownership and memory lifetimes? Oops, alien again. In the end it's no easier to work with than the C definitions, plus generated code often creates problems with build systems and IDEs, so people just go with what already 99% works and deal with its warts as best they can.
- layer8 5y agoIt would need tighter integration with programming languages and compilers, e.g. you should be able to write something like `#include "libfoo.idl"` (similar to the ease with which you can write `extern "C"` in C++, or `__declspec(…)` in MS C, etc.) and not need an extra code-generation step. Regarding features, it’s clear that you’d need to find some sort of common ground, though not necessarily just the lowest common denominator.