15 ms·
Microsoft to Explore Using Rust
- bluejekyll 7y agoThe historic data related to memory access is really damning, 70% of CVE's are memory access related, and that hasn't changed significantly over the years charted, 2004 to 2018. What's annoying in this article is that it doesn't come right out and say that MS is considering offering a full Windows SDK with a Rust API. The closest I see the article come to mentioning this is: "Exploring the use of a memory-safe language such as Rust would provide an alternative to creating safer Microsoft apps. But Thomas also argues that third-party developers should also be looking into memory-safe languages as well. He cites reasons such as the time and effort developers put into learning how to debug the memory-related security flaws that crop up in their C++ apps." It would be interesting to know if a Rust native API is something being actively worked on at MS. BTW, MS does ship Rust in a product today, the VSCode editor/ide uses ripgrep for search, which the article fails to mention as well.
- lmkg 7y ago> it doesn't come right out and say that MS is considering > offering a full Windows SDK with a Rust API It's possible that the Security Response Team doesn't have the authority to dictate the priority of new products for the dev tools teams.
- ChrisSD 7y ago> What's annoying in this article is that it doesn't come right out and say that MS is considering offering a full Windows SDK with a Rust API. The closest I see the article come to mentioning this is: "Exploring the use of a memory-safe language such as Rust would provide an alternative to creating safer Microsoft apps. Creating a fully Rustified Windows API interface would be a massive task. The WinApi is vast and parts of it are ancient. It's practically a living history of Windows. And that's before you get to the more modern COM and UWP stuff. What they might offer is a more focused subset.
- bluejekyll 7y agoA subset is all I was thinking really. Perhaps starting with the kernel.
- contextfree 7y agoWe (primarily Patrick Reisert, I'm trying to contribute a bit) have been working on WinRT support for Rust. It is a work in progress but is already usable now, with some missing capabilities such as UI support. https://github.com/contextfree/winrt-rust https://github.com/contextfree/winrt-rust
- qzw 7y agoIf MS is serious about this, I’d like to see them make Rust a first class option for Windows kernel development. There are a lot of drivers that really should be “rewritten in Rust”.
- xiphias2 7y agoEventually they should get there, but I don't think that the Rust ecosystem is ready for that. Experimenting works the best when MS doesn't yet commit to external Rust API, but writes new code in Rust (especially CVE bug fixes) and transforms gradually.
- richliss 7y agoEspecially as Dave Cutler is still alive.
- ceronman 7y ago"70% of all Microsoft patches are for memory-related bugs". This says a lot. I'm sure Microsoft has very smart and competent engineers, yet they still get all these bugs. It's because manual memory management is really, really hard. I'm baffled to keep hearing some people saying that manual memory management is okay when the evidence is this huge. Perhaps for very simple programs is okay to do manual memory management, but for complex ones like most of them nowadays, it seems close impossible for humans to write safe programs.
- gwbas1c 7y agoKeep in mind that, in kernel mode, things like garbage collection just won't work!
- merb 7y agomaybe it would? maybe somebody could create a co-processor just for that. sadly cpu's won't actually have specific extensions to have a good way of doing garbadge collection. but I guess it would be pretty helpful.
- sametmax 7y agoGood thing rust doesn't have one.
- __s 7y agoFeel like that's a common misconception: https://en.wikipedia.org/wiki/Midori_(operating_system) https://en.wikipedia.org/wiki/Midori_(operating_system) http://programatica.cs.pdx.edu/House http://programatica.cs.pdx.edu/House
- steve76 7y agoSo let's get rid of .NET and JVM, and just use Chrome. That would screw everyone over REAL big! Just think, you can ping out all those smart devices, whether they run iOS or Droid. If you want the internet, you need webkit, ... ... ... sort of. All I want is a power off interface "trigger zone". Like if you are in class, and you like your professor's joke, kick your back pack and you get XP.
- Stubb 7y agoGet ready for R#.
- blub 7y agoBased on this article it looks like it's possible for MS to truly embrace Rust. This would be an opportunity for them at the same time to extend the language by offering for example a dialect which is less focused on functional programming idioms and the stranger notations, like lifetimes. There are many people complaining about the above, and they would probably vote for the MS dialect, which could result in extinguishing current Rust and de facto replacing it with a more beginner-friendly version.
- majewsky 7y agoI don't think you can reasonably have a Rust dialect without lifetimes. Ownership, borrowing and lifetimes is the very core of Rust. The other Rust submission on the frontpage right now explains this: https://boats.gitlab.io/blog/post/notes-on-a-smaller-rust/ https://boats.gitlab.io/blog/post/notes-on-a-smaller-rust/
- binarycoffee 7y agoI fear GP's post has not been fully appreciated. (I noted these words: [...] embrace [...] extend [...] extinguish [...])
- Xophmeister 7y agoIronRust?
- sleepydog 7y agoTetanus (consequence of sharp rust)
- Arnavion 7y ago(Note that rust does not cause tetanus. Tetanus germs live in wet soil, that just happens to be the reason the sharp thing was rusted.)
- frabert 7y ago"Besides being superior to C# in regards to better memory protections, Rust is also more popular with developers these days and might be easier to recruit for" Citation needed. I'm quite sure the pool of C#/.NET devs right now is quite a bit larger than the pool of Rust devs, to be honest, if anything for the sheer amount of headstart that C# has got over Rust.
- mattmanser 7y agoEspecially as he mentions SO: C#: 450 asked today, 2548 this week Rust: 14 asked today, 82 this week Yeah, sooooo much more popular.
- adamnemecek 7y agoThere might also be the aspect that Rust programmers ask fewer questions due to the fact for example that C# might be taught in a university whereas Rust programmers come to the language mostly on their own.
- CameronNemo 7y agoWould that not skew questions toward Rust, where people rely on online resources to learn the language and cannot first ask questions ~~during office hours~~ on piazza?
- 0_gravitas 7y agoI hang out a every once in a while in the Rust discord (official and comminity) and theres always a bunch of questions, probably close to the amount of what SO shows. I haven't dipped into it myself but from what I hear the Rust book (available for free on their site) and documentation are really good. So maybe that in combination with other tutorials is a reason why SO isnt so active. It's a similar deal with Elixir, elixir SO isnt too active because almost everything is asked on the Elixir forums, so if you go with SO as your sole popularity meter you're not always going to come away with accurate conclusions.
- zaphirplane 7y agoInteresting, I would have expected doubling down on c# and .net maybe some compile to native. Obviously not for low level, but the stats are not clear on if it’s general subsystems and applications or low level either
- moksly 7y agoMicrosoft uses a lot of different techs. Isn’t a lot of their cross platform and web code for office 365 build with React? That doesn’t mean they aren’t moving forward with .Net or C#, but the main thing they want to sell to developers in 2019 is Azure where it used to be enterprise licenses for VS and windows server. And they don’t need C# for that. Also, they seem to be wanting Rust as a replacement for C and C++, so it’s probably mostly unrelated to C#.
- pjmlp 7y agoYes, they announced at BUILD the new React Native for Windows using WinUI (UWP update).
- brighteyes 7y agoIt's interesting that someone in Microsoft is talking about Rust, but the article is very flawed. For example, > C#, a programming language developed by Microsoft, also features some memory access improvements but is not as advanced as Rust. [..] Besides [Rust] being superior to C# in regards to better memory protections That's false, isn't it? C# is a memory safe language, period. It relies on GC for that. In fact C# has arguably better memory safety than Rust because you can do things safely in C# that you would be forced to use 'unsafe' in Rust for. (Granted, then you have overhead from GC, but that's not what the author is talking about.) > Rust is also more popular with developers these days and might be easier to recruit for. The author has misinterpreted what "most loved" means in the quoted survey: it means that among Rust developers, it gets a very high rating. That says nothing about how big that group is, nor how popular it is in the general population of developers. The Rust community is growing but still very small - it's an emerging language. Almost everyone that uses it decided to use it because they like it. (That doesn't diminish the accomplishment - there are other emerging languages that are not as loved by their users.)
- dragonwriter 7y ago> C# is a memory safe language, period It's quite possible that what the author intends by “memory protections” is broader than what is captured by “memory safety”; e.g., the borrower checker is, in a sense, a way of protecting memory from unexpected changes in parallel tasks.
- brighteyes 7y agoI think that's too generous to the author given the other mistakes in the article, but sure, if you expand the meaning beyond regular memory safety, then it becomes a mixed picture: Rust protects from some race conditions, but other types of parallel code must use 'unsafe'. And as mentioned before some data structures can be done safely in C# but not in Rust. It is definitely false for the author to say Rust is "superior to C# in regards to better memory protections", in any definition of "memory protections".
- writepub 7y ago
- magicnubs 7y agoIf this goes anything like their "exploring integrating Python into Excel", in 18 months we'll have heard no more about it and it will be presumed abandoned.
- jsgo 7y agoin both cases, it was teams/users within Microsoft and not Microsoft itself, was it not? Dunno, I'm glad there are teams looking at things outside of Microsoft developed technologies. NodeJS receiving kudos for being so good at serving requests lead to articles about how it could be done in ASP.NET (with some rearchitecting of the ready bake application code) which apparently gave way to ASP.NET Core and I'd say if all of that is true, we're all better for it (ASP.NET developers, anyway).
- magicnubs 7y agoI'll definitely agree with that. Broadly, I like the direction Microsoft has been headed in, I guess I'm just disappointed that there has been no more information (even them saying they've shelved the idea) after the huge outpouring of support.
- nullwasamistake 7y agoThis is interesting coming from MS! I've used a lot of VM/GC languages and IMO C# is the best of them all. All the things people complain the most about, like type erasure in Java, or lack of generics in Go, are done right in C#. I used it for years and don't have any major complaints. Hearing that the company with the "best" language (all subjective) is interested in Rust is exciting.
- jeffdavis 7y agoIt looks like it's more about breaking into the C++ domain than the C# domain.
- inlined 7y agoI wonder if this applies to Windows at all (and in which parts). Windows Longhorn (using this name for the two years of effectively scrapped work on Vista) was written in c# but abandoned. The best reason I’ve heard is that the GC wasn’t suitable for an OS, especially in edge cases. For example, the C++ code I wrote at Microsoft had to gracefully handle an out of memory situation after any alloc (including setting the STL to not throw exceptions). An out of memory exception in C# can be catastrophic if the handler had to JIT in low level OS code.
- giancarlostoro 7y agoThere's also Midori written in a spin off language of C# by Microsoft: https://en.wikipedia.org/wiki/Midori_(operating_system) https://en.wikipedia.org/wiki/Midori_(operating_system)
- inlined 7y agoI was fascinated with Midori as a Microsoft employee but nearly 10 years later I’ve resigned that it will probably be forever a research toy and not be subject to the same scrutiny as Windows.
- muricula 7y agoMidori was laid to rest a few years ago. Production OS kernels in GC'd languages remain a pipe dream.
- inlined 7y agoI’m still holding out for Fuchsia, which is partially built in Go and Rust: https://en.m.wikipedia.org/wiki/Google_Fuchsia https://en.m.wikipedia.org/wiki/Google_Fuchsia
- giancarlostoro 7y agoI think that'd be the sweet spot. Do lower level portions in something like Rust or C, but the environment can be in Go, D, etc. Although a D OS could potentially be all D. Was this not what the Inferno OS did anyway? They used C for the core, and then made Inferno for other parts.
- mastax 7y agoThis article is a reblog of Microsoft's post: https://msrc-blog.microsoft.com/2019/07/16/a-proactive-approach-to-more-secure-code/ https://msrc-blog.microsoft.com/2019/07/16/a-proactive-appro...
- reacharavindh 7y agoI thought Microsoft has already been using Rust and contributing to its ecosystem indirectly via its developers such as Actix and Actix-web, although it might just be that the author happens to work for MS while building it in spare time.
- steveklabnik 7y agoMicrosoft has been using Rust for several things; this is a broader announcement for a broader audience.
- pictur 7y agoAnyone see an article that says bad things about rust? these articles are shitty.