Chapel vs D

Israel via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 26 10:16:59 PST 2014


On Friday, 26 December 2014 at 11:52:27 UTC, Ola Fosheim Grøstad
wrote:
> The Chapel quick ref card gives a nice overview of Chapel 
> syntax and features:
>
> http://chapel.cray.com/spec/quickReference.pdf
>
> Cray has of course geared Chapel towards non-realtime 
> high-throughput computing, so it is not an alternative to 
> C/C++/Rust/D for interactive applications. But the syntax is 
> quite clean and the feature set makes sense.
>
> The Chapel parameter specification has immutable value types as 
> the default except for arrays, syncs, singles and atomics which 
> get ref-semantics. Chapel also allows named parameters, and has 
> an inout-type that copies in and out for safer multi-threading 
> (avoiding spurious writes from other threads during the 
> computation).
>
> The typing/casting syntax uses postfix "expression:type" 
> notation which produces clean looking casts. Mutable 
> declarations are prefixed with "var". Read only references and 
> immutable values are prefixed with "const".
>
> Chapel also has yield-based iterators (generators) like Python, 
> numerical-ranges (and domain maps for array indexing).
>
> I think D needs to consider improving the syntax and the 
> feature set by looking closely at competing languages. If one 
> can improve D by taking on conventions from other performance 
> oriented languages then D will look less weird and moving to D 
> more attractive.
>
> Chapel's syntax is cleaner looking that D, and Chapel also have 
> some features that D would benefit from adopting.
>
> I think Rust is loosing some followers on syntax alone, and D 
> too. Planning for a D3 syntax upgrade with some premature 
> experiments would be a good idea.

I think the languages out there with the cleanest looking syntax
is C# and similarly Java.

I came from the Microsoft world and C# and the one thing i miss
is my Compound worded syntax with capital letters like
GetCurrentDirectory() whereas in D it looks like thisExe()

Same with how we deal with other syntax situations like input.
In C# i would use something like:

int ThisNumber;
ThisNumber = Console.ReadLine();

in D it looks worse with its "old" way of doing it:

int thisNumber
readf("%s", &thisNumber);

The D version takes alot more work and the C# version looks alot
cleaner and more well structured and easier to understand.
Whenever i see this kind of syntax it hurts. Maybe its because im
so used to C# and im biased...
The point is, I agree. Syntax like this is so terrible to look at
it hurts. I feel like i lose 10 minutes of my lifespan every time
i look at this.


More information about the Digitalmars-d mailing list