Live data from Hacker News

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

rocket.rs

21–30 of 91 posts

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

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

AFAIK Rocket has always been focused on developing an ergonomic type safe API to building web applications. Many things it depends on, codegen, proc macros, that sort of thing, are yet to be stabilized. I'm not affiliated with the project, this is just what I've read about it.

There are other frameworks you can use if you want to use stable, many of them are async already. Granted, none are really 'mature', but this is a new-ish space for Rust anyway.

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

#22
post #7

Earlier quoted context omitted.

I'm really eager to push for use of rocket (and thus rust) at work, but while rocket being on version 0.x it probably is a tough sell. The benefits rocket (at least seems to) bring feels obvious and I notice every now and then at work that "hey, this would be so easy to do with rocket".

As a whole, Rust developers see 1.0 as a stability commitment and to my knowledge, everybody (well, not Rouille) wants to be async and depend on Futures 1.0. I believe Futures 0.3 is most of the way to where the Futures team wants 1.0 to be and the initial roadmap was trying for 1.0 in 2018 so my uninformed guess is that we'll see Futures 1.0 in the first half of 2019. I expect the whole Rust network server ecosystem…

So, Futures are moving into the standard library; there’s been a last minute procedural issue over one name, and then they’ll be in. So “futures 1.0” isn’t as important, the futures library mostly provides extra utilities, not the core of futures themselves. It’s likely this means they’ll be in 1.33, February 28 (if my math is right)

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

#23
post #21
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?

AFAIK Rocket has always been focused on developing an ergonomic type safe API to building web applications. Many things it depends on, codegen, proc macros, that sort of thing, are yet to be stabilized. I'm not affiliated with the project, this is just what I've read about it. There are other frameworks you can use if you want to use stable, many of them are async already. Granted, none are really 'mature', but this…

Most of that stuff is now stable; the major thing it’s waiting on is a fairly technical detail that gives Rocket more informative errors. If Sergio was willing to regress a bit there, it could be on stable, in my understanding. But developer experience is kind of the whole point, so he’s making the call to wait longer.

(EDIT: I just reviewed the flag list and I am 99% sure this is true; the never type could use a library instead, and I am pretty (but not %100) sure proc_macro_hack could fix the other one. It’s quite possible I’m wrong, but in the end, it’s still basically three features left to go.)

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

#24
I am truly moved by what this small (probably one, maybe two person?) team has accomplished here. Just look at their code and its organization, while noting how languages like Rust, Nim, and Go show us how to tackle the software complexity in various software domains. Having been in the enterprise field for a handful of decades, I am convinced that work such as this is signaling a brave new world of software development that is just ahead of us -- small teams, phenomenal productivity, which needs to combine with a grasp of architecture processes to taken on complex IT stuff. After having been in the SAP, Dessault PLM, and Oracle database-centric industries for some decades now, and I am convinced that a new generation of software software engineers with imagination and willingness to learn aspects of the businesses they serve, they will take on these sprawling legacy systems with much less effort than we think it should take right now. Exiting times are ahead for those who use these opportunities, I'd say.

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

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

Coming from dynamic languages it will feel very different, especially if you don't have a lot of experience with typed compiled languages. Personally, I came from a JS background and I love it. It totally sold me on the benefits of a good type system so much so that I sorely miss it when working with JS now.

Writing web servers in Rust is a fairly new space, it's not as mature as js/php/python, however things are moving quickly. Having your code run orders of magnitude faster is pretty nice too.

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

I think conflating 'working on code quickly' with compilation is a mistake, however, yes, you do need to compile your code. IMO a compiler will help you iterate more quickly because it's able to check for errors before you run your code.

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

If you want an ORM the thing you want to look at is diesel. I'm not sure if it's async or not.

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

rust language server (RLS) has plugins for most editors. I think the best experience for developing rust right now is in VScode or vim, IMO.

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

#26
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…

I've bumped around a site idea I've been working on for five years now. I started with Flask, then Django, then felt bad about page load times so I looked for something faster.

That basically made me shelf it for about two years, until last year when Rocket was rising and I gave it a shot. Got hung up again that year due to missing expressiveness in query handling and shelved it again. In the last month I picked it back up and have been working on it again and I must say - this is the best server side development experience I've had, either on the side or working with node / rails / etc for money.

I also definitely feel the performance bump, even without async in yet, and scaling Rocket apps is much more trivial than trying to scale Flask / Django via multiprocess.

I've also been spoiled by the Rust compiler and RLS, despite its breakages its still some really impressive stuff with how if you can get something to compile it is substantially more likely to work and not have errant edge cases that something written in a less prudent language would struggle with.

I haven't really gotten involved in any larger scale Rust projects or took on a maintainer role on anything substantial - I've just made a few patches to Rocket and some support libraries - but I can easily imagine this is the best kind of environment to do collaborative work in. You get rustfmt for style, you get the best compiler ever for debugging, and the project management of Cargo is just impossibly elegant and delightful over anything else I've used. Its definitely something I'd love to work in at a day job as it matures onto the market.

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

#27

I've toyed with various Rust web frameworks and I think rocket is one of the most promising. A thought out, high quality project. The person behind it strikes me as someone who pays attention to details, from the codebase, docs, all the way to the presentational website. Kudos!

I lurk the Matrix room for Rocket and I have no idea where Sergio finds the time to near single handedly develop a huge web framework while helping at least a dozen people a day get into it on the IRC.

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

#28
post #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?

I would assume so. At a high level, not much different than node with express (Edit: for FaaS).

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

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

Honestly, the nightly compiler is _really_ stable for the "nightly" moniker it receives. It's basically just the rolling release of the current Rust codebase each night. I've run into issues before where I get an internal compiler error, but those have been rare and rolling back a version (or waiting to roll forward) resolves them.

For the most part, there's very little risk running Rust nightly and in fact, that's my MO. I like being able to receive the latest benefits and opt into compiler gates and whatnot. I couldn't do that on Rust stable.

Overall, I feel very little friction sticking with nightly rust and using libraries that are still nightly-only.

Post reply on HN