Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Microsoft Software Programming

Microsoft Seeks Rust Developers To Rewrite Core C# Code (theregister.com) 77

An anonymous reader shares a report: Microsoft's adoption of Rust continues apace if a posting on the IT titan's careers website is anything to go by. Although headcount at Microsoft might currently be down -- by two percent compared to the previous year -- recruitment persists at the Windows giant. In this case, the company is forming a team of Rustaceans to tackle a platform move away from C#.

The job, a principal software architect for Microsoft 365, has responsibilities that include "guiding technical direction, design and implementation of Rust component libraries, SDKs, and re-implementation of existing global scale C# based services to Rust." According to the post, the job lurks within the Substrate App Platform group, part of the Microsoft 365 Core Platform organization. The Substrate does the heavy lifting behind the scenes for Microsoft's cloud services, making a rewrite into Rust quite a statement of intent. Microsoft said: "We are forming a new team focused on enabling the adoption of the Rust programming language as the foundation to modernizing global scale platform services, and beyond."

This discussion has been archived. No new comments can be posted.

Microsoft Seeks Rust Developers To Rewrite Core C# Code

Comments Filter:
  • by Press2ToContinue ( 2424598 ) on Thursday February 01, 2024 @11:20AM (#64205974)
    Microsoft embracing Rust: because rewriting code is always more fun the second time around.
    • by binarylarry ( 1338699 ) on Thursday February 01, 2024 @11:33AM (#64206024)

      Nothing succeeds like a full rewrite.

      Guaranteed success, can't fail.

    • by keltor ( 99721 ) * on Thursday February 01, 2024 @12:35PM (#64206172)
      TBF, some of the OS C# code appears to have severe performance issues and for various reasons. Now there's a new System Programming language that's much safer than C++/C that the C# code replaced but much closer to the performance of well written C++/C code (and like C++, often faster than C for highly parallel vector code.)
      • by Z00L00K ( 682162 ) on Thursday February 01, 2024 @03:14PM (#64206640) Homepage Journal

        At least now there's a good reason. Just rewriting everything done in C# don't make sense, but rewriting parts where performance matters while being safer than C matters.

        It could of course have been any other language as well, it just happened to be Rust that did fulfill the demands.

        For performance I have however seen that the architecture matters more than anything else. It doesn't matter how sharp the language is if you have a bad architecture.

        • by keltor ( 99721 ) * on Thursday February 01, 2024 @03:22PM (#64206668)
          There was a guy I worked with who hated VB6 and would rag on it all the time. One of his applications was the internal check writing system. Someone decided the Enterprise Software and "Client Services Software" would belong to separate VPs and so he had to hand off his app. His app was written for 32 bit DOS and so I ultimately had to port it and re-write it, so I rewrote in VB6. And the best part is that his app was notorious for being slow for no apparent reason, so I rewrote a K&R C terminal application to VB6 GUI and it was much much faster. He ended up throwing a fit about the whole thing and refusing to ever talk to me again (for like 5 years.) Unnecessary recursion is the bane of all software.
          • by narcc ( 412956 )

            I'm one of the few people here who will argue that VB was an important tool, particularly for the time. It had a poor reputation, however, when it came to performance. Sure, by today's standards it was lightening quick, but no one back then would have believed it could beat a terminal app written in C.

            I don't know what kind of horrors you found lurking in that old C program, but I suspect that modern developers would have felt right at home with it.

            He ended up throwing a fit about the whole thing and refusing to ever talk to me again (for like 5 years.)

            People used to feel shame and embarrassment when their sho

        • If performance is the issue, changing the language would have a minimal effect at best. The real area to investigate is changing the algorithm. Altering the Big O of the algorithm is where the gains are obtained.

          • Discord famously switched from go to rust specifically for the performance gains. The most important gain was from ditching the garbage collector, but they already noted gains outside of GC pauses before they had even optimized their rust implementation.

            • by Z00L00K ( 682162 )

              In my opinion a garbage collector is just a tool for managing less than optimal memory management.

              I started coding C on MS-DOS (that was masochistic) and then when I did malloc/free I did realize that the order that you do the free has to be exactly the inverse of the order you did malloc to avoid memory fragmentation. Otherwise the program suddenly couldn't allocate more memory because the pointer for free memory start had moved up in memory and wouldn't find the first free memory fragment. There was as I

              • So malloc/free works like a stack? But that means that it would also be possible to just write your program using only functions and local stack allocation.
                • by Z00L00K ( 682162 )

                  In MS-DOS it does. But for systems with more advanced memory management then it's not really an issue even though you'd get memory fragmentation. But if it works for MS-DOS it's no penalty when it runs on a more advanced system.

                  Local stack allocations do have some limitations. One is that you can't pass data between threads on a shared memory area as easily.

                  So both methods have their advantages and disadvantages.

    • When was the first rewrite?

  • Microsoft's hiring (and firing) practices don't lead to them hiring (and retaining) the best personnel, so they have to try to fix the problem technically.

    GLWT.

    • Re: (Score:3, Interesting)

      by gweihir ( 88907 )

      Indeed. Also, clearly their real problems are in architecture and design, so this will not fix anything, really.

  • by Viol8 ( 599362 ) on Thursday February 01, 2024 @11:31AM (#64206012) Homepage

    ... that virtual machine languages are simply not up to it performance wise for heavyweight use. Not just C#, but Java 30 years after it was created is still relatively slow compared to modern C++ (no JIT doesn't help much except in specific circumstances) and a horrendous memory hog.

    I'm a bit surprised they're going with Rust not because there's anything wrong with it per se, but because it seems the language is still at the dotting the i's and crossing the t's stage of its design. Modern C++ (read 2017 onwards) has pretty much all the advantages of Rust plus familiarity amongst devs and the dev tooling to go with it not to mention all the libraries available for it both public and no doubt internal to MS.

    • by keltor ( 99721 ) *
      Rust isn't new internally at Microsoft though. And C++ outside of the Core OS team is actually probably not as common as one would expect. Dwizzle, the guy in charge of OS Security has big on Rust for a long time.
    • > virtual machine languages are simply not up to it performance wise for heavyweight use

      Why couldn't they make a C# native compiler? It would compile C# directly to x86 or ARM machine code. That seems an easier to job than rewriting the top level app code.

      Is it because some features assume byte-code? Reflection, I'm guessin'. But maybe only those parts need rewriting instead of everything. Depends on coding style I suppose. (Reflection is a language smell anyhow, in my book. Use real data structures, the

      • There have been several successful and not super successful efforts to compile C# more natively, but yes, those things you mentioned make it not so easy.

        • by keltor ( 99721 ) *
          .NET Native even retains reflection.
          • Yes, at some cost, I don't remember really.

            I'd love to see an implementation that got rid of garbage collection altogether in favor of more deterministic implementation. Unity (3D) uses a weird version of C# called High Performance C# that has no classes, only structs, with no allocations, and so no GC but a very limited API surface.

            HPC# works, but it's ugly. Really it just proves that Microsoft needs to just replace C# with another language. I personally like Zig, which compiles very quickly and is easy

            • Unity (3D) uses a weird version of C# called High Performance C# that has no classes, only structs, with no allocations, and so no GC but a very limited API surface.

              I'm not sure if I understand you correctly, but Unity most certainly does use garbage collection:
              https://docs.unity3d.com/Manua... [unity3d.com]

              And classes:
              https://docs.unity3d.com/Manua... [unity3d.com]
              MonoBehavior, GameObject and ScriptableObject are base classes practically every Unity game inherits. You can use plain C# classes as well but they cannot reference in-game objects (but game objects can include/call them).

      • by keltor ( 99721 ) * on Thursday February 01, 2024 @03:30PM (#64206684)
        There's .NET Native since VS 2015. This is also a full architectural level rewrite of code that's probably constantly called and yet was written as a traditional web service type application (and possible not even written as a web service originally.) This is probably code were it's called billions of times a second across all of M365 and so savings here will represent huge cost benefits. I recently ported a Python Web Module to C++ in a similar way (but not the same scale) and the net savings was around $100k/month in cloud costs.
    • Re: (Score:1, Informative)

      C++ has undefined behavior and inconsistencies abound (error prone). Also, the exceptions mechanism doesn't make it a particularly useful systems programming language. Oh, yes, you can turn exceptions off, but in such cases there's no viable replacement and you simply get something useless when otherwise an exception would have occurred. Also, have you ever had the luxury of debugging templates or macros?

      Rust, has none of the issues of C++, with everything that made C++ good implemented the right way. With

      • by Anonymous Coward
        Wow, spoken like someone who has 0 knowledge or C++ or systems programming.
      • Huh? What are you babbling about? The exceptions mechanism has nothing to do with systems programming, it's purely a language feature. In *nix all system errors are passed by an API function return code or a signal.

  • by iggymanz ( 596061 ) on Thursday February 01, 2024 @11:33AM (#64206022)

    Rust isn't standardized, Microsoft will take effectively it over and make their version of it... just like C-sharp it'll be a MIcrosoft thing.

    bye bye Rust

    • by Viol8 ( 599362 ) on Thursday February 01, 2024 @11:53AM (#64206064) Homepage

      TBH its about time *someone* standardised it. Rust has the potential to be a fine language but the constant changes arn't doing it any favours.

      • What are you even talking about? The only thing that really changes at all is the ABI. Additions to the language are made but they never break anything. Everybody basically just uses the C ABI if they even need one at all, which is easy to do in rust, all you really have to do is add repr and no_mangle tags to whatever structures and functions you want to expose.

    • by keltor ( 99721 ) *
      Rust has what are called editions, those are standardized targets for Rust, 2015, 2018, and 2021 are the current editions. Microsoft has also been involved in Rust for years without taking over. Same with clang and a million other projects. They have taken over projects though, but I think more because they hired one of the leaders and were like 99% of the users of the projects.
      • Agreed mostly. I think Rust team learned from looking at the glacial pace of C standards and their failure to address issues vs. the infamous Python 2.x/3.x leap and have struck a good compromise.

        None of that bars the possibility of MS Rust becoming a thing, and developers needing to maintain an ever-growing file of Rust's equivalent of #ifdef until it gets ugly; but at least for now it seems like there's enough community outside of MS for that to not be a thing. The other FAANG 800 lb. gorillas probably

        • by KlomDark ( 6370 )
          It's not FAANG anymore, it's MANGA
          • But the G is an A? MAAAN, ANAMA, MANAA. All these could be one. Also these last two sentences were for the caps filter, its like YELLING.

        • by narcc ( 412956 ) on Thursday February 01, 2024 @05:21PM (#64206984) Journal

          I think Rust team learned from looking at the glacial pace of C standards

          That "glacial pace" is a very good thing if you're interested in very long-term stability.

          vs. the infamous Python 2.x/3.x leap and have struck a good compromise.

          Python still makes endless breaking changes. Some of us need our code to last longer than a neglected houseplant.

          • That "glacial pace" is a very good thing if you're interested in very long-term stability.

            Rust hasn't sacrificed anything there.

            • by narcc ( 412956 )

              Rust isn't even ten-years-old. You have no idea what you're talking about.

              • Rust isn't even ten-years-old. You have no idea what you're talking about.

                You're not supposed hyphenate that unless you're using it as an adjective. Nevertheless, if you count the 1.0 release, then sure, it's about 9 years old. However I have to ask, when has any backwards compatibility ever been broken? Examples please.

                Oh wait, you're that guy who said he is tired of getting kicked in the face after he licks boots, after he just said there's a boot on my neck, or something. My gross income was $265k last year, and I just got a $12k pay bump last month with another one coming thi

                • by narcc ( 412956 )

                  I have to ask, when has any backwards compatibility ever been broken? Examples please.

                  That wasn't my claim, but whatever. It happened almost immediately. Between 1.0 and 1.1 [github.com]

                  My point, obvious to everyone with an IQ above room temperature, was that Rust isn't old enough to make any claims about long-term stability.

                  Like I said, you have no idea what you're talking about. You need to learn your place, close your mouth, bow you head, and listen to your betters.

                  • My point, obvious to everyone with an IQ above room temperature, was that Rust isn't old enough to make any claims about long-term stability.

                    And my comment remains the same: Rust hasn't sacrificed anything here. That bit you linked to had an opt-out mechanism (no longer even relevant at that per the edition marker) and caused all of nobody to have to make any significant changes. C++ can't even claim that. Besides, what is your goalpost for "long enough"?

                    Like I said, you have no idea what you're talking about. You need to learn your place, close your mouth, bow you head, and listen to your betters.

                    So then why are you even here? Aren't you supposed to be licking something right now? It's not my fault you keep getting kicked in the face per your own admission. You chose to do that after all

                    • by narcc ( 412956 )

                      And my comment remains the same

                      That's because you're really stupid.

                      Again, you don't know what you're talking about here.

                      So then why are you even here?

                      To remind you that you're ignorant trash and to let other people know that your "opinion", like everything else about you, is worthless.

                    • That's because you're really stupid.

                      Again, you don't know what you're talking about here.

                      I see that you love making claims that you can't substantiate.

                      To remind you that you're ignorant trash and to let other people know that your "opinion", like everything else about you, is worthless.

                      Yet obviously some people value my time a LOT more than anybody at all values yours. That's not an opinion either, that's just a fact.

                    • by narcc ( 412956 )

                      I see that you love making claims that you can't substantiate.

                      I've more than proven my case here. That you can't see this is just more evidence that you're an idiot who doesn't know what he's talking about.

                      You've lost. Move on. Preferably to some other site.

                    • I've more than proven my case here.

                      As always, you haven't proven shit here. Just like that time you tried redacting your self-admission to being tired of getting kicked in the face after licking boots.

                    • by narcc ( 412956 )

                      You're only highlighting your own ignorance here.

                      Listen to your betters and stop posting about things you clearly know nothing anything about.

                    • Listen to your betters and stop posting about things you clearly know nothing anything about.

                      So why do you keep posting then?

    • That's Enterprise tier FUD.

    • > bye bye Rust

      Hello Rust#

  • Rust vs C++ (Score:4, Insightful)

    by chen2011 ( 1971334 ) on Thursday February 01, 2024 @12:25PM (#64206146)
    I have been teaching Rust to college students since 2020. It gets the pointer concept and uses right, i.e. the right (or best so far) balance between correctness and flexibility. In comparison, C++ is all flexibility and no real correctness guarantee. As a result, parallelization for Rust is a small step. For C++, it is almost impossible. Anyone who thinks Rust is equivalent to modern C++ is delusional.
    • Parallelization is almost impossible in C++?

      Interesting.

      • Re: Rust vs C++ (Score:4, Informative)

        by ArmoredDragon ( 3450605 ) on Thursday February 01, 2024 @10:19PM (#64207510)

        The best way to describe it:

        C++ makes it easy to get horribly wrong
        Rust makes it easy to get it right

        • by gmit ( 4661911 )
          There is nothing easy with Rust. It's full of workarounds for problems introduced by itself.
          • Once you intuitively understand Rust's borrowing rules, then you never run into any of that. In fact, you naturally just start writing code the way you were already supposed to be doing it in C++ but most C++ programmers don't, because in C++, RAII is very much an after-thought, so the "workarounds" you speak about basically don't even exist.

    • Re: (Score:2, Informative)

      by gweihir ( 88907 )

      Parallelization is never a small step and implementing it is a minor part of getting it right. Anybody that struggles with that part has no business working with it at all. Methinks you have no clue what you are talking about.

      • by dfghjk ( 711126 )

        Well, he teaches college students, so there's that. And he appears to suggest that "parallelization" is a function of "pointer correctness", whatever that means. Plenty of clues that you are right.

        • by gweihir ( 88907 )

          Thanks. Well spotted.

          I think by "pointer correctness", he may be ineptly referring to concurrent data access and modification. You know, things like locking, prevention of deadlocks, avoidance of race conditions, maintaining data consistency, and a few other things critical to get concurrent code to work right. I have done it for production stuff that also had (soft) real-time requirements and quite a few people depending on it. This is _not_ easy to get right on the architecture and design level. Implement

          • The only thing you're mentioning that's not always straightforward to do in rust for beginners is avoiding race conditions. Everything else you can generally just do willy nilly, assuming you're not using a standard Mutex or RwLock you'll probably never even encounter a deadlock. There's no guessing or having to fetch documentation to find out if something is thread safe or how to use it in a way that's thread safe. If your code isn't thread safe, it literally won't even compile. If your data structure isn'

            • by gweihir ( 88907 )

              Nonsense. You obviously have no clue what deadlocks actually are and how they happen either. And no, the compiler and run-time system _cannot_ prevent deadlocks. It can just not contribute any additional ones. You are a typical beginner or a low-skill moron with delusions.

              • Nonsense. You obviously have no clue what deadlocks actually are and how they happen either.

                On the contrary, I was doing multithreading in my earliest days. Which admittedly was only about four years ago.

                And no, the compiler and run-time system _cannot_ prevent deadlocks.

                I didn't claim this. Learn to read.

                It can just not contribute any additional ones. You are a typical beginner or a low-skill moron with delusions.

                It's actually interesting you mention being a beginner, because relatively speaking, I am. Though I know what I'm talking about on this particular topic because only a year ago I wrote a server capable of receiving thousands of data pushes per second, doing (many) lookups against them, and commiting all of this to a database in, while also being able to handle pu

      • Parallelization is never a small step and implementing it is a minor part of getting it right.

        You've never done it in rust then. The borrow checker is specifically designed so that it's hard to do this wrong. The only way to easily pass data between threads (including green threads for concurrency) is the safe way to do it. You can either pipeline your data with channels, or use locks. Some structures (e.g. dashmap for parallel or flurrymap for both parallel and concurrent) can even guarantee* no deadlocks.

        * There's one known way to cause it with flurry, basically you have to hold two refs to the sa

  • Mickey$oft Managers & Programmers in search of the ultimate Lego programming language, where everything snaps together like Lego blocks! ;^)

    C -> C++ -> C# -> Rust-> ??? ...

    What will the next one be? Will they fork Rust into Rust#? ;^)
  • by Opportunist ( 166417 ) on Thursday February 01, 2024 @01:29PM (#64206308)

    When MS starts to join the bandwagon.

  • by Afell001 ( 961697 ) on Thursday February 01, 2024 @03:14PM (#64206638)
    Instead of dumping and rewriting their C# logic as Rust, why not implement the .NET IL interpreters using Rust? Granted, it may not be any faster than it is now, it will be more future-proof and could allow them to expose Rust as a runtime language within .NET, that way any "MS"-iness with Rust is limited to this environment (compile directives and such). With that in mind, .NET languages could then run alongside Rust in the same implementation, and any desire to rewrite to Rust could be done in due course without sacrificing performance.
  • by akw0088 ( 7073305 ) on Thursday February 01, 2024 @08:14PM (#64207354)
    Java and C# are no longer the new kids on the block, rust will fall a similar fate because the novelty of something new never lasts
    • So what?

      Java is the COBOL of the 21st century.
      Python is the FORTRAN of the 21st century.
      Haskell is the LISP of the 21st century.
      C# is the PL/1 of the 21st century.
      C++ is the C++ of the 21st century.
      JavaScript is the Perl of the 21st century.

      And Rust looks like it might become the C of the 21st century.

      It is not about the novelty. It is about the size of the code base. If it is used widely enough, it will be impossible to get rid of.

An adequate bootstrap is a contradiction in terms.

Working...