Live data from Hacker News

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

rocket.rs

51–60 of 75 posts

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

#51
post #48
post #23

Earlier quoted context omitted.

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.

> Developer time is cheaper than hardware 99% of the time. I find the exact opposite to be true in most cases.

Whoops, I stated that backwards. My time is more valuable than the CPU's most of the time.

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

#52

Earlier quoted context omitted.

Rust doesn't have a stable/mature HTTP implementation/abstraction yet.

Hyper is pretty darn good and I haven't seen issues with it not being mature.

from hyper's readme:

Be aware that hyper is still actively evolving towards 1.0, and is likely to experience breaking changes before stabilising. You can also see the 1.0 issue milestone.

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

#53
post #38

I'm a Rocket fan and glad to see this big slate of improvements. On the other hand, I do want to register a bit of concern regarding the plan to add "first-class database support" for 0.4. I hope that doesn't result in a close coupling to any particular database, or to using a database in general.

Isn't Postgres worth coupling to? SQLite is a close favorite, for different reasons.

Web servers and database management are two vastly different domains. I'm wary of frameworks that attempt to impose an opinion on both.

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

#54
post #40

Earlier quoted context omitted.

This is actually driving me a bit insane trying to do anything more than the simplest Rust samples. There are... a lot of competing libraries implementing the same concepts. Input validators, crypto, tls, http (there are I believe at least 3 http/2 implementations, and hyper doesn't even support it yet) and pretty much every concept under the sun (hell, hyper has its own implementation of a url type independent from…

Yup, that's what early ecosystems are like! It'll settle down eventually.

Some ecosystems stay like this for a long time (JavaScript).

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

#55
post #19

Earlier quoted context omitted.

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

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

#57
post #40

Earlier quoted context omitted.

arewewebyet hasn't been updated since March, and there's been some big developments since then. Those probably are the two most popular, but there's a Cambrian Explosion going on right now, with new frameworks like Susanoo and Cargonauts appearing on the regular. Heck, I even have my own little half-baked one.

This is actually driving me a bit insane trying to do anything more than the simplest Rust samples. There are... a lot of competing libraries implementing the same concepts. Input validators, crypto, tls, http (there are I believe at least 3 http/2 implementations, and hyper doesn't even support it yet) and pretty much every concept under the sun (hell, hyper has its own implementation of a url type independent from…

> there are I believe at least 3 http/2 implementations, and hyper doesn't even support it yet

Hyper 0.11 with Tokio is the thing to choose for http/1. It's fast and composes nicely. Http/2 support is coming soon and looking pretty nice already.

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

#58
post #37

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?

In terms of ecosystem maturity Rust is far behind Python, but ignoring that and performance, it still has some merits: - static analysis helps you avoid numerous issues that plague Python. Runtime errors are far less likely and you are forced to greater discipline when coding - it is modern language. After using algebraic data types, pattern matching and traits it is hard to go back to old style OOP. - You can extend…

Having written tons of Python, Rust and several other languages, I have to add one more thing:

- The Cargo dependency and build tool is the best in any ecosystem. Easy to configure, works like a charm and gets improvements done regularly.

I don't miss setup.py/virtualenv/pip/pex at all.

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

#59
post #43

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?

It takes longer to get the code to compile, but once it does the integration pains and debugging needed will be significantly less. I'd absolutely argue that productivity can be higher in Rust, especially the larger the project is, or the longer you expect to support it for. A lot of what people miss when approaching Rust is that writing libraries is really hard and time consuming, but writing applications using libr…

It's not that bad. Having written some Rust libraries, there are things to like that the other ecosystems don't provide. One is the rustdoc, where you document your interfaces in code, and if you write code examples in the documentation, `cargo test` will automatically check that they work.

And like I said in another comment, there is nothing as good as cargo in anywhere else.

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

#60

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?

Rust doesn't have a stable/mature HTTP implementation/abstraction yet.

We push millions of requests daily through Hyper 0.11, which is async and uses tokio. I've had crazy three month uptimes for these systems. Basically they just do their work fast and I don't really need to focus on fixing any problems with them.

And did I tell my test coverage is quite minimal with these projects.

Post reply on HN