Coder Social home page Coder Social logo

Comments (118)

SergioBenitez avatar SergioBenitez commented on May 3, 2024 629

Thank you, everyone, sincerely. ❀️

from rocket.

fylux avatar fylux commented on May 3, 2024 473

The last remaining feature has just been merged! Finally Rocket will be able to compile with stable Rust (1.45).

from rocket.

SergioBenitez avatar SergioBenitez commented on May 3, 2024 173

A stabilization PR for the final nightly-only feature Rocket makes use of is under review! Looks like we're within a few months of Rocket compiling on stable in earnest.

from rocket.

dataf3l avatar dataf3l commented on May 3, 2024 167

I'm so happy to read this!!!, I've been tracking this bug for 2 years waiting with hope. good job guys :)

from rocket.

est31 avatar est31 commented on May 3, 2024 129

rocket

from rocket.

fylux avatar fylux commented on May 3, 2024 117

Merged rust-lang/rust#69041!
Merged also rust-lang/rust#68716!
rust-lang/rust#68717 is in FCP!

from rocket.

SergioBenitez avatar SergioBenitez commented on May 3, 2024 75

Rocket uses much more than just plugins from nightly. The set of features Rocket currently uses are:

#![feature(plugin)]
#![feature(custom_derive)]
#![feature(custom_attribute)]
#![feature(specialization)]
#![feature(conservative_impl_trait)]
#![feature(drop_types_in_const)]
#![feature(associated_consts)]
#![feature(const_fn)]

These uses are important and contribute to the pithiness of the API, so they will stick around until they're stabilized. Until then, I don't believe Rocket will run on stable.

With that being said, I believe that the ergonomics of syntex are very poor, and I don't want to recommend a subpar solution to users. I'm all for getting Rocket to work on stable as soon as possible, but I'm not willing to compromise ergonomics and usability to make that happen.

from rocket.

llebout avatar llebout commented on May 3, 2024 65

Stable is out now apparently, so it should compile on 1.45.x and later

from rocket.

l4l avatar l4l commented on May 3, 2024 57

That's one small step for a crate; one giant leap for Rustaceans

from rocket.

jhpratt avatar jhpratt commented on May 3, 2024 50

To the best of my knowledge that is correct. One has finished FCP, one is currently in it, and the third has yet to begin it.

If all three get merged by June 4, it will land on stable in Rust 1.45 on July 16. The async version of Rocket will then be able to compile on stable, though as far as I know there's no timeframe on a 0.5 release.

from rocket.

talglobus avatar talglobus commented on May 3, 2024 37

Status update?

from rocket.

ambaxter avatar ambaxter commented on May 3, 2024 37

I created a PR for Pear to remove all feature gates, though doing so appears require some mild lifetime changes in &str parameters.

As of today the beta compiles all code except for https://github.com/SergioBenitez/Pear/blob/master/codegen/src/parser.rs#L168 . https://doc.rust-lang.org/proc_macro/struct.Span.html#method.join is nightly only and in all other compilers returns None.

Open issue for Span.join is rust-lang/rust#54725

SergioBenitez/Pear#27

from rocket.

FlogramMatt avatar FlogramMatt commented on May 3, 2024 32

It's been a year since this post originally... seems the check boxes in the original post are accurate?

Seems to me like getting Rocket out of nightly would be a huge boost for Rust in general but especially for Rocket.. the Rocket team or Rust team should really focus on stabilizing these functions (or finding alternatives?).

Why so slow to get there? Have you run this by the Rust higher ups and pushed them a little bit?

from rocket.

jplatte avatar jplatte commented on May 3, 2024 32

Pear was the last using Nightly features AFAICT from the discussion above and the linked issues & PRs, and that was fixed today in SergioBenitez/Pear@333c9bf. The only thing that remains to do for Rocket to compile on the current beta / upcoming stable is Pear being updated.

from rocket.

jhpratt avatar jhpratt commented on May 3, 2024 31

Congratulations Sergio!

from rocket.

jhpratt avatar jhpratt commented on May 3, 2024 29

@sound2gd Rocket itself should be able to compile on stable as of today's release. Codegen is what still needs nightly.

from rocket.

HadrienG2 avatar HadrienG2 commented on May 3, 2024 28

As far as I know, this is currently blocked on the following dependency chain of Rust PRs, which all look well on their way:

from rocket.

jebrosen avatar jebrosen commented on May 3, 2024 25

Congrats. Will there be a 0.4.x release for this or will we have to wait for 0.5?

It will happen in 0.5. Several of the features used by 0.4 (e.g. try_trait, specialization) are part of public API and won't be removed.

from rocket.

rayrrr avatar rayrrr commented on May 3, 2024 24

That's great to see @npmccallum, thanks for the heads up. I just tried building a Rocket project with the new stable Rust 1.45.0 and the build still failed around this issue, that's what brought me here. Hopefully all that's needed at this point for this use case is a release for Pear with that merged work and then updated references to the new Pear crate version in this repo. Looking forward to that!

from rocket.

AzureMarker avatar AzureMarker commented on May 3, 2024 18

Update (May 19, 2019): proc_macro_hygiene was stabilized!

We're on 2020 now πŸ˜‰

from rocket.

futurechimp avatar futurechimp commented on May 3, 2024 14

Hi, I've been holding off on making a decision about which HTTP framework to use for a project, while quietly watching progress on this one. Are there any updates about getting Rocket to run on stable Rust?

from rocket.

Aaron1011 avatar Aaron1011 commented on May 3, 2024 13

Note that Rocket depends on pear, which still uses nightly features:

from rocket.

bestouff avatar bestouff commented on May 3, 2024 11

Either way it'd be nice to have a "tentative ETA" for stable Rocket. Even if it's "don't expect less than 2 years" that could help a lot people who might want to select it but wonder about how long they have to suffer in nightly.

from rocket.

FlogramMatt avatar FlogramMatt commented on May 3, 2024 11

@SergioBenitez You should really reach out to the Rust team and ask for them to prioritize these issues, tell them it's holding up release of Rocket. Or maybe someone can volunteer to help fix these issues if they'll help point you in the right direction?

I know that getting Rocket-like web servers was being listed as a high priority for getting Rust adoption and Rocket looks like an otherwise amazing one.

Team can be found here:
https://www.rust-lang.org/en-US/team.html

Have communicated with Brian in the past who seemed particularly good at responding and helping us out on a far less important issue:
https://github.com/brson

from rocket.

mrcz avatar mrcz commented on May 3, 2024 11

Congrats. Will there be a 0.4.x release for this or will we have to wait for 0.5?

from rocket.

mentalbrew avatar mentalbrew commented on May 3, 2024 10

The Rust community is currently in a major push toward releasing the Rust 2018 Edition. Has anybody investigated whether enough features that Rocket depends on in nightly will be available in that edition that the Rocket community could target that release for stable? It seems like it would be a win-win for both efforts if it was remotely feasible.

from rocket.

jebrosen avatar jebrosen commented on May 3, 2024 9

IIRC Some of rocket's regular dependencies in master still use nightly features (most/all fixable by updating to a more recent version) and rocket depends on `rocket_codegen. Therefore it would take some work to actually do so. Using Rocket without codegen is usually recommended against and loses most of Rocket's value-add, so it's not something I'm interested in investing time into in favor of working on async and other improvements for 0.5.

Presumably we could use something like cargo-expand to see the generated code, and then replace the macro invocation with the generated code?

I have usually found this to be impractical for anything other than testing, because you wouldn't want to and can't use the expansion of certain macros like format!(). In principle it could probably be done, but would not be very nice to maintain.

from rocket.

Xaeroxe avatar Xaeroxe commented on May 3, 2024 9

July 16th seems to be the day for stable, and June 4th is the day for beta.

from rocket.

rursprung avatar rursprung commented on May 3, 2024 9

this is great news! is there a timeline for 0.5? i've seen the milestone which also seems to contain other features, some of which are already older issues: https://github.com/SergioBenitez/Rocket/milestone/8
would it be possible to make the 0.5 as soon as it contains everything needed to compile on stable (or, right now on beta)? this would be a huge step forward and move the library in the right direction. being able to build on a stable rust release would reduce the efforts for projects trying to use this library.

from rocket.

RalfJung avatar RalfJung commented on May 3, 2024 9

The current latest stable Rocket is 0.4, which still needs nightly Rust. So those updates will likely have to wait for Rocket 0.5.

from rocket.

steveklabnik avatar steveklabnik commented on May 3, 2024 8

Looks like this primarily depends on rust-lang/rust#38356

(Or syntex)

from rocket.

est31 avatar est31 commented on May 3, 2024 8

@rayrrr note that @Aaron1011 's links point to an outdated version of pear. In the current master version of pear (which rocket doesn't use yet as it uses the crates.io version), nightly usage has been removed from the pear_codegen crate, as well as core_intrinsics from the pear crate. The only two remaining feature gates are for proc_macro_hygiene, removal of which doesn't cause any errors, and specialization, which is apparently needed for conflicting implementations of the Slice trait.

from rocket.

tyt2y3 avatar tyt2y3 commented on May 3, 2024 8

Congratulations! πŸš€

from rocket.

DanielPower avatar DanielPower commented on May 3, 2024 8

Is there an estimated timeline for 0.5 to be released?

from rocket.

admwrd avatar admwrd commented on May 3, 2024 7

Goodbye Issue #19 Hello Stable! 🍾🍾🍾

from rocket.

beefsack avatar beefsack commented on May 3, 2024 6

I'm all for getting Rocket to work on stable as soon as possible, but I'm not willing to compromise ergonomics and usability to make that happen.

I'd love to see it go stable as soon as possible, but I feel you've got the right values for the project. Accessibility is arguably more important for web frameworks than it is for other frameworks and libraries.

from rocket.

tsal avatar tsal commented on May 3, 2024 6

I'm really looking forward to using Rocket in production some day, I'm glad to see there's been some progress recently. :)

from rocket.

0xcaff avatar 0xcaff commented on May 3, 2024 6

FYI, if you don't want to wait to build web services in rust, check out actix. It works on stable rust.

from rocket.

jhpratt avatar jhpratt commented on May 3, 2024 6

Given the recent blogpost, shouldn't the milestone on this be 0.5?

from rocket.

Xaeroxe avatar Xaeroxe commented on May 3, 2024 5

The following workaround has been used by the Amethyst game engine for the absence of a never type

pub enum Never {}

This type can't be instantiated and thus fills the same purpose.

from rocket.

rayrrr avatar rayrrr commented on May 3, 2024 5

Hi @SergioBenitez thanks for this project. Given that Rocket depends on Pear, would you mind describing the purpose of Pear a bit in its own README? Seems like some util traits etc. at first glance...but with a good description in the README, perhaps some other contributors can help figure out how to remove the need for nightly there too.

from rocket.

deemoding avatar deemoding commented on May 3, 2024 5

Congratulations! Don't forget to update doc

from rocket.

hktr92 avatar hktr92 commented on May 3, 2024 5

i can't wait for v0.5 to start experimenting. i might write a v2 app at work in rust and rocket :) now it's a monolithic-like project written in php and new features feels too much for php (e.g. no multithreading in php, slow for algorithms)

from rocket.

abonander avatar abonander commented on May 3, 2024 4

std::convert::Infallible is stable in the upcoming release, that should be able to substitute for most uses of the never-type.

from rocket.

jhpratt avatar jhpratt commented on May 3, 2024 3

^^ I can quickly go through and issue a PR if that's something that's wanted.

from rocket.

KamilaBorowska avatar KamilaBorowska commented on May 3, 2024 3

never_type will be stabilized 1.41.0, so you can change std::convert::Infallible into !

from rocket.

messense avatar messense commented on May 3, 2024 2

impl Trait is scheduled to be stabilized in Rust 1.26.0 too

from rocket.

dataf3l avatar dataf3l commented on May 3, 2024 2

@0xcaff After trying multiple web frameworks, I have to say really like Rocket.
Iron, unfortunately, didn't do it for me...

I'm grateful for the efforts made by the iron team, and I value open source contributor's time as much as the next guy, but for me, I think Rocket suits fits my needs better.

from rocket.

ErichDonGubler avatar ErichDonGubler commented on May 3, 2024 1

proc_macro has been split into several subtasks -- which one(s) does Rocket depend on?

EDIT: Thanks!

from rocket.

rhzs avatar rhzs commented on May 3, 2024 1

gotcha, sorry for the fuzz

@incubus8 see this blog post for details on the plans: https://rocket.rs/v0.4/news/2018-12-08-version-0.4/

from rocket.

macpp avatar macpp commented on May 3, 2024 1

Just noting: on the latest nightly uniform_paths were stabilised, together with ability to export macro_rules from modules:

mod foo {
    macro_rules! bar123 { () => {} }
    pub(crate) use bar123 as bar;
}
foo::bar!();

It seems that it may be possible to remove decl_macro feature ( when targeting 2018 edition)

from rocket.

jebrosen avatar jebrosen commented on May 3, 2024 1

It seems that it may be possible to remove decl_macro feature ( when targeting 2018 edition)

I played with the new export functionality you mention; it's unfortunate that it only works when the application crate targets 2018. I think it would be acceptable to implement the change if 2018 is required for another reason (e.g. async/await). But I wouldn't want to break compatibility with 2015 edition just to avoid decl_macro unless it's the only feature blocking stable, and maybe not even then.

from rocket.

Centril avatar Centril commented on May 3, 2024 1

@jebrosen I would suggest avoiding long term reliance on decl_macro; I don't think the language team has any bandwidth to devote the substantial time that decl_macro requires to stabilize it.

from rocket.

rrichardson avatar rrichardson commented on May 3, 2024

Syntex should get this onto stable much more quickly, since the macros > 1.1 effort seems to be just beginning to congeal.

https://news.ycombinator.com/item?id=13245975

from rocket.

steveklabnik avatar steveklabnik commented on May 3, 2024

since the macros > 1.1 effort seems to be just beginning to congeal.

This needs more than macros 1.1, it needs 2.0. (If it only needed 1.1, then it could go stable in 1.15)

from rocket.

rrichardson avatar rrichardson commented on May 3, 2024

I intended > 1.1 to indicate "after 1.1" but that wasn't very clear.
I've seen the procedural macros effect referenced as 1.2 as well as 2.0. 2.0 does make more sense, since it is a much broader scope, as I understand it.

from rocket.

mgattozzi avatar mgattozzi commented on May 3, 2024

I've started working on getting syntex to work with this until macros are stabilized (which might be a while). I've got time over the holidays from work so I'll post any progress I make!

from rocket.

mgattozzi avatar mgattozzi commented on May 3, 2024

Just from trying to get it to work with syntex it's hard. I might try some more this week but you're right. It might just be worth it to wait till those features stabilize.

from rocket.

tbu- avatar tbu- commented on May 3, 2024

The lookup_host feature can be replaced by the ToSocketAddrs implementation of &str.

from rocket.

FlogramMatt avatar FlogramMatt commented on May 3, 2024

Perhaps you could use something like:
https://github.com/Kimundi/rustc-version-rs

In order to allow stable features to compile using stable, but features that require nightly or beta could be used only when compiling from that branch.

Currently using Iron myself and would love to switch but it's a high security project and for security reasons, I want to avoid Rust nightly.

from rocket.

messense avatar messense commented on May 3, 2024

never_type will be stabilized in Rust 1.26.0.

from rocket.

est31 avatar est31 commented on May 3, 2024

i128 just got stabilized will ship in Rust 1.27.0.

from rocket.

messense avatar messense commented on May 3, 2024

macro_reexport is now removed(not in nightly yet, incoming breaking change) and subsumed by feature(use_extern_macros) and pub use

rust-lang/rust#49982

from rocket.

maxdeviant avatar maxdeviant commented on May 3, 2024

@messense PR #624 should handle those changes.

from rocket.

jebrosen avatar jebrosen commented on May 3, 2024

I glanced at the 2018 feature status and most of the important ones for Rocket are not listed:

  • const_fn
  • decl_macro
  • never_type
  • proc_macro, and several related features such as proc_macro_non_items
  • specialization, which can apparently be worked around, but might be problematic to drop for existing rocket users

That does not necessarily mean that these features will not be stabilized this year, just that they are not being targeted as part of the Edition. async/await, however, is listed, and says 2018 will be the minimum edition. Depending on what async solution is implemented, Rocket might target the 2018 edition to make use of those ergonomics.

That being said, editions are cross-crate compatible. Whether Rocket ends up targeting the 2015 or 2018 edition should not significantly affect projects that use it.

from rocket.

est31 avatar est31 commented on May 3, 2024

Just noting, proc_macro is in the process of being stabilized: rust-lang/rust#52081

from rocket.

SergioBenitez avatar SergioBenitez commented on May 3, 2024

@est31 Unfortunately, the stabilizing subset is extremely limited and insufficient for Rocket's needs.

from rocket.

cauebs avatar cauebs commented on May 3, 2024

Now there's an easier way to keep track of these things: https://forge.rust-lang.org/state-of-rust.html

from rocket.

BanjoFox avatar BanjoFox commented on May 3, 2024

Very happy to see this progressing!
Team Aardwolf appreciates your hard work :D

from rocket.

est31 avatar est31 commented on May 3, 2024

@incubus8 see this blog post for details on the plans: https://rocket.rs/v0.4/news/2018-12-08-version-0.4/

from rocket.

jebrosen avatar jebrosen commented on May 3, 2024

At the very least, a PR will make it obvious where it's currently used and whether Infallible can fully replace its uses. It may not be accepted right way, especially if it would break existing code that uses the real never type.

from rocket.

jhpratt avatar jhpratt commented on May 3, 2024

@jebrosen Is there a minimum version Rocket guarantees, or is it just the current version? Asking because the initial checkout and cargo check returns warnings for both try_from and transpose_result. I'll naturally remove those as well if desired.

from rocket.

jebrosen avatar jebrosen commented on May 3, 2024

@jhpratt Only the Infallible change in one PR (at the very least separate commits) will be easier to split up later if we want to.

from rocket.

Henning-K avatar Henning-K commented on May 3, 2024

reqwest is almost stabled It's currently on 0.9.17
https://github.com/seanmonstar/reqwest

And how, if I may ask, is that relevant here?

from rocket.

sound2gd avatar sound2gd commented on May 3, 2024

hello, any update on this?

from rocket.

mastfissh avatar mastfissh commented on May 3, 2024

If we wanted to use rocket on stable and we use codegen right now, how hard do you think it would be to remove the codegen usage?

Presumably we could use something like cargo-expand to see the generated code, and then replace the macro invocation with the generated code?

from rocket.

mastfissh avatar mastfissh commented on May 3, 2024

To summarize - it's probably not useful, easy or very maintainable to use rocket without codegen. Makes sense.

Thanks for the clear explanation πŸ‘

from rocket.

nicoburns avatar nicoburns commented on May 3, 2024

Is there any chance we could use this trick to remove the dependency on proc_macro_hygiene, and get Rocket compiling on stable?

This reddit discussion suggests that it's a lot simpler than proc-macro-hack.

from rocket.

jebrosen avatar jebrosen commented on May 3, 2024

I think we could use that trick and get halfway there (we will have some diagnostics-related features to work out), but if I'm reading it right it would limit each function from calling routes!() or uri!() once.

from rocket.

Kampfkarren avatar Kampfkarren commented on May 3, 2024

Why doesn't Rocket just use proc-macro-hack directly? Implementation difficulty?

from rocket.

jhpratt avatar jhpratt commented on May 3, 2024

@Kampfkarren Read the comment right before yours πŸ™‚

from rocket.

Kampfkarren avatar Kampfkarren commented on May 3, 2024

That's in reference to the trick used by RustPython, no? Not proc-macro-hack?

from rocket.

jhpratt avatar jhpratt commented on May 3, 2024

Ah, you're right. Either way, diagnostics would definitely take a big hit.

from rocket.

jebrosen avatar jebrosen commented on May 3, 2024

The limitation I was thinking of was something else and/or outdated - I believe both proc-macro-hack and the "extracted" version of it would be usable. When it comes down to that time, I think we could use this approach while the relevant part of proc_macro_hygiene is unstable.

from rocket.

jhpratt avatar jhpratt commented on May 3, 2024

Also worth tracking rust-lang/rust#68716, which is necessary to get that part of proc macro hygiene stabilized.

from rocket.

runiq avatar runiq commented on May 3, 2024

The guide and examples pretty much all still use ![feature(decl_macro)] even though the OP says it's no longer used since July 2019. Removing the ![feature(decl_macro)] line results in failed compiles.

I feel like I'm missing something: Is the decl_macro feature still needed or not? πŸ€”

from rocket.

KamilaBorowska avatar KamilaBorowska commented on May 3, 2024

@runiq decl_macro is needed for 0.4. Future versions of rocket (0.5+) won't need it.

from rocket.

kjedamzik avatar kjedamzik commented on May 3, 2024

Congratulations 🍾πŸ₯‚

from rocket.

a3d0n avatar a3d0n commented on May 3, 2024

Awesome news πŸ˜ƒ

from rocket.

zolamk avatar zolamk commented on May 3, 2024

Awesome news. So when will we actually be able to build rocket with rust stable?

from rocket.

jhpratt avatar jhpratt commented on May 3, 2024

Note that those dates also only apply to the upcoming 0.5 release. 0.4 will continue to require nightly for the time being.

from rocket.

dnrusakov avatar dnrusakov commented on May 3, 2024

Amazing news! Congrats!

from rocket.

magnet avatar magnet commented on May 3, 2024

July 16th seems to be the day for stable, and June 4th is the day for beta.

Is that planning still accurate? Excited to see Rocket on stable :)

from rocket.

jhpratt avatar jhpratt commented on May 3, 2024

Yes, Rocket itself should be able to compile on stable in two days. I'm not sure of the dependencies are all able to be built on beta currently, though.

from rocket.

rayrrr avatar rayrrr commented on May 3, 2024

Not quite there yet...SergioBenitez/Pear#23 (comment)

from rocket.

npmccallum avatar npmccallum commented on May 3, 2024

Not quite there yet...SergioBenitez/Pear#23 (comment)

SergioBenitez/Pear#27

from rocket.

tungel avatar tungel commented on May 3, 2024

Big thank you and congrats!!!

I've been waiting for this eagerly over the last few days. Kept on refreshing my browser tabs. Finally!

from rocket.

zmilan avatar zmilan commented on May 3, 2024

Congrats. This is awesome news. Great work!

from rocket.

zzFluke avatar zzFluke commented on May 3, 2024

Congratulations! Don't forget to update doc

And crates.io front-page as well

from rocket.

hilltse avatar hilltse commented on May 3, 2024

The getting started page still haven't been updated yet. πŸš€πŸš€πŸš€

from rocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.