Hacker News new | past | comments | ask | show | jobs | submit login

This is pretty major. In anticipation of this release, I was able to remove all nightly feature flags from a smallish web backend which makes heavy use of type-driven codegen (serde and diesel). Really, truly, utterly fantastic to have stability promises for custom_derive. So excited!

!!!!!!

So excited!




Yes! We have a bunch of Rust apps at work, and just one of them was still on nightly, and now we can move that to stable, too. And we can get rid of a bunch of build.rs scripts elsewhere, which is always nice.


Just a small question, how did you find coding in rust for your web backend, did you encounter any major issues?


I've been doing a lot of web development in Rust over the past few weeks. Same as the parent poster; I was using beta so that I could have serde/diesel :)

I chose to go with straight-up tokio/hyper, rather than use existing frameworks. All of the current frameworks haven't integrated it yet, because it's only available on hyper master. (They're working on getting docs and such going before releasing the next version.) Here's my Cargo.toml: https://github.com/rust-lang-nursery/thanks/blob/master/Carg...

Overall, I feel that it's pretty great. It is still extremely new, though, so you have to be a bit comfortable with working on the bleeding edge. Also, because there's no big framework yet, it has a more... node-ish feel, in that you're doing a lot yourself and hooking up libraries, rather than using the conveniences of something like Rails. But that's not too bad; I wrote a little routing framework that also serves static content, it's about 150 lines. Another 12 or so to wrap up handlebars into something a bit nicer to use. And it uses so, so much less memory than my Rails apps do, and a six megabyte statically linked binary is a dream for deployment.

I was originally quite skeptical of all of this, but as the docs and libraries mature, I think it'll be pretty great. It won't be as easy as something like Rails, but it's much nicer than I originally assumed.


I wouldn't describe any of the issues I've had as major. There have been several papercuts (some of which are resolved by the current release), and I'm honestly not a huge fan of the iron library that I've used. I think in general I really like having Rust's nudges towards correctness for backend web code, but I need to try using something like tokio or rocket.rs instead of iron before I make too broad of a claim about how it is to develop. I think iron is good for several things, but the current amount of documentation (and several other factors) would prevent me from recommending using it in a new project right now.

I'm bullish on Rust for web development, but I think that stable custom_derive with 1.15 is just the start of improved ergonomics for it.


Which frameworks are you using for Web Development? Thanks I'm trying to get into Rust, gave it a chance a few weeks back and have been slowly working my way into it. I love it so far after ignoring it for so long.


The application is using iron, but I think at some point in the future I'd like to try building part of it in either raw tokio/hyper or using rocket.rs.


If you go for rocket I believe you'll be back on nightly, it uses some codegen that goes above and beyond what serde/diesel use in order to define routes the way it does.


That is correct, as well as another host of nightly-only features. It's gonna be a while before Rocket is stable.


Yep! I just haven't explored the options much since tokio matured more (I was at the hack night last fall for it and was very excited, but haven't tried it in the last couple of months) or since rocket was announced.


Thank you, that's one Framework I want to try!


I'm getting this: error: `#[derive]` for custom traits is not stable enough for use. It is deprecated and will be removed in v1.15 (see issue #29644)


Sounds like like you're using a crate that uses the old derive system. Where does the error originate?


I know only Serde and rustc-serialize.

Whole text of error: error: `#[derive]` for custom traits is not stable enough for use. It is deprecated and will be removed in v1.15 (see issue #29644) --> src/services/locations.rs:8:65 | 8 | #[derive(RustcDecodable, RustcEncodable, Clone, Default, Debug, Deserialize)] | ^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile -------------------------------------

Nothing helpful.


(If you indent text by two spaces, it will be formatted as code on HN.)

Are you using the macros 1.1 versions of those crates? In particular, serde_macros should now be serde_derive: https://github.com/serde-rs/serde/releases/tag/v0.8.10


thanks for help, I found.. way how to solve it (thanks to help in IRC). I'll take pause before publicly sharing my emotions about this update.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: