4 ms·
> A) is easy to write one off scripts that do a job fast, with minimal thinking and effort. I am thinking of Python and Ruby. For me I can write code with high
by epage 4y ago
> A) is easy to write one off scripts that do a job fast, with minimal thinking and effort. I am thinking of Python and Ruby. For me I can write code with high velocity in these languages.
Once I wrap up some other projects, I plan to explore this space a little bit within Rust.
imo the biggest bang for the buck is just having good `#!` support. Probably mid-year I expect to have a Pre-RFC up for single-file cargo packages. See https://github.com/epage/cargo-script-mvs/discussions/15 https://github.com/epage/cargo-script-mvs/discussions/15.
A bigger effort is a batteries included, non-zero cost stdlib. I've started writing up my thoughts at https://github.com/ergo-rs/ergo https://github.com/ergo-rs/ergo.
For more background on why I think these are important, see https://epage.github.io/blog/2021/09/learning-rust/ https://epage.github.io/blog/2021/09/learning-rust/.
Would love feedback on these ideas and other ways to make Rust easy to use without sacrificing what makes Rust it is.
- duped 4y ago> imo the biggest bang for the buck is just having good `#!` support. Shebangs don't really make sense for AOT compiled languages and I don't know why you would really want one, but you can add `#!/usr/bin/env -S cargo run` to the top of a Cargo.toml file today and it will "work." I just think the premise of "why didn't you write your last script in Rust" is flawed. It's a systems programming language, if I'm writing scripts I don't really care about the same things - like static typing or meticulous error handling. It sounds like high effort and low reward imo. A REPL though (not a true one necessarily - but live-reloading of dynamic rlibs and using dynamic dispatch in place of monomorphization for REPL-builds) would be extremely useful as a workflow tool.
- wizzwizz4 4y ago> Shebangs don't really make sense for AOT compiled languages Tell that to #!/usr/local/bin/tcc -run.
- epage 4y agoIt makes a big difference when you share a code sample, whether in a blog or on an issue, to have a single block of text to copy/paste including dependency declarations. It also lowers the barrier for experimentation. I have a directory with probably 40+ cargo-script's for one-off reproduction cases of bugs and it is much easier to work with than juggling multiple files and the overhead associated with it.
- steveklabnik 4y ago> one-off reproduction cases of bugs I had never considered this case before. I'm going to start doing this!
- samsquire 4y agoI think this is a great idea and I really encourage you to keep going and trying things out. I'm not sure if C++ and Rust are harder to develop things fast in since I'm not experienced enough with them. it's the same with haskell, it isn't native for my mind to think from a haskell perspective.