Do everything in Java…

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Sun Dec 7 11:53:06 PST 2014


07-Dec-2014 16:39, Dicebot пишет:
> On Saturday, 6 December 2014 at 09:07:34 UTC, Dmitry Olshansky wrote:
>> Solved in Scala:
>> - operator overloading
>> - properties - that + optional (), a library writer still can enforce
>> () to be used
>> - only and exactly one class - any number in any combination
>> - everything class - sort of, it has 'object' clause (just like
>> 'class') that can be thought as a kind of namespace or a singleton if
>> you love OOP.
>>
>> Not fixed:
>>  - unsigend types - nothing here unless Java adds support
>>  - pasing by value - there are immutable and value types (e.g. Tuples)
>> but I think they are references behind the scenes
>>  - no templates, but you may use AST macros which is even more powerful
>
> Scala tries to make things nicer by providing higher level abstractions
> but with tiny bit more poking JVM origins still are unpleasantly
> notable.

It actually quite successful at making things more coherent and 
extensible (something directly opposite to original Java).

There are downsides, type erasure is the most unavoidable trait.

> The whole Function1 .. Function22 trait thing has made me laugh
> very hard when reading the spec originally :)

Aye. The good things is that while e.g. (Int,Int) has type 
Tuple2![Int,Int] it's at least compiler-generated.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list