from Hacker News

#[you_can::turn_off_the_borrow_checker]

by cherryblossom00 on 1/21/22, 11:29 PM with 29 comments

  • by ncmncm on 1/22/22, 2:11 PM

    If Rust is not to fizzle like Ada (which got overwhelmingly more investment than Rust has had) it needs a radically faster adoption rate. While several traps imperil Rust's wider adoption -- pathetic compile speed is another: consider JIT in the compiler! -- the borrow checker is an important roadblock for beginners.

    There is no practical need to enforce borrow checking on all debug builds: it suffices, for beginners, to know that a production build would fail. Forbidding any sort of testing until after the borrow checker is wholly satisfied generates pointless frustration. Can Rust really afford to drive beginners away? For Rust not to fizzle and die, it needs thousands to adopt it for each who already has. Saying "I persevered, you could too, given some backbone" is a recipe for failure.

    Is it strictly worse to (1) let beginners deal with borrow checking a little later in their process, or for (2) the language to fizzle and die? Dying is still a punishingly likely prospect. Network effects matter. I doubt that failing to achieve mainstream adoption would be good for Rust, for current Rust users, or the world.

    Everyone considering a language to learn has plenty of choices. A language rarely gets a second try.

  • by cherryblossom00 on 1/22/22, 2:09 AM

  • by mikewarot on 1/22/22, 3:41 AM

    If I can turn that stupid thing off, it might be worth learning Rust after all.
  • by errantmind on 1/22/22, 5:10 AM

    Why would you want to turn it off? I've been writing Rust code for a while and only struggled with this for the first few weeks. The borrow checker is useful and, while I don't mind some unsafe Rust here and there, I wouldn't want to have a Rust dependency that completely disabled it.
  • by Waterluvian on 1/22/22, 1:17 PM

    I’m surprised. I would have assumed that the borrow checker is critical to ensuring your code can even be compiled.