Hacker News new | ask | show | jobs
by jamescostian 3267 days ago
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 going to try out Rust some more and definitely play around with this framework! The only thing that bothers me is that Rocket says it requires a nightly version of rust[0] - why is that necessary? I thought Rust was pretty stable by now.

[0] https://rocket.rs/guide/getting-started/#minimum-nightly

5 comments

> 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
i128 really surprises me. Why would a web framework need 128 bit integers?
It appears u128s are used to intern strings. i.e. efficient uuids.

https://github.com/SergioBenitez/Rocket/blob/master/codegen/...

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!
Rocket uses compiler plugins to do its magic, and compiler plugins aren't stable.
Rocket uses some advanced codegen and procedural macro stuff that's not on stable if memory serves. The annotations for routes, for example.
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.

Syntax extension plugins are probably going to happen, folks are working on it.