From the Department of Insane Ideas: D on the JVM

Gregor Richards Richards at codu.org
Wed Dec 13 06:17:40 PST 2006


Lars Ivar Igesund wrote:
> Gregor Richards wrote:
> 
>> No, I'm not saying somebody should do it, I'm saying I've done it.
>>
>> http://www.codu.org/nestedvm-gdc/
>>
>> Using NestedVM, a tool that lets you compile anything GCC supports to
>> Java bytecode, I've made a modified copy of GDC that can produce native
>> Java .class files from D source.
>>
>> What's the use? I don't know, I only did it to have a bit of perverse fun.
>>
>> Sockets and threads don't work yet, and it's not extensively tested, but
>> it works enough to get a simple Hello, World! compiled.
>>
>> I'll put up full documentation on using it later, just thought the NG
>> might be interested in knowing it exists.
>>
>>   - Gregor Richards
> 
> I suppose the most important question would be how to interface between Java
> and D.
> 

Actually it's fairly simple. NestedVM provides a virtual syscall 
"CallJava" that allows you to send a few ints out, you catch that with a 
Java function that gets strings or whatnot, and then it goes out to the 
Java world. It also provides you with .call(), which allows you to call 
any extern (C) function in D from Java.

  - Gregor Richards



More information about the Digitalmars-d-announce mailing list