The expressive typing that Rust provides seems like a great fit for this kind of highly structured data. Seems like having a virtual driver with more easily verifiable correctness to compare against would be of value to existing drivers and make implementation of future drivers easier as well. Sounds like a great idea; nice work from Daniel Almeida!
Announcement
Collapse
No announcement yet.
Rust-Written Stateless Codec Drivers Make A Lot Of Sense
Collapse
X
-
Originally posted by kpedersen View Post
Because you can assume bounds sizes for a codec stream at compile time? No, you can't. None of your mentioned solutions can avoid unsafe access if you want performance.
I covered the unsafe (get_unchecked_mut) aspect in my post. Unsafe means you are achieving nothing but wasting time writing support code just to use Rust. In short, you are just writing janky C++ using a Rust compiler.
But hey, if that's what you want to do (or rather talk about), I will leave you to it. I'm gonna limit my Rust posts to once a week because verbosity and noise is one area where Rust developers have anyone beaten and I don't personally have the time to reciprocate.
2nd. Fixed size buffers with fixed iterations up to max buffer size won't produce runtime checks. That is really common in codecs/performance sensitive things, as fixed size buffers are vectorized really well.
3rd. If you add classic C style security check (what is must have in codecs to prevent exploitation), Rust will not insert own bounds check.
- Likes 9
Comment
-
Originally posted by dajomu View Post
And where is the fun in that? Is it not better to discuss a topic I do not dominate with people who, in my opinion, knows less about the subject? If we all should act like adults, we might end up with a consensus and learn something. What an aweful idea.
- Likes 2
Comment
-
Originally posted by TheMightyBuzzard View Post
Consensus does not mean, imply, nor even hint at correctness.
*) Correct is defined as a solution that's deterministically bug free, but may or may not be fully optimized for the hardware or every possible input. Many languages often have more than one correct approach to solving a given problem, but they may not all have equal performance especially when run on real hardware and built with real tools.
- Likes 7
Comment
-
Originally posted by piotrj3 View Post
1st. Iterator loops can be checked compile time. Regardless of size.
2nd. Fixed size buffers with fixed iterations up to max buffer size won't produce runtime checks. That is really common in codecs/performance sensitive things, as fixed size buffers are vectorized really well.
3rd. If you add classic C style security check (what is must have in codecs to prevent exploitation), Rust will not insert own bounds check.
Comment
-
Originally posted by kpedersen View Post
Because you can assume bounds sizes for a codec stream at compile time? No, you can't. None of your mentioned solutions can avoid unsafe access if you want performance.
I covered the unsafe (get_unchecked_mut) aspect in my post. Unsafe means you are achieving nothing but wasting time writing support code just to use Rust. In short, you are just writing janky C++ using a Rust compiler.
But hey, if that's what you want to do (or rather talk about), I will leave you to it. I'm gonna limit my Rust posts to once a week because verbosity and noise is one area where Rust developers have anyone beaten and I don't personally have the time to reciprocate.
- Likes 1
Comment
-
Originally posted by vextium View Post
I hope you know you're talking to one of the head engineers at System76 LMAO
Now I am curious and feel perhaps we should do a poll.
That said, when "head engineers" of Sun were preaching about Java being the "C++ killer" or when Microsoft "head engineers" stated that C# was the future, I was also very much in disagreement as I am now. Once you put aside that slightly childish celebrity infatuation mentality, you will realise that any engineer can make disagreeable judgements based on hype. That is what discussion is for.Last edited by kpedersen; 07 February 2024, 04:11 PM.
- Likes 1
Comment
-
Originally posted by kpedersen View Post
Aren't many of us here lead engineers in various tech companies? Middle aged men squabbling about programming languages on a Linux forum *probably* means they do this as part of their career haha.
Now I am curious and feel perhaps we should do a poll.
That said, when "head engineers" of Sun were preaching about Java being the "C++ killer" or when Microsoft "head engineers" stated that C# was the future, I was also very much in disagreement as I am now. Once you put aside that slightly childish celebrity infatuation mentality, you will realise that any engineer can make disagreeable judgements based on hype. That is what discussion is for.
- Likes 3
Comment
-
Originally posted by kpedersen View Post
That said, when "head engineers" of Sun were preaching about Java being the "C++ killer" or when Microsoft "head engineers" stated that C# was the future, I was also very much in disagreement as I am now. Once you put aside that slightly childish celebrity infatuation mentality, you will realise that any engineer can make disagreeable judgements based on hype. That is what discussion is for.
And Java still remains a lot more favored over C++ today.
- Likes 2
Comment
-
Originally posted by kpedersen View PostAren't many of us here lead engineers in various tech companies? Middle aged men squabbling about programming languages on a Linux forum *probably* means they do this as part of their career haha.
For the time that I was working on pop-shell, I adapted Typescript for use with GJS. All of us here like languages with type systems.
- Likes 2
Comment
Comment