Hacker News new | ask | show | jobs
by Chris_Newton 4714 days ago
Whether you like it or not, your world runs on C, C++ and assembly. These languages form the ninety-percent-plus core of modern computing's foundation.

Isn’t that part of the problem? There is no technical reason we couldn’t have a language that offered the same fine control and hardware integration as C, compiled to native executable code in a similar way, but was both safer and more expressive. There is no advantage in having an awkward syntax for specifying types or in making all pointers nullable.

Mainstream industrial languages today are a triumph of good enough, and they continue to dominate primarily because of momentum and the size of the surrounding ecosystem rather than technical merit in the language itself. Unfortunately, this creates a vicious circle that reinforces the status quo, and the few organisations with sufficient resources to break that cycle have limited economic incentive to do so.

2 comments

At least in embedded systems, this looks like something that can be done the open source way. The success of the arduino and the mbed in building popular ecosystems has shown us that.

I can see some better version of the .net micro framework, being improved by the open source community(1), and benefiting from the ms ecosystems and tools, becoming fit for some large part of embedded systems work.

Also I can see this getting adopted since it let's embedded developers in small companies, who has some power on which tools to use, learn another skill that can better their employment opportunities.

(1)improved speed could be achieved through using the cito compiler project, which might be good enough for many projects. And for making the language hard real time, it could be done using specific implementation of reference counting, although at some speed/memory cost.

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.

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.