Re:Asterinas: OS kernel written in Rust and providing Linux-...
by baq on Wednesday October 16, 2024 @02:36AM
(#41856204)
If you’re writing C and don’t track ownership of values, you’re in a world of hurt. Rust makes you do from day one what you could do in C but unless you have years of experience you think it isn’t necessary.
[ Parent
| on HN ]
Re:Asterinas: OS kernel written in Rust and providing Linux-...
by metalloid on Wednesday October 16, 2024 @02:59AM
(#41856314)
It was true until LLMs arrive.
Feature compilers + IDEs can be integrated with LLMs to help programmers.
Rust was a great idea, before LLMs, but I don't see the motivation for Rust when LLMs can be the solution initial for C/C++ 'problems'.
Re:Asterinas: OS kernel written in Rust and providing Linux-...
by baq on Wednesday October 16, 2024 @03:13AM
(#41856391)
On the contrary LLMs make using safe but constraining languages easier - you can just ask it how to do what you want in Rust, perhaps even by asking it to translate C-ish pseudocode.
Re:Asterinas: OS kernel written in Rust and providing Linux-...
by smolder on Wednesday October 16, 2024 @03:18AM
(#41856419)
Relying on LLMs to code for you in no way solves the safety problem of C/C++ and probably worsens it.
Re:Asterinas: OS kernel written in Rust and providing Linux-...
by BrainInAJar on Wednesday October 16, 2024 @05:04PM
(#41863848)
probably?
even if the LLM is trained on flawless C code (which it isn't) it still has no way of reasoning about a complex system, it's just "what token is statistically most likely to come next"
Re:Asterinas: OS kernel written in Rust and providing Linux-...
by smolder on Thursday October 17, 2024 @02:10AM
(#41866874)
I said that because it's very possible for someone to write a more flawed program without an LLMs help. The exact probabilities weren't central to my point.
Re:Asterinas: OS kernel written in Rust and providing Linux-...
by ulbu on Wednesday October 16, 2024 @08:44AM
(#41858422)
Rust compiler checks things for you. People trust the Rust compiler because it enforces rules they want, so people don’t have to be in its place.
Your suggestion is to be that checker to LLM-generated code. Back to square one.
Re:Asterinas: OS kernel written in Rust and providing Linux-...
by wg0 on Wednesday October 16, 2024 @04:20AM
(#41856786)
Okay, I think it is is more like Typescript. You hate it but one day you just write small JS program and convert it to Typescript to discover that static analysis alone had so many code paths revealed that would have resulted in uncaught errors and then you always feel very uncomfortable writing plain Javascript.
But what about tools like valgrind in context of C?
Re:Asterinas: OS kernel written in Rust and providing Linux-...
by rcxdude on Wednesday October 16, 2024 @08:10AM
(#41858152)
Valgrind can only tell you about issues that your testcases exercise. It doesn't provide the same guarantees as static checking of memory safety invariants. But, if you're really concerned (especially about unsafe code), belt-and-bracers is a good strategy, and valgrind will work with rust binaries as well. Rust also has a tool called MIRI which can similarly flag up issues in testcases (it's effectively an interpreter for the intermediate representation in the compiler, and it can detect undefined behaviour even if the compiled assembly would happen to look OK. Still has the same limitation of needing extensive testcases though)
Re:Asterinas: OS kernel written in Rust and providing Linux-...
by baq on Wednesday October 16, 2024 @06:26AM
(#41857484)
You probably should run your rust programs through valgrind regardless. Rust is safer than C, but any unsafe code drops you to approximately C level of safety and any C FFI calls are obviously outside of rust's control or responsibility.
Re:Asterinas: OS kernel written in Rust and providing Linux-...
by badmintonbaseba on Wednesday October 16, 2024 @06:19AM
(#41857436)
Valgrind is great, especially if you write extensive tests and you actually run them through it regularly. And even then, it does not prove the absence of any kind of bugs. Safe rust has strong guarantees.
Re:Asterinas: OS kernel written in Rust and providing Linux-...
by tracker1 on Wednesday October 16, 2024 @08:39AM
(#41858386)
A few years ago I was worrying on a Byzantine mess of a JS project. I converted everything to TS for the sole reason of somewhat safely refactoring the project as a whole.
There was so little trust in the fragility of the original, it took a few months to convince everyone the refactored TS branch was safe.
After that, feature development was a lot faster in terms of productivity again.