-
Notifications
You must be signed in to change notification settings - Fork 302
Miscellaneous cookbook ideas #24
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
Comments
If you decide to implement one of the ideas in the op please say so here to claim it, so others don't duplicate the effort. |
I am going ahead with "Mutate elements of an array in parallel". |
I would like to work on "Dispatch work to a thread pool". I think problem statement "Sort an array of M numbers using N threads" will be optimal for demonstration. In case you had some other problem statement in mind let me know. |
Awesome. Thanks @alisha17 and @karan1276! @karan1276 Your problem statement sounds good. I'm interested in seeing your solution. |
First of all sorry if I am spamming the thread. Looking from the perspective of busy programmer with little to no experience in rust (like myself) I would greatly appreciate a systematic and comprehensive approach like in the (already mentioned) perl or python cookbooks. Please note that large part of the audience will be coming with basic problems (even if already discussed in other sources like Rust by Example ) like:
Some intermediate usecases might be:
Some other problems that I have personally encountered:
@brson Do these examples look reasonable? In order to learn rust I would be willing to implement at least few of the listed examples. |
@budziq wow thank you for all these ideas. I think almost all of them are appropriate for the cookbook. I would though like to keep the scope of the cookbook relatively aligned with the libz blitz, where we are working sort of from the inside out, documenting the most fundamental crates first. If you want to implement any of these examples I encourage you to pick ones that can be implemented with the crates discussed in that thread. Some areas on your list I don't feel prepared to deal with yet are databases, testing and mocking, RPC. I'm not sure that patterns are appropriate for this project, but there is at least one project dedicated to Rust patterns specifically. Thanks so much for jumping on this @budziq. Keep it coming. |
I've just discovered this and would add the few examples i have: Cargo
Dates and times
Development
DirectoriesFilesInputIteratorsNetwork
Numbers
PerformanceWhat to do when Rust code is slow. Strings |
Run an external command and collect stdout |
Is there any interest in adding examples for the following crates:
|
@j-haj these are both excellent points!
|
What do you think about "Send a struct through a TCP connection" ? |
@gbip Thanks!
While I think that an example showing basic connection handling and data sending/receiving with std would be beneficial, I'm not loving the idea of "sending struct" or using serde here. Here's why:
Personally I'd suggest to implement a basic TCP client server (like echo or datetime http://blog.annharter.com/2015/07/15/three-dead-protocols.html) pointing in the description that this is a basic toy example that should use Tokio/Mio for any kind of performance. |
The Perl cookbook or Python cookbook could be a good source of inspiration.
The text was updated successfully, but these errors were encountered: