6 ms·
I don't see a future where C survives, not only because of memory corruption bugs (although that's a pretty big one), but also for usability: the lack of packag
by baby 6y ago
I don't see a future where C survives, not only because of memory corruption bugs (although that's a pretty big one), but also for usability: the lack of package manager, common build system, good documentation, good standard library, etc. are just too much to compete with any modern system language.
- forrestthewoods 6y ago> I don't see a future where C survives if C dies then what replaces it?
- nicoburns 6y agoPerhaps a combination of a language like Zig (a 1:1 replacement for situations where you really do want a lot of manual low-level control) and higher-level languages like Rust eating into more and more of the use cases.
- humanrebar 6y agoI don't see C being in much worse shape than C++ with respect to build system and package manager. It's slow going, but progress seems to be happening there. Are you saying both are doomed? Or is there some scenario where C++ survives without C?
- vlovich123 6y agoI think both are, long term (think FORTRAN where it’s not particularly popular but a lot of existing code is maintained and not rewritten). C++ is actually in a slightly better spot ironically because it’s harder to integrate with. If you have a C program you can pretty easily start replacing parts with Rust. You can’t do the same with C++ which insulates it better in that sense.
- ryl00 6y agoReports of Fortran's death (latest standard 2018) are greatly exaggerated (much like C). It's receded to a niche, but it's still a very important niche (numerical, HPC). Hopefully, the development of a new Fortran front end for LLVM (from PGI/Nvidia?) pans out, as this would fill a gap in LLVM's offerings, and provide more competition for ifort and gfortran.
- vlovich123 6y agoYou’re proving my point. FORTRAN is a niche language. C++ is still mainstream. It will recede but not completely disappear
- baby 6y agoI don’t see a great future for C++ either
- edoceo 6y agoThose are features which makes C flexible on main-stream platforms and also usable for so many other platform where other languages just don't/won't work.
- pjmlp 6y agoThose features are not unique to C, they are just cargo culted as such.
- pjmlp 6y agoUnfortunely until we get rid of UNIX/POSIX clones, C will be kept around. So not in my lifetime.
- mark-r 6y agoOr at least not in Torvalds' lifetime. His views on replacements for C are legendary. It would be interesting to see his comments on this proposal.
- ratww 6y agoTorvalds himself might have a different opinion: People have been looking at that for years now. I’m convinced it’s going to happen one day. It might not be Rust, but it’s going to happen that we will have different models for writing these kinds of things https://thenewstack.io/linus-torvalds-on-diversity-longevity-rust-and-arm-chips/ https://thenewstack.io/linus-torvalds-on-diversity-longevity...
- deleted 6y ago[deleted]
- fortran77 6y agoC will survive, if just for embedded/systems programming where you need a "portable assembly language" that can run on the simplest CPUs.
- mhh__ 6y agoThat's because of sunk-cost rather than design. Thanks to LLVM and GCC you can happily write embedded code in a higher level language, but the vendors don't bother supporting it because a lot of embedded coding isn't really what we would call software (no tests etc.)
- unsatchmo 6y agoThe higher level languages are kind of the problem though. I need things like the ability to know the layout of my structs.
- mhh__ 6y agoRust, D, Whatever let you control the layout of your struct.
- ComputerGuru 6y agoEven C#, actually!
- snovv_crash 6y agoToolchains are one side, but garbage collection and big standard libraries are also a big reason. Anything with under a MB of RAM has a choice of several modern languages, but it is still basically just C, C++, Rust, Lua or MicroPython.
- mhh__ 6y agoD works fine on microcontrollers. I don't think anyone was going to write their fridge's code in Haskell anyway.
- ajsnigrutin 6y ago> I don't see a future where C survives I've been seeing those exact words for decades now, and C is still going strong. Every few year a new language comes, somes writes something in it, that was written in C before, someone might even write a basic OS in it, and after a few years, that language is almost forgotten, a new one is here, and again, someone is writing something in it, but in the end, we still use C for the things we used it 10, 20, for some, even 30 years ago.
- diegocg 6y agoUsage of C in new projects has fallen dramatically in the latest decades. It used to be the case that C was considered a general purpose programming language and applications such as Evolution were written in it. Today big applications in C are increasingly rare, and Rust is only accelerating this trend - nobody wants to have buffer overflows anymore.
- Skunkleton 6y agoDo you have a citation? Genuinely curious.
- blogant 6y ago> lack of package manager, common build system, good documentation. This is where C is superior to virtually every other language. It has K&R to start with [1], a wealth of examples to progress from there, man pages, autotools, cmake, static and shared libraries. > good standard library. It should have hash tables at least, but it isn't bad. [1] Which is still the best language book ever written (yes, it has some anti patterns, you unlearn them quickly).
- johnisgood 6y ago> It should have hash tables at least https://man.openbsd.org/ohash_init.3 https://man.openbsd.org/ohash_init.3
- ComputerGuru 6y agoWhat of it? > Those functions are completely non-standard and should be avoided in portable programs.
- johnisgood 6y agoSure, it has not been standardized, it is not part of the standard library, so what? Did the world stop? I mean, practically speaking, who cares? Implement it, or find libraries that did. There are plenty. I posted this one because it exists for an OS; OpenBSD, since 1999. Plus, AFAIK ohash is portable enough. It consists of 2 files, and you can compile it with -std=c89. Only the bounded attribute is ignored. If you want I could have brought up hcreate, hdestroy, and hsearch: > The functions hcreate(), hsearch(), and hdestroy() are from SVr4, and are described in POSIX.1-2001 and POSIX.1-2008. Happier?
- ComputerGuru 6y agoI use stb myself, so I have no qualms with that. The point is rather that GP was discussing praise for C’s standard library, and even the most portable single-file include-only dependency remains just that: an external dependency that isn’t part of the C standard library (and no, posix isn’t C).
- non-entity 6y agoAs much as I dislike C > There are only two kinds of languages: the ones people complain about and the ones nobody uses. This unfortunately seems to mostly hold true.
- unsatchmo 6y agoPorque no los dos? There are a few languages that nobody uses and also everybody seems to complain about.
- non-entity 6y ago> mostly
- saagarjha 6y agoMUMPS.
- yesenadam 6y agoComplaining about language doesn't seem off topic here: "Porque" means Because. "Por que" means Why.
- dependenttypes 6y ago> the lack of package manager Just use nix or even apt. Both of them are MUCH better when compared to trash like npm or cargo which do not even check for signatures. > common build system Such as make? There is also Ninja/Meson if you prefer.
- samatman 6y agoSQLite alone has a support contract through 2050. C survives.
- rumanator 6y ago> I don't see a future where C survives Meanwhile C is running strong since the 70s. > the lack of package manager What do you call linux distro's package managers then? I mean, in distributions like Debian you can even download a package's source code with apt-get.
- ImprobableTruth 6y ago>What do you call linux distro's package managers then? If you want to count them as package managers, they're by far the worst ones of all the well known languages (with some notable exceptions e.g. guix's and nixos's). They're not portable between distributions or even different versions of the same distribution (!), since it's non-trivial to install older versions of libraries (or, hell, different versions of the same library at the same time). Not to mention that it's a very manual and tedious process in comparison to all the other language specific package manager. 'Dependency hell' is a problem virtually limited to distro package managers (and languages like C and C++ that depend on them). Getting older, unmaintained C programs to run on Linux is an incredibly frustrating experience and I think a perfect demonstration of how the current distro package manager approach is wholly insufficient.
- account42 6y ago> If you want to count them as package managers, they're by far the worst ones of all the well known languages (with some notable exceptions e.g. guix's and nixos's). The have the only feature I care about: cross-language dependency management. Unless you are suggesting to reimplement everything in each language and then make users install ten different XML parser, SSL implementations, etc. just because not-implemented-in-my-favorite-language syndrome.
- pjmlp 6y agoOnly on platforms where UNIX is the name of the game.
- knaq 6y agoI definitely like the "lack of package manager, common build system". For me, having those is a negative for a language like rust. You see, my OS already comes with those, and I expect to use them. I have the Debian package system: dpkg, apt, aptitude, and so on. It's a big mess when other software tries to steal that role. I have the traditional build systems and more: make, cmake, autoconf, scons, and so on. If I'm building a large project with multiple languages, I'm going to use one of those tools. If a language wants to fight me on that, I'm not interested in that language.