Go 1.9

Paulo Pinto via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 23 13:13:15 PDT 2017


On Friday, 23 June 2017 at 19:27:56 UTC, Araq wrote:
> On Thursday, 22 June 2017 at 11:27:47 UTC, Paulo Pinto wrote:
>> Java is AOT compiled to native code via Excelsior JET, IBM J9, 
>> IBM Websphere RealTime, JamaicaVM, SubstrateVM, Android ART 
>> and eventually Java 10.
>>
>
> Have you used one of these products? How do they deal with 
> dynamic class loading? I know how JamaicaVM does it, no thanks.

ExcelsiorJET is quite easy to figure out, you can download their 
open source version.

Some products go the static linking way, others map .jars into 
shared libraries.

>
>>
>> C# is AOT compiled to native code since day 1, via NGEN, 
>> althouth it isn't an optimizing compiler and only supports 
>> dynamic linking.
>>
>
> From 
> https://docs.microsoft.com/en-us/dotnet/framework/net-native/net-native-and-compilation
>
> "Because the .NET Native tool chain links implementation code 
> into your app only if it knows that your app actually invokes 
> that code, either the metadata or the implementation code 
> required in the following scenarios may not be included with 
> your app:
>
> * Reflection.
> * Dynamic or late-bound invocation.
> * Serialization and deserialization.
> * COM interop.
>
> If the necessary metadata or implementation code is absent at 
> runtime, the .NET Native runtime throws an exception. You can 
> prevent these exceptions, and ensure that the .NET Native tool 
> chain includes the required metadata and implementation code, 
> by using a runtime directives file, an XML file that designates 
> the program elements whose metadata or implementation code must 
> be available at runtime and assigns a runtime policy to them. 
> The following is the default runtime directives file that is 
> added to a Windows Store project that is compiled by the .NET 
> Native tool chain: ..."
>
>> Better learn what the competition is actually doing.
>
> Reflection and dynamic class loading are essential parts of C# 
> and Java and do not work well with AOT compilation and never 
> will. Money can't patch over design mistakes.

Nice how you overlook the fact that .NET Native requires static 
linking, hence why there are such issues.

AOT compiling to native code with either NGEN or Windows 8 MDIL 
compiler doesn't have such issues, because dynamic linking is 
used instead.

Also .NET Native is still kind of work in progress, as they still 
try to bring more features from System C# into regular .NET 
toolchain. With every Windows 10 SDK release there are new 
improvement made to it.

In any case, even if native compilation toolchains for Java and 
C# aren't perfect, they make it less appealing to try out D if 
you don't come up with a solid history to go against them, that 
make people actually curious to try out D.





More information about the Digitalmars-d mailing list