Hacker News new | ask | show | jobs
by mdasen 878 days ago
> or have them generate in CI, which is unnecessarily slow and eats up CI minutes.

Maybe I'm missing something since I'm not that familiar with Dart, but wouldn't Macros use the same amount of time to run and compile?

Either you're processing my_thing.dart and writing out my_thing.g.dart and then compiling the whole thing -or- you're processing my_thing.dart and writing out the new stuff to something in memory and then compiling the whole thing. Right? The amount of time it takes to generate the methods should be the same between the two and then the time to compile the same methods with the same code should be the same as well, right?

Again, I'm not that familiar with Dart and maybe the source generators have drawbacks that I'm unaware of, but it seems like the macro would be doing the same compile-time work (just without emitting the code to a file). I'd love to know what it's doing differently if that isn't how it's working.