On Wednesday, 18 December 2019 at 19:57:43 UTC, Adam D. Ruppe wrote:
On Tuesday, 17 December 2019 at 18:29:32 UTC, H. S. Teoh wrote:
Runtime initialization is now working, and you can create a Java VM

I now have this tested and working on Windows and Linux.

- Method overloading;

This is fixed in the newest commit too.


```D
import arsd.jni;

final class Test : JavaClass!("wtf", Test) {
        @Import this();
        @Import void cool();
}

void main() {
        auto jvm = createJvm();

        auto h = new Test();
        h.cool();
}
```

```Java

package wtf;

public class Test {
        public native void test_();
        void test() { test_(); }

        void cool() {
System.out.println("********* super cool *******");
        }
}
```


As you can see there, the D code uses the java class almost as if it was native D. Overloads work now too as well as many types in many places, but not all in all cases. Still a good chunk of work to do but already super cool.


I've gotta shift my attention to COM and .net for a little while now though...


Thanks a lot for this fantastic work. I want to do s.th. similar
for Delphi (For developing windows, android and ios applications)
and your work gives me some good inspiration.

I wonder whether D could be enhanced in future to make the CRTP
idiom a little bit nicer:

  class JavaClass(string javaPackage, CRTP) : IJavaObject {}

  final class Hello : JavaClass!("", Hello) {}


It would be nice, if I could specify s.th. like that:

class JavaClass(string javaPackage = "", CRTP = @child) : IJavaObject {}

then I could just say:

  final class Hello : JavaClass

Kind regards
André



Reply via email to