3 ms·
They got type generators which somewhat influenced and predates the Source Generator feature by a few years. Not the same thing of course, and from what I've se
by throw868788 5y ago
They got type generators which somewhat influenced and predates the Source Generator feature by a few years. Not the same thing of course, and from what I've seen are slightly different in target/scope. (e.g. F#'s seems more appropriate for scripting where you can use it without a proj entry).
- runevault 5y agoDo you mean type providers? That's their own type of nice thing but to your point it is only for generating types, source generators can generate much more than a basic type. Also I swear I saw somewhere type providers were not functioning as well in newer .NET but that was hearsay as I never tried them in 5 and now 6.
- throw868788 5y agoThey are working in .NET 5 last time I checked. Opened an FSX script, "#r: nuget SwaggerProvider", point to a JSON API and it seems to work with IDE auto complete included with 2 lines of code, no project scaffolding, or package manager files required. Things seem to be improving on this front I guess as well. I do agree - source generators have a better API as an implementer and can generate more than classes. I guess as soon as I need to jump into a proj file and I'm working with MsBuild anyway what stops me creating my own generation framework that runs before PreBuild that generates code for my compile step? I've done it before source generators were a thing. I also did a quick Google search - Myriad (F# library) might be something that does something similar.
- runevault 5y agoOh Myriad looks super interesting. As I figure out what I want to do as I pick f# back up more seriously I'll have to keep this in mind.