Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 18 submissions in the queue.
posted by Fnord666 on Friday November 10 2017, @06:23PM   Printer-friendly
from the C,-C-Rust,-C-Rust-Go,-Go-Rust-Go! dept.

In which ESR pontificates on the future while reflecting on the past.

I was thinking a couple of days ago about the new wave of systems languages now challenging C for its place at the top of the systems-programming heap – Go and Rust, in particular. I reached a startling realization – I have 35 years of experience in C. I write C code pretty much every week, but I can no longer remember when I last started a new project in C!
...
I started to program just a few years before the explosive spread of C swamped assembler and pretty much every other compiled language out of mainstream existence. I'd put that transition between about 1982 and 1985. Before that, there were multiple compiled languages vying for a working programmer's attention, with no clear leader among them; after, most of the minor ones were simply wiped out. The majors (FORTRAN, Pascal, COBOL) were either confined to legacy code, retreated to single-platform fortresses, or simply ran on inertia under increasing pressure from C around the edges of their domains.

Then it stayed that way for nearly thirty years. Yes, there was motion in applications programming; Java, Perl, Python, and various less successful contenders. Early on these affected what I did very little, in large part because their runtime overhead was too high for practicality on the hardware of the time. Then, of course, there was the lock-in effect of C's success; to link to any of the vast mass of pre-existing C you had to write new code in C (several scripting languages tried to break that barrier, but only Python would have significant success at it).

One to RTFA rather than summarize. Don't worry, this isn't just ESR writing about how great ESR is.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 0) by Anonymous Coward on Saturday November 11 2017, @03:20AM (2 children)

    by Anonymous Coward on Saturday November 11 2017, @03:20AM (#595473)

    Not only does C++ provide suitably low-level access to hardware, but it also provides a fairly strict type system and robust abstraction facilities.

    What with modern syntactic sugar and a push to include in the standard library most of the kitchen, why isn't C++ the potential heir?

  • (Score: 3, Informative) by RamiK on Saturday November 11 2017, @12:41PM (1 child)

    by RamiK (1813) on Saturday November 11 2017, @12:41PM (#595564)

    C\C++ is cross-compatible to modern hardware in the same way Intel's x86 MOV instruction is Turing complete or CRISPR is suitable for carpentry. It's technically true. But oh God...

    But lets put aside what any google search for "why C++ is bad" can yield and give some concrete examples of why C\C++ is starting to build some rust that won't be easily removed:

    1. Read through https://www.cl.cam.ac.uk/~dc552/papers/asplos15-memory-safe-c.pdf [cam.ac.uk] carefully. Other approaches to bounded pointers like NV-RISC similarly can't really work around these issues either. Only Mill's belt machines are claimed to solve the harder problems without significant user-land rewrites (and indeed they're using C++). Though the compilers still need a lot of work and using linux on them will be an abysmal waste even if you can get the performance. Regardless, if Java taught us anything, it's that many software developers, companies and governments will go to extraordinary lengths to avoid vendor lock. Either way, since Go (re)moves the memory addressing details to the unsafe package and the compiler, it should become cross-platform between different fat pointers solutions even at the kernel level let alone the user-land where C\C++ definitely won't.

    2. Look up how C++11 atomics tied the x86 and C++ threading together (One example: https://stackoverflow.com/questions/29922747/does-the-mov-x86-instruction-implement-a-c11-memory-order-release-atomic-store [stackoverflow.com] ). This already led to rewrites for ARM. I can't even imagine how they're going to sort through this mess for newer machines.

    3. Hardware-assisted Garbage Collection: There been a few papers since around 2007 all proposing different mechanism to get stop-less, cheap and concurrent GC through the hardware. One recent and less invasive approach being https://people.eecs.berkeley.edu/~maas/papers/maas-asbd16-hwgc.pdf [berkeley.edu] . Whichever you choose, manually freeing memory will become less and less relevant when even the kernel end up using GC.

    Anyhow, there are better examples and better articulated papers covering these points but I think it's clear how C\C++ is not ideal for the task where modern languages are. Again, I believe C\C++ can be twisted to any hardware you'd like. But once you're dealing with Google coming up with their own capability-based design, Microsoft coming out with another one, Intel with a third machine and Apple with a 4th... Well, you start needing languages that move the low-level memory details to the compiler and let you write code you can actually execute on different platforms without rewrites or reading through book sized specs detailing undefined behavior at least in the user-land.

    Overall, I'm not saying people won't run plenty of C\C++ on the newer platforms for years to come. But there are real hardware reasons that go beyond wishful thinking and language features to make me believe ESR is correct in saying C++ is is losing its appeal with system development in the same way it lost its place to Java with business oriented application development even if I don't have exact figures to prove this.

    --
    compiling...
    • (Score: 0) by Anonymous Coward on Saturday November 11 2017, @03:41PM

      by Anonymous Coward on Saturday November 11 2017, @03:41PM (#595604)

      I'll definitely look into those points further.

      However, the C++ community really prides itself on providing a language and a set of libraries that can both provide useful degrees of abstraction and squeeze out every last cycle for performance; while old code might need a re-write, I bet that C++ will provide the tools necessary to handle with ease any such new hardware features, and it will be just like having a brand new language, yet one that builds atop an existing one.