Skip to content
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

Feature request: Fluent implementation for Java and other JVM languages #158

Closed
ExE-Boss opened this issue Jul 26, 2018 · 4 comments
Closed

Comments

@ExE-Boss
Copy link

Given that the Android frontend is implemented in Java, this will probably be necessary in order to use Fluent on Android.

See also #93 (comment):

It would also be useful to have this implemented in Java as well.

We talked a bit about this recently, and our initial take was to consider Kotlin rather than Java. Do you have an opinion on Kotlin as a target?

Well, Kotlin runs on the JVM, so it should be rather compatible with Java, although it might possibly need a few helper classes, similar to when dealing with Java ⇔ Scala calls. Granted, the need for those has significantly lessened since Java 8 and Scala 2.12.

@stasm
Copy link
Contributor

stasm commented Jul 27, 2018

We already have a WIP implementation of Fluent in https://github.com/projectfluent/fluent-rs. Do you mean that we could use FFI to use it from Android's Java code?

@ExE-Boss
Copy link
Author

ExE-Boss commented Jul 27, 2018

I would personally prefer if it was a full implementation entirely in Java, but official JNI bindings for fluent‑rs would work too (albeit a bit more limited, as the Rust binaries would have to be compiled for all target platforms, whereas a Java only implementation would work on any platform that has a JVM without needing recompilation).

@stasm
Copy link
Contributor

stasm commented Aug 3, 2018

That's good to know, thanks. JVM is not among our top-tier targets and we don't have enough people on the team to commit to a Java- or Kotlin-based implementation right now. If you're interested in working on one, I'll be more than happy to try to promote it among friends of Fluent.

OTOH, fluent-rs is becoming more and more important for us. It might even become the main implementation of Fluent used in Gecko in the not-so-distant future. If the limitations of the JNI are acceptable for your use-case, fluent-rs might be a good solution. @zbraniecki and @unclenachoduh will know more :)

I'm going to close this issue for now. I added the Other Implementations section to the README to increase the visibility of this issue and to signal that we're interested in seeing a community-driven implementation in Java or Kotlin.

Thanks!

@stasm stasm closed this as completed Aug 3, 2018
@ExE-Boss ExE-Boss changed the title Feature request: Rust implementation for Java and other JVM languages Feature request: Fluent implementation for Java and other JVM languages Aug 3, 2018
@JohnnyJayJay
Copy link

In case this is still relevant for any of the participants, here are WIP JNI bindings to fluent-rs. I will probably start publishing snapshots/alpha versions in the near future. I don't know anything about Android, but making this Android compatible should be fairly straight-forward. So if anyone wants to assist there, feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants