• 0 Posts
  • 66 Comments
Joined 2 years ago
cake
Cake day: July 9th, 2023

help-circle

  • There are several ways to achieve an effect equivalent to operator overloading in Rust, depending on exactly how you want the overloading to work.

    The most common is

    fn do_something(arg: impl Into<Args>) {
        ...
    }
    

    This lets you pass in anything into the function that can be converted into the Args type. If you define the Args type yourself then you can also define any conversion that you want, and you can make any construction method you want for it. It’s a small touch more explicit than C++'s operator overloading, but I think it pays off overall because you know exactly what function implementation all different choices of arguments will be funneling into.

    I’ll admit there’s one thing from C++ that I frequently wish were available in Rust: specialization. Generics in Rust aren’t exactly the same as templates in C++ but they’re close enough that the concept of specialization could apply to traits and generics. There is ongoing work to bring specialization into the language, but it’s taking a long time, and one of my projects in particular would seriously benefit from them being available.

    Still, Rust will have specialization support long before C++ has caught up to even a quarter of the benefits that Rust has over it.


  • Even with modern C++ it’s loaded with seg fault and undefined behavior footguns.

    The times when C++ feels more ergonomic than Rust are the times when you’re writing unsafe code and there’s undefined behavior lurking in there, waiting to ambush you once you’ve sent it to production. Code that is 100% guaranteed safe is always, and I really want to emphasize this: always more ergonomic to write in Rust than it is to write in C++.

    Show me any case where C++ code seems more ergonomic than its Rust equivalent, and I will always be able to show you how either the C++ code has a bug hiding in it or how the Rust code can be revised with syntactic sugar to be more ergonomic than the C++.


  • C++ was far and away my favorite language (I used it professionally for 10 years and was always excitedly keeping up with new ISO developments), until I learned the basics of Rust…

    Now it’s my firm belief that the world will become a better place when C++ stops existing. C++ just has no positive role to play in a world where Rust exists at the level of maturity that it already has.

    Whatever they might try to do to C++ to make it less intolerable will be in vain until they’re ready to break backwards compatibility. And once they’re willing to break backwards compatibility to legitimately improve the language, they’re just going to end up with a messy knock off of Rust.



  • I’m not trying to shill for Google but I really think it would be a mistake to break up Google without breaking up Microsoft simultaneously if not first. If they actually manage to crack open Google’s search and browser monopoly, who do they really think is going to start filling in that void? Local mom and pop search engines…? No it’s primarily going to be Microsoft with Bing and Edge, and I’m absolutely certain that whatever people don’t like about Google having its monopolies is going to be orders of magnitude worse if Microsoft gains ground there.


  • The “reform is impossible” is a self-fulfilling prophesy because it leads leftists to never try to get involved, which means they’ll never get a seat at the table, which means they’ll never be able to steer the party.

    I certainly can’t prove that the influence of big money can ever be overcome within the party by grassroots organization, but you also can’t prove that it’s impossible (you can only prove that it’s difficult, which is something I certainly won’t dispute).

    You certainly can’t prove that a true socialist movement will ever gain traction in America. It seems like the general public is so brainwashed they would rather be indentured servants of large corporations than lift a single finger to seize the means of production.

    So we’re left with two unprovable paths to consider, and here’s the thing: the two paths are not mutually exclusive. Leftists can try both at the same time with neither being disruptive to the other. So this is the pragmatism: consider all possibilities and put the eggs into more than one basket.


  • Or he’s a pragmatist who is concerned with both harm reduction and the likely reality that the only takeaway that Democrats will ever have from losing an election to someone right wing is that Democrats need to go even further to the right to win.

    If leftists give the impression that nothing will ever be good enough for them then

    1. Democrats have no incentive to court the left
    2. Democrats have no estimate for how many votes they would even be able to pick up from the left relative to how far left they might try to reach

    I personally believe that if the Democrats had taken on a progressive populist anti-genocide platform they would have won the election handsomely, but I am left with no way to empirically prove that to anyone because so many leftists opt out of voting entirely.









  • Originally, a qipao was supposed to be a loose-fitting gown

    Source for this? From living in Asia (not in China, but in a predominantly Chinese community), I’ve only seen qipao be form fitting, never loose. Even seeing older pictures of women in qipao, they’re always form fitting. And more often than not, women seem to use them to intentionally highlight their figure.

    Chinese communities tend to have a strong conservative bend, but that doesn’t mean they’re puritanical when it comes to sexuality, especially the sexually suggestive.