News for hackers. Stuff that matters.
Re:Several core problems with Rust by bccdee on Sunday November 23, 2025 @11:54PM (#46030520)
What UB? This has nothing to do with UB; it'd be well-defined in any language. It's equivalent to this python snippet:

  config = load_config()
  if !config.valid():
    sys.exit(1)  # config is corrupt. restart pod
Did Python do something wrong by letting users call `sys.exit`? No. This is a deliberate crash. Under other circumstances, crashing might have been a valid strategy, but here it turned out to be a bad choice, since Cloudflare's infrastructure was restarting the service with the same bad config every time.
Re:Several core problems with Rust by josefx on Monday November 24, 2025 @04:19AM (#46031997)
Sys exit does not crash. It raises a SystemExit exception, which can be caught on any layer above it. Given that python uses exceptions for trivial things like loop termination this can be considered normal flow control.
Re:Several core problems with Rust by Measter on Monday November 24, 2025 @09:03AM (#46034214)
And, by default, panicking in Rust also doesn't crash, it begins a stack unwind which can be caught on any layer above it with catch_unwind.
Re:Several core problems with Rust by bccdee on Tuesday November 25, 2025 @01:42PM (#46049158)
Yeah, and in Rust you can catch the panic from `unwrap()` with panic::catch_unwind. You just don't, for the same reason you don't catch SystemExits. If a SystemExit is being thrown, it's because you want to crash; if you don't wan to crash, don't throw a SystemExit.