Ideas from the Chapel language

bearophile bearophileHUGS at lycos.com
Wed Oct 3 03:45:35 PDT 2007


The Cray Inc is designing the Chapel Language:
http://chapel.cs.washington.edu/
The following notes are from the specification V. 0.750:
http://chapel.cs.washington.edu/spec-0.750.pdf
I think it's rather cute, it looks like a cross between C++, Fortress and Python. Here are few things I think can be interesting for D designers too:

- Chap. 5.4.2 page 13, ranges with "by stride".
- Chap. 5.5 page 18, if expression look more readable:
  var half = if (i % 2) then i/2 +1 else i/2;
  Instead of:
  auto half = (i % 2) ? i/2 +1 : i/2;
- Chap. 5.7, page 23, Iterators (they look like copied from Python)
- Chap. 5.8, page 23, file I/O, seems better (it looks like copied from Python)
- Chap. 11.5 page 65, swap operator (useful but probably not enough to justify a new operator)
- Chap. 11.9.1, 11.9.2 page 68, zipper/tensor iteration (partially copied from Python)
- Chap. 17.5 page 96, Tuple Destructuring (looking like copied from Python)
- Chap. 18.1-18.5 page 99-103, stridable Ranges, Unbounded Range Literals, RangeAssignment, Range methods, etc.
- Chap. 19, page 105, Domains seem interesting too (Chap. 19.9 is about subdomains).
- Chap. 20, page 121, more on iterators.
- Chap. 22, page 131, forall, ordered forall, cobegin, coforall, serial, etc.
- Chap. 24.1, page 143, Reduction Expressions

Bye,
bearophile



More information about the Digitalmars-d mailing list