xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.49k stars 515 forks source link

[RFC] generator.cs refactoring #14435

Open chamons opened 2 years ago

chamons commented 2 years ago

Our primary code generator, which I affectionately call generator.cs after it's primary source file, is in many ways showing it's age.

Some examples of this:

This is not to say generator.cs is bad - It is amazing. It's power is what allows our team to tackle binding such as massive API surface.

If, in the future we had bandwidth I would suggest the following:

I'm sure we could come up with a list of improvements we'd like to make while under the hood. Mine include:

rolfbjarne commented 2 years ago

Additional points:

  • Difficult to debug - It is not straight forward to debug why it's failing. Often it is faster to just add debug comments and re-run a given build, which can be painful given the long 10+ second cycle.

It should actually be fairly easy to debug: open src/generator.sln, select the configuration that matches the platform you're running the generator for, set breakpoints, run.

That said, it might still be hard to figure out what's going wrong.