I did not check lately, but is rust syntax still sane compared to the abomination which is the c++ syntax?
Everything Is Broken: Shipping Rust-Minidump at Mozilla
61–67 of 67 posts
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#62Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#63Earlier quoted context omitted.
So far I have found no Rust insertion-ordered collections which supports removing items without scrambling items (necessary for editing a key-value INI file) with O(log n) reads/writes, though you can use a vector with O(n) accesses which takes O(n^2) to lookup every key, which is probably good enough in most cases. And non-tree-shaped object graphs are not a library concern, but permeate entire applications; if you…
It seems that indexmap would fit your bill: Repo: https://github.com/bluss/indexmap IndexMap type itself: https://docs.rs/indexmap/latest/indexmap/map/struct.IndexMap... It has amortized O(1) reads and writes, and it supports removal without maintaining order in O(1), or while maintaining order in O(n).
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#64I wonder how much of the benefits comes from the rewrite itself and not Rust. I have taken really bad hard to maintain very large code bases written in C++ and step-by-step refactored it into bug free maintainable code. In my experience bad code written in any language is hard to maintain. And good code written in any language is easy to maintain. I have worked with C code that was a joy to maintain and C code that w…
Original rust-minidump author here: I started out by doing a pretty straightforward port of Breakpad into Rust, which I had just started learning at the time. I figured that learning a new language by porting a codebase I was intimately familiar with for a content area that I knew extremely well would make it so only the new language was the hard part. (It worked out well!) I did try to make the API more idiomatic Ru…
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#65Earlier quoted context omitted.
> Sure, you can write bad code in any language, but C and C++ are just bad languages. Let's give them credit for what we've achieved using them. I would definitely pick Rust over C++ any time, I respect C++ for all the cool things it gave us.
If they are bad languages then you should give most of the credit to the programmers that were using them.
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#66I wonder how much of the benefits comes from the rewrite itself and not Rust. I have taken really bad hard to maintain very large code bases written in C++ and step-by-step refactored it into bug free maintainable code. In my experience bad code written in any language is hard to maintain. And good code written in any language is easy to maintain. I have worked with C code that was a joy to maintain and C code that w…
There are entire classes of bugs that cannot happen in (safe) Rust that can still happen in a “bug free” C++ code based. You’re correct that Rust isn’t a panacea, but it does eliminate certain concerns that C++ just can not remove from thought while developing with it. The great thing about Rust is that it reduces the knowledge and skill a developer needs in order to write a stable and (usually) performant program. T…
Re: Everything Is Broken: Shipping Rust-Minidump at Mozilla
#67Earlier quoted context omitted.
> you can't trust that your enums have a value inside their interval If you don't set the underlying type, assigning a value that doesn't match an enumerator via `static_cast` is undefined behavior. See https://en.cppreference.com/w/cpp/language/enum . (Doing weird pointer casting things is also undefined behavior per the strict aliasing rule, though, come to think of it, I'm not sure whether memcpying an out-of-rang…
I’m assuming you are referring to this part: > If the underlying type is not fixed and the source value is out of range, the behavior is undefined. Note the fine print about the meaning of ”out of range”: > (The source value, as converted to the enumeration's underlying type if floating-point, is in range if it would fit in the smallest bit field large enough to hold all enumerators of the target enumeration.) So thi…