Junilu Lacar wrote:I'm planning on making Rust my choice for this year's Pragmatic Programmer Learn a New Programming Language every year.
A few questions for newbies:
1. Is there an IDE that works better for Rust programming? What does your development environment look like?
2. Is Rust mostly for command line / console programs or can it be used for other things?
3. What kind of programs might it not be the best choice to use?
1. I learned vim 25 years ago, and it's been my only text editor my whole career. I write every language (bash, Perl, Python, Haskell, Rust, JavaScript, etc.) in it. (I've also written all three of my books in vim. I detest
Word.) I have a few customizations for each language mostly around syntax checking and auto-formatting (e.g., yapf with Python, rustfmt for Rust). I personally dislike IDEs. I find them busy and pushy. I don't like using a mouse. I prefer using vim shortcuts where my hands never leave the keyboard, and I find I'm quite faster at editing code. With my training in music, I actually feel like vim is an instrument that I've mastered such that I barely think about how to execute very complex operations. I usually open 2-3 terminal windows where I use the command line to execute programs and tests in some and edit source code in others. I keep it as simple and as possible, so when I'm developing locally on my machine I use the same tools that I use when I'm shelled into a remote machine.
2. Rust is killer on the command line and is making progress in many other areas such as WASM (web assembly) and the Linux kernel. Honestly, I've only used it for CLIs, which is about 90% of what I do. For web development, I use Elm to write front-ends and generally Python to interact with databases for the API. Rust is a relatively young language, so I expect it will keep expanding into all these areas. I would love to use Rust to code web front- and back-ends one day. I still have a lot to learn, esp about WASM.
3. I find I still have to use Python quite a bit in the data science realm. My gig is bioinformatics, and while Rust is making some headway there, most of the tools and libraries I need are Python and R. E.g., I rely a lot on the Python "pandas" library to parse tabular data and perform basic statistical operations. The relative looseness of Python can be an advantage with nebulous and poorly formulated data, so I would only jump to Rust if I was trying to battle-harden some code. I did recently write a rather large Python application for a customer and found Python required me to write loads of tests, many of which would have been superfluous in Rust. Unfortunately, I was lacking Rust libraries to parse some very specific and tricky genetic data. Time constraints didn't allow me to roll my own version in Rust because the Python module was just fine. This will change one day, and maybe I should work on that Rust library (in my copious free time!).