Optimisation possibilities: current, future and enhancements
Cecil Ward via Digitalmars-d
digitalmars-d at puremagic.com
Thu Aug 25 11:17:21 PDT 2016
On Thursday, 25 August 2016 at 11:16:52 UTC, Cecil Ward wrote:
...
> A useful phrase I saw today: “declaration of intent given by
> the programmer to the compiler”.
Particular dream wish-list items of mine: some kind of mechanism
that could express possible operator properties, classes
properties and arithmetic identities, identity operations.
Examples:
* commutativity;
* 1.0 / (1.0 / x) ≡ x, with or without ignoring of zero and
ignoring of IEEE-weirdos; or
* sin²(x) +cos²(x) ≡ 1
* special values of objects such zero, and one, so that that (x ⊛
zero) ≡ x, and that (zero ⊛ x) ≡ x
* D strings can be first, so that x ~ "" ≡ x, arrays too
* arithmetic operators’ properties and identities a they apply to
complex numbers
Another dream: Strength reductions so that sequences / patterns
of operators (back to identities again, sort-of) could be mapped
to named helper functions or operators. For example, with
strings: s1 ~ s2 ~ s3 ~ … → StringArrayConcat( [] )
More information about the Digitalmars-d
mailing list