@mort Looks like the builder pattern to me. I'm not the biggest fan of it, but it has its reasons for existence 😆
It's basically a closure or "context" state, I guess. If you need to call compile() a lot, in many different places with same parameters, you worry about passing 1 parameter around not 2(or N).
Perhaps something like
Compiler.Context ctx = new Compiler.Context(in,out);
Compiler.compile(ctx);
would have been more clear/direct, but it's pretty much just a syntax preference.
Could be more than just preference though, in a specific case, cause the language might give special privileges to a one or the other.