p4lang / p4-constraints

Constraints on P4 objects enforced at runtime
Apache License 2.0
14 stars 7 forks source link

GMP vs boost::multiprecision as a p4-constraints dependency #137

Open fruffy opened 5 months ago

fruffy commented 5 months ago

P4C currently uses boost::multiprecision to calculate big integers. However, p4-constraints uses GMP. Is there a particular reason why GMP was chosen?

P4C used to have it, but ultimately went with boost because of license concerns. GMP uses GPL, although I do believe it is the variant with linking exceptions.

Reason I am asking is because once we integrate p4-constraints into P4C it would be nice to pick one of these big integer libraries.

smolkaj commented 5 months ago

We felt that GMP was the lighter/more stable dependency of the two, since Boost provides much more than just big integers. That said, this decision wasn't super well researched or anything, using Boost instead may be fine.