Rust Never Sleeps

Sorry, for the title, but I’m a big Neil Young fan, so I couldn’t miss the opportunity.

Rust Never Sleeps

Sorry, for the title, but I’m a big Neil Young fan, so I couldn’t miss the opportunity.

Over the past few months, I’ve been learning Rust, and I hated it initially, but now think it is the best language and environment I have ever come across. This feeling is echoed by a recent survey that put Rust at the top of the most loved computer languages (and which has been there for the past six years) [here]:

And the most dreaded include COBAL, VBA, Perl and C:

So, why Rust for me? Well, although I use Python a great deal, I have never really liked its syntax, and it has also been caused many problems in moving from Version 2 to Version 3. I must admit that I have to look-up on the Internet every time I need to do a simple for() statement. It can also be fragile in building applications and is not great in terms of its version control. While I like the way it deals with big numbers, it just seems to hide away a little too much control that C would give me.

My real first language was C, and that is the way my coding brain sees code, but it does let you away with too many bad practices. It’s also bound into a 1980s viewpoint of the work with LIBs and DLLs.

To me, Python is a great scratchpad for ideas, and good for doing small tasks. For cryptography, though, it is a bit slow and can have library integration problems. This is also the case for Node.js, and which uses horrible JavaScript style code. It also struggles to cope well with version control. To me, with Python and JavaScript, it doesn’t look too difficult for a malicious person to inject code into an application with the developers seeing it.

I also use Golang, and it is great as it compiles to native code, and I can see the code that is used in the libraries that I integrate. It’s fast and efficient, and feels more like C. But, I always just miss something, and it just doesn’t seem finished yet.

My other major language is C# running on ASP.NET, and it is great, but the integration of libraries is a little bit underwhelming for new methods. For me, it is great as a Web service platform — with its MVC approach, but not for writing code that can scale. It also is not a transferrable as other languages.

And so it is Rust that I pick for new applications for cryptography. It is my security mentor. Over the years, I have — like many — picked up slopping coding methods — probably through my C coding. Rust, though, scolds me, and tells me to do better, and then informs me why I shouldn’t be doing what I am trying. In C, you just told the compiler to get on with it, but in Rust, you are stopped at the gate.

It’s a dream to work with, and whatever I have wanted, I just search of docs.rs, and it’s there. It’s not just a library integration, as the full source code is there too, so I can review the implementation, and decide whether I want to integrate it. For productivity, I have not come across anything like it, and where I can see the different versions of the code I am integrating, and where I can lock the version number of these:

And I must praise the mighty Visual Studio Code, here. I make developing in any language a dream, and many developers seem to agree:

With Rust tools added, you have a complete environment for debugging and writing code:

So, here you go, here are my crypto examples:

https://asecuritysite.com/rust/

Enjoy!