-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: are there any plans to add more languages? #435
Comments
@saks thanks for the love! I think we're open to new adapters, but can't commit to maintaining the code. Do you want to open a PR for someone to look at? |
Hi @saks, I haven't had a chance to look at your PR in any detail yet, but I wanted to say a quick thanks for your interest and for diving in here! Short-term, it seems tractable for additional language bindings to be maintained in this repo on a best-effort basis. We currently have a Longer-term, I'd like to explore ways for individual language bindings to be maintained independently of this repo, both to let people experiment with things more easily, and to avoid extra maintenance burden on the core repo itself. I don't really know that that looks like yet, but I'd be interested in your thoughts on whether and how it might work. For example, you can imagine us adding a convention similar to how custom cargo commands work, where there could be a separate |
Hi @rfk, thanks for looking into this! I like the idea of different language adapter to live in their own repo, this will definitely simplify maintenance for the core of uniffi.
Right now my main focus is to bridge the gap between mobile platforms and a server side. Going forward I'm happy to do my best to maintain ruby bindings :)
Sounds like a good idea. I believe this architecture can add a bit of complexity in order to establish a protocol which language adapters can use to generate code based on
I see. I'm curious about swift and kotlin, |
Also, have you considered a feasibility of adding a WASM adapter of some kind? |
Ah yes, sorry, the readme is due for a refresh - we now have production apps shipping using swift and kotlin bindings generated from this tool (specifically, some of the shared components used by Firefox for Android and Firefox for iOS) so while the "incomplete" part is still accurate, the "very experimental" part can probably be softened a bit.
Heh, I have a lot of thoughts on WASM, thanks for asking! The initial data model here was inspired by the work on WASM Interface Types, although both have evolved significantly since then. In a possible future world, I can imagine the tooling here being a very thin layer on top of WASM, perhaps something along the lines of:
I think such a world would be pretty amazing - you could write language bindings based on a shared spec rather than coupling them to the particular details of UniFFI, and you could use them with languages other than Rust that also happen to compile to WASM. Of course that world doesn't exist yet, and we need to ship things in the meantime, so UniFFI does its own thing and I try to keep an eye on the evolution of the WASM ecosystem, and look for opportunities to build in that direction. For example: if we do end up introducing some sort of intermediate format so that language bindings generates can be maintained independently of the core crate, maybe that format can be a subset/superset of the WASM interface types proposal, so that the Kotlin/Swift/Ruby generators be kind of prototypes for a future more general wasm-to-X compilation toolchain. That's all very hand-wavy of course, but it's on my mind. If you're happy to share, I'm curious to hear how you would see WASM fitting in to your own picture of how you'd like to use UniFFI. |
Thanks @rfk :) No worries, I had an impression that kotlin/swift part is well polished since I've been following how application-services repo adopts uniffi and it doesn't look like something very experimental 👍
I deeply agree that this future world is truly amazing, hopefully more people working on programming languages will see the value of interoperability. Thank you so much for sharing your vision and insights into potential WASM usage.
Pretty happy to share, but my use case is pretty trivial. Right now I expose a rust library to browser JS using wasm-bindgen (the same library that I expose to ruby/kotlin/swift). This works but I quickly found too much of a code that can easily be generated. I haven't spent much time thinking through is it even possible to implement JS adapter through WASM right now, but happy to explore it later if you see a potential :) |
I haven't thought deeply about this, but it does seem like the sort of thing that should be possible, and would be fun to explore :-) |
I was reminded that we already have an issue on file to discuss this, #299. I've written out some more concrete thoughts in #299 (comment) and any feedback is welcome! |
FWIW I've just found my way here looking for a rust equivalent of Djinni to write a shared metrics library that will run on ios, android and Web. I think this usecase is pretty common for a lot of companies that are shipping a mobile app and website or electron app. I'm working at a company that doesn't have any cpp devs so trying to use something like Djinni is unrealistic and will no doubt result in bad cpp code but I think it's feasible for the team to pickup rust given how strict the compiler is. UniFFI would be perfect for this usecase if it supported WASM with js/ts bindings |
Hello everyone!
I love
uniffi-rs
and was following this project for a long time. Thank you so much for your wonderful work!I was wondering if I can use
uniffi-rs
to generate ruby library in addition to swift and kotlin. While experimenting I have reached the point where the generated ruby code is good enough as a direct replacement to my FFI layer that was written by hand.Would this project be interested in having a ruby adapter?
┆Issue is synchronized with this Jira Task
┆Issue Number: UNIFFI-52
The text was updated successfully, but these errors were encountered: