On Monday, 9 April 2018 at 07:02:50 UTC, Hasen Judy wrote:
IMO, this is one more reason why sum-types should be built into
the language compiler, instead of being implemented in
+1. Any time you have to "create" a fundamental feature in a
language... from inside the language itself... you're going to
have confusing error messages, and a huge uphill battle.
Look at Boost. While I salute the effort put into those
libraries, trying to "fix C++"... "from inside C++" is a fools
errand. The upgraded multidimensional array code looks like this:
typedef boost::multi_array<double, 3> array_type;
typedef array_type::index index;
as opposed to you know, in D:
double  A;
And the D version has useful error messages, small compile times,
and it's still easier to read, reason about, and debug.