So here I am. On my way to learning the basics of Rust where it seems I already have a complaint/problem. I think the problem stems from the lack of my ability to google the answer (I even found a link to “How to compile cargo without cargo” as funny to me as that was), but lets see what the community has to say.
Often while I was learning c/c++ (I still am) I found it really easy to just type out some lines of code and send it to the compiler to give me something to run. EG:
clang++ foo.cpp -o bar
Now I have been using this same method with the Rust compiler to provide me the same quick feedback. I have no problem using cargo, but it seems like the program has a default for meduim/large dev projects in mind right out of the gate. I have no real reason to use cargo to compile a 500 line or less piece of code it seems. I still don’t use many dependencies for my small projects, but when I build a project the folder containing the project balloons to well over 200 mb. With good reason, sure. I just feel there is no reason at this time for what I am doing…
So now to my question.
How the heck to we just use rustc to compile multiple modules into something I can run and test. I just want to run the command, let rustc chew on my code a little bit, and have it spit out a file.
Also, does rustc still depend on the main function lying in a file called main.rs, or can I specify:
and have all the dependencies lie in copy.rs…
Do I still need a lib.rs in this case?
I understand the community really promoting cargo. I can see how useful it is, just not for me right now.
Any help would be appreciated.