WeekzGod WeekzGod - 2 months ago 11
Java Question

Is it possible to code java in another language?

I was curious as to whether or not a person could code in another language.
I DON'T mean naming your variables in different languages like this:

String[] tableau = {"Janvier", "Fevrier"};
System.out.println(String[0].length);


But more like

Chaîne[] tableau = {"Janvier", "Fevrier"};
Système.sortie.imprimeln(Chaîne[0].longueur);


Is that doable or would you need to write your own french or [insert language] based coding language?

Answer Source

If you were to use a Preprocessor to accomplish this - I believe it would work perfectly well. Java does not ship with one, but C and C++ did (e.g. cpp) - So, you could add a step in your build chain to perform preprocessing and then your code would be translated into the "hosted" English Java before being compiled. For another example, consider the language CofeeScript; a language that translates itself into JavaScript. So, as long as your mapping is one for one equivalent I believe the answer is Oui.