Hacker News new | ask | show | jobs
by sapiogram 467 days ago
Rust loses a lot of its nice properties without borrow checking and lifetimes, though. For example, resources no longer get cleaned up automatically, and the compiler no longer protects you against data races. Which in turn makes the entire language memory unsafe.
2 comments

I believe OP meant to give it a GC like in Go, while keeping other features from Rust from enums/match/generics/traits/etc etc.

This should prevent most of the memory safety issues, though data races could still be tricky (e.g. Go is memory unsafe due to data races)

OTOH it would still have Rust's sane type system and all the nice features it makes possible.
OCaml and Haskell already have that nice type system (and even more nice). If OCaml's syntax bothers you, there is Reason [1] which is a different frontend to the same compiler suite.

Also in this space is Gleam [2] which targets Erlang / OTP, if high concurrency and fault tolerance is your cup of tea.

[1]: https://reasonml.github.io/

[2]: https://gleam.run/