Open chamons opened 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.
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:
PrintPlatformAttributes
takes two argumentMemberInfo mi, Type type = null
, in which situations is type null, and what do they imply about the context in which we're generating platform arguments.Generate (Type type)
way over 1000 lines long.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: