If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Announcement
Collapse
No announcement yet.
Rust Bindings Posted For KMS Drivers, VKMS Ported To Rust
I wouldn't mind a Rust like language, but with Garbage Collection instead and an integrated Async runtime that is as easy to use as in Go. That would be probably my goto language for almost anything.
You could check out Gleam, it shares a lot of my favorite features from Rust but it runs on the Erlang VM, so it's garbage collected and uses the actor model for concurrency.
jacob Ocaml could be it (I considered Swift and F# as well). Honestly I did not expect so many suggestions in the comments.
Quackdoc Agreed. This is something I am saying for long time, for any kind of stuff people learn (Archlinux, Rust...) . Rust and it's eco system is very newcomer (noob) friendly. It comes straight with a good and free tutorial, excellent documentation, tooling, great libraries, great error messages from the compiler and so on and on. It (everyone behind it) does everything they can do to make it as easy and comfortable as possible.
I don't know why you find it cringe, but hey, we are all different. Rust has its own problems with the language or eco system, such topics as Async and GUI. But the worst part of Rust is the Rust Foundation. I'm glad Rust language exists and it is probably my favorite language. I wouldn't mind a Rust like language, but with Garbage Collection instead and an integrated Async runtime that is as easy to use as in Go. That would be probably my goto language for almost anything.
Yes. Vert much so. It has a high initial hump if you are comming from a new language, but it has excellent learning resources, and writing catastrophically bad code is a lot harder (not impossible) then other languages.
Using synchronized is not the only way how to write thread-safe concurrent programs in Java. There are other synchronization primitives available, e.g. atomic values, semaphores or barriers. Using synchronized everywhere as you said is easiest one but also the worst one.
Yes, I oversimplified Java somewhat, but my point still stands, that Rust will prevent, at compile time, using something from/across multiple threads if it causes data races -- Java won't and you just have to deal with random corruption if you don't read the docs carefully or in some cases you have to read the source code.
(e.g. in Java you either need synchronized everywhere or you can have state corruption when accessing an object from multiple threads
Using synchronized is not the only way how to write thread-safe concurrent programs in Java. There are other synchronization primitives available, e.g. atomic values, semaphores or barriers. Using synchronized everywhere as you said is easiest one but also the worst one.
The Rust language is designed around memory safety without garbage collection. It's not like someone just removed garbage collection from a language and inserted a borrow checker in its place; the language had to be designed around the borrow checker. If you add garbage collection then a large amount of the language no longer makes sense.
you might be surprised that lifetimes and ownership and borrowing are still very useful when you have a garbage collector, because they also handle waay more than just memory deallocation, e.g. they handle iterator invalidation (preventing concurrent modification and iteration unless the iterators are specifically designed to allow that, which is a major class of bugs all the way from C++ through Java and Python), they also handle concurrent access bugs (e.g. in Java you either need synchronized everywhere or you can have state corruption when accessing an object from multiple threads, Rust solves that problem using mutable references (for guaranteed unique access, allowing bypassing expensive synchronization), and Send/Sync traits for managing how a type can be used across threads). ownership using the RAII pattern also neatly solves the issue of closing files and other stuff that needs predictable cleanup.
Leave a comment: