3 ms·
My project to learn rust was a camera RAW format loader[1]. Compared to the good modern C++ codebase it's based on the end result supports the same formats, has
by pedrocr 9y ago
My project to learn rust was a camera RAW format loader[1]. Compared to the good modern C++ codebase it's based on the end result supports the same formats, has the same performance, is only 20% of the lines of code, and is much safer to use (binary formats are rife for exploits). Doing all that took me less time than I had already spent previously fuzzing the C++ codebase and doing whack-a-mole on extremely scary exploitable bugs. For that use case it was extremely successful.
The next step is to build an image pipeline and editor around it[2][3]. For that the graphics ecosystem isn't as mature as the equivalent C/C++ ones but the possibilities are also amazing. The expressiveness of the language combined with the great LLVM backend means some things like very clean ways to do SIMD/threading become just a joy to use
If only I had the chance to work on this full time for a year... Help would be very much appreciated!
The kinds of things that become possible and even pleasent once you remove the mental overhead of dealing with the fundamental warts of C/C++ are amazing. After this experience with rust I don't see any reason to ever write C/C++ again.
[1] https://github.com/pedrocr/rawloader https://github.com/pedrocr/rawloader
[2] https://github.com/pedrocr/rawloader/tree/master/src/imageops https://github.com/pedrocr/rawloader/tree/master/src/imageop... (to be spun out into its own crate)
[3] https://github.com/pedrocr/chimper https://github.com/pedrocr/chimper
- vvanders 9y agoYup, that mirrors my experience working with binary wire formats and the like. There's also the added bonus that doing cross-platform code with Rust is a breeze. If you aren't depending on any C libraries you basically get it for free. I had a UI framework that was running on 5 different targets that was a joy to work with. I've done that in C/C++ before and it's a massive pain.
- ealhad 9y agoWhich framework? It have not yet done any GUI with Rust, but would gladly try.