What does HackerNews think of rouille?

Web framework in Rust

Language: Rust

#12 in HTTP
#55 in Rust
#6 in Server
My (older) code uses nickel, a sync web server that is, sadly, out of date.

I'll be migrating from that to one of:

* https://github.com/tomaka/rouille

* https://github.com/tiny-http/tiny-http

In strongly typed languages like Rust, composing smaller libraries is usually quite painless, so you don't need a large framework.

Personally for backend Rust I use rouille[0] for the server (it's very simple and async-free), askama[1] for compile-time HTML templates and (if a SPA is unavoidable, as that is of course always to be avoided if at all possible) yew[2] for client-side WASM.

Now this stack is what I like personally, but there are many options that you can combine, some more full-featured than others. Check out https://www.arewewebyet.org/ for a partial overview.

[0]: https://github.com/tomaka/rouille

[1]: https://github.com/djc/askama

[2]: https://yew.rs/

I really thought this was about the web server framework https://github.com/tomaka/rouille, that's been around for ages.
Your comment touches on a few misconceptions I see a lot.

Firstly, `reqwest` exposes both an async and a synchronous API, allowing the developer to choose which one to use. They are largely interchangeable code-wise. [1]

Secondarily, and more broadly, async is possible to opt out of. You must understand that most web and network related libraries will be async by default for performance, because people who write in Rust and people who write web servers typically care greatly about performance. This is the intersection of those two groups. That being said, there are options outside of that ecosystem. [2]

If you truly want to use an asynchronous library without migrating your application to run entirely on an async runtime like tokio, you can run it inside of a synchronous function without much trouble. I've put together a playground link for you. [3]

1. https://docs.rs/reqwest/0.11.2/reqwest/blocking/index.html

2. Iron: https://github.com/iron/iron Rouille: https://github.com/tomaka/rouille

3. https://play.rust-lang.org/?version=stable&mode=debug&editio...

For a Rust web framework I would recommend rouille.[0] Mature, stable and zero unsafe.

[0] https://github.com/tomaka/rouille

I actually thought that's what Rouille (https://github.com/tomaka/rouille) was, which was mentioned in the blog post, but it looks like just uses the macro from that package (to include the strings), not the actual library even, since at the end of the day he opts for rocket (https://rocket.rs/)

[EDIT] - I didn't address your question about go.rice -- from what I know, it doesn't have this kind of thing built in, and I don't know that it even should... "flipping a production switch" is a pretty application-specific endeavor. Also this sounds like something you should be doing with your build tools..., can't include something in the binary at runtime. Maybe I misunderstood what you were asking.

To clarify, the description for go.rice is:

> go.rice is a Go package that makes working with resources such as html,js,css,images,templates, etc very easy. During development go.rice will load required files directly from disk. Upon deployment it is easy to add all resource files to a executable using the rice tool, without changing the source code for your package. go.rice provides several methods to add resources to a binary.