Translating Java into D

Heromyth bitworld at qq.com
Sat Nov 16 03:39:52 UTC 2019


On Friday, 15 November 2019 at 13:15:29 UTC, Andre Pany wrote:
> On Friday, 15 November 2019 at 03:29:16 UTC, Heromyth wrote:
>> On Thursday, 14 November 2019 at 19:50:22 UTC, NonNull wrote:
>>> Greetings, Java seems to be almost a subset of D in various 
>>> ways.
>> No, it's not exactly right. Java is more powerful than D as 
>> for a language. Many things that Java can do can't be done by 
>> D. For example, reflection, full meta info for a type  in 
>> runtime, type deduction for a template, template member 
>> override.
>>
>> See:
>> https://stackoverflow.com/questions/4829631/unusual-generic-syntax-arrays-stringaslist
>> https://www.baeldung.com/java-executor-service-tutorial
>>
>>> Has there been any work done to automatically translate Java 
>>> source into D?
>>
>> We ported some projects in Java by hand.
>
> With the compile time reflection capabilities of D you can 
> build a runtime reflection system. Therefore I would say D has 
> reflection.
>
> The other points I do not have enough knowledge what Java 
> provides.
>
> Kind regards
> Andre

Yes, you can do everything with D in theory. The fact is that 
there are many stuff waiting for you to implement them when you 
are porting a project from Java to D, like the different or 
missing APIs, language features etc.

See what we got from the portings:

Containers: 
https://github.com/huntlabs/hunt/tree/master/source/hunt/collection
Threading: 
https://github.com/huntlabs/hunt/tree/master/source/hunt/concurrency



More information about the Digitalmars-d-learn mailing list