"So basically, this is a compiler optimization implemented by having the programmer provide hints to the compiler."
I'm not entirely sure that's correct. I think Larry Wall (being a linguist originally) designed it that way because he thought that using context-sensitive sigils was more like regular speech where leading words indicate the number, i.e. 'a cup' vs. 'some cups'...
Having taken a class on linguistics, I have to say basing a computer language on it is a horrible idea.
Human languages are far more complex and verbose than is required for talking to computers. Consider that it takes years to master a spoken language. A computer language should be much easier to pick up once you already know how to use an existing language. Computer languages should attempt to reduce complexity and verbosity where possible.
Example: I picked up lua in a week. (javascript and ruby experience helped a lot) I'm not an expert by any means but I'm capable of writing usable applications. I doubt a person could pick up a new human language in a week.
Human languages are far more complex and verbose than is required for talking to computers.
This is mostly a quibble, but human languages are not more verbose than computer languages, generally. I can generally rely on you to allocate all the variables and present the result in a context-aware way when I ask you, "What is 3 + 5?" I'd generally have to allocate variables and tell the computer where to put the result if I were to ask it the same question.
What was, and still is, sort of magical about Perl is the degree to which it is aware of context and can use it to sort out meaning. If anything, the chief complaints against Perl, which stems from its similarity to natural languages (!), is its terseness and expressive power, these complaints being that it's indistinguishable from line noise and is a write-only language.
I'm not entirely sure that's correct. I think Larry Wall (being a linguist originally) designed it that way because he thought that using context-sensitive sigils was more like regular speech where leading words indicate the number, i.e. 'a cup' vs. 'some cups'...