Vectorized / soledge

Solidity snippets too edgy to be in Solady
MIT License
109 stars 3 forks source link

✨ LibSort #15

Closed raxhvl closed 7 months ago

raxhvl commented 7 months ago

Port LibSort from solady as part of #7.

atarpara commented 7 months ago

@raxhvl, could you please explain which parts of LibSort benefit from the new opcodes (such as mcopy, tstore, tload, push0, etc.)? We're trying to avoid moving all files from solady because it's a hassle to upstream new commits from solady to soledge.

Vectorized commented 7 months ago

I'm leaving this one on hold first. LibSort only has a single copy function.

I think DynamicBufferLib will benefit most from mcopy, as it is literally copying.

Vectorized commented 7 months ago

Actually, I'd prefer if there is a library called MemCopyLib instead of LibSort.

It will have functions for copying memory arrays and bytes.

raxhvl commented 7 months ago

could you please explain which parts of LibSort

@atarpara was hoping to use mcopy in LibSort.copy() - seemed like a gentle start for me.

because it's a hassle to upstream new commits from solady

I can imagine the pain. On a separate note, how are you folks planning to tackle that?

I'm leaving this one on hold first. LibSort only has a single copy function.

Should I close (PR + Issue) for now?

I think DynamicBufferLib will benefit most from mcopy, as it is literally copying.

I will start with this.

It will have functions for copying memory arrays and bytes.

And then this.

atarpara commented 7 months ago

Should I close (PR + Issue) for now?

Yes you can close both.