4 ms·
I love Rust for systems dev, and I truly can't wait to read the article, because I can't imagine ever wanting to use it for exploratory data analysis, one-off s
by voodootrucker 6y ago
I love Rust for systems dev, and I truly can't wait to read the article, because I can't imagine ever wanting to use it for exploratory data analysis, one-off stuff, or notebooks.
Why deal with the borrow checker and compilation just to plot something in a notebook? Python is kind of ugly IMO, but it seems much quicker for prototyping.
- dpc_pw 6y agoMain reason is - you're already proficient with Rust and enjoy using it. I don't think there's much borrow checker issues in data analysis code. You `.clone()` everywhere, and it's still going to fly fast. Some benefits: * static typing niceness: language server, typo catching, some types preventing human error here and there etc. * expressing some ideas in a much more robust way * best in class tooling like package manager, rustdoc * hitting some unexpected not strictly data-analysis requirement is never a blocker * you can reuse your code, compile to WASM and embed in a page * performance of auxiliary code is never an issue * unlike Python, you can send it to another person and expect it to work just like it did for you * if it turns out that the "one-off" has to become more complex and serious, you don't have to throw away everything and start rewriting it "in more serious way"
- nextos 6y agoIn my opinion, we need a statically typed contender to R, Python and Julia. The use case is quite simple. Most data-oriented applications where you need linear algebra, probability theory, statistics do contain a significant amount of data pre-processing and business logic once extended to enter production. Here static typing is advantageous. Keeping the whole codebase in the same language is a significant advantage. Furthemore, some statically typed languages do have typing features that are advantageous for data analysis. Think F# type providers or type systems where e.g. the shape of arrays is guaranteed to match at compile time. The question is whether Rust is a good language for this, or we need something more like OCaml or F#. All these languages pop up in job offers for quantitative analysis, insurance risk modeling, etc. So there seems to be a demand.
- sieste 6y ago> In my opinion, we need a statically typed contender to R, Python and Julia. Nim is getting there.
- sp33der89 6y agoYup! I hope it gets more love from the scientific community. https://forum.nim-lang.org/t/5242 https://forum.nim-lang.org/t/5242 Also worth mention would be F#: https://github.com/SciSharp https://github.com/SciSharp
- littlestymaar 6y agoNim has lots of cool things and could probably but it really needs to chose one domain to focus on (and data analysis could be it, even though it sounds like a tough challenge given how much love Julia is getting as the new cool kid in that place). Today it looks like it's chasing too many games at a time with limited success.
- bachmeier 6y ago> we need a statically typed contender to R, Python and Julia. I'm not sure we really need a "contender". We need a complement. I personally use D. I love the language, I can compile my functions into a static library, and I can have R load them the same as it loads a library of C functions. It's worked well for me for years. Should work for plenty of languages, whether that's Rust, Nim, or whatever. There are at least two reasons I've moved away from the idea of a replacement language: - It's pretty easy to do if you already have experience with a compiled language. The benefit of a replacement language is small. - You can move to the new language slowly, to the degree that you want, without giving up or rewriting any already working code. Others can easily use your code without having to move to that language.
- dklend122 6y agoThe core team has plans to add optional static typing to julia..won't be there for a year or two though probably
- eigenspace 6y ago
- st1x7 6y agoYes, I wanted to try Rust for this year's Advent of Code and I gave up before I figured out how to read the input file.
- steveklabnik 6y agoIf you give it a try again, https://doc.rust-lang.org/std/fs/fn.read_to_string.html https://doc.rust-lang.org/std/fs/fn.read_to_string.html is probably whet you want.
- methyl 6y agoI wonder if this type signature may be too intimidating for newcomers: Result<(), Box<dyn std::error::Error + 'static>> It's probably huge effort to somehow target examples both for newbies and advanced users. I don't know what's good solution and if it's a real problem at all.
- jkelleyrtp 6y agoRust is a language that you need to sit down and read the book. It's not for casual exploration in the same way that JS/Py are. People in the Rust ecosystem will tell you to either unwrap the error or use https://docs.rs/anyhow/1.0.34/anyhow/ https://docs.rs/anyhow/1.0.34/anyhow/ to completely ignore it. Great thing - it's simple to ctrl-f and turn your one-off code into production code with powerful errorhandling.
- deleted 6y ago[deleted]
- brundolf 6y agoIt's a language where it's worthwhile to sit down and read the book, but it aspires to be fairly accessible too via zero-cost abstractions and integrated tooling. I think it's been moderately successful in this goal all things considered, but there's always more progress to be made.
- 6y ago