Pierrick Bouvier <pierrick.bouv...@linaro.org> writes: [...]
> I don't think we should think too much ahead for languages other than C, > for one, two, and even three reasons :) I agree that thinking ahead too much is a bad habit. So is thinking ahead too little :) > - First, it's already broken because we rely on ifdef that won't be > there in Rust or Go. I don't think it's broken. QAPI 'if' translates straightforwardly to C #if, but that doesn't mean it cannot be translated to conditional compilation / metaprogramming in other languages. In fact, the value of 'if' used to be C constant expressions suitable for use with #if, and we changed it to its current form specifically to enable Rust work, in merge commit c83fcfaf8a5. Marc-André's was trying to develop Rust bindings back then, and if I remember correctly this change was enough to let him implement 'if' with Rust. > - Second, it's code, we can just change it later if needed. True! > - Third, those json are consumed only by QEMU (right?), so we are free > to write/modify them as we want. Also true. > The only thing that must stay the same is what we expose to the consumer > in the schema, and which commands we expose in qemu. We may evolve the external interface as long as we honor our compatibility promise. You're aiming for "no change at all" there. I understand why that's desirable. But if it should turn out that a bit of compatible change simplifies the job, we can take the simpler route. [...]