Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable Rust #620

Closed
ajacksified opened this issue Jan 31, 2020 · 14 comments · Fixed by #886
Closed

Stable Rust #620

ajacksified opened this issue Jan 31, 2020 · 14 comments · Fixed by #886

Comments

@ajacksified
Copy link

swc looks awesome; in my tests, it compiles our app in about 1/4 the time! Do you plan on maintaining compilation with stable rust? There was an issue about a year ago (#117), but since then it seems to have broken again:

error[E0554]: \`#![feature]\` may not be used on the stable release channel 
\--> common/src/lib.rs:1:31  
1 | #![cfg_attr(feature = "fold", feature(specialization))]
  |                               ^^^^^^^^^^^^^^^^^^^^^^^`

I'm on rustc 1.41.0 and stay regularly up to date.

@kdy1
Copy link
Member

kdy1 commented Jan 31, 2020

it compiles our app in about 1/4 the time!

Glad to hear that. :)

Currently swc uses specialization heavily for visitor pattern. It can be removed, but it will be really lots of work. So only parser / codegen / ast is supported on stable rust.

@ajacksified
Copy link
Author

Currently swc uses specialization heavily for visitor pattern. It can be removed, but it will be really lots of work. So only parser / codegen / ast is supported on stable rust.

Understandable - it'll prevent us from using swc, but I'll watch for when specialization lands in stable!

@kdy1
Copy link
Member

kdy1 commented Jan 31, 2020

@ajacksified I'm curious, are you using swc from rust?
If not, do you mean that you do not trust nightly ruatc?

@ajacksified
Copy link
Author

@ajacksified I'm curious, are you using swc from rust?
If not, do you mean that you do not trust nightly ruatc?

I only have access to libc 2.12, so I can't use the precompiled swc in npm, and was hoping to use my own precompiled swc. I do not trust nightlies for production work, and even if I did, the rest of my team doesn't, which is a fair stance to take, IMO.

@kdy1
Copy link
Member

kdy1 commented Jan 31, 2020

@ajacksified I got it. It's understandable.

@cztomsik
Copy link

@ajacksified maybe just wait for #106 that would solve it.

@dancespiele
Copy link

Is there any news about this?

@kdy1
Copy link
Member

kdy1 commented May 14, 2020

@dancespiele swc now provides visitors which work on stable rust.
It's mainly for rust users and swc will not change to it.

@dancespiele
Copy link

ok great however I don't see documentation in https://crates.io/crates/swc_ecma_visit . Where can I find it?

@kdy1
Copy link
Member

kdy1 commented May 16, 2020

@dancespiele You can see it at https://docs.rs/swc_ecma_visit/0.2.0/swc_ecma_visit/ .
I'll modify ci script to upload it on github.

@fahrradflucht
Copy link

@kdy1 I'm interested in your general thoughts around the use of specialization. Reading through rust-lang/rust#31844 it doesn't sound like it will be stabilized in its current form and people even talk about de-implementing it, which is kind of understandable given how scary some examples in rust-lang/rust#33017 look.

What do you think is the way forward here for swc? Do you think there is a possibility to switch to min-specialization (rust-lang/rust#68970)?

@kdy1
Copy link
Member

kdy1 commented May 24, 2020

@fahrradflucht Hmm... I'll switch to min-specialization if min-specialization is going to be stabilized or current specialization is going to be de-implemented. However, if not, I don't want to do it at the moment because I'm too busy.

If it's really required, I can even make swc compilable with stable rustic. I don't want to do it just because It's really time-consuming and it makes organizing code much harder.

@kdy1
Copy link
Member

kdy1 commented Jul 23, 2020

Migrated to stable rustc
:)

@swc-bot
Copy link
Collaborator

swc-bot commented Oct 27, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

6 participants