|
On Apr 25, 2014 2:28 PM, "Coda Highland" <chighland@gmail.com> wrote:
>
> On Fri, Apr 25, 2014 at 10:17 AM, Gavin Wraith <gavin@wra1th.plus.com> wrote:
> > But I do not think human languages have much to offer programming
> > languages, because their semantic structures are usually based on
> > the physical circumstances of the speaker and the persons addressed.
> > Objects are classified by whether they are animate or inanimate, male
> > or female, close by the speaker, close by the persons addressed, or
> > far away. Indeed, the whole point of programming languages (and
> > mathematics) is to be free of the constraints that vernacular
> > languages impose.
>
> Programming languages have noun class systems too! Syntax and
> inflection vary based on whether you're accessing a scalar, an array,
> or an object.
This is not true in Smalltalk, since there is no distinction between those. The most you could say is that lvalues are magically unboxed when not on the left in an assignment statement, but that's true everywhere but shells and Tcl.
> Some languages inflect more visibly than others (I'm
> looking at you, Perl) but it's a universal truth of context-sensitive
> grammars.
Studying the post-hoc rationalizations for Perl's ludicrous grammar seems unlikely to reveal much about the structure of programming languages as a whole. So much comes from "I want to be like awk *and* C", and supporting specific cute one-liners; it is amazing that people could work backward from those details to a internally consistent formalization. See Groovy's development for an example of failure; see PHP for what happens when people do not feel the need to explain or reflect at all.
I think what we *can* get is a view of a particular 1990 aesthetic. Like many languages of the period, Perl was deeply scarred by the simultaneous need for automatic storage management but fear/envy of garbage collection. malloc is macho. Reference counting is efficient. Creating references is a special act.