Hello all,

I am a data center engineer of about 8 years now. I’ve spent the last 3 years or so slowly learning Python(I say slowly not because of my effort, but because learning Python was actually very difficult for me.) I am not an expert in any way shape or form, I understand the concepts of OOP, inheritance, classes, functions, methods, etc and I have found that the python documentation that can be found within the language is usually enough for me to be able to write the programs that I want to write. Very rarely have I had to write programs that have to bypass the GIL, but occasionally, I have created threadpools for applications that are not I/O intensive. What I’m saying is, for most things that I create, performance is enough with Python.

However, I have been inspired by how much love Rust is getting from the people who use Rust. I have tried to find some books for using Rust for network automation and unfortunately I have not been able to find any reputable books.

Most of the “automation” work that I do involves parsing data with regex, restructuring the data, converting the data into a modeled format and transforming something with that data. Does anyone have any common use cases for Rust that might interest me? Has anyone used Rust for network automation tools? With familiarity, can Rust’s intuitiveness match Python’s “from idea to deployment” speed? Or should I only learn Rust if I intend to create applications that need tight performance?

  • @nous
    link
    English
    5
    edit-2
    10 months ago

    For quickly throwing together a small script, a developer equivalently experienced in Python and Rust will likely find Python faster to use

    I am not sure about that. I have written a few scripts in rust that I managed to do quite quickly. Once you have a project similar to what you have done before setup time is not that long and the more examples of things you have done before lets you get going quite quickly - this is true of any language really. The slowest part I tend to find is learning the libraries you need to use for a given script or doing something you have not quite done before. Which I think in rust it can take a bit longer for these parts - but once you have overcome that hurdle similar scripts are easier to write in the future. Python might win out if you constantly need to write things from scratch with no past examples and always needing to use new unfamiliar libraries. But I find that is not often the case and over time becomes less and less the case.

    And for those cases where you can just adapt something you have written before rusts very easy refactoring actually adds a lot of value and helps to speed things up quite a bit. Though it does take quite a lot more knowledge with the language to get to that point that it does with python I think.