Does CodenameOne support other JVM languages ​​besides Java?

CodenameOne supports compiling Java code to iOS source binaries. Does it support other JVM-based languages ​​like Clojure or Jruby?

+5
source share
1 answer

Not out of the box, but it's really possible. In the past, Steve ported Mirah , which is a subset of Ruby for working at Codename One. That was when we used the old virtual machine, but also had to work with the new virtual machine.

A community member was also able to send Haxe some time ago, but I'm not sure where it ended.

The main point of the dispute when porting the JVM language is that Codename One does not support reflection, and therefore the implementation of the duck language that generates the reflective code will be "problematic".

The reason for avoiding reflection is quite simple: the code size will increase significantly, which will negatively affect the benefits of fewer manual input virtual machines. It is also quite difficult to optimize the reflection code in the AOT environment, so it will work poorly compared to JIT.

Most of the use of reflection can be replaced by bytecode manipulation ahead of time, so the virtual machine can work as if its standard Java code, even when it is not.

Usually we like the idea of ​​running other languages ​​on top of Codename One and would like to help if you have any problems. The main reason we don’t invest time in these things is to keep our attention in place.

+4
source

Source: https://habr.com/ru/post/1239380/


All Articles