Whats the best way to generate java from python?
I want to write a decorator that generates java code to call a json version of a function (I can use existing decorators to export the json api).
Whats the best way to generate the java, should I consider stuff like FSMs here?
Ideally I can write my code once, for the server and generate code to interface with it for various languages (java first).
Edit (pulled from a comment on a deleted answer):
The java code will be running on android, while the python code will be in a django server... Also, I want to be able to statically generate the java code, and have this as part of an API that people can use.
You can always create java code the same way webapps create HTML: with a template. Then you can have the java source code compiled into bytecode using a regular Java compiler ( see: Package javax.tools )
Not necessarily the best option, but definitely an option ( and quite simple btw )
Reuse is good. Complexity is a price.
It will make you pay twice or more later on. Measure your ROI (Return on Investment) before you make a leap.
[Edit:]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With