does D already have too many language features ?

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Apr 11 20:41:00 UTC 2019


On Thu, Apr 11, 2019 at 03:00:44PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote:
> On 4/11/19 2:45 PM, Nick Sabalausky (Abscissa) wrote:
> > Put simply: The question itself is flawed.
> > 
> > A language is a workshop.
> > 
> 
> Another way to look at it:
> 
> English has all sorts of words that are rarely, if ever, used. But
> does anybody really complain that English has too many words? No.

Second-language learners would object, but OK, I get your point. :-P


> Does the presence of all those extra unused words get in the way of
> millions of people successfully using the language to communicate
> ideas on a daily basis? No.

Exactly, there's a core of ideas that need to be communicated, and a
language needs to have at least that set of basic vocabulary in order to
be useful.  One could argue that that's all that's needed -- if you're
going for language minimalism.  OTOH, having a way to express more
advanced concepts beyond that basic vocabulary comes in handy when you
need to accomplish more advanced tasks.  Sure, any old Turing-complete
language is in theory sufficient to express any conceivable computation,
but the question is how effectively it can be used to communicate the
ideas pertaining to that computation.  I wouldn't want to write a GUI
app in lambda calculus, for example.

But how much to include and what to exclude is a complex question that,
AFAICT, has no simple answer.  Therein lies the rub.

Personally, I see a programming language as a kind of (highly)
non-linear, vector-space-like thing.  You have the vast space of
computations, and you need to find the "basis vectors" that can span
this space (primitives that can express any conceivable computation).
There are many possible such basis sets, but some are easier for humans
to work with than others.  Theoretically, as long as the set is Turing
complete, that's good enough.  However, amid the vast space of all
possible computations, some computations are more frequently needed than
others, and thus, in the ideal case, your basis set should be optimized
for this frequently-used subspace of computations (without compromising
the ability to span the entire space).  However, this is a highly
non-trivial optimization problem, esp. because this is a highly
non-linear space.  And one that not everyone will agree on, because the
subset of computations that each person may want to span will likely
differ from person to person.  Finding a suitable compromise that works
for most people (ideally all, but I'm not holding my breath for that
one) is an extremely hard problem.


> Certainly there ARE things that hinder effective communication through
> English. Problems such as ambiguity, overly-weak definitions, or
> LACKING sufficient words for an idea being expressed. But English's
> toolbox (vocabulary) being too full isn't really such a big problem.

Actually, natural language is surprisingly facile, expressive, and
efficient at every day conversations, because it's built upon the human
brain's exceptional ability to extract patterns (sometimes even where
there aren't any :-P) and infer meaning implied from context -- the
latter being something programming languages are still very poor at.
Even when a language doesn't have adequate words to express something,
it's often possible to find paraphrases that can. Which, if it becomes
widespread, can become incorporated into the language along with
everything else.

Where natural language falls down is when pressed into service for
something it arguably wasn't designed for: precise technicalities, such
as needed in math and computing, or in law.


T

-- 
Mediocrity has been pushed to extremes.


More information about the Digitalmars-d mailing list