
Since those concepts are covered in depth in other places (e.g. In combination with the already mentioned RAII paradigm, the ownership system can prevent nullpointers and dangling pointers, just to name two representatives of a whole zoo of nasty problems. If you are starting out with rust, have a look at the ownership system, since it is an integral component of the language and is the enabler for most the nice features. With this, rust does not only ensure safety at compile time but also makes it easy to create clean, well-behaved code and hard(er) to create an unmaintainable mess.

This is achieved by using a combinations of multiple concepts, such as the ownership system, lifetimes and explicit mutability. One of the main goals of the language is safety. grep in this case) and a deliberate action, that forces you to be aware that this can go wrong at that place. This is (obviously) bad practice, easily discoverable by static analysis (aka. unwrap() means, that you allow your code to panic (rust-slang for a more-or-less controlled crash) at this point. To use the contents of an Option you need to explicitly handle the case that it is None, for example by using a match statement, providing an alternative content or using. So is null just renamed to None? Fortunately not. But what to do if the content is not known yet? Rust provides an Option type, an enum either containing Some(.) or None. a String), you need to fill it with a value (this is called RAII). This is done by the following: If you allocate a resource (e.g. So, what makes Rust cool and why should I use it for that project? Null So, before I go over how to build a GUI with Rust, let’s quickly iterate over some aspects of the language, that make it pleasant to work with. I therefore set out to explore the realms of GUI development with Rust to gain an increased understanding of its quirks and evaluate its readiness for being used in our projects.

Rust is a systems programming language, that describes itself as a ‘safe, concurrent, practical language’.īecause Rust supports cross compilation since its early stages and provides a platform agnostic standard library, it seems to be a perfect fit to develop native, high-performant graphical desktop applications.
