7 ms·
Rocket v0.5: Stable, Async
- dkryptr 3y agoI feel kind of bad saying this, but too little too late in my opinion.
- imachine1980_ 3y agoWhat the advantage over axium(please correct me)
- tomas789 3y agoIt probably feels more familiar if you are coming from the world of Python’s Django or Flask. Other than that Axum is very likely a better choice for all use cases.
- awoimbee 3y ago*axum I migrated a rocket project to axum 1~2 years ago, due to rocket being dead at the time. Both frameworks contain all you need to build an API really. But personally I found that: Rocket is easier for beginners, and once you know what you're doing, Axum is cleaner and better integrated in the ecosystem.
- Qwuke 3y agoI'd say it's more of an opinionated approach to a web framework, which reduces boilerplate on a lot of simpler applications. In order to facilitate this, it ends up creating more of a Domain Specific Language (DSL) using macros and types for Rocket, which can be harder to manipulate in ways you might expect as a Rust developer. Axum on the other hand tends to avoid macros and uses the type system in "more composable" way with other Rust crates, and while still providing a concise way to create web apps, has resulted in more boilerplate to hit the ground running in my experience.
- jaafwasd 3y agoThere isn't one, I migrated to axum and won't go back.
- brundolf 3y agoWow, I'd honestly assumed Rocket was dead. Glad to see it continue! It takes a pretty different approach from the other Rust web frameworks (much more opinionated and all-inclusive), so it's great to have more diversity in the space
- Qwuke 3y agoSo glad to see 0.5 out of release candidacy! I really appreciated how async functions and event streams were handled in 0.5, and just seeing this version land will make it so much easier to justify using Rocket in production. I still think Rocket is the most concise web framework for Rust after 5 years now of using it in projects and even newer frameworks, and also is one of the best examples of how ergonomic you can make frameworks and DSLs in-general using Rust's type system. For those wondering what makes it so different, the "batteries included" approach really differentiates it from other web frameworks in Rust, and it reduces the total amount of boilerplate you need to setup for simple middleware, streams, and security just about everything you need to do for simple web services.
- alberth 3y agoWhat’s your productivity like using Rust for web development? Rocket seems like a lot of visual noise vs. Laravel/Rails/Django.
- dagmx 3y agoMy Rust (actix but similar to rocket syntactically) servers are almost 1:1 code similarity to my Python (flask/django) in practice. The extra verbosity tends to only be for multi threaded state management but even then I can generally wrap stuff in an Arc RWLock and be fine.
- the__alchemist 3y agoIt's more like Flask than those. I think the use case is small HTTP communications programs that are not websites.
- Qwuke 3y agoSo Rust code may look jarring in-general compared to dynamic languages, and this is because Rust is a strongly typed language, but on top of that its type system also gives guarantees around data races that other typed languages don't prevent. So most Rust frameworks seem "noisy" when doing more than Hello World in my experience. In my experience Rocket is intentionally less "batteries-included" than newer versions of frameworks like Rails and Django (especially around querying databases), but provides an opinionated approach that has minimal boilerplate in the same spirit as those frameworks. If you just want to write a Rust web service and get to the business logic, Rocket is a great choice especially if you're coming from another language.
- tomas789 3y agoHate to say that but I’d be happier if this never happened. I think many newcomers think that Rocket is “the web framework” in Rust. And if author goes silent again they will be let down. It casts kinda bad shadow on Rust community but we have better alternatives.
- felipellrocha 3y agoCan’t blame them for trying
- Qwuke 3y agoI'm not sure I understand this - I think having different options for web frameworks is great for Rust! Actually, it's probably more useful for Rust than other languages because Rust ends up being used by such a different range of developers and applications, and each framework ends up having such different opinions and providing different levels of abstractions.
- tomas789 3y agoRocket was created by Sergio Benitez. He is almost exclusively the only contributor to the project. Not because people don't want to contribute to it, but because the author wants to have it as sort of his child's brain. And there is nothing bad about that. But recently he said at a conference (as I read on Reddit) that he does not have much time anymore to invest in its development. That means that there is probably no bright future for Rocket. Especially because a batteries-included framework like this takes so much effort to develop and polish. I think that a website or API backend is the first project for many newcomers to Rust. It would be better for them to have first experience with other frameworks such that they are not let down by Rocket as it might cast a bad light at the whole ecosystem. Rocket looks tempting because a/ it has a nice website b/ it looks feature complete c/ it is similar to Django/Flask which might make it more familiar d/ other web frameworks don't have particularly appealing documentation.
- nicoburns 3y ago> He is almost exclusively the only contributor to the project. Not because people don't want to contribute to it, but because the author wants to have it as sort of his child's brain. This has been the case, but the announcement of this release also came with the announcement of the creation of a non-profit foundation to own the Rocket project, and the opening up of development / maintainership to the community
- pzmarzly 3y agoI was developing a fairly large web app with Rocket 0.4 (released 2018!) and it started as a good experience, but then I was burned by the lack of support for multipart forms (i.e. file uploads), poor async, no option to listen on unix socket (required by my hosting provider's proxy) and long compilation times (not fully fault of Rocket, Rust compiler team has done a lot to speed up compilation since then). In the end, I found hacky solutions for all these issues, but I learned that perhaps Rust is not the right choice to make full-stack web apps and rewrote everything to Laravel (PHP) and Vue (JS). Past me would have loved this update. Thank you in his name!
- Alifatisk 3y ago> I learned that perhaps Rust is not the right choice to make full-stack web apps and rewrote everything to Laravel (PHP) and Vue (JS). I fully agree with you on this one and people have been saying this for a long time now, Rust and its kind has its place. Full stack web framework is not one of them.
- garyrob 3y agoHis point seems to have been that while version .4 had those missing pieces, the problems he mentions have now been addressed in .5. Maybe Full stack web with rust is more imaginable now. In any case, I plan to try it.
- Hamuko 3y agoI think my biggest annoyance with Rocket is that testing seems like an afterthought. I don't think the documentation even mentions testing forms. I also need to hack around a bit to ship templates, since I want to distribute my app (with a Rocket server in it) as a single executable.
- deleted 3y ago[deleted]
- pezezin 3y agoFor compiled templates I have used Askama: https://crates.io/crates/askama https://crates.io/crates/askama My biggest gripe is that when a template doesn't compile the error messages are quite useless, but other than that it is great.
- Dig1t 3y agoI like the idea of Rust, its technical merits etc, but good lord this language has some crazy weird and intimidating syntax. I read the code snippets and am just confused as heck. Did it really have to look like this?
- zamalek 3y agoOnce you get over the initial hurdle, the syntax is extremely consistent and "guessable." By which I mean, once you know the basics you can guess how to do things that you have never done before - and if it doesn't work there's probably a pending RFC that matches your expectations. For example, you might learn that you can do `if let Some(foo) = option` to check if some option is Some, but to also extract the value from it. Now you might guess that the let conditionals might work elsewhere, and you'd be right! `while let Some(line) = reader.read()` totally works. Now compare this to the likes of C, where for example `break` appears in a `switch` for some bizarre reason (yes, I know the actual reason) and `case`s don't have braces.
- unshavedyak 3y agoI'd be curious how you rewrite the syntax to have the same features but less syntax choices. Especially if it was made in the same way, organic evolution over the years. I suspect it might look different. Not better or worse, just.. different. Same core complaints. Now what if it was written from scratch today? That would prob miss a lot of the warts you don't like. But it still represents a lot of complexity in all the features the language presents, so it wouldn't be Python - for sure. Personally i love the syntax, but /shrug
- speed_spread 3y agoIt really depends on where you're coming from and if you understand the problems Rust is trying to solve. Rust is a strongly typed language that promotes explicitness over ambiguity, making actual application code look quite different from JS or Python which provide a lot of shortcuts but also have plenty of hidden trapdoors. Some say that Rust naming conventions actually uses snake_case in variables because each underscore is a little trapdoor that's made apparent so you don't fall in it! Being mainly imperative with some functional and OO niceties, it's also much less weird than many other languages. Try reading some Haskell or Erlang before judging how weird a language looks...
- ufmace 3y agoVery cool to see this finally go out, and especially the new Foundation. I have to wonder though if it's too late though. I gave up waiting for a new Rocket release years ago and have been doing what Rust web work I've been doing on Axum instead - the integration with Tower is very nice.
- dkryptr 3y agoAgreed. When I first considered porting small APIs over to Rust, Rocket appeared to be the most popular besides Actix. Axum hadn't even came out (it came out a month later and we ended up using it even though it was in its infancy). It's pretty unfortunate because Rocket could be amazing but the lack of updates killed it. See you guys in 5 years when v0.6 comes out.
- sbt567 3y agoThat is definitely the problem foundation want to solve. Hope then it could reasonably speed up the development
- lrx 3y agoWhat happened to Sergio that had him fall off the face of the earth?
- the__alchemist 3y agoMaybe one day I'll use Rust for backend dev. Everyone wants something different, but I'll use Django, and deal with Python's messiness until we get a Rust framework that has a high-level ORM, built in auth, admin, etc. And would prefer no Async.
- belmont_sup 3y agoComing from normal dev work myself, I’m drawn to dotnet nowadays. If you ever make the chance, it’s real easy to get started and do what Python does in aspnet, scripting, whatever.
- norman784 3y agoIt's sad that it took to long to reach this state, a few years in beta and now it's out, if it didn't were for this it would been my framework of choice for web development in rust, it is very nice and all, but the support and lack of ways for the community to contribute killed the project for me. Now that Actix and Axum are there, I would not go back to Rocket. But still kudos to the maintainers and the new direction of the project being now in process to be owned by a non-profit. I'd hope that the community is still interested in it and grow, we need more options in the space and Rocket being different that the others is also a good thing.
- Dowwie 3y agoWow. They finally made it! Congrats to the team.
- bsnnkv 3y agoLooking forward to this hopefully final big upgrade on my 20k LOC web service[1]. The upgrade from 0.4 to the first rc of 0.5 was a slog, but I've already upgraded to 0.5-rc.4 so this should hopefully be comparatively painless. [1]: https://notado.app https://notado.app
- pjmlp 3y agoStable and not yet 1.0. A major pain in Rust ecosystem, where few libraries feel like actually having a 1.0.