News for hackers. Stuff that matters.
Re:liblinux: Architecture-independent access to Linux system... by hnlmorg on Tuesday November 09, 2021 @04:00AM (#29159284)
> I meant competitive and edited my post now to reflect that and I stand by it. I can only speak for myself with certainty but the benefits never outweighed the costs until more recent languages but if there were really alternatives then more things would have been written in them instead of in C or moving to higher-level languages.

You're now conflating "popular" with "better". What makes a language successful isn't always the same as what makes it better (eg there are countless examples of languages failing to gain significant traction (like Zig, Nim, OCaml, D, ) over other languages that had a large company backing it (like Rust did).

Moreover, what makes a language "better" isn't going to be the same for everyone. Some crave simplicity so that the entire language can be memorised (like SPARK) whereas others crave complexity where they can chose the subset of features to support (like C++). Some like C-style braces, some like ALGOL style keywords (like Ada), some prefer S-Expressions (like LISP) and some people even prefer to go direct to assembly.

We've seen operating systems built in Fortran, Pascal, LISP, Oberon and others so it's not even as if I'm making a theoretical point here.

Re:liblinux: Architecture-independent access to Linux system... by guerrilla on Tuesday November 09, 2021 @04:14AM (#29159372)
> What makes a language successful isn't always the same as what makes it better.

That's definitely true but I think the odds are that at least one of them would have succeeded if many of them really were competitive. They got a lot of chances.

Re:liblinux: Architecture-independent access to Linux system... by hnlmorg on Tuesday November 09, 2021 @04:26AM (#29159435)
You've completely missed the point.

Let's put it in other terms: if your point were true then Javascript wouldn't be the language of browsers. English (which is a mess of a language) wouldn't be the de facto international language.

You cannot conflate "success" with "better". There are so many other factors at play (like money, company politics and which platforms that language is used on happened to luck their way into the mainstream...to name a few).

My point being that the reasons for C's success was as much to do with external factors as it was to do with C itself. In fact in a parallel universe where Bell Labs didn't give UNIX source away and RMS wasn't born (thus wasn't around to create GNU and mandate C as the standard), I'd wager you'd be talking about an ALGOL-derived language (possibly SPARK) as "the best" with C as an academic curiosity; a footnote in history. Or maybe we'd all be writing LISP.

Re:liblinux: Architecture-independent access to Linux system... by guerrilla on Tuesday November 09, 2021 @04:47AM (#29159577)
Please stop making accusations. It's obvious that being better is not a sufficient condition for being popular. It's obvious that C and JavaScript are popular now primarily due to entrenchment. I'm not saying that there were no "better" languages by the standards you mean. What I'm saying is that none of them were better enough. They needed to amass such a large number of pros so as to outweigh that one single con of not being the entrenched language for the niche that we're speaking about.

This goes for ISAs too: We use x86 not because it's better or even good. It's because PowerPC (or whatever you prefer) and all those that were better were not better enough to outweigh the massive cost of losing backward compatability, training, habits, relevant capital and all of that. Maybe RISC V, paired with the right microarchitecture, actually does turn out to be so much better that the transition becomes worth that huge cost. We'll see.

We will overcome C, JavaScript, x86 and all that but only once the contenders to displace them are just *that* much better. Many things have had the chance to do that and were better in many ways but not until recently has the balanced tipped, in my opinion.

Re:liblinux: Architecture-independent access to Linux system... by hnlmorg on Tuesday November 09, 2021 @05:12AM (#29159744)
> Please stop making accusations. It's obvious that being better is not a sufficient condition for being popular.

I'm not making accusations. You literally said:

> That's definitely true but I think the odds are that at least one of them would have succeeded if many of them really were competitive. They got a lot of chances.

Which is the opposite of the point you're now making. I can only respond to the message you post.

Any way, I think we are largely in agreement even if we're describing the problem from different angles.

Re:liblinux: Architecture-independent access to Linux system... by guerrilla on Tuesday November 09, 2021 @06:32AM (#29160278)
When you say I'm missing the point, confounding things or making the opposite point, you're making accusations.

Both of my points are congruent. Rephrase the quote with "competitive" replaced with "better enough" and this becomes obvious. Your original points were that competitive (i.e. better enough) languages existed and people just got sick of C. I disagreed saying that no, if there had been competitive (i.e. better enough) languages then at least one of them would have succeed by now as they'd all had plenty of chances.

Another argument against this "sick of C" idea is that if that were really true then any of the old languages could have been adopted, now that people are supposedly suddenly sick of C. But that's not what's happening. The new languages are being adopted because they're finally better enough. The old languages aren't being adopted because they were never competitive.

Re:liblinux: Architecture-independent access to Linux system... by GoblinSlayer on Tuesday November 09, 2021 @08:27AM (#29161410)
In the early days of microcomputers the competition was between basic and pascal. Basic was interpreted because decent compilers on that hardware were difficult to achieve, but it was achieved for pascal anyway, so it won. C somehow came later.
Re:liblinux: Architecture-independent access to Linux system... by kazinator on Tuesday November 09, 2021 @07:37PM (#29169582)
Part of that "somehow" may have been Microsoft. They provided a C development environment for MS-DOS, and developed Windows in C, imitating Unix. That probably came in via Xenix. (MS-DOS originally had "Xenix" system calls and features aped after Unix, which tells you that the developers were familiar with Xenix and thus had contact with C and Unix.) Windows API's being expressed in C might have been the catalyst that caused C to explode in the consumer PC scene.

People in the computing field would have known about C in connection with Unix, but Microsoft brought system software written in C to the mass consumer market, smack in the 1980's. That would have raised the profile of C as something proven that could be used to deliver; and you could use the compiler from that same vendor, if you wanted.

Re:liblinux: Architecture-independent access to Linux system... by hnlmorg on Tuesday November 09, 2021 @05:53PM (#29168652)
Sorry but you're largely wrong on all counts there.

1. There was a lot more around than just BASIC and Pascal,

2. Pascal wasn't born much before C (roughly a couple of years),

3. and BASIC compilers did exist even as early as in the 60s.

Some examples of other languages (all of which pre-date Pascal and C):

Pascal itself was inspired from ALGOL. So there's a whole class of languages you're excluding. ALGOL was typically compiled too.

Also compiled was FORTRAN. In fact the first FORTRAN compiler was written in the 1957 and the language is credited as being the first ever high level programming language.

Even BASIC wasn't one of a kind. There were a few languages similar (the names of which escape me at this point in time). But BASIC was definitely the most popular of it's ilk.

And lets not forget LISP. It's the second oldest high level language after FORTRAN. LISP has had compilers around since the 60s, although the language is older than that.

Another popular language with compilers back in the 60s was COBOL. And as you maybe aware, some banks are still stuck running COBOL code (albeit modern COBOL looks nothing like 60s COBOL)

And I'm just listing the highlights here. I could also talk about how C evolved from B and B evolved from BCPL. But BCPL's syntax is a lot more like ALGOL than it is C. I could also talk about how FORTRAN, ALGOL and COBOL themselves aren't really a single language but rather a class of languages too. In fact Pascal evolved from ALGOL W and ALGOL W compiler was written in PL/360 which is another ALGOL-like systems language designed specifically for the IBM System/360. Which leads nicely onto the next point that there was also a lot of machine specific or vendor specific languages out there too. In fact it was quite common for organisations to design their own language - possibly even more so then than it is now.

So no, it wasn't just a decision between BASIC and Pascal in the early days. There were a lot of choices even back then. And in fact Pascal wasn't even an option in the early days because it didn't come onto the scene until 1970. Verses the 50s and 60s for all the other languages mentioned above.

Re:liblinux: Architecture-independent access to Linux system... by kazinator on Tuesday November 09, 2021 @07:28PM (#29169510)
It seems you might have paid insufficient attention to the "in the early days of microcomputers ..." qualifying remark in the grandparent comment.

When microcomputers emerged in the 1970's, in particular consumer microcomputers, many languages and other software simply did not migrate to them from Big Iron, mainly for reasons that it just didn't fit.

People who started computing with microcomputers in that era would only have read about Algol or Cobol in Byte or Creative Computing; it wouldn't be found running on their Comodore Pet or what have you.

Re:liblinux: Architecture-independent access to Linux system... by hnlmorg on Wednesday November 10, 2021 @03:06AM (#29172254)
Ack yes, I did miss the "micro" part of this sentence. Sorry.

That all said, you'd still be surprised at the number of programming languages that were ported to microcomputers, albeit more so in the early to mid-80s rather than the very start of their evolution in the 70s.

Take the British Amstrad CPC 464, that had compilers for Forth, C and COBOL (to name but a few): https://www.cpcwiki.eu/index.php/Category:Programming_softwa...

I remember seeing a similar array of options for other microcomputers too.

But I'm not disagreeing with the GPs point, those solutions I've exampled were pretty niche. I raise it more for academic interest than as a counterargument.