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

Certainty of source generators to be realized? #10882

Closed
per-samuelsson opened this issue Apr 26, 2016 · 8 comments
Closed

Certainty of source generators to be realized? #10882

per-samuelsson opened this issue Apr 26, 2016 · 8 comments

Comments

@per-samuelsson
Copy link

We got bruised by the DNX-burial and the dropping of compile modules in particular.

Now we reform, trying to assess if source generators can be an alternative. We're currently building Roslyn locally (generators branch) and are actively trying to port some of our ICompileModule-based bits, mostly to learn and see if we can achieve what we want with that.

Before we spend some major time on it, is it possible to get some kind of commitment on the future of source generators?

In Language Feature Status it's listed as part of C# 7.0 but my feeling is it does not get the same love as some of the other features on that list (e.g. it does not have a dedicated label on the issue tracker, the branch is "future", etc)

Basically, what I'm wondering is

  1. What's the approx. ETA for C# 7.0 and how likely would you say source generators in their
    current form (ish) is part of it?
  2. How sure is it something like source generators will end up in sharp Roslyn within
    reasonable time? (Like 2016-2017)
@bbarry
Copy link

bbarry commented Apr 26, 2016

(I am not an MS insider in any way)

@mattwar's issue for this is #5292; spec document here: https://github.com/dotnet/roslyn/blob/features/generators/docs/features/generators.md

The functionality is highly anticipated by a number of vocal members of the community, perhaps more than anything else currently on the C#7 list. That said, the features for C#7 are not finalized yet and there is no disclosed ETA at the moment. It is very possible that several features will still be cut and moved to some future release. Nobody wants Roslyn to ship a feature that is broken in some fundamental way and impossible to fix afterwords due to breaking compatibility.

If you need it in production code today, I would consider either StackExchange.Precompilation or a hand rolled exe that runs in a pre-compile event from msbuild as is done by @roji's async rewriter; both styles are likely to get you a significant amount of reusable code for the eventuality of generators.

@jmarolf
Copy link
Contributor

jmarolf commented Apr 26, 2016

I can't give you any kind of guarantee that source generators will be shipped. Until it is released any number of unforeseen circumstances could conspire to have the feature miss C# 7.

To be clear:

Q: What's the approx. ETA for C# 7.0 and how likely would you say source generators in their current form (ish) is part of it?
A: Can't answer this . We have plans for source generators to be a part of C# 7 but if we knew precisely when C# 7 would ship and what would be in it, we would announce it publicly. When we can guarantee things we will announce them. More vaguely, the plan as of now is for C# 7 to ship with the next version of Visual Studio, but that's not very helpful as there is no firm date for when the next version of Visual Studio will ship.

Q: How sure is it something like source generators will end up in sharp Roslyn within reasonable time? (Like 2016-2017)
A: If C# 7 contains source generators I would consider it highly likely that you would be able to use them in the 2016-2017 time-frame. That is to say, there are no current blockers on it being a part of C# 7, but things can change, and we will pull features for a variety of quality / usefulness reasons.

We really like source generators. We feel that they enable a lot of cool stuff and we want them to be in C# 7. Unfortunately I can't give you any guarantees about them.

@per-samuelsson
Copy link
Author

@bbarry @jmarolf

I totally understand the uncertainty involved, and that's why I asked for approximate answers / qualified guesses. And those you provided very well meet those expectations. Thanks a lot for taking the time to elaborate, and hinting on related alternatives too!

One final minor thing:

The functionality is highly anticipated by a number of vocal members of the community, perhaps more than anything else currently on the C#7 list.

Wouldn't that qualify at least for a dedicated label, similar to New Language Features - Tuples? If you are not considering source generators a language feature, at least replace/original would qualify, no? Such label would make this feature (and, particularly, related discussions) easier to follow.

I won't follow up on that, and don't bother answering if you got better things to do. Just sayin.

@gafter
Copy link
Member

gafter commented Apr 27, 2016

@per-samuelsson OK, there is not a new tag for it.

@per-samuelsson
Copy link
Author

It's now been 9+ months since my original question, and my feeling today is that there is still no real commitment being made as to whether source generators will ever make it into a release or not.

Especially reading that long December-discussion in #5561, the uncertainty rise. When constantly checking for issue activity tagged Replace/Original and commits (not) going into source-generators branch, it's hard to get the feeling that this is really something likely for some (C# 7.0)+1, that is suggested here in the Language Feature Status.

On our part, we are now getting to a point where we have to make a hard decision for our pre-compilation story. With RC 3 out, and project.json -> new .csproj being here, we need to start developing.

So can I reuse my questions from OP, adjusted for the new premises of today:

  1. What's the approx. ETA for C# 7.1 and how likely would you say source generators in their
    current form (ish) is part of it?
  2. How sure is it something like source generators will end up in sharp Roslyn within
    reasonable time? (2017-ish).

For us, having anything less than "quite likely" on [2] would mean we'd go for one of our backup alternatives. Which is fine, we just need to know.

cc @mattwar @CyrusNajmabadi

@CyrusNajmabadi
Copy link
Member

and my feeling today is that there is still no real commitment being made as to whether source generators will ever make it into a release or not.

We are heads down trying to ship the current version of the languages, IDE and tooling. When we finally get some time to think about future versions, we will take our standard approach. Namely, we will go through all the things we are interested in, but have not gotten to, and we'll reassess if they should go in the next release.

I'm sure we'll this feature will be something we look at. Whether we take it or not is not something I know at this point. When we make our decisions on the future work we'll be doing, we'll let everyone know.

@CyrusNajmabadi
Copy link
Member

As to your 'timing' questions. I cannot give any strong guidance here. I can say though that SourceGenerators are a massively huge feature. About as large as any single feature I've ever seen come through. Given that, hoping that it will happen in the short term is really stretching it IMO.

And i do not think this is a feature that should be 'rushed'. If we do this, i want us to do it well. That means having an excellent story for:

  1. The language
  2. The compiler
  3. The IDE(s). (Including Navigation, Editing, Refactoring).
  4. The project systems
  5. The debuggers

@per-samuelsson
Copy link
Author

And i do not think this is a feature that should be 'rushed'. If we do this, i want us to do it well. That means having an excellent story for.

I think you where already very clear on that in that December discussion in #5561. I totally respect that and understand your reasoning behind that.

As to your 'timing' questions. I cannot give any strong guidance here.

That's fine. What you wrote here already, combined with all the content in #5561 seem enough now for us to make our decision.

We are heads down trying to ship the current version of the languages, IDE and tooling.

I can see that, and understand that has to be your prio at this point. I still had to ask, because what you shipped in RC 3 that other day kind of was the "go" for us to continue on our side. Good luck with that.

And again, thanks for taking the time to provide all the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants