Enter Maestro, a unix-like monolithic kernel that aims to be compatible with Linux in order to ensure wide compatibility. Interestingly, it is written in Rust. It includes Solfége, a boot system and daemon manager, maestro-utils, which is a collection of system utility commands, and blimp, a package manager. According to Luc, it’s creator, the following third-party software has been tested and is working on the OS: musl (C standard library), bash, Some GNU coreutils commands such as ls, cat, mkdir, rm, rmdir, uname, whoami, etc… neofetch (a patched version, since the original neofetch does not know about the OS). If you want to test it out, fire up a VM with at least 1 GB of ram.

  • IrateAnteater@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    68
    arrow-down
    3
    ·
    1 year ago

    Ok, I’m out of the loop and I’ve seen this often enough that I have to ask; why do people always bring up “written in rust”? No one points out that a given project is written in C++/C#/python/ruby etc, yet we keep seeing it for rust.

    • xantoxis@lemmy.world
      link
      fedilink
      English
      arrow-up
      104
      arrow-down
      1
      ·
      1 year ago

      If you want a real answer, it’s mostly advocacy, the same reason Linux enthusiasts show up to every negative-sounding Windows thread to tell you to install Linux instead. And if it is less obnoxious, it’s only because there’s fewer Rust enthusiasts.

      There are, also, advantages to a Rust implementation that you can claim simply by virtue of something being implemented in Rust, as entire categories of problem that cause C projects to hemorrhage security vulnerabilities simply don’t exist for Rust.

      But mostly it’s people wanting you to be excited about and interested in Rust.

      • IrateAnteater@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        15
        arrow-down
        1
        ·
        1 year ago

        Is there something inherently safer with how rust does things, or is it just a case of it being new, so the vulnerabilities haven’t been found yet?

        • hperrin@lemmy.world
          link
          fedilink
          English
          arrow-up
          80
          ·
          edit-2
          1 year ago

          Yes, it is inherently safer than C. Unless you write code in an unsafe block, Rust will handle many aspects of memory allocation and management for you, and ensure their safety. It is memory safe and thread safe by default.

          C doesn’t have any of these safety checking features, so it would be equivalent to unsafe Rust, but all the time. It lets you do whatever you want with pointers for example, including making them point outside of the memory bounds. In program code, this will cause an illegal memory access exception, but in kernel code, all memory access is legal. Therefore, you could write a driver that accidentally overwrites the kernel’s own code in memory. That would likely cause a kernel panic and bring the whole system down. Whereas, in Rust, you can only do that within an unsafe code block.

          • wikibot@lemmy.worldB
            link
            fedilink
            English
            arrow-up
            10
            arrow-down
            2
            ·
            1 year ago

            Here’s the summary for the wikipedia article you mentioned in your comment:

            Thread safety is a computer programming concept applicable to multi-threaded code. Thread-safe code only manipulates shared data structures in a manner that ensures that all threads behave properly and fulfill their design specifications without unintended interaction. There are various strategies for making thread-safe data structures.A program may execute code in several threads simultaneously in a shared address space where each of those threads has access to virtually all of the memory of every other thread. Thread safety is a property that allows code to run in multithreaded environments by re-establishing some of the correspondences between the actual flow of control and the text of the program, by means of synchronization.

            article | about

        • magic_lobster_party@kbin.social
          link
          fedilink
          arrow-up
          28
          ·
          1 year ago

          Rust has many safeguards against some common errors that may cause security vulnerabilities. It’s by no means bulletproof against all vulnerabilities, but it’s something.

        • Sentient Loom@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          12
          arrow-down
          1
          ·
          1 year ago

          I only know the hype. But the hype says that Rust’s ownership system makes memory usage much safer by forcing the coder to deal with data. Your values will eventually go out of scope, and you have to dictate when that will happen or else it won’t compile.

          …or something like that.

        • bacon_pdp@lemmy.world
          link
          fedilink
          English
          arrow-up
          6
          arrow-down
          18
          ·
          1 year ago

          Well rust has a borrow checker which does make some memory bugs harder to create but to say that rust solved any of the known open problems in computer security. The answer is clearly no. It just copied some good ideas from ocaml into C++ and got some good marketing.

          borrow checkers also already exist for C/C++/etc [just most people don’t use them]

          so, slightly safer defaults than C/C++ but doesn’t contain any new/unique security magic.

          • nickwitha_k (he/him)@lemmy.sdf.org
            link
            fedilink
            English
            arrow-up
            30
            ·
            1 year ago

            I feel like this is an example of innovation vs invention. Rust did not invent borrow checking. It did, however, make the borrow checker an integral part of the language and compiler. Making memory safety the default behavior is innovative and makes it the path of least resistance.

            Memory safety issues are responsible not just for crashes and perf degredation but are a significant attack vector for exploits. Making it harder to land there makes these exploitable conditions less common. The mechanism is not unique but its integral place in the language is.

            • barsoap@lemm.ee
              link
              fedilink
              English
              arrow-up
              8
              ·
              1 year ago

              It kinda really pioneered its particular kind of memory management. There’s some theoretical ancestry involving ML-based research languages with region typing, stuff like this, but those are ultimately quite different. The rest of the type system is basically a cut-down Haskell (Hindley-Milner with qualified types (typeclasses/traits)), with some minor titbits and fiddling.

            • bacon_pdp@lemmy.world
              link
              fedilink
              English
              arrow-up
              2
              arrow-down
              15
              ·
              1 year ago

              not exactly, as there are rust compilers like mrust that don’t actually have borrow checkers and virtually none of those safety checks actually occur and there is a question of if the gcc rust compiler would be implementing that feature into the compiler.

              So, that would be an attribution failure; as it isn’t required by the language but the most popular rust compiler does include that feature.

              But yes, more compilers would likely benefit the languages they support by also adopting that feature by default.

              • QuaternionsRock@lemmy.world
                link
                fedilink
                English
                arrow-up
                12
                ·
                edit-2
                1 year ago

                Borrow checking is part of the language specification, and a compiler that does not include it is, by definition, incomplete. The authors of mrust even state this in the project README.

                Your claim is roughly equivalent to saying a C compiler which does not produce an error when a program calls an undeclared function means that C as a language does not ensure that your code doesn’t call functions that don’t exist - i.e., nonsense at worst, and irrelevant at best.

    • magic_lobster_party@kbin.social
      link
      fedilink
      arrow-up
      56
      arrow-down
      5
      ·
      1 year ago

      Programmers are hyped about Rust. It’s a programming language that has a legitimate chance to replace C and C++ for performance critical applications. So any new project in Rust increases the possibility of a future where C and C++ are programming languages of the past.

      • dewritoninja@pawb.social
        link
        fedilink
        English
        arrow-up
        5
        arrow-down
        3
        ·
        1 year ago

        Imo rust won’t replace cpp without true Oop so I might just make my own objective rust and piss off Oop haters

        • barsoap@lemm.ee
          link
          fedilink
          English
          arrow-up
          11
          arrow-down
          2
          ·
          1 year ago

          There has been no true OOP language since smalltalk, which btw wasn’t class-based.

          In practical terms Rust has subtyping – barely, at least in technical terms the only thing that uses true subtyping is lifetimes. In practical terms you have qualified types (aka traits) supporting interface inheritance which is perfectly proper as everybody knows that you shouldn’t inherit implementation as the Liskov Substitution Principle is undecidable.

          “Language X will fail because it’s not OO” what’s this, the early 00s? I thought we left that hype train behind.

      • HulkSmashBurgers@reddthat.com
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        I’ve never used rust but as you say it really does seem like a good successor to c/c++. It’s a modern, more memory safe programming language shat allows you to dig into the weeds if you need it.

    • devfuuu@lemmy.world
      link
      fedilink
      English
      arrow-up
      27
      arrow-down
      5
      ·
      1 year ago

      Because rust is the modern low level systems language, which means it gotta go fast without all the freaking problems of the only other real alternative so far that was C. The languages you list don’t even play in the same ballpark.

      • CapeWearingAeroplane@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Honest question from someone using C++, though not for systems- or embedded stuff, just for object oriented models that gotta go fast: Why is C++ not in the same ballpark, and not an alternative?

    • CaptDust@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      16
      arrow-down
      1
      ·
      edit-2
      1 year ago

      Mentioning it’s written in rust should imply this code base will have secure concurrency, better memory handling, be easier to extend, while maintaining near C++ performance. None of these are guarantees, but considering so many rust projects are “C/C++ programs, rewritten” it seems worth calling out as a differential. The language’s advantages extending to the kernel make it an interesting project.

    • Ricky Rigatoni@lemm.ee
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      4
      ·
      1 year ago

      Yes they do? All the time? To the point where github has a bar on every project page showing what percentages of every project is written in which languages?