Mama told me not to come.

She said, that ain’t the way to have fun.

  • 0 Posts
  • 809 Comments
Joined 3 years ago
cake
Cake day: June 11th, 2023

help-circle


  • I see you ignored my entire comment.

    No, I responded to the relevant part. I was using segfault as a metaphor, not arguing that it’s actually the same mechanism underneath. If you’re getting panics in production code, I consider that just as much of an emergency to fix as a segfault, and Rust helpfully gives you stack trace info with it. It’s not the same idea as an exception, which could signify an unrecoverable error or an expected issue that can be recovered from.

    I don’t know what is more explicit about expect

    It forces you to write a message, so most temporary uses will be unwrap(). I use unwrap() all the time when prototyping for the happy path, and then do proper error handling later. This is especially true in larger projects where I can’t just throw in anyhow or something and actually need to map error types and whatnot. I don’t use expect() much (current hobby project has 4 uses, 3 for startup issues and 1 for hopefully impossible condition) but I think it makes sense when there’s no way to continue.

    But yes, unwrap() is perhaps the first thing I look for as a reviewer, which is why it’s so surprising that this is the issue. At the very least, it should have been something like expect("exceeds max file size"). I personally prefer explicit panics in production code, but expect is close enough that it’s personal preference.


  • Yes, it’s not the same since you get a stacktrace (if enabled) and a message, but it’s the closest thing you get in safe rust (outside compiler bugs). I compare it to a segfault because it’s almost as unhandleble.

    Basically, you don’t want a panic to crash your program in most cases. If you do, make it explicit (i.e. with expect()). unwrap() tells me the value is absolutely there or the dev is lazy, and I always assume the latter unless there’s an explanation (or it’s obvious from context) otherwise.




  • It is unwrap’s fault. If they did it properly, they would’ve had to explicitly deal with the problem, which could clarify exactly what the problem is. In this case, I’d probably use expect() to add context. Also, when doing anything with strict size requirements, I would also explicitly check the size to make sure it’ll fit, again, for better error reporting.

    Proper error reporting could’ve made this a 5-min investigation.

    Also, the problem in the first place should’ve been caught with unit tests and a test deploy. Our process here is:

    1. Any significant change to queries is tested with a copy of production data
    2. All changes are tested in a staging environment similar to production
    3. All hotfixes are tested with a copy of production data

    And we’re not a massive software shop, we have a few dozen devs in a company of thousands of people. If I worked at Cloudflare, I’d have more rigorous standards given the global impact of a bug (we have a few hundred users, not billions like Cloudflare).


  • Ift is precious and beyond compare. It has tools that most other languages lack to prove certain classes of bugs are impossible.

    You can still introduce bugs, especially when you use certain features that “standard” linter (clippy) catches by default and no team would silence globally. .unwrap() is very controversial in Rust and should never be used without clear justification in production code. Even in my pet projects, it’s the first thing I clear out once basic functionality is there.

    This issue should’ve been caught at three separate stages:

    1. git pre-commit or pre-push should run the linter on the devs machine
    2. Static analysis checks should catch this both before getting reviews and when deploying the change
    3. Human code review

    The fact that it made it past all three makes me very concerned about how they do development over there. We’re a much smaller company and we’re not even a software company (software dev is <1% of the total company), and we do this. We don’t even use Rust, we’re a Python shop, yet we have robust static analysis for every change. It’s standard, and any company doing anything more than a small in-house tool used by 3 people should have these standards in place.








  • everyone panic selling could spread over to people panic selling everything and trying to get their hands on cold hard cash so their entire life savings dont vanish in an instant, so market wide we could see big drops?

    Yeah, that’s basically what happens in a major correction. In fact, stock prices are valid basically the result of how many prior people are buying vs selling; more buyers than sellers causes prices to go up, more sellers than buyers cause prices to go down. Stock prices tend to have momentum precisely because of this (people try to jump on the bandwagon on the way up and jump off on the way down). And that’s also why we tend to see a quick recovery afterward once all the facts come out.

    A 20-30% drop is a pretty big deal. It’s not anomalous though. There have been 19 major corrections (over 20% loss) over the past 150 years, meaning it happens every 7-10 years on average (150/19 ~= 7.8 years).

    I don’t think this is like the .com or financial markets of the 2000s. But let’s say it is. If I bought at the peak of the .com bubble (March 10, 2000), I would’ve gotten 5.3% annualized growth over that 25 years (so $1k would be $3900-ish), assuming I don’t sell. The impact would be limited long term.

    The AI bubble popping wouldn’t be the catastrophy many are making it out to be. I think it’ll be closer to the 2020 correction.

    I think Nvidia is overvalued. I don’t think the economy will crash if AI crashes.





  • My point is Nvidia isn’t propping up the bubble. If you look at the OpenAI deal, it’s a bit less than their yearly revenue, and the deal is for about the number of GPUs they make in a year, so it’s basically trading GPUs for equity. If anything, Nvidia is profiting from the bubble, not propping it up.

    we will all be effected

    Oh certainly, but I don’t think it’s any different from other large corrections.

    Here’s how I see the major companies in that chart in a crash situation:

    • Nvidia - currently trading at 50+ times earnings on AI hype, but 25 is more reasonable, so potential crash of 50%, but probably much less since they’re still king in non-AI compute
    • Microsoft - AI is mostly value add, and the stock isn’t too inspired overhyped, so maybe 10% correction?
    • OpenAI - would go under and get liquidated
    • Oracle - datacenters and AI aren’t a huge part of its business, so probably minimal impact
    • the rest - haven’t looked into all of them, but most will be hit hard

    It’ll he hit hard, but not nearly as bad as 2000 or 2008. If I look at the S&P 500, only 3 of the top 10 (Nvidia, Google, Meta) would be severely impacted, the rest only seem to dabble. Those 10 make up almost 40% of the S&P 500 and like 30-35% of the total US market. There are more large companies in there as well, but I don’t think most will be screwed like OpenAI. Palantir, for example, likely retains its government contracts for their data alone.

    So in an AI bubble scenario, I’m guessing we see a correction of like 20-30%, maybe less depending on the nature of it. I think a more likely scenario is a bear market where investors slowly get tired of poor earnings as the promises of AI fail to manifest. If OpenAI dies, large companies just move to another provider.

    And final note, it’s not a bubble because someone made a graphic, they made a graphic describing how it could be a bubble.

    I think they’re missing the forest for the trees here. It’s not a bubble because these companies are investing in AI, it’s a bubble because tons of companies are buying into the hype. These companies are merely investing into solutions those companies claim to want. I work for a relatively small non-US company (a few thousand employees, revenue around $1B), and the board recently came to our tech group asking what we’re doing with AI.

    This isn’t a handful of companies propping it up, a large chunk of the market is afraid of being left behind and demanding AI tools. All the graphic shows is how large companies are investing to meet the demand. Microsoft used OpenAI products in its offerings, OpenAI is a major Nvidia customer, etc.