thlorenz / rid

Rust integrated Dart framework providing an easy way to build Flutter apps with Rust.
64 stars 4 forks source link

Vectors and floats #66

Open MGlolenstine opened 2 years ago

MGlolenstine commented 2 years ago

I have added vectors for:

I have also added Vectors for Dart -> Rust:

I've also added float support.

thlorenz commented 1 year ago

Hey, thanks for the huge work! And sorry for replying late.

I'd like to have some collaborator give this a review and get CI passing before looking at this in detail Also I'd like to point out that some cross pollination has been going on in a project I did for Metaplex shank where I used and iterated on some ideas from rid.

The approach is a bit different as an IDL is generated from the Rust code first (via a command line tool instead of during the build) and from that IDL SDKs are generated for any language. We could use a similar approach here in the future, i.e.:

For more info have a look here, here and here

I'm just mentioning this since that could make it somewhat easier to add features like the ones you provide in the future. It also allows the Dart code generator to get the whole picture since it parses all files together instead of operating on a struct per struct basis.

LMK what you think.

MGlolenstine commented 1 year ago

Having some intermediate language sounds like a good plan, as we could reuse it to build connections between any two programming languages using it (or at least generate data structures and connections/translations between them).

I'm not sure how much I'll be able to contribute on a full rewrite of the generation system, as I've done most work on RID for work and we're mostly through the RID part and we're just using it now, not developing anymore, but would be interested in contributing when I can.

I don't quite like how IDL is to be generated through a CLI tool. I do think that there should be a way to generate it on demand (read, when it changes) during the build, as that was one of our main inconveniences with RID; forgetting to update bindings and rebuild binaries for Android platform.

I'd love to discuss this further and try to find some common ground, that would be easy to implement, use and maintain for both RID developers and developers using RID.