December 13, 2006
> 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.

World impacts! I mean, wow. That sounds like a *very* useful feature, actually. You could use advantages of three languages. Pretty impressive.


> 
>  - Gregor Richards
December 13, 2006
> I suppose the most important question would be how to interface between Java and D.

To stay in the insane possibilities: D using Java's GC!

renoX
December 13, 2006
renoX wrote:
>>I suppose the most important question would be how to interface
>>between Java and D.
> 
> 
> To stay in the insane possibilities: D using Java's GC!
> 
> renoX

Unfortunately, I think this one is one step beyond insane to im{probable,possible}.

 - Gregor Richards
December 13, 2006
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've added some basic documentation on compiling and installing nestedvm-gdc, as well as a nifty script 'gdcj' that does compilation and generation of .jar files for you :)

http://www.codu.org/nestedvm-gdc/

 - Gregor Richards
December 13, 2006
Alexander Panek wrote:
> 
>> 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.
> 
> World impacts! I mean, wow. That sounds like a *very* useful feature, actually. You could use advantages of three languages. Pretty impressive.
> 
> 
>>
>>  - Gregor Richards

It IS impressive... although it starts sounding like possible early thoughts of those who went on to create .NET/Mono and SunONE, which also attempt to marry languages after a fashion.

I'm keeping my eye on this "insane" project.

-- Chris Nicholson-Sauls
December 13, 2006
Gregor Richards wrote:

>> PS. Quotes from http://www.zentus.com/nestedvm/ and their NestedVM.pdf
> 
> First off, for the skeptical: While all those quotes are true, it isn't as bad as it seems. It compiles the actual code to Java bytecodes, so it's not a virtual /execution/ environment, just virtual memory and a virtual syscall handler.

I actually thought "was that all there was to it" and that it sounded easy, sorry if it sounded bad in any way. Patches to GDC were minimal*.

I thought the virtual execution environment of the JVM was a feature :-)
Somehow the idea of running a virtual OS in a virtual VM is hilarious.

Running through your installation, just installing darcs and ghc first.
(not sure if it's needed but seemed to be, so I use MacPorts to install)

--anders

* it probably could be cut down a bit, once the autoconf stuff is fixed.
December 14, 2006
Alexander Panek schrieb am 2006-12-13:
> Well, another thing would be reflection. Afaik, runtime reflection gets much easier when run in a VM, thus D could have reflection libraries just like Java - once being able to be run in a VM, that is.

There is no need for VMs to do runtime reflection in D.
Granted, Flectioned[1] currently only allows instanciating classes and
structs and isn't yet a replacement for java.lang.reflect.*. But it is
never the less interesting to see how the seperation between
VM and non-VM capabilities isn't as clear as many would think.

Thomas

[1] http://svn.dsource.org/projects/flectioned/downloads/flectioned.zip

December 14, 2006
I didn't mind to put your work down, of course not! I just wanted to point out, that there *are* Java reflection libraries with a pretty great approach (what I've heard from a Java programmer.. I didn't use them). And, again, I didn't want to put your work down. :)

Kind regards,
Alex
1 2
Next ›   Last »