Live data from Hacker News

Rocket, Rust Web Framework, v0.3: Fairings, TLS, Private Cookies

rocket.rs

21–30 of 75 posts

Re: Rocket, Rust Web Framework, v0.3: Fairings, TLS, Private Cookies

#22
post #4

> Private Cookies # > To encrypt private cookies, Rocket uses the 256-bit key specified in the secret_key configuration parameter. If one is not specified, Rocket automatically generates a fresh key at launch. Seems like a pretty clever idea. Do other servers/middlewares offer a similar feature? Seems like it would complicate deployment/scaling a bit if the secret has to be sent to all the nodes. Especially if they c…

Yesod does this too and it sometimes causes problems you first deploy an app to production.

Re: Rocket, Rust Web Framework, v0.3: Fairings, TLS, Private Cookies

#23
post #20

I don't have any experience in Rust. From what I read, Rust is a low level / system programming language. Comparing to dynamic languages like Python, I understand that Rust is much faster. However, Python is fast enough for most web applications. So why should I use Rust in web development? Even if the library ecosystem were mature enough, could I expect my productivity could become nearly high as in Python?

I'd say it's true that Python is fast enough for most web servers. Rather than strictly considering performance, I'd guess that people seeking to do webdev in Rust are looking to leverage Rust's static analysis to improve resilience, trading off up-front productivity for long-term maintainability (which isn't to denigrate Python, which I love, but fearless refactoring really is something that compiled langs excel at)…

We also shouldn't discount it just because Python is usually fast enough (all my personal projects are in Python). Developer time is cheaper than hardware 99% of the time. For the 1% that are running millions of requests per second through their web stacks the value proposition is pretty compelling.

Re: Rocket, Rust Web Framework, v0.3: Fairings, TLS, Private Cookies

#25
post #19

I actually really love the restrictions on fairings. I'm working on a project right now that uses Node.js with Express, and there are all of these pieces of middleware that won't compose at all, and I often find myself ripping things out and putting them in new functions. By having clear delineations between fairings, request guards, and data guards, I think you can really avoid making a lot of design mistakes. I'm g…

> Rocket says it requires a nightly version of rust[0] - why is that necessary I often joke that Rocket deliberately uses every single unstable feature solely to stymie the Rust developers' attempt to prioritize which features to stabilize. :P I'm kidding of course (hi, sbenitez!), but it's true that I've never seen any Rust project so taken with nightly features as Rocket is.

For that list of features and the discussion around them, https://github.com/SergioBenitez/Rocket/issues/19

Re: Rocket, Rust Web Framework, v0.3: Fairings, TLS, Private Cookies

#26

I don't have any experience in Rust. From what I read, Rust is a low level / system programming language. Comparing to dynamic languages like Python, I understand that Rust is much faster. However, Python is fast enough for most web applications. So why should I use Rust in web development? Even if the library ecosystem were mature enough, could I expect my productivity could become nearly high as in Python?

one nice use case is to add a quick web frontend to a rust project.

Re: Rocket, Rust Web Framework, v0.3: Fairings, TLS, Private Cookies

#27

I actually really love the restrictions on fairings. I'm working on a project right now that uses Node.js with Express, and there are all of these pieces of middleware that won't compose at all, and I often find myself ripping things out and putting them in new functions. By having clear delineations between fairings, request guards, and data guards, I think you can really avoid making a lot of design mistakes. I'm g…

The author of Rocket explicitly wants to use Rocket to experiment with new features. A lot of the stuff could be done on stable (but in a more annoying way), but it's easier with experimental features. (I discussed moving it to stable with the author)

That sounds like a lot of fun!

Re: Rocket, Rust Web Framework, v0.3: Fairings, TLS, Private Cookies

#28
Hey Sergio,

Regarding fairings, it seems a missing "middleware" case might be the sorts of things that cause redirects on entry (e.g. redirect routes with/without trailing slashes to the latter as a super trivial example). Is that something you'd expect to support in some way? I think that's something that doesn't feel like it maps either to guards or fairings well at the moment.

I did see where you mentioned your dislike of rails/sinatra/... style blunt force middleware, fwiw.

Re: Rocket, Rust Web Framework, v0.3: Fairings, TLS, Private Cookies

#29
post #8

Earlier quoted context omitted.

I this is quite similar to Rails; by default Rails includes webbrick or puma.

OK, browsing through their code, I see they use Hyper.

But they're still on the previous, non-Tokio release.

Personally I'm more tempted by something like Susanoo: https://github.com/ubnt-intrepid/susanoo/

Re: Rocket, Rust Web Framework, v0.3: Fairings, TLS, Private Cookies

#30
I was just recently looking at the state of web frameworks[1] in Rust, and it seems like the two most popular are this and Iron[2]. Can anyone comment on some of the differences between the two? Also, can anyone point out a few sites that were made using these frameworks?

[1] http://www.arewewebyet.org/

[2] https://github.com/iron/iron

Post reply on HN