If they are able to write a C-to-Rust transpiler (which Rust code then would compile to native code), then they could also write a C-to-safe-binary compiler directly, too - so Rust is not required into the compiler chain at all.
@iMagUdspEllr2 ай бұрын
Rust is designed to be a safer language. Rust is made by people who chose to specialize in making languages. Wouldn't it be better to use a safe language made by specialists than it would be to try to create and maintain a custom in-house solution as a side project? Wouldn't it be easier to write tests for the existing C code? The benefit of Rust would be that if you want to be able to expand or refactor your code, it would be better to do it in a language that doesn't require as much manual double-checking. But, is there a way to make a C-to-safe-binary compiler that essentially turns C into something Rust-like? Wouldn't it make sense to upgrade the standard C compilers to just use these safe features and then no code needs to be rewritten worldwide and then C would become as safe as Rust?
@DataPastor2 ай бұрын
@@iMagUdspEllr i consider Rust as an interesting experiment, but it is yet to see if Rust can get mass adoption. It is hard to express, how insignificant Rust is on the job market and in general in the industry. Just remember that once some cities have decided to switch to Linux in the past… such political decisions, made by some administrative committees can hardly change reality. C++ is just peaking in its popularity; it also targets now memory safety. Zig is coming as a much better substitute for C than Rust. So at the end… let us see. But I don’t believe that Rust would be the large scale solution. My personal view today.
@iMagUdspEllr2 ай бұрын
@@DataPastor Getting adopted is influenced heavily by economics, not just the merits of the language on its own. C++ suffers from not having modern tooling like Zig or Rust. But, Zig didn't set out to focus on safety, simply to be a C-replacement. I kind of just wish that C++ had better tooling and didn't become so bloated with features. But, why wouldn't we just upgrade the standard C compilers with the safety features you mentioned? Then no switch would need to occur and then C would be come safer.
@krumbergify3 ай бұрын
Converting C to unsafe Rust i trivial (for a tool). Converting C to safe Rust is not, because it requires you to redesign your application into a more functional or actor model style and most C-applications are dirt piles of globals and singletons 😂.
@JeremyChone3 ай бұрын
Thanks for sharing. The last time I coded in C was probably when I was around 15 in the late 80s. So, it's been a while.
@theevilcottonball2 ай бұрын
C programs and a lot of singletons? I disagree. The reason why it is hard to translate C, is that in C some lifetimes do not fit Rusts ownership model. Also Rust does not allow shared mutable access or cyclic/linked data structures, self referential data structures etc. I think translating those things is hard, not because C programs use a lot of singletons (they don't). Also translating things like macros to rust or some other stuff may be hard to do.
@danielyokoyama38613 ай бұрын
Hi Jeremy. Really happy with the aparent strong adoption of rust in different niches. After i started with rust I feel that i have a better grasp of the internals of the computer and memory model. This helps a lot in writing the code that I need.
@JeremyChone3 ай бұрын
Yes, same here. Somehow, there is something in the Rust way of approaching types that makes my code more maintainable and enjoyable to write.
@JohnPywtorak3 ай бұрын
Keep in mind, these kind of DARPA activities are "Research" not necessarily doing. Yes hopefully it could lead to tools etc., but it is not a presumed end game, likely though. The better question is more about Rust as a suitable new host, so to speak. DARPA can see the difficulty in maintaining safe legacy C and the long game. Thus, the need for research. There may be Rust milestones needed before it could happen, but ultimately it could be a benefit to Rust advancing it as a systems language.
@JeremyChone3 ай бұрын
Good points. Thanks.
@On.Jonathan3 ай бұрын
And even so, Rust is using LLVM as its Compiler Backend, which is written in C. Funny anyways... 😅😮
@abduljabbarazam9433 ай бұрын
Microsoft 365 is being rewritten in Rust. Not sure if it's the backend or the desktop application
@JeremyChone3 ай бұрын
Yes, me too. I assume there is some backend to that, but I did not find any conclusive data to confirm it.
@JeremyChone3 ай бұрын
The very interesting part is that they seem to rewrite C# code.
@amitkumdixit3 ай бұрын
Hi Jeremy. What do you mean when you say Microsoft is moving it's Backend from C# to Rust. What I am aware is they are moving some of their Windows OS kernel code to Rust.
@JeremyChone3 ай бұрын
This story: www.theregister.com/2024/01/31/microsoft_seeks_rust_developers/ I think, but I might be wrong, that this includes some backend services.
@Sovereign5893 ай бұрын
+1
@irlshrek3 ай бұрын
I think we made a good bet, gentlemen
@frun3 ай бұрын
I would convert the libraries first.
@dhrubrawat93163 ай бұрын
is it possible to create the video on project polonius?
@tetuaoro3 ай бұрын
thank you sir
@seaviasfo3 ай бұрын
I tried speaking french in college but it never took... weirder still is that I'm a programming language polyglot but for the life of me can't seem to pick up a 2nd human language lol 😂.
@JeremyChone3 ай бұрын
Don't worry, we have GPTs now.
@taquanminhlong3 ай бұрын
Im not really sure whether we should but AI might cause a mess 😂 better write rust on your own
@JeremyChone3 ай бұрын
You have a point. I think they will find the right balance. GenAI, used right, can be a tremendous tool to speed up dev and migrations. The trick is that I do not think the industry has found a good way to use it yet. They focus on building fancier and fancier tic-tac-toe, but this might be the wrong approach... more on that in a video at some point.
@RoamingAdhocrat3 ай бұрын
I can imagine the existence of tooling to transcribe C into unsafe Rust, and tooling to convert unsafe Rust into safe Rust, in a way proven not to change functionality... but I could be wrong, I'm not a compsci grad You'd then need human devs to examine the remaining unsafe blocks and see what improvements can be made from there.