6 ms·
Axum 0.8
- dang 2y agoRelated: Getting Started with Axum – Rust's Most Popular Web Framework - https://news.ycombinator.com/item?id=38545341 https://news.ycombinator.com/item?id=38545341 - Dec 2023 (25 comments) Axum 0.7.0 - https://news.ycombinator.com/item?id=38432225 https://news.ycombinator.com/item?id=38432225 - Nov 2023 (1 comment) Migrating from Warp to Axum - https://news.ycombinator.com/item?id=33718765 https://news.ycombinator.com/item?id=33718765 - Nov 2022 (75 comments) Show HN: Axum web framework for Rust – a demo tutorial - https://news.ycombinator.com/item?id=30615288 https://news.ycombinator.com/item?id=30615288 - March 2022 (1 comment)
- DidYaWipe 2y ago[flagged]
- akaike 2y agoAxum allows you to create a server in Rust. It’s a web framework, somewhat similar to the JavaScript equivalent, ExpressJS
- omnicognate 2y agoIs > an ergonomic and modular web framework built with tokio, tower, and hyper. as it says 12 words into the article.
- deleted 2y ago[deleted]
- DidYaWipe 2y agoThat belongs in the title.
- lytedev 2y agoI really like Axum. Like... a lot. However, it feels petty weird sometimes as the extractor thing results in somewhat unusual-looking function signatures. Not a real problem and something I'm sure I would appreciate more if I understood exactly how it worked... But it makes for really ergonomic definitions of route handlers. Even if it presently feels a little bit like weird or gross dependency injection.
- dgls 2y agoI'd recommend giving https://www.youtube.com/watch?v=Wnb_n5YktO8 https://www.youtube.com/watch?v=Wnb_n5YktO8 a watch if you want to learn how it all works. Although, after watching it I'm pretty convinced Axum is actually an alien technology designed by minds greater than our own...
- diggan 2y ago> https://www.youtube.com/watch?v=Wnb_n5YktO8 https://www.youtube.com/watch?v=Wnb_n5YktO8 Two hour video which is basically a raw dump of a past live stream... Is there any condensed version with the relevant information, or even better, a text article version?
- iknowstuff 2y agohttps://lunatic.solutions/blog/magic-handler-functions-in-rust/ https://lunatic.solutions/blog/magic-handler-functions-in-ru... https://github.com/alexpusch/rust-magic-patterns/blob/master/axum-style-magic-function-param/Readme.md https://github.com/alexpusch/rust-magic-patterns/blob/master...
- vimwizard 2y agoI had the same thought about both axum and diesel
- Kinrany 2y agoI wish they extracted the magic functions into a separate library. There is no reason for dependency injection to be tied to HTTP servers.
- LeftHandPath 2y agoI've enjoyed what I've done with Axum thus far. I ultimately opted to use Leptos on top of it, so I don't really use it directly at this point. But it's neat. For a long time, I used PHP and JS/TS for web projects. Now I'm using Rust with Axum/Tokio/Tower/Hyper (web server), Leptos (SSR using "Islands" flag, which also allows WASM generation for front end; JSX-like syntax), and Diesel (ORM and query builder that expects you define your schema using raw SQL). (I also leapt from DB2, MySQL and MariaDB to PostgreSQL) It's heaven.
- satvikpendem 2y agoIt's great, isn't it? I'm doing the same for my apps, with Rust as the backend with Axum and Diesel, except I'm using Flutter for the frontend and also flutter_rust_bridge for some Rust crates I want to use directly inside the Flutter frontend. I'm using Flutter as I'm making mobile apps primarily and I think it will take Rust based solutions a long time to get to feature and component parity with Flutter, it is simply a huge task to create a UI framework and component library from scratch, only a company like Google or Apple seem to be able to do so.
- cies 2y ago> It's heaven. Your welcome. PHP and JS/TS are SWE ghettos. The improvements that TypeScript React, Laravel or Drizzle (smart SQL builder for TS) give are great but none can fix the underlying problems that a really shitty programming language results in. I used to really love Ruby. But I now believe there's even better that's also totally free. Rust is really nice! Kotlin, OCaml and Haskell also have some amazing "doing it right" cultures, that leverage "stronger typing" techniques.
- LeftHandPath 2y agoI’ve always loved Haskell as well, although the most I did with it was writing a small language interpreter for a CS class. It’s amazing how much better major languages could be. They’re slowly getting better - I started out using PHP 5 at work, and the improvements since then (eg PHP 8.4) are HUGE. I’ve used modern C++ extensively as well. I love Rust more than either. If you like Ruby, Loco RS is really neat as a(n immature) Ruby on Rails replacement.
- koito17 2y agoI have slowly been getting into Rust for some personal projects. Already ported one of my Clojure applications to Rust and really enjoy the the tooling (and resource efficiency!) compared to Clojure. Would like to try Axum, but couldn't find reliable code generation tools. Has the tooling improved on that front? I would love to hear if anyone has tried the rust-axum[1] OpenAPI generator and whether it generates decent Axum-based code. OpenAPI isn't a hard requirement. I'm open to using Protobuf or Smithy as an IDL if the Rust ecosystem offers better server code generation with them. [1] https://openapi-generator.tech/docs/generators/rust-axum/ https://openapi-generator.tech/docs/generators/rust-axum/
- nicce 2y agoSmithy can likely do all you need: https://github.com/smithy-lang/smithy-rs https://github.com/smithy-lang/smithy-rs Since it is used on production in AWS, some versions are lagging behind, however. Server generator is based on hyper/tower and works with axum too.
- tracker1 2y agoI think Axum has been pretty great... like a high perforance version of Oak/Koa/Hono in the JS/TS space. Mostly used it for straight web services so far.
- robjwells 2y agoI really hope guide-level docs are on the roadmap for Axum. The current situation of "here are some (third-party) blog posts and YouTube videos" is not greatly encouraging. For reference: https://github.com/tokio-rs/axum?tab=readme-ov-file#getting-help https://github.com/tokio-rs/axum?tab=readme-ov-file#getting-... https://github.com/tokio-rs/axum/blob/main/ECOSYSTEM.md#tutorials https://github.com/tokio-rs/axum/blob/main/ECOSYSTEM.md#tuto...
- joshka 2y agoThe API docs[1] often have a decent amount of guide level information on items within the library, but are perhaps lacking in the "use this crate for ..." type space. What specifically do you think is missing? [1]: https://docs.rs/axum/latest/axum/ https://docs.rs/axum/latest/axum/
- cogman10 2y agoI've been dabbling with axum as of late and I agree the docs are relatively good. I think 2 things that are missing. - What you mention, "use this for that" sorts of guides. The ecosystem is pretty good, but when you pull down axum you aren't getting something like Java's Spring framework. Instead, you are getting something more like Javascript's expressjs. That makes it a bit tricky to go through and track down which tower plugins you should be using. - "How to structure your app" sorts of guides. Axum doesn't really force any sort of layout of design, which is good, but it's also not great in that it leaves that actual design up to the beginners imagination. Something like "Here's an example of a todo app with multiple users" would do wonders in showing a recommended layout. Covering how you should do DI, input validation, error handling, session management, module layout, testing. All that sort of stuff would be really useful to have/see.
- the__alchemist 2y agoI await the day we'll get full-featured (Django-like; not flask-like), and non-Async web server in rust.
- YmiYugy 2y agoI think loco.rs, which actually builds on axum is the closest thing right now. Last time I toyed around with it though, I found it to be pretty verbose, particularly because it uses SeaORM
- junon 2y agoCurious, why the non-async requirement?
- the__alchemist 2y agoThe most popular rust web frameworks are Async, and I don't enjoy Async code. (Nothing original here; standard coloring/ergonomics concerns)
- satvikpendem 2y agoIf you're waiting for non-async, it'll probably never happen. The best that might happen is with the keyword generics proposal that will remove any differences ergonomically between sync and async code.
- jfuajfwasdf 2y agoWe were already there in Rust infancy. Nobody enjoyed the baggage that came with userspace threads.
- samsartor 2y agoI tried Axum recently and had a fairly bad experience. Incomprehensible trait errors, generics all over the place, and mind-numbing async glue code. Salvo wound up being way more straightforward for my (admittedly simple) use case. I haven't written a Rust web server since before async/await, back in the Actix days. Axum is definitely an improvement on that. But I think the async ecosystem still has a long way to go.
- wging 2y agoThe key for trait errors is https://docs.rs/axum-macros/latest/axum_macros/attr.debug_handler.html https://docs.rs/axum-macros/latest/axum_macros/attr.debug_ha... -- it's made solving my problems much easier.
- the__alchemist 2y agoConsider Rouille - it's a very minimal web server in Rust. It does not have the ergonomics problems Axum does, which you describe.
- mattrighetti 2y agoI've used Axum for almost a year now, last project I built is a mix of APIs and SSR with HTMX + Askama. It's been great so far. Hypermedia was scary at first because I was used to Next.js and React, breaking down everything into single and reusable components and their logic living inside of it. Now I'm doing pretty much all of it with minimal JS and the help of XPath. I've been playing with this stack for months and I am now digging it - Plus, can't beat the beauty of the single binary that comes out of it! I run that with systemd and it's been flawless so far.
- robotburrito 2y agoI want to try this sometime. I’m in the process of learning rust by creating something using rocket.rs. Apparently this is out of style and more people use Axum now. But I’m going to keep going with rocket.
- jeltz 2y agoI really like Axum but have two issues with it 1) no well-integrated OpenAPI generation and 2) confusing error messages when you make an error in the request handler signature. The second problem Iblwsrned today might be solved with the #[debug_handler] macro but I know of no solution to the former.