eclipse-iceoryx / iceoryx

Eclipse iceoryx™ - true zero-copy inter-process-communication
https://iceoryx.io
Apache License 2.0
1.65k stars 384 forks source link

Replace cpptoml to toml11 #907

Open homalozoa opened 3 years ago

homalozoa commented 3 years ago

Brief feature description

cpptoml is not update for a long time. and it not compatible to toml v1.0, not writen in modern c++, etc...

perhaps toml11 is a better choice ?

Detailed information

elfenpiff commented 3 years ago

@homalozoa just to be on the safe side, you mean this: https://github.com/ToruNiina/toml11 ?

We choose cpptoml back then since it had a small code base and the right license (we require something like MIT or Apache 2.0). This is important because we may have to certify this toml implementation later.

From a first look toml11 also has the right license (MIT), the code base looks clean and the repository seems somehow active (last commit on June 30th). This being said I would be alright with using a different TOML implementation.

@budrus @dkroenke when we would use a different TOML implementation do we have to redo the eclipse process again since we got a new dependency?

@homalozoa Do you have currently specific issues with cpptoml so that certain files cannot be parsed? If so we could add patches to solve your pain quickly. And would you like to integrate toml11?

For now I would suggest to wait until September 6th since our colleague which handled all the TOML stuff @elBoberido is on vacation and I would like him to have a look at this too before we start working on this issue since I am not sure that we have considered all side effects.

elBoberido commented 3 years ago

@elfenpiff well, one of the reasons for cpptoml was that it was active at the time we looked for a lib and it seemed to be easily ported away from heap usage, which would make certification easier. After a closer look, I came to the conclusion that it's not that easy to remove the heap usage and it's also not maintained anymore.

Alternatives would be toml11 and tomlcpp. The former is a pure C++ lib but is also quite big. The latter one has less lines of code and doesn't use execptions but is a wrapper around a C library. It might also be easier to get in, since we can claim we just mixed the ordering of words :D (don't take me serious on this)

Hard to tell which one would be the better fit

dkroenke commented 3 years ago

To make it more complicated i would like to bring in a third candidate: https://marzer.github.io/tomlplusplus :smile: It gives some options (header-only lib, exception-free) and have an active community with a good documentation.

Maybe it's a good idea to have some comparison:

tomlcpp toml11 tomlplusplus
License MIT MIT MIT
Exception No exceptions Throws exception Option to disable
Documentation Short Readme on GitHub More detailed doc with examples and good code-snippets Website with tutorials, API reference, examples, explanations how to integrate
Testing Only tested by toml specification tests, no unittests Unittests are written, On the CI only a part of them are executed Unittests that are executed on GCC 10.2 and Clang 12
Platform support Unknown if MacOS or Windows is supported POSIX and Windows Linux, MAC, Windows

Maybe that helps a bit for the decision, we can of course extend this here. I see here either toml11 or tomlplusplus in favor because there is more activity on GitHub (that can change of course).

homalozoa commented 3 years ago

@elfenpiff It's just a suggestion in case of using toml files compatible to toml v1.0 in the future. And choosing a project wrote in modern c++ with modern standard is friendly to new compilers.

We are using toml11 in XiaoMi CyberDog(that quadruped robot). It's easy to use with exceptions. And tomlplusplus is also a good choice.

elBoberido commented 3 years ago

@dkroenke tomlplusplus is indeed a good option but it is C++17. It would be a good excuse to update to this standard, tough :smile: