mojo-flx icon indicating copy to clipboard operation
mojo-flx copied to clipboard

Fix new and deleted methods and add variadic functionality

Open martinvuyk opened this issue 1 year ago • 2 comments

Hi, pretty amazing project. I was thinking of starting a FlatBuffer impl when I came across this.

There is still a lot of code that won't be functional, I saw a Tuple inside a list in a Cache struct somewhere, rn Tuple doesn't conform to CollectionElement sadly.

I added some variadic input into your add funcs, and an idea of taking in a FlexVec as input for the map with a key. Other than that the changes are mostly to fix broken changes since the latest mojo release

Cheers!

martinvuyk avatar Jun 12 '24 19:06 martinvuyk

Hey, thanks a lot for the PR. I checked it out locally and tried to run tests with the nightly mojo version, but it seems there are still errors. I will take some time to make the project compile and run on the nightly mojo and then we can revisit the API additions you are proposing in your PR. Hope to have something for you tomorrow.

BTW I see you made changes only in the flx2 module. flx2 is a deviation from Googles FlexBuffers, where I trie to fix some issues the format has, I also were planning to add/replace some types to the format, as it is already a breaking change. I was even playing around with a thought to jump start a completely new format, based on FlexBuffers, but more suited to Mojo and call it MBuffers :).

If you are interested in this kind of things, we kick around some ideas.

mzaks avatar Jun 13 '24 15:06 mzaks

flx2 is a deviation from Googles FlexBuffers

Oh I had no idea, I'm still very new to serialization unlike you :D

My main "goal" so to say for doing FlatBuf is to eventually get to the point where the Arrow format & protocols can be implemented. It would be amazing if Mojo could become the backend for stuff like parquet and json parsing for Python. And eventually that Python folks use pure Mojo for analytical workloads.

thought to jump start a completely new format

how would it go with keeping compatibility with FlexBuffers?

martinvuyk avatar Jun 13 '24 16:06 martinvuyk