Lambda the Ultimate

inactiveTopic The Sociology of Language Evolution
started 4/10/2002; 1:58:58 PM - last post 4/15/2002; 6:48:39 AM
Ehud Lamm - The Sociology of Language Evolution  blueArrow
4/10/2002; 1:58:58 PM (reads: 3749, responses: 6)
The Sociology of Language Evolution
From time to time I feel the need to mention the sociological dimension of language design and evolution.

The discussion on addding a boolean type to Python is a good example.

Small and some would say unimportant changes generate emotional responses, and this is no exception. A good starting point for investigating how this issue is effecting the Python community is a comp.lang.python entitled What has PEP 285 done to us? Also check out the thread True/False story...

I don't want to comment on the specific issue (though you are welcome to let us know what you think...) I am more interested in seeing how the role of language designer (== language god?) changes, as he takes on roles of educator, mediator etc.


Posted to Python by Ehud Lamm on 4/10/02; 2:24:45 PM

Chris Rathman - Re: The Sociology of Language Evolution  blueArrow
4/10/2002; 3:34:48 PM (reads: 2281, responses: 0)
Sounds like the issue has been talked over way too much, but... As proposed: False==0 and True==1

I also think that True==2 should also return True. More specifically, the value of truth should always be expressed in terms of false: False==0 and True==Not(False). Anyhow, True should be any value other than zero when you are trying to mesh integers and boolean logic.

That's probably how the implementation actually works, but it might be a tad cleaner if the PEP made that obvious.

As for language evolution, no matter how you evolve a language, there's always gonna be a set of current users who don't like the changes. In the end, you either need a strong personality or standards committee to force the issue.

Ehud Lamm - Re: The Sociology of Language Evolution  blueArrow
4/11/2002; 12:13:52 AM (reads: 2247, responses: 0)
Indeed. You also need to prioritize changes. My gut feeling is that if you have automatice conversion from arbitrary data types to boolean values, you don't really need a boolean type. A boolean type is useful so long as it helps catch errors that stem from using expressions that are not boolean in if statements. However, this kind of automatic conversion is often helpful and fun...

Dan Shappir - Re: The Sociology of Language Evolution  blueArrow
4/11/2002; 2:54:34 AM (reads: 2247, responses: 0)
Some anecdotes about my experience with the Boolean issue:
1. When using C++ I often write code along the lines of:
X* p;
...
if ( p )...
Unfortunately, this doesn’t work for Java so it that language I have to remember to type:
X p;
...
if ( p != null ) ...
Not such a big issue but still annoying.

2. The win32 API defines a BOOL type as well as TRUE and FALSE constants. Unfortunately, sizeof(BOOL) == 4 while sizeof(bool) == 1. This can lead to all sort of annoying warnings when compiling code that uses both types.

3. COM on win32 actually introduces 2 additional Boolean types. First there is VARIANT_BOOL which is the Boolean type used by VB. VARIANT_FALSE is defined as 0 while VARIANT_TRUE is defined as –1 (more on that below).

Even stranger is the use of the HRESULT values S_OK and S_FALSE to indicate the Boolean values True and False. It is strange because S_OK, which is used to indicate True, equals 0 and S_FALSE, used to indicate False, equals 1 !

4. As mentioned above VB uses –1 to indicate True because VB does not have logical operators that are distinct from binary operators. Therefore, 1 And 2 in VB equals 0, hence it returns False.

Funny that the Boolean data type, the simplest one of all, can generate so many options and such a debate (Next of the list: unsigned vs. signed chars and unsigned types in general. Oh, and the sizof(long) ).

Ehud Lamm - Re: The Sociology of Language Evolution  blueArrow
4/11/2002; 6:12:30 AM (reads: 2232, responses: 0)
For another approach to language evolution, see this discussion of the Ada process.

Alex Moffat - Re: The Sociology of Language Evolution  blueArrow
4/11/2002; 2:24:22 PM (reads: 2203, responses: 0)
Both threads also seem to show the difficulty of trying to keep a usenet discussion on a civil basis. As it used to say on old maps "Here be monsters".

Ehud Lamm - Re: The Sociology of Language Evolution  blueArrow
4/15/2002; 6:48:39 AM (reads: 2104, responses: 0)
This is, of course, true. Most of the (formal) communication is done via mailing lists, which are a bit better.