Subject: Chomsky's Universal Language as basis for a new programming language? (original title: Python, Tcl, Perl and Rindolf)

From: Omer Zak <[email-masked]>
Date: Thu, 14 Feb 2002 02:01:44 +0200 (IST)

I posted some comments about Rindolf to the Rindolf mailing list.  Here I
would like to discuss more general issues.

The question is what is the essence of Perl?  What makes Perl so Perlish?

I suggest that the answer to this question is that its evolution is
directed by Larry Wall's wish to construct a computer language, which is
as close to Chomsky's Universal Language as possible (the inner language,
which is assumed to be used by everyone inside his head).  Testimony to
his success in this endeavor is the fact that it is possible at all to
write poems in Perl.

How would a computer language, which is equivalent to Chomsky's Universal
Language, look like?

Basically, when we manipulate stuff in our brains, we manipulate giant
chunks of information (1MB objects, anyone?), which could be the snapshot
of the state of several neurons, or a sound sample, or the results of
retinal scan for few seconds, or intermediate results of computations and
pattern matches of the above.

We interrogate those chunks of information to answer those questions, for
which we need answer right now (e.g. is Shlomi visible to us at this
moment?  Do our fingers feel the heat from a burning match?).  Then we
perform actions (such as yell "Bravo!" at Shlomi, or throw the match away
as long as it misses that open gasoline barrel).  We also construct new
chunks of information by combining pieces of information from other chunks
of information (and from the raw input of our senses).

In computer languages, actions naturally map into invocation of procedures
(with or without parameters).  We have the concept of API, via which we
move the robot's arms, cause the washing machine to start spinning the
teddy bear which is being washed, etc.

There are, of course, the sequences and iterations and modularizations
(nested procedure calls).  Conditionals involve information retrieval
(asking a question, whose answer is TRUE or FALSE).

Information retrieval is a more complicated subject:
- We can get the numerical value of a scalar.
- A string can tell us whether it matches the pattern /ab(.*)ba/ and
  provide us with the substring which matched the parenthesized
  subpattern.
- A database (or Python hash) can return a tuple of values, which are
  keyed according to another tuple (of one or more) constants.

Now, Hans Reiser (at http://www.namesys.com/whitepaper.html) proposes a
generalized model for data retrieval.  He speaks in terms of information
retrieval by filenames, but he suggests to generalize the notation to
allow associative retrieval.

So I suggest to think about appropriate way to retrieve information in
a future computer language.  Not limited to array indices, not limited to
hash keys.  Not limited to return of scalar values (or single chunk of
information).

Such a notation should unify the operations of:
- Retrieve array element, by index.
- Retrieve an array slice.
- Retrieve information from associative array.
- Retrieve a set of records from a relative database (single-record
  retrieval from relative database is already isomorphic to associative
  array access in Perl and Python).
- Match a pattern to a string and extract interesting substrings.
- Interrogate an object, using a query method, and get specialized
  information (such as:  "how many elements does this array have?").
- Retrieve the complex arctangent of a complex number.

Of course, special-case notations for the common operations - should be
defined to be similar to what is being used in contemporary computer
languages - I am not proposing radical break from tradition.

And the third subject - notation for putting together information chunks.
This already exists, and needs no dramatic innovations.

                                             --- Omer
There is no IGLU Cabal.  There is no mention of Tcl in this E-mail message
either.
WARNING TO SPAMMERS:  see at http://www.zak.co.il/spamwarning.html