6 ms·
#[you_can::turn_off_the_borrow_checker]
- mikewarot 5y agoIf I can turn that stupid thing off, it might be worth learning Rust after all.
- udbhavs 5y agoIn that case you're better off using OCaml with the native target.
- jaxrtech 5y agongl the borrow chicker is miles better than it used to be in terms of implants cit behavior and just dealing with more "natural" scoping patterns. It sure isn't perfect, but at the end of the day, I trust the borrow checker more than my logic to make sure that multi threaded applications do not have threading issues...
- Arnavion 5y agoYou're not going to learn anything useful by turning it off. If that's what's stopping you, don't bother.
- deleted 5y ago[deleted]
- cherryblossom00 5y agoMore discussion on r/rust: https://www.reddit.com/r/rust/comments/s9az4y/you_canturn_off_the_borrow_checker/ https://www.reddit.com/r/rust/comments/s9az4y/you_canturn_of...
- deleted 5y ago[deleted]
- errantmind 5y agoWhy 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.
- maxbond 5y agoThis is a curiosity which explicitly asks you not to use it for production. Just an exercise in hacking on the language and making it behave in ways it's not supposed to. I agree with you; the borrow checker is much of Rust's value proposition, and if one wanted to do without it, then Rust isn't the right tool for their particular needs.
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- Waterluvian 5y agoI’m surprised. I would have assumed that the borrow checker is critical to ensuring your code can even be compiled.
- ncmncm 5y agoIf 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.
- marginalia_nu 5y ago> If Rust is not to fizzle like Ada [...] it needs a radically faster adoption rate I would challenge this. Adoption rate does not mean longevity. There are many flash-in-the-pan technologies that are here one year and gone a few later. As a concrete example, the adoption rate of Ruby on Rails was nearly vertical in around 2006. PHP was old, boring, adoption was flat if not declining. ROR looked to become become king of the web. Today ROR is largely a legacy technology, a footnote at best. PHP is still here, though. It will likely outlast node, too, despite being an awful language. Large-scale adoption is a slow march through the decades, and has a lot more with momentum than anything else. A big reason why these antique languages have such sticking power is that they have a mature and well-established ecosystem. If you want a new language to join them, that is where the focus should be.
- ncmncm 5y agoThe number of lines of code in use has to be high, but there is a great deal of COBOL code. Who is coding new COBOL, or PHP? Ruby looked promising, but fizzled. Sticking power is necessary, but not sufficient. Rapid increase is necessary, but not sufficient. To get that miracle, you need both. Sticking at low adoption is the same as fizzling. Peaking but not sticking is fizzling. There are millions of ways to fail, a whole selection laid out for every language to choose from. Most languages pick one, and do. Succeeding takes a lot of good choices, and negligibly few bad ones. Failing to ease adoption where possible is a bad one.