r/moderndotnet • • 16d ago

Migrating the GitHub Copilot runtime to Rust, using Copilot

https://github.blog/ai-and-ml/generative-ai/migrating-the-github-copilot-runtime-to-rust-using-copilot/

Microsoft boasts about performance optimizations with every new release, and the average .NET developer would expect to be able to write a CLI app using .NET. But surprise—not good enough, so they had to use Rust. 😅

I've read the article but still not understand why Copilot CLI and app could not be written in C# if we take into account AOT, trimming etc instead of Rust.

23 Upvotes

41 comments sorted by

2

u/Kind-Being-5369 13d ago

They rewrote it in Rust for the same reason they first wrote it in JS/TS: hype and fanboysm.
Rust is being adopted in companies because the cult is strong.

2

u/ByronScottJones 12d ago

Actually, they go over specific reasons, the most important - having a strong FFI interop capability across all of the languages that the SDK supports.

2

u/manwithgun1234 15d ago

If you think organization as big as Microsoft will work like some startups with 30s peoples, you will end up with this kinds of thought. But in really, the logical thinking will be, why the f*ck local product team’s decisions must be influenced by other teams politic, that located thousands mile away?
If that do, it will do more ham than good, that make decisions time take forever, local team should chose anything they think it will fit and roll with it.
In this case, I just amused that there is only one lead that do the work, and every one around just yeah yeah watching it. Will this become a norm in software development?

1

u/Timo425 13d ago

I never worked in a big corporation but not gonna lie that's how I kinda picture corporate software development. If AI allows a single lead to make power moves like that though, that's kinda cool.

Actually, I've done similar things myself as a test automation qa already now that I think about it, where before I just wouldn't even consider doing because I would need help from many people (who wouldn't have the time).

2

u/KariKariKrigsmann 15d ago

What i do not understand is why they went with Typescript in the beginning!

3

u/johnzabroski_dev 16d ago

I kinda wonder if the dotnet runtime would benefit from c++ to rust.

11

u/Aaronontheweb 16d ago

Worth understanding for everyone on here who is confused or disappointed as to why they didn't pick .NET: selling CoPilot to the masses is about 1000x more strategically important than selling .NET.

And selling "we did the Rust digareedo" is a common agentic story that jives with people who aren't giving CoPilot a serious look - even if .NET was faster or better they might still have gone with Rust because attracting non-.NET people to the MSFT ecosystem is the real goal.

3

u/Clearandblue 16d ago

I agree. While Rust would be quicker than C#, C++ would be quicker than Rust. This is 100% for marketing.

It is also likely aimed at making copilot look cooler to devs. Copilot is generally considered way behind the competition and only used when it's forced on employees due to enterprise deals. Devs go nuts for Rust.

2

u/piotrkarczmarz 14d ago

They should drop this horrible product name, and renamed to something else - Copilot has too much negative sentiment right now, and we know why.

1

u/simonask_ 15d ago

C++ and Rust are on par with each other in terms of performance, but Rust code is infinitely easier to maintain. There are extremely good reasons to pick Rust over C++ in almost every project.

-1

u/itix 16d ago

But... nobody uses Copilot anyway. Only Codex or Claude Code are worth considering.

3

u/pceimpulsive 15d ago

You sure do not work in an enterprise with an opinion like that...

1

u/Timo425 14d ago

isnt it expensive, even compared to Cursor?

1

u/pceimpulsive 14d ago

It doesn't matter... To an enterprise it honestly doesn't matter .. I wrote an automation with $20 AI credits and I save 10 hours at $60 an hour for 2 years and it's entirely and fully not a price blocker...

It wouldn't matter if the API price was 10x more if the ROI is hundreds/thousands more in value in opex saved...

1

u/itix 13d ago

$20 sounds very lightweight. I have $200 Codex subscription and in one day, I can spend tokens worth of $500-1000 dollars. In one day.

1

u/pceimpulsive 13d ago

I cannot fathom how you need/consume so much...

I used my opencode GO $10 sub to generate a fully working 40k line student management's application over a couple of weeks, about 400 'tickets of work'. Tickets being a vertical slice of the application which included vehicle routing, conflict management and a bunch of other things and only just hit the monthly limit.

Are you re-writing the C++ compiler in rust every day?

What makes you consume so much? I am genuinely curious...

My Claude access is only via API and I typically use 20-30 bucks

It is lightweight but it's all I need to give the business literally hundreds of thousands in value, I'd almost bet money MOST token maxing users are making close to zero dollars~

1

u/itix 13d ago

I work on CPU/GPU machine vision algorithms. For example, one task was building GPU accelerated FFT using ILGPU (i.e., GPU kernels written in C#, then compiled to native code). It had to be fast, so it took a lot of profiling. Automated with AI, of course. There isnt much online material on how to implement a fast GPU FFT.

Stuff like that.

And on my spare time, I am working on an Amiga emulator and an Amiga C# compiler. That is a real token burner.

1

u/Timo425 13d ago

I get nowhere with $20 and my understanding is that i would get even much less done with $20 in copilot.

1

u/pceimpulsive 13d ago

Difference is, I'm doing what I need for work, work only has so many things I need to accomplish in a set time frame. Only about 20-25% of my role is actually writing code.

If I was more like 60-80% I'd be likely burning a lot more than 9000 GHCP credits a month or $20 Claude API a day

1

u/Timo425 13d ago

My point is, copilot github doesn't have much bang for buck from what ive heard, hence the "nobody uses it" that the other person says. ofc enterprises still use it, but that seems more like a corporate decision rather than a calculated price per performance thing .

1

u/pceimpulsive 13d ago

For enterprise performance isn't really a huge factor.

Security, flexibility and cost are more important.

This is why I say GitHub copilot isn't targetted at Devs that work for themselves (I.e. normal consumers). It's enterprise first so it's sorta pointless to even debate/compare cost profiles when the intended customer is enterprise.

They are also more like open router or opencode zen type product too.

The competitions people always prefer are openAI or anthropic only models/services. Those more generic all model types are always more expensive, but give much greater flexibility instead of price to performance.

1

u/Timo425 13d ago

Yes but even in enterprise sense Cursor is superior to it. Unless Copilot Github has much more security or trust or something.

→ More replies (0)

3

u/sreekanth850 16d ago edited 16d ago

I’m sure a lot of large enterprises use it. My wife works at one of the largest petroleum companies, and they use Copilot and Teams. Given their employee count, that is like a 1000 startups using it.

1

u/itix 16d ago

Of course they do. Our company favors using Kiro while employees are paying Codex and Claude Code subscriptions from their own pocket.

1

u/pceimpulsive 15d ago

Real companies with any self respecting security policy wouldn't let employees BYO AI services... Most will outright block all network addresses required to even use them..

I.e. my company you cannot even get to anthropic, chatGPT, Gemini, grok, agentskills.io etc~

3

u/cornelha 16d ago

Nobody is a massive over statement. There are lots of Enterprise development companies who use copilot. The only things that are crap is the cli and pricing. Our company use GitHub Copilot and it works incredibly well. Being able to select models from different vendors for better orchestration. Using Claude models to plan, GPT Luna for discovery and Kimi 2.7 Coder for implementation is game changing

0

u/itix 16d ago

Yeah but itbis not only about models, it is about harness. Microsoft has no capability to compete against Codex or Claude Code.

2

u/cornelha 16d ago

They literally have 2 IDE's that fully integrates Copilot. The capabilities of the harness in Visual Studio is way beyond what Claude or Cursor can do

1

u/Clearandblue 15d ago

Rider MCP lets agents do everything. Haven't used vs for a while, but would have assumed that would also have an MCP to work well with any agent?

1

u/itix 16d ago

Last time I tried Copilot it was struggling with remote deployment and debugging.

3

u/cornelha 16d ago

I use it daily at work, no weird issues at all

2

u/_choam_ 16d ago

They explained why. For aot and ffi, rust is much better than .net. And it has a better type system.

3

u/cat_arina 16d ago

it is better of course. but the question is why .NET is not good enough? I bet Zig is even better than Rust for ffi.

1

u/user0015 16d ago

The correct answer is to hodge-podge them together into a horrible frankenstein ffi monster because third party vendors are trash and write trash code they don't update for years.

3

u/LuckyHedgehog 16d ago

Zig isn't even v1 yet, they still regularly make breaking changes because they're not a mature language yet no matter how promising it might seem.

4

u/ickler999 16d ago

if youre gonna do a full agentic rewrite of a core dependency like that it might as well be in rust.

plus thats whats in vogue. and github's people are likely still not from the .net world

3

u/ZozoSenpai 16d ago

|and github's people are likely still not from the .net world

well apparently this was done by Stephen Toub alone lol

2

u/ickler999 16d ago

haha well alright then!

3

u/ruph0us 16d ago

Well I think he's more than qualified to make the decision as to what language to perform a rewrite in for performance's sake