Pencil: A Microframework Inspired by Flask for Rust
fengsp.github.io
Pencil: A Microframework Inspired by Flask for Rust
1–10 of 58 posts
Re: Pencil: A Microframework Inspired by Flask for Rust
#2Re: Pencil: A Microframework Inspired by Flask for Rust
#3Re: Pencil: A Microframework Inspired by Flask for Rust
#4Re: Pencil: A Microframework Inspired by Flask for Rust
#5I don't use Rust, but your code examples look great! I understand that Rust has less opportunity for "magic" to clean things up (for example, in Python you can use a decorator to specify a route for a function), but otherwise it looks very clear. Awesome work!
Re: Pencil: A Microframework Inspired by Flask for Rust
#6Looks good! I don't know how I feel about using OK for anything but 200 responses though.
You could also look at it from another point-of-view. Ok() means that I am able to fully handle this request, even if it's an HTTP error code, and Err being "nope, don't know. Sorry bud".
Re: Pencil: A Microframework Inspired by Flask for Rust
#7I've found that whenever I start a small web project in a new language, I always look for the "Flask" of that language. I love using a framework that gives the bare essentials and nothing else. I don't use Rust, but your code examples look great! I understand that Rust has less opportunity for "magic" to clean things up (for example, in Python you can use a decorator to specify a route for a function), but otherwise…
#[route("/foobar")]
fn user(_: &mut Request) -> PencilResult {
// ...
}
However, procedural macros are unstable, but Rust is able to do amazing things with macros.Re: Pencil: A Microframework Inspired by Flask for Rust
#8Re: Pencil: A Microframework Inspired by Flask for Rust
#9Re: Pencil: A Microframework Inspired by Flask for Rust
#10I've found that whenever I start a small web project in a new language, I always look for the "Flask" of that language. I love using a framework that gives the bare essentials and nothing else. I don't use Rust, but your code examples look great! I understand that Rust has less opportunity for "magic" to clean things up (for example, in Python you can use a decorator to specify a route for a function), but otherwise…