Preferences

simonask
Joined 1,381 karma

  1. It’s absolutely not useless, I do it often as a way to diagnose various kinds of problems. But it’s extremely rare that a handwritten version actually performs better.
  2. An old approach to micro-optimization is to look at the generated assembly, and trying to achieve the same thing with fewer instructions. However, modern CPUs are able to execute multiple instructions in parallel (out-of-order execution), and this mechanism relies on detecting data dependencies between instructions.

    It means that the shorter sequence of instructions is not necessarily faster, and can in fact make the CPU stall unnecessarily.

    The fastest sequence of instructions is the one that makes the best use of the CPU’s resources.

  3. Just be careful not to blindly apply the same techniques to a mobile or desktop class CPU or above.

    A lot of code can be pessimized by golfing instruction counts, hurting instruction-level parallelism and microcode optimizations by introducing false data dependencies.

    Compilers outperform humans here almost all the time.

  4. You know, I actually sympathize with the opinion that people should be expected and assumed to be able to resist attempts to convince them of being nazis.

    The problem with it is, it already happened at least once. We know how it happened. Unchecked narratives about minorities or foreigners is a significant part of why the 20th century happened to Europe, and it’s a significant part of why colonialism and slavery happened to other places.

    What solution do you propose?

  5. Rust fanboys on Reddit are not contributing to the Linux kernel. What matters here is that Rust helps serious people deliver great code.
  6. This is just so obtuse. Be serious.

    Even if you somehow manage to ignore the very obvious theoretical argument why it works, the amount of quantitative evidence at this point is staggering: Rust, including unsafe warts and all, substantially improve the ability of any competent team to deliver working software. By a huge margin.

    This is the programming equivalent of vaccine denialism.

  7. And it is intellectually lazy.
  8. You have a wild amount of confirmation bias going on here, though.

    Of course, this bug was in an `unsafe` block, which is exactly what you would expect given Rust's promises.

    The promise of Rust was never that it is magical. The promise is that it is significantly easier to manage these types of problems.

  9. I just wonder how readily people would defend this viewpoint if they belonged to any of those groups whose "feelings" are typically being "hurt".

    I don't know about you, but there does not exist any amount of technical achievement that will make me brush off sexism, racism, homophobia, transphobia, or anything else. If you are going to be disrespectful to me or people I care about, we cannot work together, period.

    By "political correctness" people often mean "the basic requirement to treat your fellow humans respectfully", and that's an incredibly low bar.

  10. I think it’s because you misread my comment by skimming over the important parts.

    This isn’t about tooling, it’s about language features and type systems.

  11. Copenhageners eat the same plastic-wrapped salads, organic grass-fed whatever, and whatever the latest green smoothie trend is, as in Southern California.

    If this is a dig at the largely pork/cabbage/potato-based diet of Northern Europe, you will be relieved to hear they don’t follow it.

    Source: Am one.

  12. Comparing type systems is difficult, but the general experience is that it is significantly easier to encode logic invariants in Rust than in C++.

    Some of the things you can do, often with a wild amount of boilerplate (tagged unions, niches, etc.), and some of the things are fundamentally impossible (movable non-null owning references).

    C++ templates are more powerful than Rust generics, but the available tools in Rust are more sophisticated.

  13. FTA:

    > Others think someone from the Rust (programming language, not video game) development community was responsible due to how critical René has been of that project, but those claims are entirely unsubstantiated.

    What is this culture war you're fighting?

  14. And they are saying that it already is, naming a few examples of things that really need to be illegal to reprogram.

    GPS et al would be non-functional if everybody could make a jammer.

    (That’s not to say that app stores fall even remotely in that category.)

  15. No matter how hard you try to paint it as such, Rust is not a tribe. This is such a weird characterization.

    Rust contributions to the Linux kernel were made by individuals, and are very obviously subject to the exact same expectations as other kernel contributions. Maintainers have responsibilities, not “communities”.

  16. C has a lot of the same borrowing rules, though, with some differences around strict aliasing versus the shared/exclusive difference in Rust.

    Most of the things people stub their toe on in Rust coming from C are already UB in C.

  17. Using LLVM somewhere in the build doesn't require that you compile everything with LLVM. It generates object files, just like GCC, and you can link together object files compiled with each compiler, as long as they don't use compiler-specific runtime libraries (like the C++ standard library, or a polyfill compiler-rt library).

    `clang-cl` does this with `cl.exe` on Windows.

  18. What they mean is that the Linux kernel has a long-standing policy to keep the whole kernel compilable on every commit, so any commit that changes an internal API must also fix up _all_ the places where that internal API is used.

    While Rust in the kernel was experimental, this rule was relaxed somewhat to avoid introducing a barrier for programmers who didn't know Rust, so their work could proceed unimpeded while the experiment ran. In other words, the Rust code was allowed to be temporarily broken while the Rust maintainers fixed up uses of APIs that were changed in C code.

  19. In any struct where all fields have the same size (and no field type requires higher alignment than its size), it is guaranteed on every (relevant) ABI that there is no padding bytes.
  20. I'm no expert, but the narrative is that it really depends what you need them for. And keep in mind that joining the jet fighter programme also means joining the development of it, enacting a certain amount of influence through your funding. For example, it is conceivable that a sufficiently upgraded Gripen tailored to our needs would be just as effective (which aren't really dogfighting, as I understand it), and cheaper.

    Anyway we're all just crossing our fingers that the US is just temporarily insane and will eventually come to its senses. What else can you do.

This user hasn’t submitted anything.