-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifying all exercises to work with cargo #18
Comments
👍 |
I've played around with this approach myself, but in the end my conclusion was that cargo doesn't add much benefit when you don't use dependencies. For the exercism use case cargo test his equivalent to rustc --test test.rs && ./test So cargo does simplify things a little bit for the user. On the other hand it requires adding a cargo.toml file and a subdir to hold the lib.rs and test.rs file, so it does add bureaucracy. Looking at other tracks Elixir uses a direct invocation of the test file, even though mix (cargo equiv) is available. OCAM has simple makefiles that invokes a compilation manager (not a package system like cargo). Haskell uses direct invocation of the test file (using a standard script that immediately executes a compiled file). All that said I'd love to hear more opinions about this. Eduardo Bautista [email protected] schreef op 9 oktober 2014 20:18:33 CEST:
|
@pminten I think running |
Oh, I do agree that it's more convenient. Whether it's going to be the common approach for two file rust programs remains to be seen, though it's quite possible. We may want to consider though whether the more "primitieve" compiler and run approach providers a learning benefit since it teaches people how compilation works under the hood of cargo. Eduardo Bautista [email protected] schreef op 9 oktober 2014 21:41:55 CEST:
Verzonden van mijn Android telefoon met K-9 Mail. |
@pminten Yeah, I understand that. Although, even the official guide stops using |
I would actually think that keeping things close to the metal (fewer dependencies) would be a good thing in exercism, provided that it's not an anti-pattern in the language. I see exercism as being about understanding the fundamentals as deeply as possible. All the magic/convenience of higher-level tools is often something that obscures things for beginners, whereas if you're comfortable with the fundamentals, adding a convenience wrapper is trivial. |
Well, with all things Rust on exercism, lets make this decision once the language is stable 😛 |
Yeah, good point. |
At the moment, there's 3 different places that help explain how to do testing in rust, we should point people at these docs so they can read them first? The Rust Guide The Rust Testing guide The Crates Guide |
In general, Cargo is how you maintain packages, but Exercism isn't exactly a package. I'd just assume a small, single file, The Testing Guide is the best place to point people, though I haven't revised it yet. |
I'd really like to give this a bump. I'd be willing to create a pull request to add cargo to the exercises, if that's the direction we want to move. |
In general, they're gonna need updated period. But yes, Cargo should be involved. |
I'm new to Rust and was hoping to start learning using Exercism, but with Rust 1.0.0-beta I don't even know how to run the tests w/o cargo, because the docs just don't mention it. So +1 for Cargo-based test for Rust Exercism! |
With beta out, it would be a decent time to start doing this. |
It looks like cargo will be the preferred way to run tests going forward. Since it comes with Rust, we should probably set up the exercises so that
cargo run
andcargo test
can be used. I can help by making the changes.The text was updated successfully, but these errors were encountered: