On 12/30/2011 12:30 PM, Xah Lee wrote:
> 2011-12-28
>
> Dear Richard,
>
> you are, perhaps the top 10 haters of Mathematica/Wolfram on this
> earth.
I didn't know there was a rating service for this.
I would prefer to categorize my attitude towards Mathematica as
rationally critical of its faults, and disdainful of its hype.
After all, I have a paper on my web site suggesting improvements
to (for example) its rule processing, and an implementation of its
evaluator and matcher in lisp.
I think that my view of Dr. Wolfram is pretty much irrelevant to
a discussion of Mathematica's design unless one can in particular
pin a design failure to Wolfram himself rather than someone else.
> Me, is a dedicated lover of Mathematica, and actually i admire
> Stephen Wolfram, his ideas, personality, too, in fact many of his
> views, philosophies, are in alignment with my own. (one other guy i
> could think of is Bertrand Russell)
For a moment I thought you were saying that Bertrard Russell admired
Wolfram. Maybe you should check out Isaac Newton.
>
> Richard Fateman wrote:
>> This is in contrast to "almost all computer languages" which DO have a
>> syntax described in Backus-Naur Form.
... snip
>>
>> (RF) Other languages, like Algol-60, Pascal, FORTRAN, Basic, ... also have
>> (annotated) formal syntax descriptions, typically available in any
>> reference manual for them.
>
> (XL) they have syntax spec in the same sense that there's syntax spec for
> english. Just read grammar books!
no, some grammar specification for English does not define English. It
attempts to explain it, in part.
>
> i didn't clarify myself before. Let me do now.
>
> No major programing language in use has a formal grammar for their
> syntax. By formal grammar, i mean a “formal language” (in the context
> of symbolic logic. See
http://en.wikipedia.org/wiki/Formal_language .
> Parsing Expression Grammar would be a example of such formal
> language).
>
> In particular, let's look at 2 examples. Java and Python.
>
> Neither have a FORMAL LANGUAGE spec of their syntax. Worse, both
> their “spec” is not sufficient to implement the language, even just
> the syntax part. The vast majority of “language spec” are like that.
> They are more of “a guide to implementation”, and that's it.
You are requiring that the syntax document also specify the SEMANTICS.
This is not the point here. Mathematica has no BNF in its
documentation. Contrast that with Java, Python, etc.
Formal specification (to the level of making an implementation a trivial
"parsing" of the specification itself) of a programming language is
rarely pursued in theory, and (I suspect) never in practice.
>
> Fateman wrote:
>> (The term "regular" wrt syntax has a particular formal distinction).
>> Sure, and i would ask you some questions about syntax, but given your
>> known antagonism against Mathematica and Wolfram, am not sure i'd get
>> answers that's unbiased and useful to me.
>
>> Google is your friend. Look up "regular grammar" to find out about
>> right and left linear grammars, for example.
>
> Now, let me discuss my idea about “regular syntax”. (i don't know if
> there's a term for this idea, so i just say “my idea”. Actually i
> should call it “systematic syntax”. That would be better than “regular
> syntax”.)
You should certainly use a different term than "regular syntax".
>
> The “systematic syntax” i have in mind is this:
>
> • a language with a formal language spec of the syntax.
>
> • this formal language spec, is “regular” in the sense that it is very
> simple, perhaps just a handful of rules. As a example of opposite, you
> could have a formal language spec for Java syntax, but that would be
> tens or hundreds of pages.
I am sure you could do something like this for a language that is
trivial. Formal specification of programming languages is not unknown,
in theory.
>
> Now, my claim about Mathematica is this: its syntax specified in a
> general formal language would be very small, yet the syntax is very
> rich.
Well then, what can you show us that (a) explains all of Mathematica
and (b) is very small?
No other major lang comes close. (lisp would also have a very
> simple syntax spec in formal lang, but its syntax isn't rich).
Please, then, define "rich". There are hierarchies of syntax.
Google "context free", "context sensitive" for a start.
>
> Now, we can discuss what is meant by “simple”.
>
> First, let me give a formal lang spec in BNF for a simplifed lisp
> syntax.
>
> • The set of symbols are english letters a to z, and the parens “(”
> and “)” and space “ ”.
>
> • let's call the letters a to z as atoms, and denote it by α.
>
> starting strings:
>
> • α
> • ()
>
> transformation rules
>
> • α → (α)
> • (α) → (α α …)
> • (α) → ((α))
>
> That's it. Very simple.
two problems here. 1. It is wrong. 2. Your rules are not context free.
Elaboration. Your "system" cannot generate (a b () c).
Rules in BNF can only have single symbols on the left hand side.
Now you are free to require context sensitive rules in YOUR "system"
but be warned that people who have studied such things for, oh, 60
or 70 years think that is not a good idea unless you really really
need it.
>
> Now, a lang can have such simple syntax, but usually such simple ones
> are not useful, not expressive, hard to read. For example, assembly
> langs. Or think of arithmetic with just “+”.
>
> What we want is a rich syntax, but still regular with simple rules
> (that can be specified by a formal language with just a few rules.) In
> some sence, such syntax grammar is a systematic one.
You haven't defined rich OR regular OR simple OR expressive OR formal or
for that matter, what you mean by grammar.
>
> I don't like the dwellers of comp.lang.lisp (they are idiots),
.. snip...
let's not talk about them, let's talk about what you are saying..
>
> as a example of the complexities of C-like syntax, let's have a peek
> show:
>
> i++
> ++i
> for(;;){}
> while(){}
> 0x123
> expr1 ? expr2 : expr3
> sprint(…%s,#@$#!%*&fuck@#)
um, so Mathematica doesn't have complexities? I recall a contest of
some sort asking what is the longest string of (non repeating) operators
possible that has a meaning in Mathematica. e.g. symbols like
_@?!+%*. I can't spot it via Google, but I think that the length
exceeded 12. I described the Mathematica shorthand syntax as "runic".
..snip...
>
> Btw, a little extra tip for my readers:
>
> There is a confusion of the word “formal”. When people say “formal”,
> as in “formal proof”, even mathematians, they usually mean “rigorous”.
> Basically, they use the word “formal” as a synonym of “rigor”. (And
> what's “rigorous” changes with time. Usually it just means the current
> standard, accepted by other mathematicians.)
I think you have to define "people" here. Computer scientists have a
notion of a formal grammar. You are not really free to redefine it
in that context.
>
> This is partly a abuse of language, partly a establish english usage
> habit (called “phraseme”). Still, many mathematicians are ignorant of
> “formal” in formal languages. In fact, many of them sneer at the idea
> of David Hilbert's formalism or Bertrand Russel logicism, like idiots.
I like the image of mathematicians sneering. Do they do that a lot?