nervosnetwork / molecule

Another serialization system: minimalist and canonicalization.
MIT License
36 stars 23 forks source link

few minor improvements #9

Closed yangby-cryptape closed 4 years ago

yangby-cryptape commented 5 years ago
yangby-cryptape commented 4 years ago

The only thing I wasn't sure, is why there's an API version and a moleculec version. The 2 values are the same, so we probably can just use one now.

Sorry, I forgot to answer this (that's why I didn't merge this PR one month ago).

Reasons:

  1. We can upgrade the compiler for generated code, and the new generated code can use the old headers.
  2. We can upgrade the headers, and the old generated code which generated by an old compiler can use them.
  3. Currently, the compiler is only one executable file. When I update the generated code for rust, I have to update the version of compiler, too. But the generated C code is compatible, so I have to define a C_API_VERSION_MIN to keep the MOLECULE_API_VERSION_MIN(it's different from the version of compiler).