fplll / fpylll

A Python interface for https://github.com/fplll/fplll
GNU General Public License v2.0
118 stars 60 forks source link

Question: API design for LLL module #264

Closed alxiong closed 7 months ago

alxiong commented 7 months ago

I'm a little surprised by the API design for many methods/functions under class LLL, particularly on decision between in-place mutation and immutable-functional-style, fpylll seems to choose neither.

Specifically, reduced_A = LLL.reduction(A) currently also mutate the original A which is counterintuitive. I think we should choose one of the two:

I find the first option more ergonomic.

malb commented 7 months ago

Hi, we're more or less trying to mirror FPLLL in our API since the idea is to make that, including its low-level routines, accessible for easy experimentation. This also means it is easy to shoot yourself in the foot with the library, by design. So, while I get the dissatisfaction with the API from an application perspective, I'm not too keen to change it drastically.

But perhaps an additional high-level API could be defined and added as a submodule?

alxiong commented 7 months ago

I see, that's fair. Thanks for the clarification.