Open AndyGauge opened 6 years ago
@budziq can you review this list? This is from when @withoutboats and @aturon were planning new recipes. I'm happy to create the issues, but before officially adopting them, I'm hoping for your input. There are also opportunities in here to expand our adopted crates so cc https://github.com/rust-lang-nursery/ecosystem-wg/issues/22
can you review this list
@AndyGauge Sure! It looks very cool on the first glance, but I'll need some time to give any reasonable feadback. Some assorted musings:
diesel
, rusqlite
, postgres
or all?Rc
, RefCell
, Cell`)nom
using its API was a pleasure, can't really speak for lalrpop
. But I'm guessing that the approaches are different enough to warrant showing both, although pest
seams to be quite popular too.ndarray
as there are quite a few [more popular crates for matrix operations(https://crates.io/keywords/matrix) including nalgebra
. I still do all my data sciency stuff in python so I cannot really tell anything about the quality of these libs. Maybe @aturon can give us some insight why ndarray
was originally chosen?uuid-rs
and num
(possibly bigint) examplesnix
). But maybe just showing that there are such interfaces will be educational enough?std::sync::mpsc::channel
vs crossbeam_channel
rusqlite
, postgres
, diesel
would be a good scope.nom
and consider additional parsers later.num
isn't showcased. I also don't know if science is really needed by a wide audience. We should probably just drop this and pursue https://github.com/rust-lang-nursery/rust-cookbook/issues/362xml-rs
and maybe an xmltree
examplenum
I think uuid-rs
has a small usage case and already good documentation. I figure if you need to generate a UUID, you just google uuid in rust and find the plain api. +1 Bigintlibc
and winapi
until more categories are fleshed out.crossbeam_channel
over std::sync::mspc::channel
in the Cookbook. We already highlight crossbeam.@AndyGauge :+1: Sorry for taking so long. Imho all of these are valid points. Lets go with these recipes!
Hello, I don't know if I should post this here but, I have an implementation of an algorithm for the closest pair of points problem. It is a very nice use case of a btreeset, since the data needs to be sorted, and inserted into at random points.
For each point in a vec of points sorted by x coordinate, the algorithm calculates the distance only to points that are within the square around it with a diameter of 2*(min distance so far) as shown here For the horizontal dimension, you can just use the fact that you're working in a sorted vec, but to keep track of proximity in a second dimension, a btreeset is useful. You basically insert points into the btreeset as you pass over them in your for loop. Then you will know which points are close in the x dimension based on the sorted vec, and you will know which points are close in the y direction based on the BtreeSet.
If you think this is a good idea I'd be glad to clean up my code and try to submit a pull request.
Create an issue for each of the recipes
Arc
crossbeam
Mutex
mspc
Rc
std::net
Command
APIstd::env
winapi
,libc
nom
lalrpop
std
string apis — pattern APIsRefCell
Cell
These were taken from https://paper.dropbox.com/doc/Cookbook-new-recipe-list--AHhY6tZWu74Ju8uewuP5J87BAg-oRJe83bTkNE4Gk2Qmvu5V