Do everything in Java…

Rikki Cattermole via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 5 18:49:35 PST 2014


On 6/12/2014 3:12 p.m., H. S. Teoh via Digitalmars-d wrote:
> On Sat, Dec 06, 2014 at 03:01:44PM +1300, Rikki Cattermole via Digitalmars-d wrote:
>> On 6/12/2014 11:28 a.m., Freddy wrote:
>>> On Thursday, 4 December 2014 at 13:48:04 UTC, Russel Winder via
>>> Digitalmars-d wrote:
>>>> It's an argument for Java over Python specifically but a bit more
>>>> general in reality. This stood out for me:
>>>>
>>>>
>>>> !…other languages like D and Go are too new to bet my work on."
>>>>
>>>>
>>>> http://www.teamten.com/lawrence/writings/java-for-everything.html
>>>
>>> My problems with java:
>>>    no unsigned ints
>>>    primitive are passed by value; arrays and user defined types are
>>> passed by reference only (killing memory usage)
>>>    no operator overloading(looks at java.util.ArrayList)
>>>    no templates
>>>    no property syntax(getters and setters are used instead even if
>>> you know the field is never going to be dynamic)
>>>    only and exactly one class per file(ALL THE IMPORTS)
>>>    every thing must be inside a class(globals and free functions
>>> are static fields in a class)
>>> This is all i can remember.
>>
>> You forgot type removal for generics during compilation.
>
> I dunno, while type erasure is certainly annoying when you actually need
> information about the type, it's also eliminates template bloat. I think
> the ideal system should be somewhere in between, where type erasure is
> actively performed by the compiler where the type information is not
> needed, while template instantiations are retained when it is needed.
> This should keep template bloat under control while still offering full
> template capabilities. D currently leans on the template bloat end of
> the spectrum; I think there is much room for improvement.
>
>
> T

Its a bit more then annoying. What happened when it was originally 
implemented was basically hacking of the compiler to support it,
type erasure wasn't a design decision to my understanding.
Then again the last time I checked Java's reference compiler / jvm 
source code it was a real mess to say the least.
If I remember right an xml parser lib was at the same level in the repo 
as the compiler and nothing else at that level. This was only a few 
years ago now.

I really hope I'm wrong or its changed since then but who knows.


More information about the Digitalmars-d mailing list