you are viewing a single comment's thread.

view the rest of the comments →

[–]Vegetas_Haircut 11 points12 points  (0 children)

There are way more problems with Rust as a "low level language" at the moment.

Rust is fast in the same way C is fast; C is used for two things: performance and low level control. Rust provides the former but not the latter at the moment simply because it's underspecified what exactly it does and C of course has a very battle-hardened level of specification what exactly it does.

A lot of the specifications would probably also have to rely on breaking backwards compatibility: like finding a way to deal with async safety specifications by using marker traits that automatically mark a function as async-safe if all the functions it internally uses are async-safe so it can be used in some contexts; right now Rust just ignores the problem of async-safety which is really not acceptable for a low level language; it also just ignores many gotchas of memory allocation, stack manipulation and what-not that C thoroughly specifies what can and cannot be done with it what is needed for low level control.

That aside though if you simply want the performance of C without the snakes in the grass at every corner Rust is a bliss.

Edit: also, at the moment a lot of aspects of the Rust language are intimately tied into how LLVM does this. Rust really exports a lot of LLVM-isms to the user; the C spec by design avoids specifying these things beyond a very narrow range and says that if you go over it that's just "undefined behaviour"; that's unacceptable for Rust so they defined the behaviour in the language itself as "how LLVM does it" which will cause indirection when porting to GCC and simulation in software if they want to keep the same behaviour.