In the Rust web framework world, Axum and Salvo are often put side by side. Both are written in Rust, both run on top of hyper, and both are async. But once you’ve built a few real services with each, you’ll realize they aren’t really competing on the same axis at all — they represent two genuinely different worldviews. This article isn’t about putting one above the other (Axum is an excellent framework); it’s about showing how a different abstraction layer leads to a noticeably different developer experience and expressive power.

The Axum version referenced here is 0.8.x. One quick clarification: Axum 0.8 followed matchit 0.8 in switching its path-parameter syntax from :name / *name to {name} / {*name}, which on the surface looks almost identical to Salvo’s. But the real difference has never been “braces vs. colons” — it’s the abstraction model itself.

阅读全文

在 Rust 的 Web 框架江湖里,Axum 与 Salvo 常常被放在一起比较。两者都用 Rust 写成,都跑在 hyper 之上,都支持异步,但只要写过几个真实业务,你就会发现:它们其实是两种完全不同的"世界观"。本文不是要贬低任何一方——Axum 是一个优秀的框架——而是想说明:当抽象层次不同时,开发体验和表达能力会显著不同。

本文对比的 Axum 版本为 0.8.x。需要先澄清一点:Axum 0.8 跟随 matchit 0.8 把路径参数语法从 :name / *name 改成了 {name} / {*name},看起来与 Salvo 的占位符语法几乎一致。但真正的差异从来不在"花括号还是冒号"这种表层,而在抽象模型本身。

阅读全文