yes, not a unix os but rather unix-like, and i want to program all of it on python, is that possible?? even the kernel, i want it all python. i know most kernels use c++ or c* but maybe python has a library to turn c* into python?? i’m still sort of a beginner but thanks and i would appreciate the answers

  • litchralee@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    16 hours ago

    While I get your point that Python is often not the most appropriate language to write certain parts of an OS, I have to object to the supposed necessity of C. In particular, the bolded claim that an OS not written in C is still going to have C involved.

    Such an OS could instead have written its non-native parts using assembly. And while C was intentionally designed to be similar to assembly, it is not synonymous with assembly. OS authors can and do write assembly when even the C language cannot do what they need, and I gave an example of this in my comment.

    The primacy of C is not universal, and has a strong dependency on the CPU architecture. Indeed, there’s a history of building machines which are intended for a specific high-level language, with Lisp Machines being one of the most complex – since Lisp still has to be compiled down to some sort of hardware instructions. A modern example would be Java, which defines the programming language as well as the ISA and byte code: embedded Java processors were built, and thus there would have been zero need for C apart from legacy convenience.

    • MajorHavoc@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      10 hours ago

      I have to object to the supposed necessity of C. In particular, the bolded claim that an OS not written in C is still going to have C involved.

      Such an OS could instead have written its non-native parts using assembly.

      Agreed! That’s a great point!

      I appreciate your clarification. Not everything has to run C. It’s just a trend in today’s products.

      I was attempting to humorously reference Monty Python’s Spam sketch, where it seems like everything on the menu has at least a little Spam in it. Every device I could think of, that I’ve toyed with enough to guess what it has running, is running at least a bit of C.

      For an attempt at a counterpoint, I thought of a few devices, like my PineWatch, that run an OS codes entirely written in one language. But… That one language is, of course, C.

      legacy convenience.

      Yeah. I think legacy convenience is, indeed, why there’s C in so many places, even places it doesn’t have to be.

      There’s so many folks with so much hardware driver expertise in C, and they teach our next generation, so I figure that will continue until something really compelling changes their preference.

      I appreciate your point. There are lots of non-C ways to create bytecode. My (amused) point is that we don’t seem very fond of any of those methods, today.