3 ms·
On a side topic, what are the recommended Rust frameworks for creating REST APIs?
by ggregoire 5y ago
On a side topic, what are the recommended Rust frameworks for creating REST APIs?
- brundolf 5y agoRocket is the most promising up-and-comer I know about: https://rocket.rs/ https://rocket.rs/ It manages to provide an experience along the lines of Flask or Express Iron and Actix are the more established but more complicated ones Edit: According to a reply, Iron is considered abandoned
- agersant 5y agoIron is very much abandoned, I would not recommend it. I agree Actix and Rocket are the more common picks!
- brundolf 5y agoGot it. I knew Iron was kinda being phased out due to stuff like not having async/await, but I didn't know it had gone so far as being "abandoned".
- deleted 5y ago[deleted]
- ggregoire 5y agoActix is #5 on techempower.com/benchmarks, that's impressive!
- Zababa 5y agoAnd Rocket is surprisingly slow. Is this because it's not async yet?
- deleted 5y ago[deleted]
- brundolf 5y agoIt is higher-level than actix, though it's still surprising to see it as low as it is. I'm curious what the story is there too. It is significantly higher than Express and Flask, though it's lower than raw NodeJS and PHP. I guess maybe these benchmarks only test the overhead of the framework itself, and ignore the benefits of having your business logic and middleware written in a faster language? The tests for node and PHP would pretty much only be running battle-tested native code if that's what's going on
- tempest_ 5y agoRocket prior to 0.5 was not async and thus does not really preform well in those benchmarks. 0.5 however is async and is currently in rc, when it is released I would expect it to climb up the list a little bit.
- Zababa 5y agoIs there info on when the 0.5 is supposed to be released? I don't see anything on the Github except that the only issue left on the 0.5 milestone is updating the readme.
- ggregoire 5y agoSome comments about it here: https://news.ycombinator.com/item?id=26069195 https://news.ycombinator.com/item?id=26069195
- brundolf 5y agoNice, good info. v0.5 (currently in RC) is the stable/async version mentioned. Excited to see the benchmark get updated for that version.
- ggregoire 5y agoDigging up the topic, I also found this new framework https://github.com/tokio-rs/axum https://github.com/tokio-rs/axum, which already seems to be popular. Sentry is rewriting some of their libs from Actix to Axum: https://github.com/getsentry/symbolicator/commit/b6ef7cb00b710add4acc46dc48d52f219b8da0f8 https://github.com/getsentry/symbolicator/commit/b6ef7cb00b7...
- bynxbynx 5y agoI've enjoyed dropshot (https://github.com/oxidecomputer/dropshot/ https://github.com/oxidecomputer/dropshot/) but recognize it's not for everyone :)
- mojzu 5y agoLooks like an interesting project, how complete is the OpenAPI support? It seems like most Rust web frameworks have an open issue for it/some partial implementation
- masklinn 5y agoI don’t know that i’d recommend warp per se but it’s an interesting take on the subject.
- option_greek 5y agoWarp is pretty good. It's simple, fast and gets out of the way once you create the routes. No enforcement of any specific conventions etc.
- masklinn 5y agoOh yes I like Warp, don't get me wrong, but it's odd compared to the "standard". And the Result/Rejection system used for routing confuses people a lot (which is understandable, its use here is quite at cross purpose with normal uses for a Result).