- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: Human perception of complexity
Am 27.11.2011 16:21, schrieb Rex Kerr:
8OFiuTSMRWy9Jai+ThP5obZ_+cdEe0cLiwg [at] mail [dot] gmail [dot] com" type="cite">let's just add the implicit rules (not just the number of *visible* elements) and your example's count skyrockets.
On Sun, Nov 27, 2011 at 5:08 AM, HamsterofDeath <h-star [at] gmx [dot] de" rel="nofollow">h-star [at] gmx [dot] de> wrote:
Am 27.11.2011 10:11, schrieb Rex Kerr:On Mon, Nov 21, 2011 at 12:06 PM, Dennis Haupt <h-star [at] gmx [dot] de" target="_blank" rel="nofollow">h-star [at] gmx [dot] de> wrote:is that even valid english? i've never seen or heard something nested like this. anyway, if it is, this should also count:
i thought about this.
i think something's "descriptive complexity" is the smallest number of language elements necessary to describe it. it completely depends on the language you are using to describe it.
Alas, this is not well-aligned with subjective measures of complexity.
"The girl the boy the dog bit hit cried."
Generated via very simple rules and using very few language elements, but I think once you figure out what this is saying that you will find that there is higher descriptive complexity version that is much easier to understand.
This is one reason why Bernd's proposal is a research proposal (and would take serious effort).
--Rex
dog bites boy. boy hits girls. girl cries.
it's one word shorter than your version and easier to understand. it is also less cuddled and can be read in one direction instead of forcing the reading to jump back and forth.
It's valid English with perfect grammar, but it uses a form that so difficult to parse that you didn't quite manage to do it properly. The key building block is that
noun-verb
can be used as a modifier (with a transitive verb) as well as an independent clause (in the case of a reflexive verb), as in
"Throw away the cookie the dog bit."
Now we have a nesting rule:
noun-verb -> (noun-(noun-verb))-verb
which is perfectly valid but really hard to parse.
So, what does
The girl the boy the dog bit hit cried
mean? Why,
The girl cried when hit by the boy who was bitten by the dog.
The difference between this and your version, is that yours tells a story via the linking of events; mine (both the original and the expansion) uses the events only as modifiers to distinguish which girl and boy. (Even that the girl cried _because_ the boy hit her is only implied; if she cried because she didn't get what she wanted for her birthday, but everyone knew that she was "the girl who was hit by a boy", the sentence would work:
You know that girl who was hit by the boy who was bitten by a dog? Well, she cried.
)
Anyway, point is--very simple recursive rules can rapidly lead to something which is infuriatingly incomprehensible. Programmers are better than most at unwrapping these things, I'd expect, but it still points out that descriptive complexity is a sorely inadequate measure of perceived complexity.
--Rex










Re: Human perception of complexity
On Sun, Nov 27, 2011 at 11:07 AM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
What do you mean? The rules are
sentence ::= compound-noun verb1
compound-noun ::= simple-noun modifier | simple-noun
modifier ::= compound-noun verb2
simple-noun ::= individual-name | article category-name
where verb1 and verb2 are reflexive and transitive verbs respectively. That's it.
Re: Human perception of complexity
after thinking more, i find your example very simple instead of complex. i'll shift to an excuse so i don't jave to admit defeat: the language in my head went from "parse that and put it into a complex structure" to "parse that into a more simple structure"
Re: Human perception of complexity
On Sun, Nov 27, 2011 at 5:57 PM, ARKBAN wrote:
> I am completely willing to admit the dot notation may be easier to read if
> you are willing to relearn or are learning from scratch. I can't say the
> same for older programmers (not without more empirical evidence). I'm
> actively trying to win Scala converts, and in my experince these sorts of
> syntax deviations make that more difficult.
funny to me in that i don't so much mind the first 2 levels of
understanding notation, e.g. having to map "->" over to "." or
whatever, where things are pretty static, it is more the things like
"why do i sometimes not/need () in scala? or semi colons? or {} vs.
()?" or all the other sort of probably now on stackoverflow questions
that seem to keep coming up. sure if you grok things enough you can
reason them out but for a while they don't strike me as something my
subconscious motor memory will get the hang of, and i'll be facing
either confusing error messages, or frustrating runtime bugs.
Re: Human perception of complexity
Totally agree. I didn't mention these other idiosyncrasies in my email
but they are also a big concern for me when explaining Scala to the less
informed. (I don't think I could list all of them if I tried.)
ARKBAN
On 11/27/2011 09:02 PM, Raoul Duke wrote:
> On Sun, Nov 27, 2011 at 5:57 PM, ARKBAN wrote:
>> I am completely willing to admit the dot notation may be easier to read if
>> you are willing to relearn or are learning from scratch. I can't say the
>> same for older programmers (not without more empirical evidence). I'm
>> actively trying to win Scala converts, and in my experince these sorts of
>> syntax deviations make that more difficult.
> funny to me in that i don't so much mind the first 2 levels of
> understanding notation, e.g. having to map "->" over to "." or
> whatever, where things are pretty static, it is more the things like
> "why do i sometimes not/need () in scala? or semi colons? or {} vs.
> ()?" or all the other sort of probably now on stackoverflow questions
> that seem to keep coming up. sure if you grok things enough you can
> reason them out but for a while they don't strike me as something my
> subconscious motor memory will get the hang of, and i'll be facing
> either confusing error messages, or frustrating runtime bugs.
Re: Human perception of complexity
> (I don't think I could list all of them if I tried.)
hear hear! :-)
[there's sort of a mish-mash of things i see opined about how good/bad
scala is to learn and master.
some people seem to be saying that since scala is more consistent
under the covers, it is easier to learn... you just have to think like
a compiler. other people are saying that sure java's inconsistencies
suck (just look at Hello World) but at least most everybody is used to
them now. and if somebody claims oh well we have new programmers
coming up all the time, why should they have to suffer java's
idiosyncrasies, i think they are missing how scala has them too, at
least from certain vantage points. (maybe those vantage points are
only of dumb people who can't think like a compiler all the time and
have the scala spec in their head all the time.)
for me, scala is cool, but it is something that cannot be said to be
simple. even if it is consistent. (shoot, locked up crazy people can
have internally consistent monologues going on, but that doesn't mean
i want to think like them.) it is probably mostly just due to the fact
that scala is trying to be very powerful.]
sincerely.