|
|
Subscribe / Log in / New account

The Rust for Linux project

The Rust for Linux project

Posted Sep 23, 2021 4:15 UTC (Thu) by marcH (subscriber, #57642)
Parent article: The Rust for Linux project

> It's somewhat low-level like C but, depending on the code, it might be less easy for developers to predict what the resulting assembly code will look like.

I really doubt anyone can predict the assembly code produced from any non-trivial piece of C unless they turn off optimizations.

https://queue.acm.org/detail.cfm?id=3212479 "C is not a low-level language", etc.


to post comments

The Rust for Linux project

Posted Sep 24, 2021 14:37 UTC (Fri) by error27 (subscriber, #8346) [Link] (2 responses)

People might surprise you.

Some of the kernel is written in assembly. But there are definitely parts which are written in C but the author has the assembly in mind and reviews the assembly to verify.

The Rust for Linux project

Posted Sep 26, 2021 8:08 UTC (Sun) by marcH (subscriber, #57642) [Link] (1 responses)

For small and trivial pieces of C maybe (I wrote "non-trivial"). Are the equivalent parts in Rust harder to predict and if so why? Interesting question.

The Rust for Linux project

Posted Sep 27, 2021 13:06 UTC (Mon) by mathstuf (subscriber, #69389) [Link]

My gut feeling is that it is more around figuring out what the optimizer can help out with. Rust can probably optimize iterator method chains far better than C's loops, but at that point, you're also fiddling with details that affect the inline heuristic engine and other such details that vary between compiler implementations and versions of the same compiler, so even there I'd think that "what my specific compiler does" may not be suitable because the optimization could fall on the other side of the line in the next release too.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds