D language as script through JVM

Paulo Pinto pjmlp at progtools.org
Fri Aug 17 10:35:47 PDT 2012


Am 17.08.2012 17:24, schrieb Alexey Egorov:
>> It looks like the 'getAddress' function requires the memory to have
>> been obtained using allocateMemory. It seems to me this would prevent
>> the (excelllent) builtin gargbage collector from working, which would
>> be a waste.
>>
>> It seems .net would be a better target, but according to the thread
>> that xenon325 links to, that either can't be done, or is very hard.
>
> i don`t know about compilers so much (but with my friend we make
> something like C-scripting language with own virtual machine). so, it is
> impossible to make jvm byte code from D. can you explain the reason in
> more details?
>
>

The bytecodes supported by the JVM are optimized for the semantics of 
the Java languages.

Only operations that are required to sucessfully compile Java are available.

This means any language targeting the JVM has to somehow map its own
semantics to what is expected by the JVM, sometimes which consections.

In D's case there are many operations, like unsafe code, or the sematics
associated with stack data types, which cannot be implemented by JVM 
instructions.

--
Paulo



More information about the Digitalmars-d mailing list