Reasoning behind using C# and Rust together? #528
-
Hey! I stumbled upon this project and was hoping that it implemented LLM loading and prompting in Rust. I quickly noticed that the project uses a dotnet server that the tauri desktop program connects to. The server serves a webpage that the user interacts with. I took a closer look at the roadmap and overall goals of the project. The reasoning for the desktop app seems to be the possibility of user-specific data enhancements for the LLMs: create embeddings for PDFs, pictures or other local data using the tauri desktop app that grants access to them, and then let the user prompt/search for content. I can imagine that the C# code base already existed before the idea of local file scanning came up. Is that correct? If not, what was the reasoning to not have a monorepo entirely written in Rust? Are there plans to move the code base to Rust long-term? Thank you for taking your time! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @mainrs and thanks for your question. You got the basic architecture right: The Rust application starts a .NET server, which then serves a website. But we have some functions in the application that we’ve built in Rust—like reading documents, accessing the clipboard, managing passwords, and so on. In the future, we’ll keep deciding on a case-by-case basis whether to implement a feature in Rust or in C#/.NET. The reason for the desktop application: Yes, partly because of RAG. But also because AI Studio can create files directly on the file system this way—like code files for a coding assistant, office files for daily work, or assets for bigger projects (a book author working with LaTeX can generate texts and images, a game developer can create dialogues in different languages, and so on). Now, your main question: Why not do everything in Rust? At the beginning, I was working alone and built the idea for MindWork AI Studio in my spare time. I tried out Leptos to create the UI in Rust too, but compared to Blazor in .NET, it was just too complicated. On top of that, I have 20 years of experience with C# and .NET. So I tried combining Rust and Tauri with .NET and Blazor to see how tricky the integration would be. It turned out to be pretty simple, so I stuck with it. Now we have the best of both worlds. When we want to build a new feature, we can weigh different factors: Do we really need Rust’s safety and performance? Is there a great library in Rust or .NET that’ll help us? Since we run a web API between the Rust and .NET processes, we can choose where and how to implement things with a lot of flexibility. Will we ever switch everything to Rust? Right now, I don’t think so. Developing the UI in Blazor with help from MudBlazor is super easy and fast. Our team is experienced with .NET—and not so much with Rust. Now that AI Studio is being used for business, like at the DLR (the German NASA), being able to build features quickly is a huge plus. Would we love to do everything in Rust? Absolutely; we love Rust ❤️ |
Beta Was this translation helpful? Give feedback.
Hey @mainrs and thanks for your question.
You got the basic architecture right: The Rust application starts a .NET server, which then serves a website. But we have some functions in the application that we’ve built in Rust—like reading documents, accessing the clipboard, managing passwords, and so on. In the future, we’ll keep deciding on a case-by-case basis whether to implement a feature in Rust or in C#/.NET.
The reason for the desktop application: Yes, partly because of RAG. But also because AI Studio can create files directly on the file system this way—like code files for a coding assistant, office files for daily work, or assets for bigger projects (a book author working with LaTeX…