Live data from Hacker News

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

rocket.rs

11–20 of 75 posts

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

#13

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 uses compiler plugins to do its magic, and compiler plugins aren't stable.

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

#14

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…

Rust Stable is great, but not all of the macro (the Macro 2.0 stuff) support is on the stable release channel yet. There are still some things you can't do on stable (or can do, but inconveniently).

(Rocket also depends on a few other nightly only features. Things will likely change in the future once the Macro stuff stabilizes though)

There is also the matter of compiler plugins... which may never land in stable.

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

#15

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 uses some advanced codegen and procedural macro stuff that's not on stable if memory serves. The annotations for routes, for example.

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

#16
post #9
post #6

Earlier quoted context omitted.

Rails had encrypted cookies for ages

I think wyldfire was referring to the part about generating a new key on launch. Of course, Rails might do that too, for all I know.

uhh generating a new key on launch means every time you restart the app, everyone's cookies must be reset because the old ones can't be decrypted anymore.

It's just a convenience feature for development.

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

#17

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)

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

#18
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?

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

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

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

#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). It's not the right tradeoff for everyone or every application, certainly. And maybe other people just really like Rust. :P
Post reply on HN