Hacker News new | ask | show | jobs
by kabdib 4719 days ago
There have been many contenders, notably Eiffel, Oberon and D. There are many others that I don't immediately remember the names of.

These languages have /great/ technical merit. They offer safety (in various forms) and other interesting technologies that C definitely lacks. They were lauded by academics and industry pundits. So why didn't they take the industry by storm?

Perceived technical merit is a terrible way to choose a language.

Pascal was widely regarded as a great language, a wonderful model, and it was widely used in the 80s by various large companies. Today it is mostly dead. I believe this is because Pascal only did an adequate job of expressing stuff at the hardware and kernel level, and that C was better. Certainly nearly everyone at Apple that I worked with breathed a sigh of relief when it became obvious that it was okay to write C instead of Pascal for new projects. For the most part we'd been writing C for years anyway, just in Pascal. About the only thing that people missed were nested procedures (whereupon, C++).

Your new "adult" language is going to need a set of very compelling offerings over and above "well, it's safer" in order to succeed.

Take a look at things people are doing /to/ C in order to be better:

- "analyze" builds that do control graph analysis and find bugs (not just ones endemic to C, but actual logic bugs, too)

- declarative sugar that helps tools to reason about what things like drivers are trying to do

- control extensions (commonly seen as macros providing 'foreach' like support)

- ways for tools to enforce local conventions (without spending tons of manpower on parsers and so forth)

Come up with a language as good as C at low-level programming, that has great debugger support, offers easy tool plugins, and that has interoperability with the gazillions of libraries already available [take a page from C#'s great interop story here], and you might have something. Go "academic" and just say "this is good for you, use it instead," and the working programmers will see nothing in it for them and ignore you, just as they've ignored or abandoned dozens of other offerings in the last 30 years.

2 comments

There have been many contenders, notably Eiffel, Oberon and D. [...] So why didn't they take the industry by storm?

Some possible reasons, based on my limited knowledge of those languages:

Eiffel — Emphasis on simplicity over performance optimisation; emphasis on OO programming style; legal issues around various parts of the ecosystem in the early days

Oberon — Limitations of basic type system, such as a lack of enumeration types and the way coercion of numerical types worked until recent versions

D — Many of the same major strengths and weaknesses as the more established C++; two rival “standard” libraries for a long time

Your new "adult" language is going to need a set of very compelling offerings over and above "well, it's safer" in order to succeed.

Of course. You can throw in “it’s easier to write” and “it’s more powerful” and you still only have a small part of the big picture, because in reality so much depends on the surrounding ecosystem: development tools, libraries, and so on. However, there is no reason we couldn’t have a language that was superior to C in both safety and expressive power, remained compatible with calling to/from C functions at ABI level for library compatibility and ease of porting, and used a clean grammar to help tool developers.

Take a look at things people are doing /to/ C in order to be better:

While I don’t disagree with any of your examples, I’m not sure they really tell us anything useful. The absence of other things that people might do could be because they aren’t particularly valuable or it could be because they are valuable but also prohibitively difficult or expensive to achieve starting from C as the foundation.

C's success in the industry is largely tied to UNIX's success.

As UNIX systems started to spread into the industry and getting market share from mainframes, developers also wanted to have those utilities in their home systems. This lead to C being spread outside the natural environment (C) and "infecting" non UNIX systems.

As Pascal refugee, I only touched C when required to do so. Even with its quirks I find C++ offers a more welcoming place, thanks to its stronger type improvements and better abstractions over C.

Like any systems programming language, C will only get replaced if the operating systems vendors force developers to use something else.

This is what Microsoft is doing by transitioning Visual C++ to a pure C++ compiler.

UNIX vendors will never do it because C is synonym of UNIX. All even C compilers get to be written in C++ nowadays.

Who knows what other OS vendors might still be relevant.