Thereafter, rustc compiles and executes the code with output channeled through stdout. I want to do this over saving the data to the hard drive for efficiency reasons. Is this possible to achieve? Thanks,
Thanks, I didn't know /tmp was stored on the RAM. That makes sense. BTW, long time no see. I hope your math degree is going well and is interesting . Happy holidays!
This is why I did https://crates.io/crates/runner - so one can do runner -e 'println!("{}", 42)', as well as accept snippets as files (inspired by runnable doc examples).
Ok wow, this is exactly what I need! I really like scripting in rust but the statically linked binary size was a really big turnoff for me. I had tried doing things dynamically but it was really cumbersome. Can this do stuff like compile dynamically in release mode as well?
Sure, it understands -O for optimize. To run the dynamically linked exes they need to be able to see the Rust shared library (LD_LIBRARY_PATH, on Windows just drop it on the path somewhere).
There are unfortunately limits to dynamic linking once you involve other crates. Some library crates can be easily dynamically compiled, others are awkward.