[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: succinctness = power

> From: "Anton van Straaten" <anton@appsolutions.com>
> Date: Fri, 24 May 2002 16:27:09 -0400
> Fredrik Lundh wrote:
> >
> > paul graham wrote:
> >
> > > The more I think about it, succinctness seems to be what
> > > languages are *for*.  If so, to say that the aim of a language
> > > is not to be succinct seems almost to say that its aim is not
> > > to be a good programming language.
> >
> > nonsense.
> >
> Rather hard to know what you're basing that conclusion on...  I'd say Paul
> is correct, almost provably so (along the lines of Algorithmic Information
> Theory).  However, you have to carefully identify what it is that you're
> trying to express in a language - it usually goes beyond the direct problem
> being solved.  Other (interrelated) requirements are ease of human
> comprehension, maintainability, extensibility, reusability of code,
> performance, checkability, testability, costs of development, etc.  A
> language ought to be as succinct it can be while still achieving the goals
> that are considered important.
> It's possible to come up with very succinct languages that can express
> complex concepts in a very few bits, but they may fail to meet many of the
> sorts of requirements I mentioned.  So it's clearly possible to be too
> succinct.  The goal should be to be as succinct as you possibly can, but no
> succincter.  :)
> Anton

An example I often give is that of J (an APL dialect;
http://www.jsoftware.com).  Here are some J function definitions:

This function:                      means:
m0=: >: @ +: @ i.                   First odd integers
m1=: +/ @ (1: + 2: * i.)            Sum of odd integers
m2=: %:@(+/@(*:@(]-+/%#)))          Standard deviation

Clearly, this is a syntactically very succinct language, but at what cost?
It's important to distinguish between syntactic succinctness and semantic
succinctness (expressiveness).  The former is achieved by using very terse
variable/function names, while the latter is achieved by having powerful
language mechanisms.  J actually has both, but IMO would be much easier to
use (and read) if the use of line-noise operators was deprecated.  This is
why I don't like the word "succinctness"; most people think it means
syntactic succinctness e.g. like in the obfuscated C code contests.