Announcement

Collapse
No announcement yet.

Rust Bindings Posted For KMS Drivers, VKMS Ported To Rust

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by darcagn View Post
    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.

    Comment


    • #22
      Originally posted by michael
      a lower barrier to entry for new developers
      is rust considered noob-friendly or something?

      Comment


      • #23
        Originally posted by programmerjake View Post
        (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.

        Comment


        • #24
          Originally posted by dpospisil View Post

          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.

          Comment


          • #25
            Originally posted by quaz0r View Post
            is rust considered noob-friendly or something?
            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.

            Comment


            • #26
              Originally posted by byteabit View Post

              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.
              So basically you want OCaml.

              Comment


              • #27
                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.

                Comment


                • #28
                  Originally posted by byteabit View Post
                  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.

                  Comment


                  • #29
                    Originally posted by byteabit View Post
                    jacob Ocaml could be it (I considered Swift and F# as well). Honestly I did not expect so many suggestions in the comments.
                    imho Zig is something you should watch closely

                    it isn't based on garbage collection, by handles the "usual" problems through various semantic abstractions

                    it is not like Rust, and it feels more like high level garbage collected languages

                    and yes the first impression when you learn you must specify allocators will be a shock!

                    Comment


                    • #30
                      Originally posted by Sethox View Post
                      The only thing I find cringe about Rust is that the book I am reading to learn Rust calls Rust developers "Rustaceans".
                      Well, a more fitting name would be "Rustafarians" for their cult-like behavior.

                      ‚Äč

                      Comment

                      Working...
                      X