Live data from Hacker News

Rocket v0.4: Typed URIs, Database Support, Revamped Queries

rocket.rs

11–20 of 91 posts

Re: Rocket v0.4: Typed URIs, Database Support, Revamped Queries

#11
post #4

I've never tried Rust or Rocket, but it appears to be gaining popularity, so I have the following questions for existing users: What's it like to work with? Do you prefer it to JS/PHP/Python for web related projects? Can you iterate on code quickly, or is there a compile step on every iteration? Are there stable libraries for interacting with MySQL/Redis/Postgres asynchronously? Is there good IDE support, for example…

> What's it like to work with? Do you prefer it to JS/PHP/Python for web related projects?

Of the popular frameworks in languages you mention, Rocket is fairly close to Flask in terms of feel. Rust is a typed language and Rocket uses code generation and function's type signatures to automatically check the incoming parameters.

This can be fairly simple, like verifying+converting a param to a number. It can be fairly involved like setting it up so that if one of your handler function's arguments is an AdminUser, Rocket will take the user id from the request/cookie, connect to the database, and verify that the user is an admin. This is doable with middleware in many frameworks for the languages you mention but the difference is that this is on-demand based on the argument types.

> Can you iterate on code quickly, or is there a compile step on every iteration?

Rust is a compiled language. There's a compile step when you make a code change.

> Are there stable libraries for interacting with MySQL/Redis/Postgres asynchronously?

There are libraries for interacting with all those things. That said, the Rust async ecosystem is in a transition period at the moment. If you're familiar with the JS transition from callbacks to Promises to async/await, it's basically that. Check back in 6 months.

> Is there good IDE support, for example in Atom?

IDE support in Rust isn't particularly good yet. In general, find references and go to defintion work but autocomplete does not.

Re: Rocket v0.4: Typed URIs, Database Support, Revamped Queries

#12

Once rocket makes it to stable, I think it will be the go to choice for web development in Rust. The focus on creating a great developer story makes rocket a joy to use. I am shocked that Sergio maintained rocket alone for so long. I would have figured there was a team of 3-4 people working on rocket. Glad to see he is getting help!

Does it make any sense to use this with FaaS?

Re: Rocket v0.4: Typed URIs, Database Support, Revamped Queries

#13
post #4

I've never tried Rust or Rocket, but it appears to be gaining popularity, so I have the following questions for existing users: What's it like to work with? Do you prefer it to JS/PHP/Python for web related projects? Can you iterate on code quickly, or is there a compile step on every iteration? Are there stable libraries for interacting with MySQL/Redis/Postgres asynchronously? Is there good IDE support, for example…

It's a bit rough to work with still - the IDE support is still a work in progress (though improving) and there is a compile step with every iteration (incremental compilation has improved this too). Diesel is the main library for interacting with SQL databases, it wasn't async last time I used it, and a quick web search tells me it still isn't - this has been a BIG problem with Rust over the last year, as everyone wa…

That's a great summary, thank you. What about the rate of improvement? Do you think it will be significantly more developer friendly in a few months?

Re: Rocket v0.4: Typed URIs, Database Support, Revamped Queries

#14
There's some super exciting stuff in this release, but what caught my eye was this:

> Aynchronous Request Handling (#17) > > In 0.5, Rocket will migrate to the latest asynchronous version of hyperand futures with compatibility for async/await syntax. Of utmost importance is preserving Rocket's usability. As such, these changes will be largely internal, with asynchronous I/O peeking over the covers only when explicitly desired or required. As a side effect, we expect a substantial performance boost from the migration as well as resolution to long-standing issues.

Lacking async was my main reason at the time for switching out a hobby project from Rocket to Actix, It's exciting to see that this might change soon as Rocket really just hits the nail on the head when it comes to useability. It _feels_ fantastic compared to so many frameworks both in Rust and other languages.

Re: Rocket v0.4: Typed URIs, Database Support, Revamped Queries

#15
post #9
post #5

Earlier quoted context omitted.

Are ther plans to get to stable?

The plan was always to get on stable[1]. Sergio just wasn't willing to compromise on the API to make it happen sooner and I appreciate that since it's a motivation to stabilize the things Rocket depends on. The release notes being discussed here mention that Rocket should be on stable with the next major (Rocket) release. [1] https://github.com/SergioBenitez/Rocket/issues/19 edit: specify Rocket release, not Rust rel…

To be clear, it means the next major release of Rocket, not Rust (I misinterpreted your comment and had to go look, so I thought I'd save others time if they also misinterpreted your comment.)

Re: Rocket v0.4: Typed URIs, Database Support, Revamped Queries

#17
post #16

It concerns me that you have to use a Rust nightly build to use Rocket. Am I off the mark on being concerned about this?

I think it is healthy to have some projects pushing the envelope on what is possible. It provides a goal to work towards and helps test out those new language features so they can be further refined before hitting stable.

It becomes less healthy if the whole community is relying on nightly.

Re: Rocket v0.4: Typed URIs, Database Support, Revamped Queries

#19
I make up to $90 an hour working from my home. My story is that I quit working at Walmart to work -online and with a little effort I easily bring in around $40h to $86h… Someone was good to me by -sharing this link with me, so now i am hoping i could help someone else out there by sharing this link…

Try it, you won’t regret it!… http://xurl.es/xdjy9

Post reply on HN