Planet Gluster

Aggregated news from external sources

A Challenging Introduction to Rust

2024-11-27

Learning a new programming language is rough without using it regularly. When I tried to learn Go a while ago, I struggled because I was not using it a lot. Then I my team at work started using Go and it clicked into place really well. When I decided to pick up Rust, I ran into the same challenge. This time, work wasn’t going to save me. I decided to challenge myself to write all new personal code in Rust.

As part of a college course I’m doing, I have a security and cryptography module this year and I decided to try to write the code for that module with Rust. In some particularly tricky sections, I had to write the code in Python first and then figure out how to convert that into Rust. I’m pretty sure my code isn’t the most perfect, it helped me get a sense for using the language constructs and reading a lot of documentation.

Some useful things I learned

  • Read the docs. Duh. I also enjoyed Rust by example.
  • Clippy helped improve my code into something marginally elegant.
  • Learning to write tests early increased my velocity a lot. The code-edit-run cycles are a lot easier if unit tests do the work for you.

Following a book or a full guide bored me a bit, so this was a nice middle ground and I got to submit this for my assignment. The code is at cipher-suite and I can’t really think of any real world use cases for it. It was fun playing around with it.

Source: nigelb (A Challenging Introduction to Rust)

BLOG

  • 06 Dec 2020
    Looking back at 2020 – with g...

    2020 has not been a year we would have been able to predict. With a worldwide pandemic and lives thrown out of gear, as we head into 2021, we are thankful that our community and project continued to receive new developers, users and make small gains. For that and a...

    Read more
  • 27 Apr 2020
    Update from the team

    It has been a while since we provided an update to the Gluster community. Across the world various nations, states and localities have put together sets of guidelines around shelter-in-place and quarantine. We request our community members to stay safe, to care for their loved ones, to continue to be...

    Read more
  • 03 Feb 2020
    Building a longer term focus for Gl...

    The initial rounds of conversation around the planning of content for release 8 has helped the project identify one key thing – the need to stagger out features and enhancements over multiple releases. Thus, while release 8 is unlikely to be feature heavy as previous releases, it will be the...

    Read more