← Back to context

Comment by starspangled

10 months ago

Nothing in Linux is "here to stay", it always has to demonstrate its worth, and what it's worth is depends enirely on the technology and its developers, not Linus.

Perhaps C is here to stay and that is the way Linux should live and naturally die. That's what's being proposed here by the guy who opposes multi-language projects.

  • That's my overall point of view too. Regardless of infinite technical discussions about one or another, if Alice and Bob can't live together than just don't get married.

    Why spend all this energy on conflict and drama to no end? If one language/technology/group is so much better then just fork the thing and follow their own path.

    I'm actually not defending the C guys, I just want to leave them alone and let "Nature" take his course, if they die on obsolescence, then they die. who cares..

    • I concur. Personally, I'd love to see all the Linux Rust effort being redirected at Redox OS.

      If the Asahi team focused their efforts on Redox, with all the genius talent they they have, we could see an actually practical, usable implementation of Redox on real hardware; a potential daily-driver which would catapult the development of whole ecosystem - and that can only be a good thing.

      2 replies →

  • Most UNIX systems that were not implemented in C, and thus lacked the symbiotic relationship, never survived in the market, sadly.

    There have been UNIX systems implemented, Pascal, Ada, Modula-2, Modula-3, as the most relevant ones.

    All gone.

    Also note that POSIX/UNIX certification requires a C compiler presence.

    • Market failures of the other Unices aren't necessarily related to the technical advantages or disadvantages or symbiosis with C or being implemented in C. However, making C programmers' life easier was crucial.

      Linux was at the correct place at the correct time. It was the only free version of Unix-like OSes that didn't have legal bullshit to deal with. IBM and Intel's support also made GNU/Linux ecosystem successful, without them it would stay as an academic project. Being free meant that it had an advantage where price sensitivity mattered and dotcom boom and VC explosion is very sensitive to cheaping out and preffers suffering with less-than-ideal software. So Linux stayed popular while other ones died slowly.

      C had a huge following and all OSes had to support it. Simplicity made it popular when average hardware at the hands of many academics and young professionals was very weak. Being written in C may have made things marginally easier but neglecting it for Ada or Pascal was a terminal mistake. Windows isn't Unix at all but it also had to support C well.

      1 reply →

    • Linux kernel is also one of the few that do not use C ABI as entry point for user programs at all.

      As for C compiler presence in POSIX, only existence of C-accessible APIs with specific structure are mandated, C compiler is optional just like Fortran runtime and compiler are.

      4 replies →

  • Yes, perhaps a C-only Linux would do that and die, and perhaps it would continue its customization of C flavor and runtime it uses (e.g., the various static and dynamic memory limitations and checkers) and closes the gap with Rust to a point where the incremental benefit of using it is not significant enough that it makes a Rust based competitor an inevitability. We may already be beyond that point, even.

    • The changes required to bring C to a Rust level of safety would make it an entirely different language, even when restricted to the kernel's domain. Also, if you're already doing codebase-specific patches to the language itself, many of the arguments around codebase portability that justify the use of C fall apart.

      Aside from that, there are other benefits to Rust than safety: it's better at modelling data and states, as the now-infamous filesystem talk [0] outlined.

      [0]: https://lwn.net/Articles/978738/

      4 replies →

    • Or may be Zig might be more acceptable to the Kernal team, once it becomes mature enough?

  • This is inevitable: Rust is proposed as a safe language, but there is no way to have a "half-secure" kernel. The only option for people who believe in Rust is to have its own kernel, and Linux should have no part on this.

    • > there is no way to have a "half-secure" kernel.

      There is, and this is how Rust naturally works. If you look at its standard library, you will see a lot of unsafe code or libc calls hidden away under safe interfaces.

      In fact, this is how all memory safe languages work, including Java, Python, etc: A small trusted base written in an unsafe language that exposes a safe interface (i.e. the interpreter, the JVM, etc), with the large majority of the code written over that safe interface (i.e. the Java/Python code).

      Rust is used to make kernel drivers secure by providing a safe interface for them to use.

  • Keeping the project single language doesn't mean that the project can't change. The C used today is not the same C used when when the project was started. Changing language is also possible. Using two different languages long-term however means that everyone effectively needs to be proficient in both languages and a lot of work is duplicated.

Would you say that C is "here to stay" in Linux? I would say so. I think you understood what was meant.

  • The drama is the problem, not rust. I don't know why, but either zealots choose rust or rust induces zealotry.

    Its exactly what Linus said.

    • >. I don't know why, but either zealots choose rust or rust induces zealotry.

      That is actually quite well put together. May be The language that introduce absolute control also induces zealotry and produce zealots.

      However that doesn't happen with Ada. So that cant be the full explanation.

  • No I wouldn't say that. If Rust or another language eventually proved itself more value than C and things were eventually all rewritten, C would go away.

    For that matter the C of Linux 10 years ago was not there to stay either, it has changed and certain features and practices are deprecated and dropped and others adopted. It's not the same C.

DEC Alpha support is somehow still in the mainline Linux kernel...

  • Yeah m68k is still around too and it has more than a decade on alpha.

    People use and maintain them and they have very little impact outside arch/ nowadays so they're on the happy side of cost/benefit I guess.

    • I guess the biggest difference is that Coldfire parts are still being produced (c.f: MCF52256CVN66).

      I'm not sure if Alphas are even being made anymore, even 15-20 years ago.

    • M68k has the advantage that it has a fairly typical memory model.

      Alpha's memory model has problems with providing atomic access to single bytes, which i'd imagine in a kernel is a bit annoying :-)

      And then there's just the social aspect, m68k was used in the Amiga/Atari/Mac/QL/x68k, so there is a whole generation of us m68k fans who are willing to keep it alive.

      Alpha has it's fans (me included!), but it's not exactly the same. So in a way it's no surprise it's slowly bitrotting away.

      2 replies →