On 29/11/2021 14:06, Bart wrote:
> On 29/11/2021 09:05, David Brown wrote:
>> On 28/11/2021 20:25, Bart wrote:
>
>> Why should anyone care?
>>
>> When I started watching TV, there were three channels, and most TV's
>> were black and white and about as deep as they were high.
>
> In 1962 we had a TV with only 1 channel, in black and white and with 405
> lines.
>
> In the same year, Lawrence of Arabia was released in cinemas in 70mm
> format (somewhat beyond 4K quality). The screen was pretty flat too!
>
> Not sure how such things are relevant, my remarks are about
> characteristics of programming languages, not hardware.
>
>>> * Case insensitive (in code, file system and CLIs)
>>
>> That stems from a time when computers had six bits for a character
>> because 8 bits would cost too much, and people used teletype instead of
>> screens and keyboards.
> All languages and all OSes were using the same hardware. Yet Unix+C went
> for case-sensitivity, other made a different choice.
>
> A /choice/. That doesn't make it right and the others wrong.
>
Most programming languages in use today are case-sensitive. Those that
are not are mostly leftovers from the days when computers SHOUTED at you
because they didn't support lower case letters.
Most filesystems in use today are case-sensitive. Those that are not
are mostly leftovers from those same days. Even NTFS on Windows is a
fully case-sensitive filesystem, and can happily support "readme.txt"
and "Readme.txt" as different files in the same directory. The OS has a
layer in its API to make the filesystem appear case-preserving but
case-insensitive.
Case insensitive doesn't work when you go beyond the UK/US alphabet.
The complications for various languages are immense. In German, the
letter ß traditionally capitalises as SS - one letter turns into two.
In Turkish, "i" and "I" are two completely different letters, with their
opposite cases being "İ" and "ı". It quickly becomes ridiculous when
you need to support multiple languages. On the other hand,
case-sensitive naming is usually just done as binary comparison.
So unless you think that everyone should be forced to write a limited
form of UK or US English and that ASCII is good enough for everyone,
case-sensitive is the only sane choice for file systems.
You can reasonably argue that the majority choice is not necessarily
right. But you have a much harder time trying to argue that an outdated
minority choice is right.
> I used machines with both upper and lower case capability from 1982; I
> still prefered case-insensitivity because it was generally better and
> more user-friendly.
>
>> If you have trouble getting your cases right,
>> you are in the wrong job.
>
> If you have trouble thinking up distinct identifiers in examples like this:
>
> Abc abc = ABC;
>
> then /you're/ in the wrong job!
>
That's a strawman, and you know it. Or do you think it's fine to write:
OO0O1I II1IIlI1 = OIOII1IIl0I;
The ability to write sensible identifiers - or confusing ones - is not
dependent on case sensitivity. (And please don't give us the tired old
bullshit about having seen poor coding in some C code you found online
that left you confused. It would merely show that you prefer
cherry-picking to rational arguments, or that you are easily confused.)
>>>
>>> * 1-based indexing, with A[i,j] for 2D accesses
>>
>> 1-based counting is good for everyday counting, not for programming.
>
> Bollocks. In any case, you snipped my remark that I implement N-based
> arrays, so that I can use 0-based /as needed/, and have always done.
>
As I said, it can be good to have more flexible array indexes in a
higher level language.
But if you have just one starting point, 0 is the sensible one. You
might not like the way C handles arrays (and I'm not going to argue
about it - it certainly has its cons as well as its pros), but even you
would have to agree that defining "A[i]" to be the element at "address
of A + i * the size of the elements" is neater and clearer than
one-based indexing. Again, 0 is the common choice, especially amongst
lower level languages. (The worst possible choice, of course, is to
have a configurable default starting number.)
> You haven't explained why A[i][j] is better than A[i,j].
>
I didn't "explain" it because I don't agree - the two choices have their
pros and cons. One views arrays as purely linear - so A is a linear
array of elements, each of which is a linear array. The other views
arrays like A as being a single object with multiple dimensions.
Sometimes one viewpoint is better than the other.
I can, however, note that I dislike C's comma operator. One of its
disadvantages is that it means "A[i, j]" is interpreted as "evaluate i
for it's side-effects, then treat as A[j]", which is not remotely helpful.
>>> * Keyword-based block delimiters (do...end, not {...})
>>
>> That comes from a time when keyboards with symbols such as { } were
>
> So you see it as progress that {,} with their innumerable issues were
> introduced. Because this:
>
> } else {
>
> or:
>
> }
> else {
>
> or:
>
> } else
> {
>
> or:
>
> }
> else
> } # (oops!)
>
> etc. is SO much better than just:
>
> else
>
> You must be delusional.
>
No, I am not delusional - the use of brackets is hugely better than
relying on line-endings or spacing for block structuring. (And yes, I
am fully aware that I use Python that uses indentation for structuring.)
Mistakes like the one you made there are easily diagnosed by tools -
unlike mistakes for when you don't have delimiting symbols.
However, the choice you gave was not between brackets and nothing, but
between brackets and keywords for delimiters. I find brackets
convenient and light-weight, and very easy to see and use correctly when
combined with a reasonable indentation strategy. I don't see it as a
particularly big issue - "begin"/"end", or whatever, work fine too. But
I see no advantage in them.
(I /do/ see advantage in /requiring/ block delimiters in, for example,
conditionals and loops. Making them optional is a source of errors,
regardless of how they are spelt.)
>
>> considered advanced and modern. (Hence those monstrosities, the
>> trigraph and digraph.) Oh, I forgot - you find it such an effort to
>> press the "shift" key on your keyboard.
>>
>>>
>>> * Proper Read A, B, C and Print A, B, C features ...
>>
>> What a pointless and meaningless statement. There are a hundred and one
>> different ways to do "proper" read and print, with everyone having their
>> own ideas about what is best.
>
> This is just pure jealousy. Show me the C code needed to do the
> equivalent of this (without knowing the types of a, b, c other than they
> are numeric):
>
> print "?"
> readln a, b, c
> println a, b, c
In C, you don't work with variables whose types are unknown.
You are under the delusion that there is one "correct" interpretation
here. You think that /your/ ideas are the only "obvious" or "proper"
way to handle things. In reality, there are dozens of questions that
could be asked here, including:
Does there have to be a delimiter between the inputs? Does it have to
be comma, or space, or newline? Are these ignored if there are more
than one? Are numbers treated differently in the input? Would an input
of "true" be treated as a string or a boolean? Are there limits to the
sizes? How are errors in the input, such as end-of-file or ctrl-C
treated? How do you handle non-ASCII strings?
Should there be spaces between the outputs? Newlines? Should the
newline be a CR, an LF, CR+LF, or platform specific? What resolution or
format should be used for the numbers? If someone had entered "0x2c"
for one of the inputs, is that a string or a number - and if it is a
number, should it be printed in hex or in decimal?
Should the output go to the "standard out" stream, assuming that is
supported by the language and the OS? The "standard error" stream? A
printer? A debug port? A text box in a gui? Should it be determined
by a wider context in some way, such as via functions that redirect the
output of "println" statements?
No matter how you implement such things, it will not be the right choice
for some people in some cases. A language (and/or standard library) can
make a reasonable starting point that is appropriate for a variety of
uses of the language. And it can fully /document/ and /specify/ the
behaviour. That's all - that's the best that can be done.
(And note that I am /not/ saying that C is "perfect" here. C's "printf"
solution has a lot of advantages, which is why it has often been copied
in other languages, but it has a lot of disadvantages too. The same
applies to your language's print statements.)
>
> Here the language provides informal line-based i/o, as might be useful
> for interactive programs, or reading/writing files, while still allowing
> more precise control as needed.
>
>> Because you are wrong.
>
>> And you are a margin of /one/, because you believe that languages should
>> follow exactly what /you/ want in all aspects, with a total disregard
>> for anyone else.
>
> What exactly are the choices for someone in 2021 who wants to use (or is
> required to use) a language like C, but favours even one of my
> characteristics?
>
The same choices /everybody/ makes in /every/ aspect of their lives -
you find the most suitable compromise. No one programs in C because
they think it is a perfect language - they program in C because it is
the best choice for their needs at the time, weighing up the advantages
and disadvantages.
You don't go to the bakers and say "I'd like a loaf of bread just like
that one, except 30% longer". You choose between a smaller loaf than
you wanted, or buying two and having too much bread, or buying a
different loaf that is the right size but a different texture.
If you are really keen on getting exactly the loaf you want but the
bakers don't stock it, then you can learn to make bread yourself and
make your own loaves that are exactly what /you/ want. But you don't
expect them to be popular with other people.
If you think that lots of people would like loaves that are 30% longer,
then you can try and start a business making and selling them. That's
fine too - though not easy.
What you don't do, however, is go to the butcher's shop and complain to
the butcher that the baker's loaves are so terrible.
Picking a programming language is not really any different from any
other kind of choice in life.
>> Yes, you can have your opinion. Yes, you can make your own language the
>> way /you/ want it. Yes, you can give suggestions and ideas based on
>> these in a discussion about languages. No, you can't tell people that
>> you alone are right, and the rest of the world is wrong, and expect to
>> be taken seriously.
>
> But YOU are allowed to say that:
>
> * Case-insensitivity is wrong
> * 1-based is wrong
> * A[i,j] is wrong
> * Anything other than {...} blocks is wrong
> * Easy read/print statements in a language are wrong
> * Line-based i/o is wrong
> * Left-to-right type syntax is wrong. (Did you say that, or decided not
> to mention that one?!)
>
Yes, I am allowed to say that (though I most certainly did /not/ say
that). But I am not allowed to expect everyone to agree with me just
because I say so. See the difference? If I want anyone to take my
opinions seriously (and I don't always expect that), I have to be able
to justify them. "Case insensitivity is clearly better because I like
it" is not a justification.
> All things that C doesn't have.
Only you are arguing about C here - only you seem to imagine people
think it is perfect. It is far and away the most successful programming
language, massively used and massively popular, so it makes a good
yardstick for comparisons and discussions. But nobody suggests it is an
ideal language (I certainly have not done so).
>
> Actually, Ada and Fortran are still around, are case-insensitive, are
> N-based, and don't use brace syntax.
>
If you take a sample of a thousand programmers, you can count on one
hand the number that have any concept of those languages beyond "Ada is
used by the US DoD" and "Fortran was used in the early days of
programming". (Usenet is not a good sample, given its demographics.)
> Lua doesn't use braces for blocks. It is also 1-based.
>
> Also 1-based are Julia, Mathematica, and Matlab ("Learn some maths"? Sure!)
>
> Julia doesn't use braces either.
>
> These are all characterics that still exist across languages, but not
> necessarily within one system languages which is where I need them.
>
>
>>
>>>
>>> Getting back to what this is about, which was your suggestion that C is
>>> so perfect, it is pointless to create something new unless it comes with
>>> a raft of advanced, heavy features, then why SHOULDN'T there be an
>>> alternative systems language with it's OWN set of characteristics?
>>>
>
>> I /could/ explain what I had written earlier. But what would be the
>> point? It would just repeat the same things I wrote before. You didn't
>> read them then, why should I think you'll read them now?
>
> I'll repeat what you said:
>
> "Given the vast benefits of C in terms
> of existing implementation, code, experience and information, why would
> anyone bother with a different compiled language unless it let them do
> things that you cannot easily do in C?"
>
> You are clearly saying, don't bother creating an alternative to C unless
> it actually does something different.
Yes. Surely that is obvious? There is no point in re-inventing the
same wheel everyone else already uses - you have to bring something new
to the table. (Or you are doing this all for fun and education.) And
given how many people already use C, how many tools there are, how much
code there is, you need /serious/ advantages over it in order for anyone
to choose your language over C.
>
> I disagreed: you CAN have an alternative that, while it does the same
> things, can achieve that differently.
No one will use it. So what's the point?
It would not be impossible to design a new programming language that is
of a similar level to C but has a fair number of technical improvements.
(It is certainly possible to have lots of technical /differences/, but
being different does not make it better just because one person prefers
the change.)
But can you make one that has enough technical improvements to gain any
kind of following?
Let's say that I agree that your language's "println" system is the
bee's knees, that I have always found writing "int * p" confusing, and
that I'd be much happier if I was able to write my identifiers in small
letters when I am in a good mood and in capitals when I am feeling
angry. Would that persuade me to throw away my existing compilers,
debuggers, editors and change to your language? Should I change the
tiny, cheap microcontrollers we use to embedded Windows systems as that
is the only target you support? For C, I have the standards documents
and reference sites, and compilers and libraries that follow these
specifications, and an endless supply of knowledgeable users for help,
advice, or hire - for your language, we have one guy off the internet
who regularly fails to answer simple questions about the language he
wrote without trying it to see the result.
So, again, what is the point of a language that is roughly like C but
with a few technical improvements and perhaps a nicer syntax (in some
people's opinion) ?
There is plenty of scope for making a good new programming language, but
if it is going to be used, it needs to let people do what they are
already doing, things they can do by moving to other established
languages, /and/ something new.
That means it doesn't just have to be a massive technical improvement
over C. It also has to beat C++, Ada, Rust, D, Go, C#, OCaml, and even
oldies like Forth and FORTRAN and "weird" choices like Haskell or Eiffel.
>
> I listed some things out of many dozens. You of course with disagree
> with every one of them.
>
Again, you merely demonstrate your clouded prejudice that hinders you
from reading anything people write.
> Doesn't matter what it is:
>
> C does X C's way is perfect
> Bart does Y Bart is WRONG, and in a minority of one
>
> Even when I show that other languages, old or new, also do Y. Or when I
> give an example of Y clearly being better than X.
>
> My dislike of C is rational. Your loyalty to it, and hatred of anyone
> who dares to badmouth it, is irrational.
If someone thinks that C is perfect, or that your language was always
wrong, or was blindly loyal to C, then I agree that would be irrational
(or at the very least, ignorant). But I have expressed none of these
things. I most certainly have not expressed hatred of you or anyone
else. (I have accused you of hating /C/, not of hating any person.)
Your problem here is that you cannot appreciate that someone can explain
how C works, or why it is the way it is, or how to use it. You cannot
grasp that people can find C useful, practical and enjoyable without
treating them as though they view C as "perfect" and the paradigm of
programming languages.
I use C a lot - I know the language well and find it very useful for the
programming tasks I have. I'll drop it in a heartbeat when I have a
better alternative. (Indeed I have done so - when it is practical for a
project, taking into account a wide range of factors, I use C++. And
for PC programming I almost never use C.)
These threads would be a lot more pleasant if you could wrap your head
around that.
Oh, and you should get over your delusion that your dislike of C is
rational. Your dislike of /some/ aspects of C are rational (again, no
one who has used C significantly likes it all - and the same applies to
all programming languages). Some is purely a matter of taste (and
that's fine). Much of it, however, is due to your wilful and stubborn
insistence on making life hard for yourself. Such martyrdom is not
becoming.
>> I /have/ been discussing ideas and suggestions here. Some have been of
>> interest to James, others not - which is fine. And I write comments
>> aimed at making him (or anyone else interested in languages) think about
>> how the language might be used - because that's what's important. I am
>> not the one who thinks every thread is an opportunity for a new anti-C
>> rant.
>
> No. Your message is 'Just don't bother trying to rewrite C', presumably
> because it is perfect.
>
You presume incorrectly.
I have written a great many things in James' threads - few of which were
about C. (And most of those were of the form "C does it this way - you
might want to do it differently".)
But this particular message was "Don't bother trying to rewrite C" -
because C is already here. If you want to design a language, make a new
one.
> C is still VERY widely used, but you don't believe in an alternative.
> You want people to continue driving a Model T, unless the new car can
> also fly!
I hope you were not suggesting that /your/ language is somehow more
modern than C! But perhaps you just wanted to end on a joke.