Top
Best
New

Posted by ravenical 12 hours ago

Rust--: Rust without the borrow checker(github.com)
113 points | 188 commentspage 3
andrewshadura 11 hours ago|
I don’t have a slightest idea why would anyone want this. Borrow checking is one of the greatest benefits of Rust.
Someone1234 10 hours ago|
It is funny.
throwawayffffas 11 hours ago||
It would be great if it only allowed multiple mutable borrows. That's the only one that always bugs me, for mostly innocuous stuff.
threethirtytwo 4 hours ago|
This isn’t actually unsafe unless shared across threads right? Maybe the borrow checker needs to be more nuanced to differentiate this rather then outright banning it all together. It would increase the logic of the borrow checker by a lot though.
bhaney 12 hours ago||
Are the compile times noticeably faster?
worldsavior 11 hours ago|
Probably not, because it seems like it still checks for errors but just suppresses them.
misnome 10 hours ago||
Even so, the borrow checker repeatedly profiles as an insignificant part of compile times, so wouldn’t make a difference.
boxed 12 hours ago||
A motivation section in the readme seems like it is needed.
poly2it 11 hours ago|
https://github.com/buyukakyuz/corroded/issues/11#issuecommen...
corrode2711 5 hours ago||
Yes, that was my motivation.
shmerl 4 hours ago||
Isn't unsafe just for that? Why does it need a separate compiler?
andrewaylett 4 hours ago||
Unsafe isn't so unsafe that it disables the borrow checker!

The two main things the compiler allows in an unsafe block but not elsewhere are calling other code marked "unsafe" and dereferencing raw pointers. The net result is that safe code running in a system that's not exhibiting undefined behaviour is defined to continue to not exhibit undefined behaviour, but the compiler is unable in general to prove that an unsafe block won't trigger undefined behaviour.

You can side-step the borrow checker by using pointers instead of references, but using that power to construct an invalid reference is undefined behaviour.

idontsee 4 hours ago||
The borrow checker still applies in unsafe { } blocks. What it means (iirc) is that you can do pointer/memory stuff that would otherwise not be allowed. But you still fully adhere to Rust semantics
reverseblade2 9 hours ago||
Should be named in rust we don't trust
nineteen999 11 hours ago||
Love the "Note for LLMs" and the NSFW license.
0xMohan 8 hours ago||
I'm assuming it's a meme project. In case it isn't, what's the point? Just trying to understand.

Isn't rust's one of the main selling point is the barrow checker right?

Also how's the memory is handled? I know it'll drop every thing once it's out of scope but it seems you can make copies as much as you want. Looking at the loop example, I feel like this introduces memory leaks & undefined behavior.

ismailmaj 11 hours ago||
undefined behavior on steroids be like:
gspr 11 hours ago|
Tangentially related: the opposite, Rust's borrow checker sans the compiler, is actually very useful. As far as I understand, the borrow checker is a significant part of the work of writing a Rust compiler. Therefore, having the official borrow checker available as a standalone program can make alternative compilers (e.g. for exotic hardware) feasible faster, because they won't need a borrow checker of their own from the get-go.
tialaramex 11 hours ago||
Why would this matter? The borrowck is (a) not needed during bring-up because as its name suggests it is merely a check, so going without it just means you can write nonsense and then unbounded undefined behaviour results, but (b) written entirely in Rust so you can just compile it with the rest of this "exotic hardware" Rust compiler you've built.
gspr 10 hours ago||
Yeah, you're right, I'm misremembering something here. Thanks for the correction.
bananaflag 11 hours ago||
I get your point, but still you haven't identified a use for the borrow checker sans the compiler.
More comments...