[Feature] [Xlang] Auto method name translation
See original GitHub issueSearch before asking
- I had searched in the issues and found no similar feature requirement.
Description
A common issue when communicating between Java and Python using the cross language API is the method name convention is not consistent for the language.
For example when calling java from Python
counter_class = ray.java_actor_class(
"io.ray.demo.Counter")
counter = counter_class.remote()
# Note the camelCase
counter.incrementValue.remote()
calling Python from Java is less worried because you have to create PyActorMethod
by string. But the snake_case still stand out.
PyActorClass actorClass = PyActorClass.of(
"ray_demo", "Counter");
PyActorHandle actor = Ray.actor(actorClass).remote();
ObjectRef objRef1 = actor.task(
PyActorMethod.of("increment_value", int.class)).remote();
The mix of camelCase and snake_case is harms readability and compatibility. For example, in Ray Serve, our Python actor needs to manage both Java and Python actors, we have to sprinkle these cases everywhere:
if lang = "JAVA":
ref = actor.performTask.remote(...)
else:
ref = actor.perform_task.remote(...)
Proposal
Ideally, I can just call a snake_case method on Java actor handle and have it automatically translated to camelCase method name. so that
ref = java_actor.perform_task.remote(...)
automatically resolves to the actor’s performTask method.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Image-to-Image Translation: Methods and Applications - arXiv
Abstract—Image-to-image translation (I2I) aims to transfer images from a source domain to a target domain while preserving.
Read more >Linguistic Features · spaCy Usage Documentation
spaCy is a free open-source library for Natural Language Processing in Python. It features NER, POS tagging, dependency parsing, word vectors and more....
Read more >Translation AI - Google Cloud
Cloud Translation lets you dynamically translate between languages using pre-trained or custom ML models based on your content needs.
Read more >An Analysis of Arabic-English Translation: Problems ... - ERIC
This research paper is designed with a view to looking into various problems of translating. Arabic texts into English and fixing them with...
Read more >GNU gettext utilities
The two strings, untranslated and translated, are quoted in various ways in the PO file, using " delimiters and \ escapes, but the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I feel that this should be opt-in. So
Yes. Proposal from @jon-chuang looks good.