JTransc + Android/iOS status support

Joakim via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 29 17:32:03 PST 2016


On Tuesday, 29 November 2016 at 10:37:53 UTC, soywiz wrote:
> Amazing! Right now all the generated code uses __gshared. In 
> Java you have to use 
> https://docs.oracle.com/javase/8/docs/api/java/lang/ThreadLocal.html to get TLS. And I didn't implemented it yet for multithreading. Because the initial jtransc design was to support all targets including javascript that doesn't support the traditional threading model, but one based on workers without sharing state at all. But I will try to implement multithreading soon for supported targets.

OK, so the way TLS is done doesn't matter for you.  There is 
another form of emulated TLS right now, that requires a small 
patch to llvm, so it is there already if you want to try it.

> I used termux, but they do not support java/openjdk yet; so no 
> gradle. Even when I'm able to transcompile jtransc itself so I 
> could convert it to javascript and run it on node converting 
> .class and .jar files into something else. But it is ideally 
> used from gradle and compiling java/kt files into .class in the 
> process. Also gradle really needs dynamic loading, so no AOT 
> possible. It would be amazing if termux people support java.

They do, after all Android runs Java.  For example, jack, the new 
Java compiler from google that is now the default in the Android 
SDK and is itself written in Java, is available as a package in 
Termux.  I use it to compile the Java portions of the sample apps 
from the NDK, seems to work fine.  There are many other Java 
utilities available in Termux, though not gradle.

> What I can do is to generate the program.d file in my desktop 
> and try D compiler on it.
> But I have to investigate it a bit more.

Yes, this is what I had in mind, in any case.  Generate the D 
code elsewhere by using your tool, then cross-compile using the 
ldc cross-compiler for Android linked above.


More information about the Digitalmars-d mailing list