Live data from Hacker News

Rocket v0.5: Stable, Async

rocket.rs

31–40 of 59 posts

Re: Rocket v0.5: Stable, Async

#31
post #24
post #19

Earlier quoted context omitted.

> perhaps Rust is not the right choice to make full-stack web apps This is a good step, but I still wonder if this is the case. I do like some aspects of writing webapps in Rust, but the ecosystem for serious web apps is still woefully immature. There just aren't battle-tested and well-supported solutions for many critical things, including tracing, monitoring, security, etc.

The `tracing` ecosystem is IMO pretty good, and even works with Sentry for various frameworks (well largely it's all tower based anyway) Not sure what you mean by monitoring. What do you expect (and do you have any examples where other languages provide monitoring solutions?). Security wise, I've not had any issues finding crates for specific things I needed either, but security is a broad domain (so what did you fin…

Well that's the thing about it - it mostly appears to be there, but often proves to be immature. Meaning it technically works, but most of them are inflexible, single-person projects that occasionally completely redo their API. They work their way, and good luck if you want to do anything slightly different, and unpredictable things might happen if you try to combine several things together. Not exactly confidence-inspiring to base an important production web app upon.

Tracing appears to work, but I was trying to get OpenTelemetry trace IDs into our log messages with a custom layer, which I needed anyways to match our standardized output format that every other web app in every other language can be set up to log as. I still haven't figured out how to get the current OTel TraceID in the context of Layer.on_event - there's like 4 different ways that look like they ought to work, but none of them actually do.

I wanted to set up Prometheus metrics as well. I hadn't dug too deep into that one, but it didn't seem clear what the best / most mature crates were for that or how they'd integrate with everything else.

I was able to put together a Tower Layer for our custom internal request signing system - good on them for having a standardized middleware system, though it'd be nice if more of the Rust HTTP ecosystem actually used it. I think Rocket still doesn't. It was also rather a struggle to figure out how to do things I would expect to be basic, like process the request body in the context of a Layer middleware while still leaving it available to downstream Layers and the final request handler.

Re: Rocket v0.5: Stable, Async

#32
Maybe 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.

Re: Rocket v0.5: Stable, Async

#33
It'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.

Re: Rocket v0.5: Stable, Async

#34
post #14

I 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?

No, the code you're looking at is using a bunch of macros to implement an embeded DSL on top of Rust.

For example this:

    #[get("/echo")]
    fn echo_stream(ws: WebSocket) -> Stream!['static] {
        Stream! { ws =>
            for await message in ws {
                yield message?;
            }
        }
    }
Is not valid Rust code. The `for await message in ws` is particularly egregious.

Re: Rocket v0.5: Stable, Async

#36
post #14

I 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?

This is definitely not helped by Rocket. Even I, knowing Rust well, don't enjoy the way Rocket puts so much logic into attribute macros and function signatures.

Re: Rocket v0.5: Stable, Async

#37
post #5

Hate 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.

https://rocket.rs/v0.5/news/2023-11-17-rwf2-prelaunch

They address your concern, a foundation is being created

Re: Rocket v0.5: Stable, Async

#39
post #17

Very 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.

Agreed. 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.

Re: Rocket v0.5: Stable, Async

#40
post #7

I 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 en…

I tried rocket back then and reached similar conclusions - then I just picked the most popular choice (actix at the time). Actix had its highs and lows but always delivered. Nowadays I'm on axum (mainly because the API is nice and because it feels like the community is moving in that direction) and the experience is great. I'm working to rewrite my node.js and python service to Rust to simplify my stack and take care…

> feels like the community is moving in that direction

Likely unpopular opinion here but the Rust community is incredibly fickle and tends to attract "shiny new thing" types. I'd be very cautious hitching your wagon to whatever horse they are championing in 202X. Use what is best for your needs.

Post reply on HN