Announcement

Collapse
No announcement yet.

XCP-ng Initating Effort To Rewrite Xen Components In Rust

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    no rush no rust

    Comment


    • #12
      Originally posted by archkde View Post
      I can get rewriting C, or maybe Python if performance is an issue, components in Rust. But why Go or OCaml? These are fine languages.
      They are fine languages, but neither can match the performance of Rust. Both are also garbage collected, which makes them unsuitable for certain application areas. Go also doesn't provide the same safety guarantees.
      Last edited by jacob; 18 March 2023, 09:19 PM.

      Comment


      • #13
        Originally posted by lucrus View Post
        But... why "Riir"? I mean, I don't know Rust and I assume it must be a good thing (TM) since so many C/C++ project move to it, but why rewriting something that already works? Wouldn't be better to just start something new instead? Porting existing code without adding anything new, being forced to keep compatibility with what exists, is among the most boring things a programmer could be asked to do. And it gains you nothing in the short term, so you only delay innovation of your existing product.
        It seems that the Xen devs believe that RIIR will help them in the long run. Maybe it will and maybe it won't, but if maintaining the C code is becoming an issue, then it could be a good idea. After all, rewriting parts of a project is not uncommon, and rewriting C code in Rust is not a worse proposition than rewriting it in C, and probably a better one.

        Comment


        • #14
          Originally posted by patrick1946 View Post

          I am not so sure. Rust is a difficult language by design. For many things Python should be easier.
          Rust has a reputation of being difficult but honestly it's not nearly as bad as it's made out to be. Of course if you are coming from either a Java/C# background, or a C or C++ background and you expect Rust to be pretty much the same with a different syntax and some conveniences here and there, then you will hit a seemingly insurmountable mountain of roablocks. But if you don't try to do C in Rust and instead deliberately try to use Rust idiomatically, keeping in mind that references, scopes and lifetimes mean something very different than in C and C++, and if you buy into the whole approach heavily slanted towards functional programming, then it's really not that hard to get you code past the maniac compiler.

          Comment


          • #15
            Originally posted by jacob View Post

            It seems that the Xen devs believe that RIIR will help them in the long run. Maybe it will and maybe it won't, but if maintaining the C code is becoming an issue, then it could be a good idea. After all, rewriting parts of a project is not uncommon, and rewriting C code in Rust is not a worse proposition than rewriting it in C, and probably a better one.
            It's about fashion. I have seen that so often. I have seen people writing code in C because they disliked C++. I have seen people rewrite C code because C++ with classes was the new thing. People writing Perl because they liked to be seen as smart because nobody understand their code. Now there a people who like Rust and search things they can rewrite. There will be a new languages after Rust because Rust has blind spots too. That is the way.

            Comment


            • #16
              Originally posted by patrick1946 View Post

              It's about fashion. I have seen that so often. I have seen people writing code in C because they disliked C++. I have seen people rewrite C code because C++ with classes was the new thing. People writing Perl because they liked to be seen as smart because nobody understand their code. Now there a people who like Rust and search things they can rewrite. There will be a new languages after Rust because Rust has blind spots too. That is the way.
              This is not some Rust enthusiasts who want to rewrite somebody else's project in Rust just because. This is XCP-ng who decided to rewrite their own code and chose to use Rust for it. There is no fashion nor conspiracy at play.

              Comment


              • #17
                Originally posted by jacob View Post

                Rust has a reputation of being difficult but honestly it's not nearly as bad as it's made out to be. Of course if you coming from either a Java/C# background, or a C or C++ background and you expect Rust to be pretty much the same with a different syntax and some conveniences here and there, then you will hit a seemingly insurmountable mountain of roablocks. But if you don't try to do C in Rust and instead deliberately try to use Rust idiomatically, keeping in mind that references, scopes and lifetimes mean something very different than in C and C++, and if you buy into the whole approach heavily slanted towards functional programming, then it's really not that hard to get you code past the maniac compiler.
                Yes, that I mean by difficult. I really wanted to like Rust but I find Rust quite metaphysical approach not seducing. It is not very pragmatic. I got the impression that it was written by people who dislike C++ and want to develop a better C. I understand that there are bad ideas in C++ but in my view templates are not. They are a very powerful generic implementation and with concepts they got manageable. In Rust in many cases you have to use macros. Even if they are good macros they are to my understanding not typed. This is a big drawback to me. The generics are quite limited too. And then Rust has this hidden exception support with panic. This goes on. I have the impression that it wants to fix the same problems like Java but in a faster way. For that the resource model has to be limited which makes it difficult. I am not sure if that is enough to be called a C++ successor. I am much more inclined to think that it will find it's niche like golang.

                I think the biggest problem of Rust will be that the other languages will not go away. You have to interface too them easily. But if your resource model is different it gets much harder.

                Comment


                • #18
                  Originally posted by patrick1946 View Post

                  I am not so sure. Rust is a difficult language by design. For many things Python should be easier.
                  Depends, as always. Build scripts helpers, and test scripts are usually best left in python. Whatever they are doing in the application maybe be better ported. They didn't mention actually porting the python code for now.

                  Comment


                  • #19
                    Originally posted by patrick1946 View Post
                    ...
                    I think you are correct that Rust is more designed as a successor to C, and not C++. Whether that's good or bad may depend on your personal preferences. In many cases I think something more like Go or C# may be better suited as a C++ successor, or just using future versions of it as it evolves.
                    Last edited by smitty3268; 18 March 2023, 11:24 PM.

                    Comment


                    • #20
                      One thing that I like about Rust is that it allows devs with background in other languages besides C/C++ tap into the same level of perf without needing to learn/handle/deal with C/C++ baggage.

                      There's several blog posts on how python/javascript devs can use rust in performance critical ccod

                      I haven't used C before nor follow it's development closely, but I know about C89, C99 and later versions, you have GNU extensions, the newer auto keyword and so on.

                      Sure the borrow checker can be a PITA, but it is like a English speaker learning a Latin based language, you need to think about things that doesn't exists in English

                      Comment

                      Working...
                      X