Closed mcandre closed 11 years ago
Yes, Erjang can call Java code; syntax like:
foo() ->
'java.lang.System':'gc'();
lets you call static Java methods. Returned objects can pose as Erlang terms. E.g. if it implements java.util.List
, then it can pose as an Erlang list (i.e. you can match/deconstruct it). See more here: http://www.javalimit.com/2010/06/a-java-api-for-erjang.html
Currently, you cannot use Erjang to write Android apps; but it might not be totally undoable. Erjang has a byte code interpreter (use command line +i
) which disables the to-JVM-bytecode-JIT, and this should in principle allow us to run apps on Android; but it has never been tried and there are probably a handful of classes that are being dynamically generated that could have been statically generated. Problem with Android is that dynamic code generation (JVM code) cannot be depended upon.
Can Erjang call Java code?
Can Erjang be used to write Android apps?