I'll take Richard Hipp's C code over just about anyone's Rust code any day of the week. The man is a national treasure!
An embedded database written in Rust
41–50 of 74 posts
Re: An embedded database written in Rust
#42Earlier quoted context omitted.
Indeed. This is why I aggressively checksum everything and pay particular attention to throwing away all data that was written after any detected corruption during recovery. This is easier with the log-only architecture. It's also totally os and filesystem agnostic. I was happily surprised yesterday when it passed tests on fuchsia :]
So you might end up throwing away everything. (I know, it's not your fault)
Re: An embedded database written in Rust
#43Earlier quoted context omitted.
In Rust abstractions are free.
If that was so, there wouldn't have been a need for the unsafe mode.
Quoting from the rust book:
> Unsafe Rust exists because, by nature, static analysis is conservative. When the compiler is trying to determine if code upholds the guarantees or not, it’s better for it to reject some programs that are valid than accept some programs that are invalid. That inevitably means there are some times when your code might be okay, but Rust thinks it’s not! In these cases, you can use unsafe code to tell the compiler, “trust me, I know what I’m doing.” The downside is that you’re on your own; if you get unsafe code wrong, problems due to memory unsafety, like null pointer dereferencing, can occur.
> There’s another reason Rust has an unsafe alter ego: the underlying hardware of computers is inherently not safe. If Rust didn’t let you do unsafe operations, there would be some tasks that you simply could not do. Rust needs to allow you to do low-level systems programming like directly interacting with your operating system, or even writing your own operating system! That’s one of the goals of the language. Let’s see what you can do with unsafe Rust, and how to do it.
Re: An embedded database written in Rust
#44Does rust compile reliably to embedded targets yet? Last time I checked there were a lot of problems with armv5.
We have a whole working group this year working on embedded.
Re: An embedded database written in Rust
#45Re: An embedded database written in Rust
#46Earlier quoted context omitted.
If that was so, there wouldn't have been a need for the unsafe mode.
Unsafe does not exist for performance. Quoting from the rust book: > Unsafe Rust exists because, by nature, static analysis is conservative. When the compiler is trying to determine if code upholds the guarantees or not, it’s better for it to reject some programs that are valid than accept some programs that are invalid. That inevitably means there are some times when your code might be okay, but Rust thinks it’s not…
Re: An embedded database written in Rust
#47Earlier quoted context omitted.
In Rust abstractions are free.
If that was so, there wouldn't have been a need for the unsafe mode.
Re: An embedded database written in Rust
#48Earlier quoted context omitted.
In Rust abstractions are free.
Do you realize "zero-cost" abstractions are not specific to Rust?
(I would also disagree with that statement, but in a different way: Rust enables zero-cost abstractions, but nothing inherently means they have to be. I can also make quite costly ones, and they'll compile.)
Re: An embedded database written in Rust
#49Earlier quoted context omitted.
Do you realize "zero-cost" abstractions are not specific to Rust?
Your parent didn't say that. Speaking about Rust in a thread about a Rust project seems to be very on-topic? (I would also disagree with that statement, but in a different way: Rust enables zero-cost abstractions, but nothing inherently means they have to be. I can also make quite costly ones, and they'll compile.)
Re: An embedded database written in Rust
#50Earlier quoted context omitted.
Do you realize "zero-cost" abstractions are not specific to Rust?
Your parent didn't say that. Speaking about Rust in a thread about a Rust project seems to be very on-topic? (I would also disagree with that statement, but in a different way: Rust enables zero-cost abstractions, but nothing inherently means they have to be. I can also make quite costly ones, and they'll compile.)
Yes and it's more disturbing. It says "In Rust abstractions are free" when an algorithm was discussed.
Rust having "free" abstractions does not change the performance characteristics of an algorithm: this is what the grand-parent was talking about.