Snapchat / djinni

A tool for generating cross-language type declarations and interface bindings. Djinni's new home is in the Snapchat org.
Apache License 2.0
166 stars 44 forks source link

Compatibility of Snapchat/djinni with C++14 #125

Closed martin00001313 closed 1 year ago

martin00001313 commented 1 year ago

Hi Djinni Community,

It's more questions and confirmation:

In scope of Dropbox's Djinni to Snapchat's Djinni migration few major features/changes are:

  1. TypeScrip support
  2. Migration to C++17

Question: the djiini configurations which are applicable for DropBox Djinni and support C++14, will be applicable and work fine in case of Snapchat's Djinni(i.e. is there a compatibility support) and can be assumed that the future will be compiled under C++14(as they have been configured based on Dropbox Djinni for C++14 compiler support)

Note: I did local integration and seems it works fine. Just need to check official support and confirmation.

LiFengSC commented 1 year ago

We set C++ standard version to 17 simply because this is the version we use internally at Snap for our C++ codebase right now. The code in Djinni probably builds fine with C++14.

ZacharyHarringTyv commented 1 year ago

Hi there,

It's great to hear that you're working on migrating from Dropbox's Djinni to Snapchat's Djinni. As for your question about compatibility, it's important to note that while there are some similarities between the two versions, there are also some differences that may affect the migration process.

In terms of configuration, it's possible that some of the Djinni configurations that worked with Dropbox's version may also work with Snapchat's version, but it's difficult to say for certain without more information about the specific configurations being used.

Regarding C++ compatibility, it's worth noting that Snapchat's Djinni supports C++17, whereas Dropbox's Djinni supports C++14. While it's possible that your code may compile under C++14 with Snapchat's Djinni, it's generally recommended to migrate to C++17 to take advantage of the latest features and improvements.

Ultimately, it's important to thoroughly test your code with Snapchat's Djinni and ensure that everything works as expected. If you encounter any issues, it may be helpful to reach out to the Snapchat Djinni community for support and guidance.

I hope this helps! Let me know if you have any further questions.

martin00001313 commented 9 months ago

The only incompatibility I see for C++14 is nested namespace which is C++17 feature. like for namespace n1::n2

Is there a way to configure old-style/standard nested namespace for generated code i.e. to be namespace n1 { namespace n2 {...}}

LiFengSC commented 9 months ago

Hi @martin00001313,

We changed the namespace format to be C++17 style in this PR

This is hardcoded and not configurable.

If you really need the C++14 style, you can fork our repo and revert this change there for yourself.