Hacker News new | past | comments | ask | show | jobs | submit login

I would have considered the borrow checker and zero cost abstractions to be rusts defining characteristics, so ocaml isn't anything like rust except some syntax and that they are both multi-paradigm. And then my point is that as the author points out, you don't really need a GC if you have a borrow checker. If you want a language with few costly abstractions, but with a GC, go or D come to mind I guess? But the borrow checker is such a big piece of rust I don't really consider those similar languages either.

If the idea is for a safe but more ergonomic language at the cost of performance, I think you'd be focused on making clone and copy implicit when a move doesn't work, getting rid of explocit borrows/references, and perhaps figuring out mutability without needing to annotate it. The absolute type safety is probably the biggest speedbump I hit in daily usage though, not the borrow-checker. A strong but duck/dynamic type system might solve that?




Most people when they say like Rust, they mean ML syntax, as Rust is the very first experience with Hindley–Milner type systems.

Borrow checker alone makes several algorithms and data structures quite hard to implement.

Swift memory ownership model, Linear Haskell, Hylo (née Val), Chapel, Ada formal proofs, D's ownership model, are all examples where language designers decided borrow checker alone is too much to ask for.


Swift's proposal with copy on write is the sort of thing I was suggesting to make the borrow checker more ergonomic. It is going to be optional though, which I think takes some of the utility away. I want much stronger safety guarantees in the overall infrastructure than that would provide. Linear types in haskell would provide that, but speaking of some data structures being difficult, Haskell makes largely the same ones problematic. Ada has a borrow checker of sorts, but it makes unchecked_deallocate UB. As long as you don't free memory it doesn't have UB. That isn't a bad trade really, but it still isn't completely impossible to do bad things with access types and they aren't that ergonomic either. I don't know much about the others you mentioned. There is definitely a space for a friendlier enforcement of ownership that makes strong guarantees. But again, the borrow checker isn't my main pain point in rust, its the static strong typing with no duck typing for generics. It makes for nice error messages, but it makes other stuff hard.


No need to call unchecked_deallocate directly, unless one isn't using controlled types, and even better SPARK features.

No UB to worry about.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: