19
devios1
6y

Holy shit. I just watched a video on Rust and I think I am in love.

Tracked mutability, reference counting, guaranteed thread safety, all in a compiled type-safe language with the performance of C++? 😍

Why did I not check this out sooner??

Comments
  • 3
    Link to the video? It's been on my list for ages, just never took the leap to actually trying it out.

    Looks like it may become the wasm standard, so should probably brush up.
  • 2
  • 2
    And their documentation is like nothing I have seen before!!

    Might be the most pleasurable language that I've ever learned!
  • 2
    I’m getting more and more excited the more I learn. I haven’t been this excited about a new language in a long time. This could be exactly what I’ve been looking for.

    I especially like that it is clearly very inspired by C++ and has many of the same philosophies such as giving the developer complete control (unlike languages like Swift and Java). It protects you from doing dangerous things at compile time thanks to its strict mutability rules, but if you need to you can still override it by adding an unsafe block and entering the unsafe superset mode of the language.

    It uses traits for generics, which sounds interesting to me though I don’t yet fully understand the difference between traits and interfaces/protocols.
  • 1
    I would love to use it, but dont think it's an option with my current projects in mind. I'll wait till it gets some more libraries/packages and love.
  • 0
    Oh my god its error handling is beautiful. I want to cry. In a good way.
  • 1
    "The Result types are enumerations, often referred to as enums. An enumeration is a type that can have a fixed set of values, and those values are called the enum’s variants.

    "For Result, the variants are Ok or Err. The Ok variant indicates the operation was successful, and inside Ok is the successfully generated value. The Err variant means the operation failed, and Err contains information about how or why the operation failed."

    It's so damn simple and elegant. It even forces you to handle (or at least acknowledge) errors at compile time to guarantee there won't be any accidentally ignored errors.

    It's clear that it's there to be helpful, but it's not going to nanny you about it. It lets you override anything you don't want.

    It also has a panic! macro that acts more like an exception and unwinds the call stack for unrecoverable errors.
  • 1
    Here's a good followup video if you watched the other and want more. This one goes a bit deeper: https://youtube.com/watch/...

    Welp. I've definitely found my next language!
  • 1
    @devios1 finally watched that video you shared. He made it all seem so simple and common sense. A real language with a purpose.
  • 1
    From docs to the Rust book everything this far has been a very pleasant experience. And Cargo is really a great tool.

    I won't be quick to replace c or c++ with it, but I can really see myself learning more about it since it truly is a wonderful language.
Add Comment