opendal icon indicating copy to clipboard operation
opendal copied to clipboard

use tuple style struct in C binding

Open asukaminato0721 opened this issue 1 year ago • 7 comments

Which issue does this PR close?

Closes https://github.com/apache/opendal/discussions/5161

Rationale for this change

What changes are included in this PR?

use tuple to avoid inner.

Are there any user-facing changes?

asukaminato0721 avatar Oct 07 '24 04:10 asukaminato0721

the change in readme: https://stackoverflow.com/a/21594/13040423

asukaminato0721 avatar Oct 07 '24 04:10 asukaminato0721

Fair enough to move forward in my opinion.

What do you think? @Xuanwo @yuchanns @xyjixyjixyji

tisonkun avatar Oct 07 '24 04:10 tisonkun

It seems like it's just changing from .inner to .0. I'm not sure if it's better to stick with the old style for a more readable and consistent approach when we have more than one field like in opendal_bytes.

Does it make a difference in understanding or performance in a public API on the C side?

Xuanwo avatar Oct 07 '24 04:10 Xuanwo

It seems like it's just changing from .inner to .0. I'm not sure if it's better to stick with the old style for a more readable and consistent approach when we have more than one field like in opendal_bytes.

Does it make a difference in understanding or performance in a public API on the C side?

+1

Does it impact the performance?

yuchanns avatar Oct 07 '24 17:10 yuchanns

Does it make a difference in understanding or performance in a public API on the C side?

no.

Tuple style is just a syntax sugar that has 0 instead of inner as a field.

asukaminato0721 avatar Oct 07 '24 23:10 asukaminato0721

So we may suspend this request and perhaps review it again before we build the release process for the C binding.

tisonkun avatar Oct 08 '24 04:10 tisonkun

IMO inner name provides better semantics when developers are reading the actual header files.

xyjixyjixyji avatar Oct 21 '24 05:10 xyjixyjixyji

Closed due to discussions above. I am open to reopen this if someone favors this approach and illustrate reasons.

xyjixyjixyji avatar Nov 26 '24 16:11 xyjixyjixyji