3 ms·
Unless you're writing libraries, Rust feels a lot like Python. One thing that sticks out in a scripting mindset is the various string types, but I mostly accep
by jdub 6y ago
Unless you're writing libraries, Rust feels a lot like Python.
One thing that sticks out in a scripting mindset is the various string types, but I mostly accept that as a small price to pay for doing things correctly (OS strings vs. UTF-8 vs. C strings).
Because of the kinds of things I build with Rust, I've had to write quite a few cargo build scripts (build.rs files), which are very bash/Python script-y in nature. Not once have I wished for a different language!
- aboodman 6y agoCan you point me to some open source examples of these? I work in Rust and I cannot for the life of me imagine describing it as "scripty". On the contrary I feel constantly bludgeoned by the type system whenever I have to do something in that realm (e.g., a unit test).
- jdub 6y agoOh, I was describing the nature of build.rs files as script-y, rather than Rust itself. :-) Here's a very simple one: https://github.com/alexcrichton/brotli2-rs/blob/master/brotli-sys/build.rs https://github.com/alexcrichton/brotli2-rs/blob/master/brotl... Here's one with much more complicated requirements: https://github.com/sfackler/rust-openssl/blob/master/openssl-sys/build/main.rs https://github.com/sfackler/rust-openssl/blob/master/openssl...